MegaGlest Forum
MegaGlest => Feature requests => Closed feature requests => Topic started by: Omega on 6 September 2013, 22:33:08
-
I believe it would be beneficial for map editing and scenario creation if the map editor displayed the coordinates for the tile the mouse is currently hovering over in the status bar in the window. This feature is seen in most modern image editors.
-
I believe it would be beneficial for map editing and scenario creation if the map editor displayed the coordinates for the tile the mouse is currently hovering over in the status bar in the window. This feature is seen in most modern image editors.
GAE does this no? Are you sure MG doesn't already have this?
-
GAE does this no? Are you sure MG doesn't already have this?
I don't have my computer setup to compile the tools, but as of the latest stable release, it doesn't appear to exist.
-
I will check if its there already. If its not there I try to add it, as it's very useful for scenarios.
-
Hi guys,
If no one has already done this, I am happy to take a look and see if I can implement this.
I have a little bit of experience coding, and will see if I am able to come up with anything.
I will let you know how I go.
-
Welcome to the board and MegaGlest. And yes, noone is working on this yet. ( beside of you now :D)
-
i got it :D
sry I didnt see anyone else is working on it already...
maybe you can make it better than me because i display the Position here:
(http://i.imgur.com/VtB4LK5.png)
the changes i made (svn diff output) :
Index: source/glest_map_editor/main.cpp
===================================================================
--- source/glest_map_editor/main.cpp (Revision 4566)
+++ source/glest_map_editor/main.cpp (Arbeitskopie)
@@ -304,6 +304,7 @@
-2, // Brush Type
-2, // Brush 'Value'
-1, // Brush Radius
+ -2, // Position
};
CreateStatusBar(siCOUNT);
GetStatusBar()->SetStatusWidths(siCOUNT, status_widths);
@@ -314,6 +315,7 @@
SetStatusText(wxT("Brush: Height"), siBRUSH_TYPE);
SetStatusText(wxT("Value: 0"), siBRUSH_VALUE);
SetStatusText(wxT("Radius: 1"), siBRUSH_RADIUS);
+ SetStatusText(wxT("Position: 0"), siPOS_VALUE);
wxToolBar *toolbar = new MainToolBar(this->panel, wxID_ANY);
toolbar->AddTool(miEditUndo, _("undo"), wxBitmap(edit_undo), _("Undo"));
@@ -603,6 +605,7 @@
objectUnderMouse = currObject;
}
+ SetStatusText(wxT("Position: ") + ToUnicode((program->getCell(x,y))), siPOS_VALUE);
//#ifdef WIN32
//repaint = true;
//#endif
Index: source/glest_map_editor/program.cpp
===================================================================
--- source/glest_map_editor/program.cpp (Revision 4566)
+++ source/glest_map_editor/program.cpp (Arbeitskopie)
@@ -10,6 +10,7 @@
// ==============================================================
+#include "conversion.h"
#include "program.h"
#include "util.h"
#include <iostream>
@@ -183,6 +184,12 @@
}
}
+string Program::getCell(int x, int y) {
+ int i=(x - ofsetX) / cellSize;
+ int j= (y + ofsetY) / cellSize;
+ return intToStr(i) + "," + intToStr(j);
+}
+
int Program::getResource(int x, int y) {
int i=(x - ofsetX) / cellSize;
int j= (y + ofsetY) / cellSize;
Index: source/glest_map_editor/main.h
===================================================================
--- source/glest_map_editor/main.h (Revision 4566)
+++ source/glest_map_editor/main.h (Arbeitskopie)
@@ -53,6 +53,7 @@
siBRUSH_TYPE,
siBRUSH_VALUE,
siBRUSH_RADIUS,
+ siPOS_VALUE,
siCOUNT
};
Index: source/glest_map_editor/program.h
===================================================================
--- source/glest_map_editor/program.h (Revision 4566)
+++ source/glest_map_editor/program.h (Arbeitskopie)
@@ -175,6 +175,7 @@
int getObject(int x, int y);
int getResource(int x, int y);
+ string getCell(int x, int y);
static const MapPreview *getMap() {return map;}
};
EDIT:@titi its not good for scenarios because a map having 128*128 cells in map editor has 256*256 ingame....
-
Hey great work! :thumbup:
You beat us to it but no worries at all, we will have a look for other ways to contribute to MegaGlest :)
We are already designing some cool new maps.
-
@PT I would imagine that multipling the value by 2 could give a somewhat accurate location value in game