mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Merge pull request #8861 from ChillerDragon/pr_prompt_fix_last_disabled
Fix editor prompt suggesting disabled last action
This commit is contained in:
commit
7951136fab
|
@ -101,7 +101,7 @@ void CPrompt::OnRender(CUIRect _)
|
|||
{
|
||||
m_PromptSelectedIndex = 0;
|
||||
m_vpFilteredPromptList.clear();
|
||||
if(m_ResetFilterResults && m_pLastAction)
|
||||
if(m_ResetFilterResults && m_pLastAction && !m_pLastAction->Disabled())
|
||||
{
|
||||
m_vpFilteredPromptList.push_back(m_pLastAction);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ void CPrompt::OnRender(CUIRect _)
|
|||
{
|
||||
if(m_PromptSelectedIndex >= 0)
|
||||
{
|
||||
const CQuickAction *pBtn = m_vpFilteredPromptList[m_PromptSelectedIndex];
|
||||
CQuickAction *pBtn = m_vpFilteredPromptList[m_PromptSelectedIndex];
|
||||
SetInactive();
|
||||
pBtn->Call();
|
||||
m_pLastAction = pBtn;
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
class CPrompt : public CEditorComponent
|
||||
{
|
||||
bool m_ResetFilterResults = true;
|
||||
const CQuickAction *m_pLastAction = nullptr;
|
||||
CQuickAction *m_pLastAction = nullptr;
|
||||
int m_PromptSelectedIndex = -1;
|
||||
|
||||
std::vector<const CQuickAction *> m_vpFilteredPromptList;
|
||||
std::vector<CQuickAction *> m_vpFilteredPromptList;
|
||||
std::vector<CQuickAction *> m_vQuickActions;
|
||||
CLineInputBuffered<512> m_PromptInput;
|
||||
|
||||
|
|
Loading…
Reference in a new issue