Compare commits

...
2 Commits
@@ -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); */
@@ -3053,9 +3063,19 @@ public int Native_SimulateMapEnd(Handle plugin, int numParams)
} }
stock void AddMapItem(const char[] map) stock void AddMapItem(const char[] 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); 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)
{ {