Skip to content

Commit 04efae6

Browse files
committed
nomination: add cvar mapm_nom_return_to_list
1 parent a149916 commit 04efae6

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

cstrike/addons/amxmodx/configs/map_manager.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ mapm_nom_remove_maps "1"
254254
// 0 - disable, 1 - enable
255255
mapm_nom_show_lists "0"
256256

257+
// EN: Open to the map list menu after exiting the nominations menu.
258+
// RU: Открыть меню списков карт после выхода из меню номинаций.
259+
// 0 - disable, 1 - enable
260+
mapm_nom_return_to_list "1"
261+
257262
// EN: Enables a nomination for writing part of the map name in chat.
258263
// RU: Включает номинирование по написанию части названия карты в чате.
259264
// 0 - disable, 1 - enable

cstrike/addons/amxmodx/scripting/map_manager_nomination.sma

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#endif
1010

1111
#define PLUGIN "Map Manager: Nomination"
12-
#define VERSION "0.3.7-1"
12+
#define VERSION "0.3.8"
1313
#define AUTHOR "Mistrick"
1414

1515
#pragma semicolon 1
@@ -42,6 +42,7 @@ enum Cvars {
4242
RANDOM_SORT,
4343
REMOVE_MAPS,
4444
SHOW_LISTS,
45+
RETURN_TO_LIST,
4546
FAST_NOMINATION
4647
};
4748

@@ -59,6 +60,7 @@ new g_hCallbackDisabled;
5960
new g_iNomMaps[33];
6061
new g_iLastDenominate[33];
6162
new bool:g_bIgnoreVote = false;
63+
new bool:g_bReturnToList[33];
6264

6365
new g_sPrefix[48];
6466
new g_szCurMap[32];
@@ -87,6 +89,7 @@ public plugin_init()
8789
g_pCvars[RANDOM_SORT] = register_cvar("mapm_nom_random_sort", "0"); // 0 - disable, 1 - enable
8890
g_pCvars[REMOVE_MAPS] = register_cvar("mapm_nom_remove_maps", "1"); // 0 - disable, 1 - enable
8991
g_pCvars[SHOW_LISTS] = register_cvar("mapm_nom_show_lists", "0"); // 0 - disable, 1 - enable
92+
g_pCvars[RETURN_TO_LIST] = register_cvar("mapm_nom_return_to_list", "1"); // 0 - disable, 1 - enable
9093
g_pCvars[FAST_NOMINATION] = register_cvar("mapm_nom_fast_nomination", "1"); // 0 - disable, 1 - enable
9194

9295
g_hForwards[CAN_BE_NOMINATED] = CreateMultiForward("mapm_can_be_nominated", ET_CONTINUE, FP_CELL, FP_STRING);
@@ -402,6 +405,7 @@ public clcmd_mapslist(id)
402405
}
403406

404407
if(get_num(SHOW_LISTS) && mapm_advl_get_active_lists() > 1) {
408+
g_bReturnToList[id] = false;
405409
show_lists_menu(id);
406410
} else {
407411
show_nomination_menu(id, g_aMapsList);
@@ -447,6 +451,9 @@ public lists_handler(id, menu, item)
447451
new list_name[32];
448452
mapm_advl_get_list_name(item, list_name, charsmax(list_name));
449453
new Array:maplist = mapm_advl_get_list_array(item);
454+
455+
g_bReturnToList[id] = true;
456+
450457
show_nomination_menu(id, maplist, list_name);
451458

452459
return PLUGIN_HANDLED;
@@ -524,6 +531,12 @@ public mapslist_handler(id, menu, item)
524531
{
525532
if(item == MENU_EXIT) {
526533
menu_destroy(menu);
534+
535+
if(g_bReturnToList[id] && get_num(RETURN_TO_LIST)) {
536+
g_bReturnToList[id] = false;
537+
show_lists_menu(id);
538+
}
539+
527540
return PLUGIN_HANDLED;
528541
}
529542

0 commit comments

Comments
 (0)