From eeefaf8090fee475e9a0c34bba465ca4830b465b Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Thu, 24 Mar 2022 10:35:06 +0100 Subject: [PATCH] Add two more preset slots. --- cvarinfo.marifx | 2 ++ zscript.txt | 1 + zscript/mfx_menu.zsc | 12 ++++++------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cvarinfo.marifx b/cvarinfo.marifx index 51ac6d4..e4743f1 100644 --- a/cvarinfo.marifx +++ b/cvarinfo.marifx @@ -135,3 +135,5 @@ nosave string mfx_preset4 = ""; nosave string mfx_preset5 = ""; nosave string mfx_preset6 = ""; nosave string mfx_preset7 = ""; +nosave string mfx_preset8 = ""; +nosave string mfx_preset9 = ""; diff --git a/zscript.txt b/zscript.txt index 7d2c5b9..8f88598 100644 --- a/zscript.txt +++ b/zscript.txt @@ -7,5 +7,6 @@ version "4.7.1" included from here. */ +const MFX_NUMPRESETS = 10; #include "zscript/mfx_menu.zsc" #include "zscript/mfx_handler.zsc" diff --git a/zscript/mfx_menu.zsc b/zscript/mfx_menu.zsc index 69c1263..c852d49 100644 --- a/zscript/mfx_menu.zsc +++ b/zscript/mfx_menu.zsc @@ -82,7 +82,7 @@ Class MFXPresetUtility Class OptionMenuItemMFXPresetList : OptionMenuItemOptionBase { CVar mCVar; - String names[8]; + String names[MFX_NUMPRESETS]; OptionMenuItemMFXPresetList Init( String label, Name command, CVar graycheck = null, int center = 0 ) { @@ -94,18 +94,18 @@ Class OptionMenuItemMFXPresetList : OptionMenuItemOptionBase void UpdateNames() { - for ( int i=0; i<8; i++ ) + for ( int i=0; i 7 ) Selection = 0; + if ( ++Selection >= MFX_NUMPRESETS ) Selection = 0; } else return OptionMenuItem.MenuEvent(mkey,fromcontroller); SetSelection(Selection);