From 363f82860d302032f39d6b352ce95937b86719ab Mon Sep 17 00:00:00 2001 From: haven <85509162+cookiesock@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:01:43 -0500 Subject: [PATCH] character and stage type for events --- source/funkin/backend/chart/EventsData.hx | 4 ++++ .../funkin/editors/charter/CharterEventScreen.hx | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/source/funkin/backend/chart/EventsData.hx b/source/funkin/backend/chart/EventsData.hx index 05f35bde..eff3fd8e 100644 --- a/source/funkin/backend/chart/EventsData.hx +++ b/source/funkin/backend/chart/EventsData.hx @@ -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); + TCharacter; + TStage; } diff --git a/source/funkin/editors/charter/CharterEventScreen.hx b/source/funkin/editors/charter/CharterEventScreen.hx index ec9ce660..20d84715 100644 --- a/source/funkin/editors/charter/CharterEventScreen.hx +++ b/source/funkin/editors/charter/CharterEventScreen.hx @@ -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;