diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-17 14:13:59 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-17 14:13:59 -0400 |
| commit | 90ae982fc2bfdf2f4c049db747ce9516debb148a (patch) | |
| tree | 8f2bbbccda62d61c6d76a55cfc0f2acb36dd023d /tools | |
| parent | e882367d80a0bcdd09b5412d908b0fdb6b6bfe34 (diff) | |
| download | therapy-90ae982fc2bfdf2f4c049db747ce9516debb148a.tar.gz therapy-90ae982fc2bfdf2f4c049db747ce9516debb148a.tar.bz2 therapy-90ae982fc2bfdf2f4c049db747ce9516debb148a.zip | |
Map editor now assumes a reasonable amount of screen real estate
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mapedit/src/frame.cpp | 30 |
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) |
| 67 | wxEND_EVENT_TABLE() | 67 | wxEND_EVENT_TABLE() |
| 68 | 68 | ||
| 69 | MapeditFrame::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)) | 69 | MapeditFrame::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 | ||
| 235 | void MapeditFrame::OnExit(wxCloseEvent& event) | 259 | void MapeditFrame::OnExit(wxCloseEvent& event) |
