2022-02-03 22:20:26 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
2022-02-20 13:31:55 +00:00
|
|
|
using System;
|
2022-08-19 01:28:05 +00:00
|
|
|
using System.Linq;
|
2022-02-03 22:20:26 +00:00
|
|
|
using TMPro;
|
2024-02-16 06:17:16 +00:00
|
|
|
|
2023-10-27 20:19:11 +00:00
|
|
|
using Jukebox;
|
2022-02-04 22:16:22 +00:00
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
namespace HeavenStudio.Editor
|
2022-02-03 22:20:26 +00:00
|
|
|
{
|
|
|
|
public class EventPropertyPrefab : MonoBehaviour
|
|
|
|
{
|
|
|
|
public TMP_Text caption;
|
2023-10-14 01:43:44 +00:00
|
|
|
protected string _captionText;
|
2022-08-23 14:27:30 +00:00
|
|
|
public EventParameterManager parameterManager;
|
Advanced Blocks (#720)
* play sfx and play animation blocks
i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction
i can revert this if need be but it just seemed vestigial
* count in rework + preloading, multisound addition
multisound was using an array that was converted to a list..?
very silly when you consider it's a list first so sometimes it's list -> array -> list lol
new Count-In and Play SFX block preloads sfx now!! epic.
* prefab-ify event properties, Button EntityType
* things are very nearly working!
however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
* okay it's WORKING now
i just need to do some better dropdown stuff
* ITS WORKING ITS WORKING ITS WORKING
arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!!
* about to make a struct + class, tooltip improvements
gonna make the struct define it, then the class will actually be the dropdown
this is gonna make things so so so so much easier to comprehend
* finishing up, probably one more commit after this
* split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol
* fixed a count bug
* added param tooltip toggle
* grah it's ALMOST DONE
* it's 99.9% finished.
just some touch ups, i don't think i even know of any bugs
* alright, looks like that's all the bugs gone
* EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
|
|
|
public RiqEntity entity;
|
2022-08-23 14:27:30 +00:00
|
|
|
public string propertyName;
|
2023-08-16 11:00:27 +00:00
|
|
|
public List<PropertyCollapse> propertyCollapses = new List<PropertyCollapse>();
|
2022-02-04 22:16:22 +00:00
|
|
|
|
Advanced Blocks (#720)
* play sfx and play animation blocks
i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction
i can revert this if need be but it just seemed vestigial
* count in rework + preloading, multisound addition
multisound was using an array that was converted to a list..?
very silly when you consider it's a list first so sometimes it's list -> array -> list lol
new Count-In and Play SFX block preloads sfx now!! epic.
* prefab-ify event properties, Button EntityType
* things are very nearly working!
however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
* okay it's WORKING now
i just need to do some better dropdown stuff
* ITS WORKING ITS WORKING ITS WORKING
arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!!
* about to make a struct + class, tooltip improvements
gonna make the struct define it, then the class will actually be the dropdown
this is gonna make things so so so so much easier to comprehend
* finishing up, probably one more commit after this
* split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol
* fixed a count bug
* added param tooltip toggle
* grah it's ALMOST DONE
* it's 99.9% finished.
just some touch ups, i don't think i even know of any bugs
* alright, looks like that's all the bugs gone
* EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
|
|
|
public virtual void SetProperties(string propertyName, object type, string caption)
|
2022-02-03 22:20:26 +00:00
|
|
|
{
|
2022-08-23 14:27:30 +00:00
|
|
|
this.parameterManager = EventParameterManager.instance;
|
2023-10-14 01:43:44 +00:00
|
|
|
|
Advanced Blocks (#720)
* play sfx and play animation blocks
i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction
i can revert this if need be but it just seemed vestigial
* count in rework + preloading, multisound addition
multisound was using an array that was converted to a list..?
very silly when you consider it's a list first so sometimes it's list -> array -> list lol
new Count-In and Play SFX block preloads sfx now!! epic.
* prefab-ify event properties, Button EntityType
* things are very nearly working!
however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
* okay it's WORKING now
i just need to do some better dropdown stuff
* ITS WORKING ITS WORKING ITS WORKING
arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!!
* about to make a struct + class, tooltip improvements
gonna make the struct define it, then the class will actually be the dropdown
this is gonna make things so so so so much easier to comprehend
* finishing up, probably one more commit after this
* split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol
* fixed a count bug
* added param tooltip toggle
* grah it's ALMOST DONE
* it's 99.9% finished.
just some touch ups, i don't think i even know of any bugs
* alright, looks like that's all the bugs gone
* EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
|
|
|
entity = parameterManager.entity;
|
|
|
|
this.propertyName = propertyName;
|
|
|
|
this.caption.text = _captionText = caption;
|
2022-02-03 22:20:26 +00:00
|
|
|
}
|
Advanced Blocks (#720)
* play sfx and play animation blocks
i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction
i can revert this if need be but it just seemed vestigial
* count in rework + preloading, multisound addition
multisound was using an array that was converted to a list..?
very silly when you consider it's a list first so sometimes it's list -> array -> list lol
new Count-In and Play SFX block preloads sfx now!! epic.
* prefab-ify event properties, Button EntityType
* things are very nearly working!
however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
* okay it's WORKING now
i just need to do some better dropdown stuff
* ITS WORKING ITS WORKING ITS WORKING
arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!!
* about to make a struct + class, tooltip improvements
gonna make the struct define it, then the class will actually be the dropdown
this is gonna make things so so so so much easier to comprehend
* finishing up, probably one more commit after this
* split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol
* fixed a count bug
* added param tooltip toggle
* grah it's ALMOST DONE
* it's 99.9% finished.
just some touch ups, i don't think i even know of any bugs
* alright, looks like that's all the bugs gone
* EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
|
|
|
public virtual void SetCollapses(object type) { }
|
2024-04-08 02:18:51 +00:00
|
|
|
public virtual void PostLoadProperties(object type) { }
|
2023-08-16 11:00:27 +00:00
|
|
|
|
|
|
|
public void UpdateCollapse(object type)
|
|
|
|
{
|
2024-05-12 21:37:01 +00:00
|
|
|
List<EventPropertyPrefab> recursedCollapse = new() { this };
|
2023-08-16 11:00:27 +00:00
|
|
|
foreach (var p in propertyCollapses)
|
|
|
|
{
|
2024-05-12 21:37:01 +00:00
|
|
|
if (p.collapseables.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (var c in p.collapseables)
|
|
|
|
{
|
|
|
|
if (c != null)
|
|
|
|
{
|
|
|
|
c.gameObject.SetActive(p.collapseOn(type, p.entity) && gameObject.activeSelf);
|
|
|
|
c.RecursiveUpdateCollapse(recursedCollapse);
|
|
|
|
}
|
Advanced Blocks (#720)
* play sfx and play animation blocks
i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction
i can revert this if need be but it just seemed vestigial
* count in rework + preloading, multisound addition
multisound was using an array that was converted to a list..?
very silly when you consider it's a list first so sometimes it's list -> array -> list lol
new Count-In and Play SFX block preloads sfx now!! epic.
* prefab-ify event properties, Button EntityType
* things are very nearly working!
however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
* okay it's WORKING now
i just need to do some better dropdown stuff
* ITS WORKING ITS WORKING ITS WORKING
arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!!
* about to make a struct + class, tooltip improvements
gonna make the struct define it, then the class will actually be the dropdown
this is gonna make things so so so so much easier to comprehend
* finishing up, probably one more commit after this
* split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol
* fixed a count bug
* added param tooltip toggle
* grah it's ALMOST DONE
* it's 99.9% finished.
just some touch ups, i don't think i even know of any bugs
* alright, looks like that's all the bugs gone
* EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
|
|
|
}
|
2024-05-12 21:37:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Advanced Blocks (#720)
* play sfx and play animation blocks
i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction
i can revert this if need be but it just seemed vestigial
* count in rework + preloading, multisound addition
multisound was using an array that was converted to a list..?
very silly when you consider it's a list first so sometimes it's list -> array -> list lol
new Count-In and Play SFX block preloads sfx now!! epic.
* prefab-ify event properties, Button EntityType
* things are very nearly working!
however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
* okay it's WORKING now
i just need to do some better dropdown stuff
* ITS WORKING ITS WORKING ITS WORKING
arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!!
* about to make a struct + class, tooltip improvements
gonna make the struct define it, then the class will actually be the dropdown
this is gonna make things so so so so much easier to comprehend
* finishing up, probably one more commit after this
* split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol
* fixed a count bug
* added param tooltip toggle
* grah it's ALMOST DONE
* it's 99.9% finished.
just some touch ups, i don't think i even know of any bugs
* alright, looks like that's all the bugs gone
* EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
|
|
|
_ = p.collapseOn(type, p.entity);
|
2023-08-16 11:00:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-12 21:37:01 +00:00
|
|
|
public void RecursiveUpdateCollapse(List<EventPropertyPrefab> updated)
|
|
|
|
{
|
|
|
|
if (updated == null)
|
|
|
|
{
|
|
|
|
updated = new();
|
|
|
|
}
|
|
|
|
if (updated.Contains(this))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
updated.Add(this);
|
|
|
|
foreach (var p in propertyCollapses)
|
|
|
|
{
|
|
|
|
if (p.collapseables.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (var c in p.collapseables)
|
|
|
|
{
|
|
|
|
if (c != null)
|
|
|
|
{
|
|
|
|
c.gameObject.SetActive(p.collapseOn(entity[propertyName], p.entity) && gameObject.activeSelf);
|
|
|
|
c.RecursiveUpdateCollapse(updated);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_ = p.collapseOn(entity[propertyName], p.entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-16 11:00:27 +00:00
|
|
|
public class PropertyCollapse
|
|
|
|
{
|
2024-05-12 21:37:01 +00:00
|
|
|
public List<EventPropertyPrefab> collapseables;
|
2023-10-27 20:19:11 +00:00
|
|
|
public Func<object, RiqEntity, bool> collapseOn;
|
|
|
|
public RiqEntity entity;
|
2023-08-16 11:00:27 +00:00
|
|
|
|
2024-05-12 21:37:01 +00:00
|
|
|
public PropertyCollapse(List<EventPropertyPrefab> collapseables, Func<object, RiqEntity, bool> collapseOn, RiqEntity entity)
|
2023-08-16 11:00:27 +00:00
|
|
|
{
|
|
|
|
this.collapseables = collapseables;
|
|
|
|
this.collapseOn = collapseOn;
|
2023-10-27 20:19:11 +00:00
|
|
|
this.entity = entity;
|
2023-08-16 11:00:27 +00:00
|
|
|
}
|
|
|
|
}
|
2022-02-03 22:20:26 +00:00
|
|
|
}
|
|
|
|
}
|