diff options
| author | navewindre <nw@moneybot.cc> | 2023-12-04 18:06:10 +0100 |
|---|---|---|
| committer | navewindre <nw@moneybot.cc> | 2023-12-04 18:06:10 +0100 |
| commit | aef0d1c1268ab7d4bc18996c9c6b4da16a40aadc (patch) | |
| tree | 43e766b51704f4ab8b383583bdc1871eeeb9c698 /sourcemod/scripting/gokz-hud/menu.sp | |
| parent | 38f1140c11724da05a23a10385061200b907cf6e (diff) | |
bbbbbbbbwaaaaaaaaaaa
Diffstat (limited to 'sourcemod/scripting/gokz-hud/menu.sp')
| -rw-r--r-- | sourcemod/scripting/gokz-hud/menu.sp | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/sourcemod/scripting/gokz-hud/menu.sp b/sourcemod/scripting/gokz-hud/menu.sp new file mode 100644 index 0000000..4b7259e --- /dev/null +++ b/sourcemod/scripting/gokz-hud/menu.sp @@ -0,0 +1,96 @@ +/* + Tracks whether a GOKZ HUD menu or panel element is being shown to the client. +*/ + + + +// Update the TP menu i.e. item text, item disabled/enabled +void CancelGOKZHUDMenu(int client) +{ + // Only cancel the menu if we know it's the TP menu + if (gB_MenuShowing[client]) + { + CancelClientMenu(client); + } +} + + + +// =====[ EVENTS ]===== + +void OnPlayerSpawn_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnOptionChanged_Menu(int client, HUDOption option) +{ + if (option == HUDOption_TPMenu || option == HUDOption_TimerText) + { + CancelGOKZHUDMenu(client); + } +} + +void OnTimerStart_Menu(int client) +{ + // Prevent the menu from getting cancelled every tick if player use start timer button zone. + if (GOKZ_GetTime(client) > 0.0) + { + CancelGOKZHUDMenu(client); + } +} + +void OnTimerEnd_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnTimerStopped_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnPause_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnResume_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnMakeCheckpoint_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnCountedTeleport_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnJoinTeam_Menu(int client) +{ + CancelGOKZHUDMenu(client); +} + +void OnStartPositionSet_Menu(int client) +{ + // Prevent the menu from getting cancelled every tick if player use start timer button zone. + if (GOKZ_GetTime(client) > 0.0) + { + CancelGOKZHUDMenu(client); + } +} + +void OnPluginEnd_Menu() +{ + for (int client = 1; client <= MaxClients; client++) + { + if (IsValidClient(client)) + { + CancelGOKZHUDMenu(client); + } + } +}
\ No newline at end of file |
