Merge pull request #1031 from Gymnasiast/patch-1

Fix land tool size staying in window after unselect land ownership tool
This commit is contained in:
Ted John 2015-04-29 18:25:33 +01:00
commit 6b3b1c9284
1 changed files with 9 additions and 4 deletions

View File

@ -369,14 +369,19 @@ static void window_map_mouseup()
*/
static void window_map_mousedown(int widgetIndex, rct_window*w, rct_widget* widget)
{
// The normal map window doesn't have widget 8 or 9.
// I assume these widgets refer to the Scenario Editor's map window.
if (widgetIndex == 8) {
// These widgets all refer to the Scenario Editor's map window.
if (widgetIndex == WIDX_MAP_SIZE_SPINNER_UP) {
RCT2_CALLPROC_X(0x0068D641, 0, 0, 0, widgetIndex, (int)w, 0, 0);
}
else if (widgetIndex == 9) {
else if (widgetIndex == WIDX_MAP_SIZE_SPINNER_DOWN) {
RCT2_CALLPROC_X(0x0068D6B4, 0, 0, 0, widgetIndex, (int)w, 0, 0);
}
else if (widgetIndex == WIDX_SET_LAND_RIGHTS)
{
// When unselecting the land rights tool, reset the size so the number doesn't
// stay in the map window.
RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 1;
}
}
/**