(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:
16
viewport.c
16
viewport.c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user