character and stage type for events

This commit is contained in:
haven
2024-08-06 12:01:43 -05:00
parent 6aaa9e1421
commit 363f82860d
2 changed files with 20 additions and 0 deletions
@@ -70,6 +70,8 @@ class EventsData {
hscriptInterp.variables.set("StrumLine", TStrumLine);
hscriptInterp.variables.set("ColorWheel", TColorWheel);
hscriptInterp.variables.set("DropDown", Reflect.makeVarArgs((args) -> {return args.length > 0 ? TDropDown([for (arg in args) Std.string(arg)]) : TDropDown(["null"]);}));
hscriptInterp.variables.set("Character", TCharacter);
hscriptInterp.variables.set("Stage", TStage);
var hscriptParser:Parser = new Parser();
hscriptParser.allowJSON = hscriptParser.allowMetadata = false;
@@ -127,4 +129,6 @@ enum EventParamType {
TStrumLine;
TColorWheel;
TDropDown(?options:Array<String>);
TCharacter;
TStage;
}
@@ -5,6 +5,8 @@ import flixel.util.FlxColor;
import funkin.backend.chart.ChartData.ChartEvent;
import funkin.backend.chart.EventsData;
import funkin.backend.system.Conductor;
import funkin.game.Character;
import funkin.game.Stage;
using StringTools;
@@ -163,6 +165,20 @@ class CharterEventScreen extends UISubstateWindow {
var dropdown = new UIDropDown(eventName.x, y, 320, 32, options, Std.int(Math.abs(options.indexOf(cast value))));
paramsPanel.add(dropdown); paramsFields.push(dropdown);
dropdown;
case TCharacter:
addLabel();
var charFileList = Character.getList(false);
var textBox:UIAutoCompleteTextBox = new UIAutoCompleteTextBox(eventName.x, y, cast value);
textBox.suggestItems = charFileList;
paramsPanel.add(textBox); paramsFields.push(textBox);
textBox;
case TStage:
addLabel();
var stageFileList = Stage.getList(false);
var textBox:UIAutoCompleteTextBox = new UIAutoCompleteTextBox(eventName.x, y, cast value);
textBox.suggestItems = stageFileList;
paramsPanel.add(textBox); paramsFields.push(textBox);
textBox;
default:
paramsFields.push(null);
null;