From daa06092522310594e750f9a3dab4fd96e917ae2 Mon Sep 17 00:00:00 2001 From: furo Date: Fri, 24 Nov 2023 16:55:36 +0100 Subject: [PATCH] Hide "Allow unused" button when not using "DDNet" entities. --- src/game/editor/popups.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 3cddb4321..0dd22b9b0 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -280,15 +280,18 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect Selector.VSplitMid(&No, &Yes); pEditor->UI()->DoLabel(&Label, "Allow unused", 10.0f, TEXTALIGN_ML); - static int s_ButtonNo = 0; - static int s_ButtonYes = 0; - if(pEditor->DoButton_ButtonDec(&s_ButtonNo, "No", !pEditor->m_AllowPlaceUnusedTiles, &No, 0, "[ctrl+u] Disallow placing unused tiles")) + if(pEditor->m_AllowPlaceUnusedTiles != -1) { - pEditor->m_AllowPlaceUnusedTiles = false; - } - if(pEditor->DoButton_ButtonInc(&s_ButtonYes, "Yes", pEditor->m_AllowPlaceUnusedTiles, &Yes, 0, "[ctrl+u] Allow placing unused tiles")) - { - pEditor->m_AllowPlaceUnusedTiles = true; + static int s_ButtonNo = 0; + static int s_ButtonYes = 0; + if(pEditor->DoButton_ButtonDec(&s_ButtonNo, "No", !pEditor->m_AllowPlaceUnusedTiles, &No, 0, "[ctrl+u] Disallow placing unused tiles")) + { + pEditor->m_AllowPlaceUnusedTiles = false; + } + if(pEditor->DoButton_ButtonInc(&s_ButtonYes, "Yes", pEditor->m_AllowPlaceUnusedTiles, &Yes, 0, "[ctrl+u] Allow placing unused tiles")) + { + pEditor->m_AllowPlaceUnusedTiles = true; + } } }