summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/mapedit/src/frame.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/mapedit/src/frame.cpp b/tools/mapedit/src/frame.cpp index 3646d4e..2a553b6 100644 --- a/tools/mapedit/src/frame.cpp +++ b/tools/mapedit/src/frame.cpp
@@ -66,8 +66,34 @@ wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame)
66 EVT_BUTTON(CANCEL_STARTPOS_BUTTON, MapeditFrame::OnCancelSetStartpos) 66 EVT_BUTTON(CANCEL_STARTPOS_BUTTON, MapeditFrame::OnCancelSetStartpos)
67wxEND_EVENT_TABLE() 67wxEND_EVENT_TABLE()
68 68
69MapeditFrame::MapeditFrame(std::unique_ptr<World> world) : wxFrame(NULL, wxID_ANY, "Map Editor", wxDefaultPosition, wxSize(GAME_WIDTH*2+TILE_WIDTH*6*6+10+10+150, GAME_HEIGHT*3)) 69MapeditFrame::MapeditFrame(std::unique_ptr<World> world) : wxFrame(NULL, wxID_ANY, "Map Editor")
70{ 70{
71 int screenWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
72 int screenHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);
73 bool setSize = false;
74 wxSize toSetSize = GetSize();
75 if (screenWidth > 1280)
76 {
77 setSize = true;
78 toSetSize.SetWidth(1280);
79 }
80
81 if (screenHeight > 800)
82 {
83 setSize = true;
84 toSetSize.SetHeight(800);
85 }
86
87 if (setSize)
88 {
89 SetSize(toSetSize);
90
91 int numClosers = openWindows.size() - 1;
92 SetPosition({GetPosition().x + numClosers*20, GetPosition().y + numClosers*20});
93 } else {
94 Maximize();
95 }
96
71 this->world = std::move(world); 97 this->world = std::move(world);
72 this->world->setParent(this); 98 this->world->setParent(this);
73 currentMap = this->world->getLastMap(); 99 currentMap = this->world->getLastMap();
@@ -228,8 +254,6 @@ MapeditFrame::MapeditFrame(std::unique_ptr<World> world) : wxFrame(NULL, wxID_AN
228 dontSelectMap = true; 254 dontSelectMap = true;
229 mapTree->SelectItem(currentMap->getTreeItemId()); 255 mapTree->SelectItem(currentMap->getTreeItemId());
230 dontSelectMap = false; 256 dontSelectMap = false;
231
232 Maximize(true);
233} 257}
234 258
235void MapeditFrame::OnExit(wxCloseEvent& event) 259void MapeditFrame::OnExit(wxCloseEvent& event)