[L4D2] Panel Items with ITEMDRAW_DISABLED / ITEMDRAW_NOTEXT are still functional when selected

Aperta
#2,206 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

Start by tracing the Panel selection handling for ITEMDRAW_DISABLED and ITEMDRAW_NOTEXT, comparing it with the CreateMenu behavior described in the issue. The example reproduces the bug on Left 4 Dead 2; verify whether selecting either flagged item triggers MenuAction_Select, while the regular option still works. Done means disabled and hidden Panel items no longer behave like selectable options.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Help us help you

  • I have checked that my issue doesn't exist yet.
  • 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");
  	}
  }
}
Lingua principale
C++
Stelle
1.2k
Fork
476
Merge medio
2g 9h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di alliedmodders/sourcemod

Tutte le issue di alliedmodders/sourcemod

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.