Skip to content

Commit

Permalink
Merge pull request ddnet#7537 from furo321/allow-unused
Browse files Browse the repository at this point in the history
Hide "Allow unused" button when not using "DDNet" entities.
  • Loading branch information
def- committed Nov 24, 2023
2 parents 3fff2f9 + daa0609 commit edee3d5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/game/editor/popups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
pEditor->m_AllowPlaceUnusedTiles = false;
}
if(pEditor->DoButton_ButtonInc(&s_ButtonYes, "Yes", pEditor->m_AllowPlaceUnusedTiles, &Yes, 0, "[ctrl+u] Allow placing unused tiles"))
if(pEditor->m_AllowPlaceUnusedTiles != -1)
{
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;
}
}
}

Expand Down

0 comments on commit edee3d5

Please sign in to comment.