Merge pull request #8861 from ChillerDragon/pr_prompt_fix_last_disabled

Fix editor prompt suggesting disabled last action
This commit is contained in:
Dennis Felsing 2024-09-01 07:05:30 +00:00 committed by GitHub
commit 7951136fab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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;