Repository navigation
menu-core v0.3.0
Menu Core for amxts 0.3. It needs
@amxts/core0.3 and@amxts/config-core0.2, andnpx amxts upgrademoves a project to them.
👀 Highlights
🧩 Several at once
A plugin that answers a menu file's actions and placeholders can now give them all in one call, and read several menus ahead of time:
menus.register("CP_MENU", "CP_MORE");
menus.addActions({
CP_SAVE: save,
CP_WHERE: ({ player, menu }) => player.print(`You are in ${menu.name}`),
});
menus.addPlaceholders({
saved: player => `${savedBy(player)}`,
});An action or a placeholder is a function of the player, or of the menu's context when it needs more. These calls cross between plugins, which is why this release needs the 0.3 core.
🛡️ ADMIN and ACCESS_ADMIN built in
A menu.ini written for the Pawn menu_core often uses the ADMIN condition or the ACCESS_ADMIN restriction. Pawn's menu_core answered them itself, so here they warned "not registered" and greyed the item out even for an admin. Menu Core now answers both: ban, rcon, admin or menu access (d, l, u, y). A plugin that registers either name still has the last word.
🩹 Important fixes
- A menu file from the Pawn
menu_corekeeps its words in an[Основное]section. It was read as no menu, silently. It now reads as[MAIN], and a section that isn't a menu is reported in the console (be951c2). - Opening the menu a player is already looking at, from a command such as
chooseteam, starts it again from its first page. Before, it redrew the page they were on and seemed to do nothing. From one of the menu's own items it still stays where it was (c6afcaf). - The plugin reports its version,
0.3.0(9d471a8).
👉 Changelog
🚀 Enhancements
- menus: Several menus, actions and placeholders at once (8a9794c)
- menus: ADMIN and
ACCESS_ADMINbuilt in (5ef9c8a)
🩹 Fixes
- menus: The Pawn
menu_core's [Основное] is [MAIN] (be951c2) - menus: Show the menu a player is on from its start (c6afcaf)
- The plugin says its version,
0.3.0(9d471a8)
💅 Refactors
player.print, not the free print (2622715)
📖 Documentation
- A list menu's example that runs on every core (ba519eb)
❤️ Contributors
- Ernest Manukyan (@kukson777)