From 789b8ebef9aebe8d860bde8152a485203424998b Mon Sep 17 00:00:00 2001 From: jenz Date: Fri, 11 Sep 2026 16:05:36 +0200 Subject: [PATCH] now the menu displays the category in parantheses for each map --- .../scripting/mapchooser_extended_unloze.sp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/mapchooser_extended/scripting/mapchooser_extended_unloze.sp b/mapchooser_extended/scripting/mapchooser_extended_unloze.sp index e677814..88057db 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_unloze.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_unloze.sp @@ -2310,6 +2310,16 @@ NominateResult InternalNominateMap(char[] map, int owner) 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 */ /* 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) { - 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)