mirror of
https://github.com/ddnet/ddnet.git
synced 2024-10-18 14:58:19 +00:00
Fix some editor quick actions not being clickable
Add separate UI element IDs for the quick action buttons in the prompt dialog, to ensure that the UI element IDs are different from the IDs used for the regular menu buttons. Otherwise, some buttons could not be activated with clicks because the menu button with the same ID was rendered first. Closes #8998.
This commit is contained in:
parent
b6f80e5375
commit
30021839c7
|
@ -130,7 +130,7 @@ void CPrompt::OnRender(CUIRect _)
|
|||
|
||||
for(size_t i = 0; i < m_vpFilteredPromptList.size(); i++)
|
||||
{
|
||||
const CListboxItem Item = s_ListBox.DoNextItem(m_vpFilteredPromptList[i], m_PromptSelectedIndex >= 0 && (size_t)m_PromptSelectedIndex == i);
|
||||
const CListboxItem Item = s_ListBox.DoNextItem(m_vpFilteredPromptList[i]->ActionButtonId(), m_PromptSelectedIndex >= 0 && (size_t)m_PromptSelectedIndex == i);
|
||||
if(!Item.m_Visible)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ private:
|
|||
FButtonActiveCallback m_pfnActiveCallback;
|
||||
FButtonColorCallback m_pfnColorCallback;
|
||||
|
||||
const char m_ActionButtonId = 0;
|
||||
|
||||
public:
|
||||
CQuickAction(
|
||||
const char *pLabel,
|
||||
|
@ -64,6 +66,8 @@ public:
|
|||
}
|
||||
|
||||
const char *Description() const { return m_pDescription; }
|
||||
|
||||
const void *ActionButtonId() const { return &m_ActionButtonId; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue