mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Refactor border button condition, move button variable
The conditions can be combined into one if-statement to better readability.
This commit is contained in:
parent
c29d4b984c
commit
0db4b5fe0c
|
@ -1112,15 +1112,10 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
||||||
|
|
||||||
// tile manipulation
|
// tile manipulation
|
||||||
{
|
{
|
||||||
static int s_BorderBut = 0;
|
|
||||||
CLayerTiles *pT = (CLayerTiles *)GetSelectedLayerType(0, LAYERTYPE_TILES);
|
CLayerTiles *pT = (CLayerTiles *)GetSelectedLayerType(0, LAYERTYPE_TILES);
|
||||||
|
if(pT && !pT->m_Tele && !pT->m_Speedup && !pT->m_Switch && !pT->m_Front && !pT->m_Tune)
|
||||||
// no border for tele layer, speedup, front and switch
|
|
||||||
if(pT && (pT->m_Tele || pT->m_Speedup || pT->m_Switch || pT->m_Front || pT->m_Tune))
|
|
||||||
pT = nullptr;
|
|
||||||
|
|
||||||
if(pT)
|
|
||||||
{
|
{
|
||||||
|
static int s_BorderBut = 0;
|
||||||
TB_Bottom.VSplitLeft(60.0f, &Button, &TB_Bottom);
|
TB_Bottom.VSplitLeft(60.0f, &Button, &TB_Bottom);
|
||||||
if(DoButton_Ex(&s_BorderBut, "Border", 0, &Button, 0, "Place tiles in a 2-tile wide border at the edges of the layer", IGraphics::CORNER_ALL))
|
if(DoButton_Ex(&s_BorderBut, "Border", 0, &Button, 0, "Place tiles in a 2-tile wide border at the edges of the layer", IGraphics::CORNER_ALL))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue