now the menu displays the category in parantheses for each map

This commit is contained in:
jenz
2026-09-11 16:05:36 +02:00
parent 1ccb5cc387
commit 789b8ebef9
@@ -2310,6 +2310,16 @@ NominateResult InternalNominateMap(char[] map, int owner)
return Nominate_Added; return Nominate_Added;
} }
public void GetMapCategory(const char[] mapname, char[] output_category, int maxlen)
{
strcopy(output_category, maxlen, "Uncategorized");
if (g_Config && g_Config.JumpToKey(mapname))
{
g_Config.GetString("MapCategory", output_category, maxlen, "Uncategorized");
g_Config.Rewind();
}
}
/* Add natives to allow nominate and initiate vote to be call */ /* Add natives to allow nominate and initiate vote to be call */
/* native bool NominateMap(const char[] map, bool force, &NominateError:error); */ /* native bool NominateMap(const char[] map, bool force, &NominateError:error); */
@@ -3054,7 +3064,17 @@ public int Native_SimulateMapEnd(Handle plugin, int numParams)
stock void AddMapItem(const char[] map) stock void AddMapItem(const char[] map)
{ {
AddMenuItem(g_VoteMenu, map, map); char map_with_category[1024];
if (StrContains(map, "ze_") == 0)
{
GetMapCategory(map, map_with_category, sizeof(map_with_category));
Format(map_with_category, sizeof(map_with_category), "%s (%s)", map, map_with_category);
AddMenuItem(g_VoteMenu, map, map_with_category);
}
else
{
AddMenuItem(g_VoteMenu, map, map);
}
} }
stock void GetMapItem(Handle menu, int position, char[] map, int mapLen) stock void GetMapItem(Handle menu, int position, char[] map, int mapLen)