diff options
| author | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
| commit | 5e2eb7d67ae933b7566f1944d0bb7744da03d586 (patch) | |
| tree | 054acff1113270a9cd07933df760f3768c1b6853 /sourcemod/scripting/gokz-jumpstats/options_menu.sp | |
| parent | 341db13a008dc12bb22ceb50452d93d01476308c (diff) | |
move source stuff to its own folder
Diffstat (limited to 'sourcemod/scripting/gokz-jumpstats/options_menu.sp')
| -rw-r--r-- | sourcemod/scripting/gokz-jumpstats/options_menu.sp | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/sourcemod/scripting/gokz-jumpstats/options_menu.sp b/sourcemod/scripting/gokz-jumpstats/options_menu.sp deleted file mode 100644 index 903a8bb..0000000 --- a/sourcemod/scripting/gokz-jumpstats/options_menu.sp +++ /dev/null @@ -1,145 +0,0 @@ -static TopMenu optionsTopMenu; -static TopMenuObject catJumpstats; -static TopMenuObject itemsJumpstats[JSOPTION_COUNT]; - - - -// =====[ PUBLIC ]===== - -void DisplayJumpstatsOptionsMenu(int client) -{ - optionsTopMenu.DisplayCategory(catJumpstats, client); -} - - - -// =====[ EVENTS ]===== - -void OnOptionsMenuCreated_OptionsMenu(TopMenu topMenu) -{ - if (optionsTopMenu == topMenu && catJumpstats != INVALID_TOPMENUOBJECT) - { - return; - } - - catJumpstats = topMenu.AddCategory(JS_OPTION_CATEGORY, TopMenuHandler_Categories); -} - -void OnOptionsMenuReady_OptionsMenu(TopMenu topMenu) -{ - // Make sure category exists - if (catJumpstats == INVALID_TOPMENUOBJECT) - { - GOKZ_OnOptionsMenuCreated(topMenu); - } - - if (optionsTopMenu == topMenu) - { - return; - } - - optionsTopMenu = topMenu; - - // Add HUD option items - for (int option = 0; option < view_as<int>(JSOPTION_COUNT); option++) - { - itemsJumpstats[option] = optionsTopMenu.AddItem(gC_JSOptionNames[option], TopMenuHandler_HUD, catJumpstats); - } -} - -public void TopMenuHandler_Categories(TopMenu topmenu, TopMenuAction action, TopMenuObject topobj_id, int param, char[] buffer, int maxlength) -{ - if (action == TopMenuAction_DisplayOption || action == TopMenuAction_DisplayTitle) - { - if (topobj_id == catJumpstats) - { - Format(buffer, maxlength, "%T", "Options Menu - Jumpstats", param); - } - } -} - -public void TopMenuHandler_HUD(TopMenu topmenu, TopMenuAction action, TopMenuObject topobj_id, int param, char[] buffer, int maxlength) -{ - JSOption option = JSOPTION_INVALID; - for (int i = 0; i < view_as<int>(JSOPTION_COUNT); i++) - { - if (topobj_id == itemsJumpstats[i]) - { - option = view_as<JSOption>(i); - break; - } - } - - if (option == JSOPTION_INVALID) - { - return; - } - - if (action == TopMenuAction_DisplayOption) - { - if (option == JSOption_JumpstatsMaster || - option == JSOption_ExtendedChatReport || - option == JSOption_FailstatsConsole || - option == JSOption_FailstatsChat || - option == JSOption_JumpstatsAlways) - { - FormatToggleableOptionDisplay(param, option, buffer, maxlength); - } - else - { - FormatDistanceTierOptionDisplay(param, option, buffer, maxlength); - } - } - else if (action == TopMenuAction_SelectOption) - { - GOKZ_JS_CycleOption(param, option); - optionsTopMenu.Display(param, TopMenuPosition_LastCategory); - } -} - - - -// =====[ PRIVATE ]===== - -static void FormatToggleableOptionDisplay(int client, JSOption option, char[] buffer, int maxlength) -{ - if (GOKZ_JS_GetOption(client, option) == JSToggleOption_Disabled) - { - FormatEx(buffer, maxlength, "%T - %T", - gI_JSOptionPhrases[option], client, - "Options Menu - Disabled", client); - } - else - { - FormatEx(buffer, maxlength, "%T - %T", - gI_JSOptionPhrases[option], client, - "Options Menu - Enabled", client); - } -} - -static void FormatDistanceTierOptionDisplay(int client, JSOption option, char[] buffer, int maxlength) -{ - int optionValue = GOKZ_JS_GetOption(client, option); - if (optionValue == DistanceTier_None) // Disabled - { - FormatEx(buffer, maxlength, "%T - %T", - gI_JSOptionPhrases[option], client, - "Options Menu - Disabled", client); - } - else - { - // Add a plus sign to anything below the highest tier - if (optionValue < DISTANCETIER_COUNT - 1) - { - FormatEx(buffer, maxlength, "%T - %s+", - gI_JSOptionPhrases[option], client, - gC_DistanceTiers[optionValue]); - } - else - { - FormatEx(buffer, maxlength, "%T - %s", - gI_JSOptionPhrases[option], client, - gC_DistanceTiers[optionValue]); - } - } -} |
