Skip to content

Commit

Permalink
core: rework from static menu items to dynamic
Browse files Browse the repository at this point in the history
add new param for mapm_add_custom_item
  • Loading branch information
Mistrick committed Oct 8, 2023
1 parent 23c0b2a commit d61b89a
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 119 deletions.
3 changes: 2 additions & 1 deletion cstrike/addons/amxmodx/scripting/include/map_manager.inc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ native mapm_set_displayed_name(item, name[]);
* id - client index who used the custom item
* item - custom item index
*
* @param type Item type
* @param name Displayed name
* @param handler Handler function, which will be called after selecting a custom item in the voting
* @param add_blank Adds blank line before custom item
Expand All @@ -207,7 +208,7 @@ native mapm_set_displayed_name(item, name[]);
* @return Custom item index
* Invalid_Custom_Item - If can't register handler
*/
native MCustomItem:mapm_add_custom_item(name[], handler[], bool:add_blank = false, bool:add_number = true);
native MCustomItem:mapm_add_custom_item(MCI_Type:type, name[], handler[], bool:add_blank = false, bool:add_number = true);

/**
* Returns if vote started.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ enum {
enum MCustomItem {
Invalid_Custom_Item = -1
};

enum MCI_Type {
mci_before,
mci_after
}
Loading

0 comments on commit d61b89a

Please sign in to comment.