Skip to content

Commit d61b89a

Browse files
committed
core: rework from static menu items to dynamic
add new param for mapm_add_custom_item
1 parent 23c0b2a commit d61b89a

File tree

3 files changed

+183
-119
lines changed

3 files changed

+183
-119
lines changed

cstrike/addons/amxmodx/scripting/include/map_manager.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ native mapm_set_displayed_name(item, name[]);
199199
* id - client index who used the custom item
200200
* item - custom item index
201201
*
202+
* @param type Item type
202203
* @param name Displayed name
203204
* @param handler Handler function, which will be called after selecting a custom item in the voting
204205
* @param add_blank Adds blank line before custom item
@@ -207,7 +208,7 @@ native mapm_set_displayed_name(item, name[]);
207208
* @return Custom item index
208209
* Invalid_Custom_Item - If can't register handler
209210
*/
210-
native MCustomItem:mapm_add_custom_item(name[], handler[], bool:add_blank = false, bool:add_number = true);
211+
native MCustomItem:mapm_add_custom_item(MCI_Type:type, name[], handler[], bool:add_blank = false, bool:add_number = true);
211212

212213
/**
213214
* Returns if vote started.

cstrike/addons/amxmodx/scripting/include/map_manager_consts.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,8 @@ enum {
106106
enum MCustomItem {
107107
Invalid_Custom_Item = -1
108108
};
109+
110+
enum MCI_Type {
111+
mci_before,
112+
mci_after
113+
}

0 commit comments

Comments
 (0)