From 54eee8e0a79898825b39749b38134f4369ccd3ab Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 16 Mar 2015 00:07:38 -0400 Subject: Adjusted how resizing the map editor works Also added an informative label for the entity manager that currently lies --- tools/mapedit/src/frame.cpp | 14 +++++++++++++- tools/mapedit/src/widget.cpp | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'tools') 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 @@ #include "widget.h" #include "tile_widget.h" #include +#include #include "panel.h" #include @@ -101,6 +102,8 @@ MapeditFrame::MapeditFrame(Map map, std::string filename) : wxFrame(NULL, wxID_A cancelEntityButton->Disable(); cancelEntityButton->Bind(wxEVT_BUTTON, &MapeditFrame::OnCancelAddEntity, this); + wxStaticText* entityInfoLabel = new wxStaticText(entityEditor, wxID_ANY, "Click and drag an entity to move it.\nRight click an entity to delete it."); + wxBoxSizer* entitySizer = new wxBoxSizer(wxVERTICAL); entitySizer->Add(entityHeader, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxBoxSizer* entitySizer1 = new wxBoxSizer(wxHORIZONTAL); @@ -111,6 +114,8 @@ MapeditFrame::MapeditFrame(Map map, std::string filename) : wxFrame(NULL, wxID_A entitySizer2->Add(addEntityButton, 1, wxEXPAND | wxRIGHT, 2); entitySizer2->Add(cancelEntityButton, 1, wxEXPAND | wxLEFT, 2); entitySizer->Add(entitySizer2, 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + entitySizer->Add(new wxStaticLine(entityEditor), 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + entitySizer->Add(entityInfoLabel, 0, wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALL, 5); entityEditor->SetSizer(entitySizer); entitySizer->SetSizeHints(entityEditor); @@ -122,9 +127,16 @@ MapeditFrame::MapeditFrame(Map map, std::string filename) : wxFrame(NULL, wxID_A wxBoxSizer* sizer2 = new wxBoxSizer(wxHORIZONTAL); sizer2->Add(layout3, 1, wxEXPAND, 0); - sizer2->Add(notebook, 0, wxALIGN_TOP | wxALIGN_CENTER_HORIZONTAL | wxLEFT, 2); + sizer2->Add(notebook, 0, wxALIGN_TOP | wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxEXPAND, 2); this->SetSizer(sizer2); sizer2->SetSizeHints(this); + + wxBoxSizer* splitterSizer = new wxBoxSizer(wxVERTICAL); + splitterSizer->Add(layout3, 1, wxEXPAND, 0); + splitterSizer->Add(mapEditor, 1, wxEXPAND, 0); + splitterSizer->Add(propertyEditor, 0, wxALIGN_TOP, wxALIGN_LEFT, 0); + layout3->SetSizer(splitterSizer); + splitterSizer->SetSizeHints(layout3); } 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) int x = (event.GetPosition().x + vX) / scale - (addingEntity->getWidth() / 2); int y = (event.GetPosition().y + vY) / scale - (addingEntity->getHeight() / 2); - printf("%d,%d\n",x,y); + MapObjectEntry data; data.object = addingEntity; data.position = std::make_pair(x,y); -- cgit 1.4.1