diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-16 00:07:38 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-16 00:07:38 -0400 |
commit | 54eee8e0a79898825b39749b38134f4369ccd3ab (patch) | |
tree | f6354dcc33e50b93d2bd157de2be21404ed7bf61 /tools/mapedit/src | |
parent | 213cab3c04b81428ab715f340bd7c12438fdb980 (diff) | |
download | therapy-54eee8e0a79898825b39749b38134f4369ccd3ab.tar.gz therapy-54eee8e0a79898825b39749b38134f4369ccd3ab.tar.bz2 therapy-54eee8e0a79898825b39749b38134f4369ccd3ab.zip |
Adjusted how resizing the map editor works
Also added an informative label for the entity manager that currently lies
Diffstat (limited to 'tools/mapedit/src')
-rw-r--r-- | tools/mapedit/src/frame.cpp | 14 | ||||
-rw-r--r-- | tools/mapedit/src/widget.cpp | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/mapedit/src/frame.cpp b/tools/mapedit/src/frame.cpp index aa77f1f..6119ad3 100644 --- a/tools/mapedit/src/frame.cpp +++ b/tools/mapedit/src/frame.cpp | |||
@@ -2,6 +2,7 @@ | |||
2 | #include "widget.h" | 2 | #include "widget.h" |
3 | #include "tile_widget.h" | 3 | #include "tile_widget.h" |
4 | #include <wx/splitter.h> | 4 | #include <wx/splitter.h> |
5 | #include <wx/statline.h> | ||
5 | #include "panel.h" | 6 | #include "panel.h" |
6 | #include <list> | 7 | #include <list> |
7 | 8 | ||
@@ -101,6 +102,8 @@ MapeditFrame::MapeditFrame(Map map, std::string filename) : wxFrame(NULL, wxID_A | |||
101 | cancelEntityButton->Disable(); | 102 | cancelEntityButton->Disable(); |
102 | cancelEntityButton->Bind(wxEVT_BUTTON, &MapeditFrame::OnCancelAddEntity, this); | 103 | cancelEntityButton->Bind(wxEVT_BUTTON, &MapeditFrame::OnCancelAddEntity, this); |
103 | 104 | ||
105 | wxStaticText* entityInfoLabel = new wxStaticText(entityEditor, wxID_ANY, "Click and drag an entity to move it.\nRight click an entity to delete it."); | ||
106 | |||
104 | wxBoxSizer* entitySizer = new wxBoxSizer(wxVERTICAL); | 107 | wxBoxSizer* entitySizer = new wxBoxSizer(wxVERTICAL); |
105 | entitySizer->Add(entityHeader, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | 108 | entitySizer->Add(entityHeader, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); |
106 | wxBoxSizer* entitySizer1 = new wxBoxSizer(wxHORIZONTAL); | 109 | wxBoxSizer* entitySizer1 = new wxBoxSizer(wxHORIZONTAL); |
@@ -111,6 +114,8 @@ MapeditFrame::MapeditFrame(Map map, std::string filename) : wxFrame(NULL, wxID_A | |||
111 | entitySizer2->Add(addEntityButton, 1, wxEXPAND | wxRIGHT, 2); | 114 | entitySizer2->Add(addEntityButton, 1, wxEXPAND | wxRIGHT, 2); |
112 | entitySizer2->Add(cancelEntityButton, 1, wxEXPAND | wxLEFT, 2); | 115 | entitySizer2->Add(cancelEntityButton, 1, wxEXPAND | wxLEFT, 2); |
113 | entitySizer->Add(entitySizer2, 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | 116 | entitySizer->Add(entitySizer2, 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); |
117 | entitySizer->Add(new wxStaticLine(entityEditor), 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | ||
118 | entitySizer->Add(entityInfoLabel, 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | ||
114 | entityEditor->SetSizer(entitySizer); | 119 | entityEditor->SetSizer(entitySizer); |
115 | entitySizer->SetSizeHints(entityEditor); | 120 | entitySizer->SetSizeHints(entityEditor); |
116 | 121 | ||
@@ -122,9 +127,16 @@ MapeditFrame::MapeditFrame(Map map, std::string filename) : wxFrame(NULL, wxID_A | |||
122 | 127 | ||
123 | wxBoxSizer* sizer2 = new wxBoxSizer(wxHORIZONTAL); | 128 | wxBoxSizer* sizer2 = new wxBoxSizer(wxHORIZONTAL); |
124 | sizer2->Add(layout3, 1, wxEXPAND, 0); | 129 | sizer2->Add(layout3, 1, wxEXPAND, 0); |
125 | sizer2->Add(notebook, 0, wxALIGN_TOP | wxALIGN_CENTER_HORIZONTAL | wxLEFT, 2); | 130 | sizer2->Add(notebook, 0, wxALIGN_TOP | wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxEXPAND, 2); |
126 | this->SetSizer(sizer2); | 131 | this->SetSizer(sizer2); |
127 | sizer2->SetSizeHints(this); | 132 | sizer2->SetSizeHints(this); |
133 | |||
134 | wxBoxSizer* splitterSizer = new wxBoxSizer(wxVERTICAL); | ||
135 | splitterSizer->Add(layout3, 1, wxEXPAND, 0); | ||
136 | splitterSizer->Add(mapEditor, 1, wxEXPAND, 0); | ||
137 | splitterSizer->Add(propertyEditor, 0, wxALIGN_TOP, wxALIGN_LEFT, 0); | ||
138 | layout3->SetSizer(splitterSizer); | ||
139 | splitterSizer->SetSizeHints(layout3); | ||
128 | } | 140 | } |
129 | 141 | ||
130 | void MapeditFrame::OnExit(wxCloseEvent& event) | 142 | void MapeditFrame::OnExit(wxCloseEvent& event) |
diff --git a/tools/mapedit/src/widget.cpp b/tools/mapedit/src/widget.cpp index ba3b6a5..a78caae 100644 --- a/tools/mapedit/src/widget.cpp +++ b/tools/mapedit/src/widget.cpp | |||
@@ -139,7 +139,7 @@ void MapeditWidget::OnClick(wxMouseEvent& event) | |||
139 | 139 | ||
140 | int x = (event.GetPosition().x + vX) / scale - (addingEntity->getWidth() / 2); | 140 | int x = (event.GetPosition().x + vX) / scale - (addingEntity->getWidth() / 2); |
141 | int y = (event.GetPosition().y + vY) / scale - (addingEntity->getHeight() / 2); | 141 | int y = (event.GetPosition().y + vY) / scale - (addingEntity->getHeight() / 2); |
142 | printf("%d,%d\n",x,y); | 142 | |
143 | MapObjectEntry data; | 143 | MapObjectEntry data; |
144 | data.object = addingEntity; | 144 | data.object = addingEntity; |
145 | data.position = std::make_pair(x,y); | 145 | data.position = std::make_pair(x,y); |