From 7b641526f9c3a66aae6decfe14e02cb5ddf9bbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 20 Sep 2024 10:45:14 +0200 Subject: [PATCH] Remove unnecessary `Skip` and `DescColor` variables --- src/game/editor/prompt.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/game/editor/prompt.cpp b/src/game/editor/prompt.cpp index 8dc12ef53..822651e00 100644 --- a/src/game/editor/prompt.cpp +++ b/src/game/editor/prompt.cpp @@ -112,11 +112,7 @@ void CPrompt::OnRender(CUIRect _) if(m_PromptInput.IsEmpty() || FuzzyMatch(pQuickAction->Label(), m_PromptInput.GetString())) { - bool Skip = false; - if(m_ResetFilterResults) - if(pQuickAction == m_pLastAction) - Skip = true; - if(!Skip) + if(!m_ResetFilterResults || pQuickAction != m_pLastAction) m_vpFilteredPromptList.push_back(pQuickAction); } } @@ -146,9 +142,7 @@ void CPrompt::OnRender(CUIRect _) Ui()->DoLabel(&LabelColumn, m_vpFilteredPromptList[i]->Label(), 10.0f, TEXTALIGN_ML, Props); Props.m_MaxWidth = DescColumn.w; - ColorRGBA DescColor = TextRender()->DefaultTextColor(); - DescColor.a = Item.m_Selected ? 1.0f : 0.8f; - TextRender()->TextColor(DescColor); + TextRender()->TextColor(TextRender()->DefaultTextColor().WithAlpha(Item.m_Selected ? 1.0f : 0.8f)); Ui()->DoLabel(&DescColumn, m_vpFilteredPromptList[i]->Description(), 10.0f, TEXTALIGN_MR, Props); TextRender()->TextColor(TextRender()->DefaultTextColor()); }