From fc5daea6b184c9b6656c2eff96bdd1fd2568b420 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Wed, 2 Oct 2024 22:51:13 +0200 Subject: [PATCH 1/2] Add Array and Array and Float to flags macro --- source/funkin/backend/system/macros/FlagMacro.macro.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/funkin/backend/system/macros/FlagMacro.macro.hx b/source/funkin/backend/system/macros/FlagMacro.macro.hx index 477512c0..4cfb49bc 100644 --- a/source/funkin/backend/system/macros/FlagMacro.macro.hx +++ b/source/funkin/backend/system/macros/FlagMacro.macro.hx @@ -52,6 +52,10 @@ class FlagMacro { parser = macro value.split(",").map((e) -> e.trim()); case macro: Array: parser = macro value.split(","); + case macro: Array: + parser = macro value.split(",").map((e) -> Std.parseInt(e)); + case macro: Array: + parser = macro value.split(",").map((e) -> Std.parseFloat(e)); case macro: Array: parser = macro value.split(",").map((e) -> { e = e.trim(); @@ -59,6 +63,8 @@ class FlagMacro { }); case macro: Int: parser = macro Std.parseInt(value); + case macro: Float: + parser = macro Std.parseFloat(value); case macro: String: parser = macro value; case macro: Bool: From ab8c509cdee371395789392ef523fcdc7d6af037 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Wed, 2 Oct 2024 22:52:45 +0200 Subject: [PATCH 2/2] Update the support message --- source/funkin/backend/system/macros/FlagMacro.macro.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/backend/system/macros/FlagMacro.macro.hx b/source/funkin/backend/system/macros/FlagMacro.macro.hx index 4cfb49bc..3f827d7b 100644 --- a/source/funkin/backend/system/macros/FlagMacro.macro.hx +++ b/source/funkin/backend/system/macros/FlagMacro.macro.hx @@ -151,7 +151,7 @@ class FlagMacro { case TPath({name: "Map", pack: []}): Context.error("Flag " + field.name + " cannot be a Map", field.pos); default: - Context.error("Flag " + field.name + " must be either a Bool, Int, String, Array, Array or Array", field.pos); + Context.error("Flag " + field.name + " must be either a Bool, Int, Float, String, Array, Array, Array, Array or Array", field.pos); } if(parser == null) {