[x] I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
[x] I can always reproduce the issue with the provided description below.
Environment
Operating System version: Any version
Game/AppID (with version if applicable): cstrike & another
Current AMX Mod X version: below
amxx version
AMX Mod X 1.9.0.5216 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Sep 10 2018 16:28:34
Built from: https://github.com/alliedmodders/amxmodx/commit/91f36f23
Build ID: 5216:91f36f23
Core mode: JIT+ASM32
Current Metamod version: below
meta version
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 15:47:38 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
[x] I have updated AMX Mod X to the latest version and it still happens.
[x] I have updated AMX Mod X to the latest snapshot and it still happens.
[x] I have updated Metamod to the latest version and it still happens.
Description
I have a suggestion for creating static menus.
We may use the 3rd argument of an native menu_create. And when we use .ml = true - menu should use title names as ML Keys. Simple code example below.
Problematic Code (or Steps to Reproduce)
#include <amxmodx>
new g_hMenu;
new g_hMenuCB;
public plugin_init()
{
register_plugin("Static menu ML tests", "0.0.1", "wopox1337");
register_dictionary("static_menu_test.txt");
Build_StaticMenu();
register_clcmd("radio1", "CMD_MenuTest");
// register_clcmd("say /MenuTest", "CMD_MenuTest");
}
Build_StaticMenu()
{
g_hMenu = menu_create("MENU_NAME", "MenuHandler_1", .ml = true); // ml parameter not used now.
g_hMenuCB = menu_makecallback("MenuCallback");
/*
* This is way how i want to create items & menus. And ML at this moment don't works.
*/
menu_additem(g_hMenu, "ITEM_0", .callback = g_hMenuCB);
menu_additem(g_hMenu, "ITEM_1", .callback = g_hMenuCB);
menu_additem(g_hMenu, "ITEM_2", .callback = g_hMenuCB);
menu_additem(g_hMenu, "ITEM_3", .callback = g_hMenuCB);
menu_additem(g_hMenu, "ITEM_4", .callback = g_hMenuCB);
}
public MenuCallback(id, menu, item)
{
new name[32], _dummy[1];
menu_item_getinfo(menu, item, _dummy[0], _dummy, charsmax(_dummy), name, charsmax(name), _dummy[0]);
/** This is wrong way to dinamicly set item name cuz name
* will be re-setted each time & ML Key willn't found.
*/
// menu_item_setname(menu, item, fmt("%l", name));
}
public MenuHandler_1(id, menu, item)
{
// server_print("-> MenuHandler_1(%i, %i, %i)", id, menu, item);
}
public CMD_MenuTest(id)
{
menu_display(id, g_hMenu);
return PLUGIN_HANDLED;
}
Help us help you
Environment
Description
I have a suggestion for creating static menus. We may use the 3rd argument of an native menu_create. And when we use
.ml = true
- menu should use title names as ML Keys. Simple code example below.Problematic Code (or Steps to Reproduce)
Logs
Not needed now.