mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Started work on merging the karate man events
This breaks enum dropdowns but I'll fix that tomorrow
This commit is contained in:
parent
25e90b0b39
commit
267d9f6bdd
4 changed files with 31 additions and 8 deletions
|
@ -8,6 +8,15 @@ namespace RhythmHeavenMania.Games.KarateMan
|
||||||
{
|
{
|
||||||
public class KarateMan : Minigame
|
public class KarateMan : Minigame
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public enum HitType
|
||||||
|
{
|
||||||
|
Pot = 0,
|
||||||
|
Rock = 2,
|
||||||
|
Ball = 3,
|
||||||
|
TacoBell = 6
|
||||||
|
}
|
||||||
|
|
||||||
public enum LightBulbType
|
public enum LightBulbType
|
||||||
{
|
{
|
||||||
Normal,
|
Normal,
|
||||||
|
|
|
@ -99,11 +99,11 @@ namespace RhythmHeavenMania.Editor
|
||||||
dropDownData.Add(optionData);
|
dropDownData.Add(optionData);
|
||||||
}
|
}
|
||||||
dropdown.AddOptions(dropDownData);
|
dropdown.AddOptions(dropDownData);
|
||||||
dropdown.value = ((int)Enum.Parse(objType, parameterManager.entity[propertyName].ToString()));
|
dropdown.value = Array.IndexOf(Enum.GetValues(objType), Enum.GetValues(objType).GetValue((int)parameterManager.entity[propertyName]));
|
||||||
|
|
||||||
dropdown.onValueChanged.AddListener(delegate
|
dropdown.onValueChanged.AddListener(delegate
|
||||||
{
|
{
|
||||||
parameterManager.entity[propertyName] = Enum.ToObject(objType, dropdown.value);
|
parameterManager.entity[propertyName] = (int)Enum.GetValues(objType).GetValue(dropdown.value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (objType == typeof(Color))
|
else if (objType == typeof(Color))
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace RhythmHeavenMania.Editor
|
||||||
|
|
||||||
for (int i = 0; i < mg.actions.Count; i++)
|
for (int i = 0; i < mg.actions.Count; i++)
|
||||||
{
|
{
|
||||||
if (mg.actions[i].actionName == "switchGame") continue;
|
if (mg.actions[i].actionName == "switchGame" || mg.actions[i].hidden) continue;
|
||||||
GameObject g = Instantiate(EventRef, eventsParent);
|
GameObject g = Instantiate(EventRef, eventsParent);
|
||||||
g.GetComponent<TMP_Text>().text = mg.actions[i].actionName;
|
g.GetComponent<TMP_Text>().text = mg.actions[i].actionName;
|
||||||
g.SetActive(true);
|
g.SetActive(true);
|
||||||
|
|
|
@ -49,14 +49,20 @@ namespace RhythmHeavenMania
|
||||||
public float defaultLength;
|
public float defaultLength;
|
||||||
public bool resizable;
|
public bool resizable;
|
||||||
public List<Param> parameters;
|
public List<Param> parameters;
|
||||||
|
public bool hidden;
|
||||||
|
|
||||||
public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool resizable = false, List<Param> parameters = null)
|
/* If you want to add additional arguments to GameAction, leave `bool hidden = false` as the last parameter
|
||||||
|
* You can specify an action as hidden by adding `hidden: value` as the final parameter in your call
|
||||||
|
* (Even if you haven't used all prior arguments)
|
||||||
|
*/
|
||||||
|
public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool resizable = false, List<Param> parameters = null, bool hidden = false)
|
||||||
{
|
{
|
||||||
this.actionName = actionName;
|
this.actionName = actionName;
|
||||||
this.function = function;
|
this.function = function;
|
||||||
this.defaultLength = defaultLength;
|
this.defaultLength = defaultLength;
|
||||||
this.resizable = resizable;
|
this.resizable = resizable;
|
||||||
this.parameters = parameters;
|
this.parameters = parameters;
|
||||||
|
this.hidden = hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +241,13 @@ namespace RhythmHeavenMania
|
||||||
new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List<GameAction>()
|
new Minigame("karateman", "Karate Man", "70A8D8", false, false, new List<GameAction>()
|
||||||
{
|
{
|
||||||
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||||
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2),
|
new GameAction("hit", delegate
|
||||||
|
{
|
||||||
|
KarateMan.instance.Shoot(eventCaller.currentEntity.beat, eventCaller.currentEntity.type);
|
||||||
|
}, 2, false, new List<Param>()
|
||||||
|
{
|
||||||
|
new Param("type", KarateMan.HitType.Pot, "Object")
|
||||||
|
}),
|
||||||
new GameAction("bulb", delegate {
|
new GameAction("bulb", delegate {
|
||||||
var e = eventCaller.currentEntity;
|
var e = eventCaller.currentEntity;
|
||||||
var c = KarateMan.instance.LightBulbColors[e.type];
|
var c = KarateMan.instance.LightBulbColors[e.type];
|
||||||
|
@ -246,8 +258,6 @@ namespace RhythmHeavenMania
|
||||||
new Param("type", KarateMan.LightBulbType.Normal, "Type"),
|
new Param("type", KarateMan.LightBulbType.Normal, "Type"),
|
||||||
new Param("colorA", new Color(), "Custom Color")
|
new Param("colorA", new Color(), "Custom Color")
|
||||||
}),
|
}),
|
||||||
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2),
|
|
||||||
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2),
|
|
||||||
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
|
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
|
||||||
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
|
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
|
||||||
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }),
|
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }),
|
||||||
|
@ -267,7 +277,11 @@ namespace RhythmHeavenMania
|
||||||
new Param("colorA", new Color(), "Custom Background Color"),
|
new Param("colorA", new Color(), "Custom Background Color"),
|
||||||
new Param("colorB", new Color(), "Custom Shadow Color")
|
new Param("colorB", new Color(), "Custom Shadow Color")
|
||||||
}),
|
}),
|
||||||
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2),
|
// These are still here for backwards-compatibility but are hidden in the editor
|
||||||
|
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2, hidden: true),
|
||||||
|
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2, hidden: true),
|
||||||
|
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2, hidden: true),
|
||||||
|
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2, hidden: true),
|
||||||
}),
|
}),
|
||||||
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
|
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue