patch from titi_son showing the map coordinates in the map editor
This commit is contained in:
parent
a83eb9baba
commit
d2f0591bfa
|
@ -298,12 +298,13 @@ void MainWindow::init(string fname) {
|
||||||
fileName = "New (unsaved) map";
|
fileName = "New (unsaved) map";
|
||||||
int status_widths[siCOUNT] = {
|
int status_widths[siCOUNT] = {
|
||||||
10, // empty
|
10, // empty
|
||||||
-2, // File name
|
-25, // File name
|
||||||
-1, // File type
|
-6, // File type
|
||||||
-2, // Current Object
|
-20, // Current Object
|
||||||
-2, // Brush Type
|
-14, // Brush Type
|
||||||
-2, // Brush 'Value'
|
-20, // Brush 'Value'
|
||||||
-1, // Brush Radius
|
-10, // Brush Radius
|
||||||
|
-25, // Position
|
||||||
};
|
};
|
||||||
CreateStatusBar(siCOUNT);
|
CreateStatusBar(siCOUNT);
|
||||||
GetStatusBar()->SetStatusWidths(siCOUNT, status_widths);
|
GetStatusBar()->SetStatusWidths(siCOUNT, status_widths);
|
||||||
|
@ -314,6 +315,7 @@ void MainWindow::init(string fname) {
|
||||||
SetStatusText(wxT("Brush: Height"), siBRUSH_TYPE);
|
SetStatusText(wxT("Brush: Height"), siBRUSH_TYPE);
|
||||||
SetStatusText(wxT("Value: 0"), siBRUSH_VALUE);
|
SetStatusText(wxT("Value: 0"), siBRUSH_VALUE);
|
||||||
SetStatusText(wxT("Radius: 1"), siBRUSH_RADIUS);
|
SetStatusText(wxT("Radius: 1"), siBRUSH_RADIUS);
|
||||||
|
SetStatusText(wxT("Pos (Ingame): 0"), siPOS_VALUE);
|
||||||
|
|
||||||
wxToolBar *toolbar = new MainToolBar(this->panel, wxID_ANY);
|
wxToolBar *toolbar = new MainToolBar(this->panel, wxID_ANY);
|
||||||
toolbar->AddTool(miEditUndo, _("undo"), wxBitmap(edit_undo), _("Undo"));
|
toolbar->AddTool(miEditUndo, _("undo"), wxBitmap(edit_undo), _("Undo"));
|
||||||
|
@ -603,6 +605,15 @@ void MainWindow::onMouseMove(wxMouseEvent &event, int x, int y) {
|
||||||
objectUnderMouse = currObject;
|
objectUnderMouse = currObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetStatusText(wxT("Pos (Ingame): ")
|
||||||
|
+ ToUnicode(intToStr(program->getCellX(x))
|
||||||
|
+ ","
|
||||||
|
+ intToStr(program->getCellY(y))
|
||||||
|
+ " ("
|
||||||
|
+ intToStr(2*(program->getCellX(x)))
|
||||||
|
+ ","
|
||||||
|
+ intToStr(2*(program->getCellX(x)))
|
||||||
|
+ ")"), siPOS_VALUE);
|
||||||
//#ifdef WIN32
|
//#ifdef WIN32
|
||||||
//repaint = true;
|
//repaint = true;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
|
@ -53,6 +53,7 @@ enum StatusItems {
|
||||||
siBRUSH_TYPE,
|
siBRUSH_TYPE,
|
||||||
siBRUSH_VALUE,
|
siBRUSH_VALUE,
|
||||||
siBRUSH_RADIUS,
|
siBRUSH_RADIUS,
|
||||||
|
siPOS_VALUE,
|
||||||
siCOUNT
|
siCOUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -183,6 +183,14 @@ int Program::getObject(int x, int y) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Program::getCellX(int x) {
|
||||||
|
return (x - ofsetX) / cellSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Program::getCellY(int y) {
|
||||||
|
return (y + ofsetY) / cellSize;
|
||||||
|
}
|
||||||
|
|
||||||
int Program::getResource(int x, int y) {
|
int Program::getResource(int x, int y) {
|
||||||
int i=(x - ofsetX) / cellSize;
|
int i=(x - ofsetX) / cellSize;
|
||||||
int j= (y + ofsetY) / cellSize;
|
int j= (y + ofsetY) / cellSize;
|
||||||
|
|
|
@ -175,6 +175,8 @@ public:
|
||||||
|
|
||||||
int getObject(int x, int y);
|
int getObject(int x, int y);
|
||||||
int getResource(int x, int y);
|
int getResource(int x, int y);
|
||||||
|
int getCellX(int x);
|
||||||
|
int getCellY(int y);
|
||||||
static const MapPreview *getMap() {return map;}
|
static const MapPreview *getMap() {return map;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue