Skip to content

Commit

Permalink
Add ShowPage param for weapon menus
Browse files Browse the repository at this point in the history
  • Loading branch information
ArKaNeMaN committed Nov 19, 2023
1 parent 5c0173e commit a7474a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions amxmodx/scripting/VipM/WeaponMenu/Configs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ bool:Cfg_ReadMenu(&JSON:jMenu, Menu[S_WeaponMenu]){
Menu[WeaponMenu_PerPage] = json_object_get_number(jMenu, "PerPage");
}

Menu[WeaponMenu_ShowPage] = true;
if (json_object_has_value(jMenu, "ShowPage", JSONBoolean)) {
Menu[WeaponMenu_ShowPage] = json_object_get_bool(jMenu, "ShowPage");
}

Menu[WeaponMenu_Limits] = VipM_Limits_ReadListFromJson(json_object_get_value(jMenu, "Limits"));

new JSON:jMenuItems = JsonObjectGetItemsValue(jMenu);
Expand Down
2 changes: 2 additions & 0 deletions amxmodx/scripting/VipM/WeaponMenu/Menus.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Menu_WeaponsMenu(const UserId, const MenuId, const Menu[S_WeaponMenu]) {
menu_setprop(iMenu, MPROP_PERPAGE, Menu[WeaponMenu_PerPage]);
}

menu_setprop(iMenu, MPROP_SHOWPAGE, Menu[WeaponMenu_ShowPage]);

static iInactiveItemHandler;
if (!iInactiveItemHandler) {
iInactiveItemHandler = menu_makecallback("@MenuItemHandler_Inactive");
Expand Down
1 change: 1 addition & 0 deletions amxmodx/scripting/VipM/WeaponMenu/Structs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum _:S_WeaponMenu{
bool:WeaponMenu_Fake,
WeaponMenu_FakeMessage[256],
WeaponMenu_PerPage,
bool:WeaponMenu_ShowPage,
}

enum MenuItemType{
Expand Down

0 comments on commit a7474a7

Please sign in to comment.