Skip to content

Commit

Permalink
Simplified changing of block size, now just flips between 4x1x1 and 1…
Browse files Browse the repository at this point in the history
…x1x1
  • Loading branch information
timhutton committed Jan 21, 2021
1 parent 777fac0 commit 1a7def0
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/gui/InfoPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,20 +607,30 @@ void InfoPanel::ChangeBlockSize()
int oldz = sys.GetBlockSizeZ();
int newx, newy, newz;

// position dialog box to left of linkrect
wxPoint pos = ClientToScreen( wxPoint(html->linkrect.x, html->linkrect.y) );
int dlgwd = 300;
pos.x -= dlgwd + 20;
const bool allow_full_control = false;
if (allow_full_control)
{
// position dialog box to left of linkrect
wxPoint pos = ClientToScreen(wxPoint(html->linkrect.x, html->linkrect.y));
int dlgwd = 300;
pos.x -= dlgwd + 20;

XYZIntDialog dialog(frame, _("Change the block size"), oldx, oldy, oldz, pos, wxSize(dlgwd,-1));
XYZIntDialog dialog(frame, _("Change the block size"), oldx, oldy, oldz, pos, wxSize(dlgwd, -1));

if (dialog.ShowModal() == wxID_OK)
if (dialog.ShowModal() == wxID_OK)
{
newx = dialog.GetX();
newy = dialog.GetY();
newz = dialog.GetZ();
if (newx != oldx || newy != oldy || newz != oldz)
frame->SetBlockSize(newx, newy, newz);
}
}
else
{
newx = dialog.GetX();
newy = dialog.GetY();
newz = dialog.GetZ();
if (newx != oldx || newy != oldy || newz != oldz)
frame->SetBlockSize(newx, newy, newz);
newx = (oldx == 4) ? 1 : 4;
newy = newz = 1;
frame->SetBlockSize(newx, newy, newz);
}
}

Expand Down

0 comments on commit 1a7def0

Please sign in to comment.