You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
I can always reproduce the issue with the provided description below.
Left 4 Dead 2 on Linux server, SM 1.11.0.6968 / MM 1.11.0-dev+1155
Description
If a Panel created with CreatePanel has items with the ITEMDRAW_DISABLED or ITEMDRAW_NOTEXT draw style flags, in the past selecting these options would simply close the panel without passing the action == MenuAction_Select check in the callback (or maybe it didn't call the callback at all, I don't know). However, these options are now passing through when they shouldn't, meaning disabled and hidden menu options are incorrectly functioning equivalent to regular menu options. This does not seem to happen to Menus created with CreateMenu.
Example Code
public Action PanelTest(int client, int args)
{
Panel panel = CreatePanel();
DrawPanelItem(panel, "disabled option", ITEMDRAW_DISABLED);
DrawPanelItem(panel, "functional option");
SendPanelToClient(panel, client, PanelTestHandler, 999);
CloseHandle(panel);
return Plugin_Handled;
}
public PanelTestHandler(Menu menu, MenuAction action, int param1, int param2)
{
if(action == MenuAction_Select)
{
switch(param2)
{
case 1:
PrintToChatAll("this shouldnt be visible");
case 2:
PrintToChatAll("this should be visible");
}
}
}
The text was updated successfully, but these errors were encountered:
The menu system does have it's own validity concept which it uses to filter these out of the callback, but panels are meant to be a very low-level abstraction. MenuStyle_Radio does have the true key map, so it could filter them out itself in ClientPressedKey if the workaround is in use.
Help us help you
Left 4 Dead 2 on Linux server, SM 1.11.0.6968 / MM 1.11.0-dev+1155
Description
If a Panel created with
CreatePanel
has items with theITEMDRAW_DISABLED
orITEMDRAW_NOTEXT
draw style flags, in the past selecting these options would simply close the panel without passing theaction == MenuAction_Select
check in the callback (or maybe it didn't call the callback at all, I don't know). However, these options are now passing through when they shouldn't, meaning disabled and hidden menu options are incorrectly functioning equivalent to regular menu options. This does not seem to happen to Menus created withCreateMenu
.Example Code
The text was updated successfully, but these errors were encountered: