mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 14:47:37 +02:00
Added inactive functions
I'm going to flesh it out more in the next commit
This commit is contained in:
@ -50,12 +50,21 @@ namespace RhythmHeavenMania
|
||||
public bool resizable;
|
||||
public List<Param> parameters;
|
||||
public bool hidden;
|
||||
public EventCallback inactiveFunction;
|
||||
|
||||
/* 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)
|
||||
/// <summary>
|
||||
/// <para>Creates a block that can be used in the editor. The block's function and attributes are defined in the parentheses.</para>
|
||||
/// <para>Note: Every parameter after the second one is an optional parameter. You can change optional parameters by adding (name): (value) after the second parameter.</para>
|
||||
/// </summary>
|
||||
/// <param name="actionName">Name of the block</param>
|
||||
/// <param name="function"><para>What the block does when read during playback</para>
|
||||
/// <para>Only does this if the game that it is associated with is loaded.</para></param>
|
||||
/// <param name="defaultLength">How long the block appears in the editor</param>
|
||||
/// <param name="resizable">Allows the user to resize the block</param>
|
||||
/// <param name="parameters">Extra parameters for this block that change how it functions.</param>
|
||||
/// <param name="hidden">Prevents the block from being shown in the game list. Block will still function normally if it is in the timeline.</param>
|
||||
/// <param name="inactiveFunction">What the block does when read while the game it's associated with isn't loaded.</param>
|
||||
public GameAction(string actionName, EventCallback function, float defaultLength = 1, bool resizable = false, List<Param> parameters = null, bool hidden = false, EventCallback inactiveFunction = null)
|
||||
{
|
||||
this.actionName = actionName;
|
||||
this.function = function;
|
||||
@ -63,6 +72,8 @@ namespace RhythmHeavenMania
|
||||
this.resizable = resizable;
|
||||
this.parameters = parameters;
|
||||
this.hidden = hidden;
|
||||
if(inactiveFunction == null) inactiveFunction = delegate { };
|
||||
this.inactiveFunction = inactiveFunction;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +85,12 @@ namespace RhythmHeavenMania
|
||||
public string propertyCaption;
|
||||
public string tooltip;
|
||||
|
||||
/// <summary>
|
||||
/// A parameter that changes the function of a GameAction.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">The name of the variable that's being changed. Must be one of the variables in <see cref="Beatmap.Entity"/></param>
|
||||
/// <param name="parameter">The value of the parameter</param>
|
||||
/// <param name="propertyCaption">The name shown in the editor. Can be anything you want.</param>
|
||||
public Param(string propertyName, object parameter, string propertyCaption, string tooltip = "")
|
||||
{
|
||||
this.propertyName = propertyName;
|
||||
@ -91,7 +108,7 @@ namespace RhythmHeavenMania
|
||||
{
|
||||
new Minigame("gameManager", "Game Manager", "", false, true, new List<GameAction>()
|
||||
{
|
||||
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }, 0.5f),
|
||||
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }, 0.5f, inactiveFunction: delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); }),
|
||||
new GameAction("end", delegate { Debug.Log("end"); }),
|
||||
new GameAction("skill star", delegate { }, 1f, true),
|
||||
new GameAction("flash", delegate
|
||||
@ -271,7 +288,8 @@ namespace RhythmHeavenMania
|
||||
}),
|
||||
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat); }, 2f),
|
||||
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentEntity.beat); }, 2f,
|
||||
inactiveFunction: delegate { SpaceSoccer.DispenseSound(eventCaller.currentEntity.beat); }),
|
||||
new GameAction("keep-up", delegate { }, 4f, true),
|
||||
new GameAction("high kick-toe!", delegate { }, 3f, false, new List<Param>()
|
||||
{
|
||||
|
Reference in New Issue
Block a user