mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Fix editor prompt suggesting disabled last action
The editor prompt always has as a first entry the last action that ran. But this entry should not show up if that action is currently disabled.
This commit is contained in:
parent
36f0bcc509
commit
daad41fbd7
|
@ -101,7 +101,7 @@ void CPrompt::OnRender(CUIRect _)
|
||||||
{
|
{
|
||||||
m_PromptSelectedIndex = 0;
|
m_PromptSelectedIndex = 0;
|
||||||
m_vpFilteredPromptList.clear();
|
m_vpFilteredPromptList.clear();
|
||||||
if(m_ResetFilterResults && m_pLastAction)
|
if(m_ResetFilterResults && m_pLastAction && !m_pLastAction->Disabled())
|
||||||
{
|
{
|
||||||
m_vpFilteredPromptList.push_back(m_pLastAction);
|
m_vpFilteredPromptList.push_back(m_pLastAction);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ void CPrompt::OnRender(CUIRect _)
|
||||||
{
|
{
|
||||||
if(m_PromptSelectedIndex >= 0)
|
if(m_PromptSelectedIndex >= 0)
|
||||||
{
|
{
|
||||||
const CQuickAction *pBtn = m_vpFilteredPromptList[m_PromptSelectedIndex];
|
CQuickAction *pBtn = m_vpFilteredPromptList[m_PromptSelectedIndex];
|
||||||
SetInactive();
|
SetInactive();
|
||||||
pBtn->Call();
|
pBtn->Call();
|
||||||
m_pLastAction = pBtn;
|
m_pLastAction = pBtn;
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
class CPrompt : public CEditorComponent
|
class CPrompt : public CEditorComponent
|
||||||
{
|
{
|
||||||
bool m_ResetFilterResults = true;
|
bool m_ResetFilterResults = true;
|
||||||
const CQuickAction *m_pLastAction = nullptr;
|
CQuickAction *m_pLastAction = nullptr;
|
||||||
int m_PromptSelectedIndex = -1;
|
int m_PromptSelectedIndex = -1;
|
||||||
|
|
||||||
std::vector<const CQuickAction *> m_vpFilteredPromptList;
|
std::vector<CQuickAction *> m_vpFilteredPromptList;
|
||||||
std::vector<CQuickAction *> m_vQuickActions;
|
std::vector<CQuickAction *> m_vQuickActions;
|
||||||
CLineInputBuffered<512> m_PromptInput;
|
CLineInputBuffered<512> m_PromptInput;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue