(svn r6040) -Add: when clicking twice on a Location Button, the SmallMap centers on your position (based on FS#54 by thomasdev)

-Add: when clicking twice in SmallMap on a position, it centers there (based on FS#54 by thomasdev)
-Add: add a button in SmallMap that centers the SmallMap on your current position (based on FS#54 by thomasdev)
This commit is contained in:
truelight
2006-08-21 17:41:04 +00:00
parent 0663fdfc1a
commit 7c6ec91ef7
3 changed files with 66 additions and 30 deletions

View File

@@ -1788,7 +1788,21 @@ bool ScrollWindowTo(int x , int y, Window *w)
bool ScrollMainWindowTo(int x, int y)
{
return ScrollWindowTo(x, y, FindWindowById(WC_MAIN_WINDOW, 0));
Window *w;
bool res = ScrollWindowTo(x, y, FindWindowById(WC_MAIN_WINDOW, 0));
/* If a user scrolls to a tile (via what way what so ever) and already is on
* that tile (e.g.: pressed twice), move the smallmap to that location,
* so you directly see where you are on the smallmap. */
if (res) return res;
w = FindWindowById(WC_SMALLMAP, 0);
if (w == NULL) return res;
SmallMapCenterOnCurrentPos(w);
return res;
}