mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
open a menu for !deletesetstart
This commit is contained in:
parent
72ae96e0c8
commit
8900e4b6ff
@ -1883,13 +1883,49 @@ public Action Command_DeleteSetStart(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
Shavit_PrintToChat(client, "%T", "DeleteSetStart", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
|
||||
Menu menu = new Menu(MenuHandler_DeleteSetStart);
|
||||
menu.SetTitle("%T\n ", "DeleteSetStartMenuTitle", client);
|
||||
|
||||
DeleteSetStart(client, Shavit_GetClientTrack(client));
|
||||
for (int i = 0; i < TRACKS_SIZE; i++)
|
||||
{
|
||||
if (gB_HasSetStart[client][i])
|
||||
{
|
||||
char info[8], sTrack[32];
|
||||
IntToString(i, info, sizeof(info));
|
||||
GetTrackName(client, i, sTrack, sizeof(sTrack));
|
||||
menu.AddItem(info, sTrack);
|
||||
}
|
||||
}
|
||||
|
||||
if (!menu.ItemCount)
|
||||
{
|
||||
delete menu;
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
menu.ExitButton = true;
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public int MenuHandler_DeleteSetStart(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if(action == MenuAction_Select)
|
||||
{
|
||||
char info[8];
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
int track = StringToInt(info);
|
||||
Shavit_PrintToChat(param1, "%T", "DeleteSetStart", param1, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
|
||||
DeleteSetStart(param1, track);
|
||||
}
|
||||
else if(action == MenuAction_End)
|
||||
{
|
||||
delete menu;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DeleteSetStart(int client, int track)
|
||||
{
|
||||
gB_HasSetStart[client][track] = false;
|
||||
|
||||
@ -29,6 +29,10 @@
|
||||
"#format" "{1:s},{2:s}"
|
||||
"en" "Start position has been {1}deleted{2}."
|
||||
}
|
||||
"DeleteSetStartMenuTitle"
|
||||
{
|
||||
"en" "Start position to delete"
|
||||
}
|
||||
// ---------- ZoneHook ---------- //
|
||||
"ZoneHook_Crosshair"
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user