mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
Modernize sm_style menu.
This commit is contained in:
parent
6934fd77c2
commit
ca91332017
@ -573,24 +573,26 @@ public Action Command_Style(int client, int args)
|
||||
}
|
||||
|
||||
Menu m = new Menu(StyleMenu_Handler);
|
||||
m.SetTitle("%T", "StyleMenuTitle", client);
|
||||
m.SetTitle("%T\n%T\n ", "StyleMenuTitle", client, "StyleMenuCurrent", client, gS_StyleStrings[gBS_Style[client]][sStyleName]);
|
||||
|
||||
for(int i = 0; i < gI_Styles; i++)
|
||||
{
|
||||
char[] sInfo = new char[8];
|
||||
IntToString(i, sInfo, 8);
|
||||
|
||||
char[] sDisplay = new char[64];
|
||||
|
||||
if(gA_StyleSettings[i][bUnranked])
|
||||
{
|
||||
char[] sDisplay = new char[64];
|
||||
FormatEx(sDisplay, 64, "%T %s", "StyleUnranked", client, gS_StyleStrings[i][sStyleName]);
|
||||
m.AddItem(sInfo, sDisplay);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
m.AddItem(sInfo, gS_StyleStrings[i][sStyleName]);
|
||||
strcopy(sDisplay, 64, gS_StyleStrings[i][sStyleName]);
|
||||
}
|
||||
|
||||
m.AddItem(sInfo, sDisplay, (view_as<int>(gBS_Style[client]) == i)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
|
||||
}
|
||||
|
||||
// should NEVER happen
|
||||
@ -614,6 +616,11 @@ public int StyleMenu_Handler(Menu m, MenuAction action, int param1, int param2)
|
||||
|
||||
BhopStyle style = view_as<BhopStyle>(StringToInt(info));
|
||||
|
||||
if(view_as<int>(style) == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ChangeClientStyle(param1, style);
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
// ---------- Menus ---------- //
|
||||
"StyleMenuTitle"
|
||||
{
|
||||
"en" "Choose a style:"
|
||||
"en" "Choose a style"
|
||||
}
|
||||
"StyleSelection"
|
||||
{
|
||||
@ -40,6 +40,11 @@
|
||||
{
|
||||
"en" "[Unranked]"
|
||||
}
|
||||
"StyleMenuCurrent"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "Current: {1}"
|
||||
}
|
||||
// ---------- Misc ---------- //
|
||||
"LeftRightCheat"
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user