mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #3324
This commit fixes a bug involving tool windows being closed when the tile inspector was opened. This was caused by calling tool_cancel() from wrong places, causing all tool windows being closed.
This commit is contained in:
parent
f4ca5870db
commit
2ea8ab1441
|
@ -15,6 +15,7 @@
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#include "../addresses.h"
|
#include "../addresses.h"
|
||||||
|
#include "../input.h"
|
||||||
#include "../localisation/localisation.h"
|
#include "../localisation/localisation.h"
|
||||||
#include "../interface/themes.h"
|
#include "../interface/themes.h"
|
||||||
#include "../interface/widget.h"
|
#include "../interface/widget.h"
|
||||||
|
@ -99,13 +100,11 @@ static int window_tile_inspector_tile_x;
|
||||||
static int window_tile_inspector_tile_y;
|
static int window_tile_inspector_tile_y;
|
||||||
static int window_tile_inspector_item_count;
|
static int window_tile_inspector_item_count;
|
||||||
|
|
||||||
static void window_tile_inspector_close(rct_window *w);
|
|
||||||
static void window_tile_inspector_mouseup(rct_window *w, int widgetIndex);
|
static void window_tile_inspector_mouseup(rct_window *w, int widgetIndex);
|
||||||
static void window_tile_inspector_resize(rct_window *w);
|
static void window_tile_inspector_resize(rct_window *w);
|
||||||
static void window_title_editor_update(rct_window *w);
|
static void window_title_editor_update(rct_window *w);
|
||||||
static void window_tile_inspector_tool_update(rct_window* w, int widgetIndex, int x, int y);
|
static void window_tile_inspector_tool_update(rct_window* w, int widgetIndex, int x, int y);
|
||||||
static void window_tile_inspector_tool_down(rct_window* w, int widgetIndex, int x, int y);
|
static void window_tile_inspector_tool_down(rct_window* w, int widgetIndex, int x, int y);
|
||||||
static void window_tile_inspector_tool_abort(rct_window *w, int widgetIndex);
|
|
||||||
static void window_tile_inspector_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height);
|
static void window_tile_inspector_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height);
|
||||||
static void window_tile_inspector_scrollmousedown(rct_window *w, int scrollIndex, int x, int y);
|
static void window_tile_inspector_scrollmousedown(rct_window *w, int scrollIndex, int x, int y);
|
||||||
static void window_tile_inspector_scrollmouseover(rct_window *w, int scrollIndex, int x, int y);
|
static void window_tile_inspector_scrollmouseover(rct_window *w, int scrollIndex, int x, int y);
|
||||||
|
@ -116,7 +115,7 @@ static void window_tile_inspector_scrollpaint(rct_window *w, rct_drawpixelinfo *
|
||||||
static void window_tile_inspector_auto_set_buttons(rct_window *w);
|
static void window_tile_inspector_auto_set_buttons(rct_window *w);
|
||||||
|
|
||||||
static rct_window_event_list window_tile_inspector_events = {
|
static rct_window_event_list window_tile_inspector_events = {
|
||||||
window_tile_inspector_close,
|
NULL,
|
||||||
window_tile_inspector_mouseup,
|
window_tile_inspector_mouseup,
|
||||||
window_tile_inspector_resize,
|
window_tile_inspector_resize,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -129,7 +128,7 @@ static rct_window_event_list window_tile_inspector_events = {
|
||||||
window_tile_inspector_tool_down,
|
window_tile_inspector_tool_down,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
window_tile_inspector_tool_abort,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
window_tile_inspector_scrollgetsize,
|
window_tile_inspector_scrollgetsize,
|
||||||
window_tile_inspector_scrollmousedown,
|
window_tile_inspector_scrollmousedown,
|
||||||
|
@ -181,11 +180,6 @@ void window_tile_inspector_open()
|
||||||
tool_set(window, WIDX_BACKGROUND, 12);
|
tool_set(window, WIDX_BACKGROUND, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_tile_inspector_close(rct_window *w)
|
|
||||||
{
|
|
||||||
tool_cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void corrupt_element() {
|
static void corrupt_element() {
|
||||||
rct_map_element* mapElement;
|
rct_map_element* mapElement;
|
||||||
mapElement = map_get_first_element_at(window_tile_inspector_tile_x, window_tile_inspector_tile_y);
|
mapElement = map_get_first_element_at(window_tile_inspector_tile_x, window_tile_inspector_tile_y);
|
||||||
|
@ -285,6 +279,7 @@ static void window_tile_inspector_mouseup(rct_window *w, int widgetIndex)
|
||||||
{
|
{
|
||||||
switch (widgetIndex) {
|
switch (widgetIndex) {
|
||||||
case WIDX_CLOSE:
|
case WIDX_CLOSE:
|
||||||
|
tool_cancel();
|
||||||
window_close(w);
|
window_close(w);
|
||||||
break;
|
break;
|
||||||
case WIDX_CORRUPT:
|
case WIDX_CORRUPT:
|
||||||
|
@ -340,6 +335,9 @@ static void window_title_editor_update(rct_window *w)
|
||||||
window_tile_inspector_highlighted_index = -1;
|
window_tile_inspector_highlighted_index = -1;
|
||||||
widget_invalidate(w, WIDX_LIST);
|
widget_invalidate(w, WIDX_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(gCurrentToolWidget.window_classification != WC_TILE_INSPECTOR)
|
||||||
|
window_close(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_tile_inspector_tool_update(rct_window* w, int widgetIndex, int x, int y)
|
static void window_tile_inspector_tool_update(rct_window* w, int widgetIndex, int x, int y)
|
||||||
|
@ -403,11 +401,6 @@ static void window_tile_inspector_tool_down(rct_window* w, int widgetIndex, int
|
||||||
window_invalidate(w);
|
window_invalidate(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_tile_inspector_tool_abort(rct_window *w, int widgetIndex)
|
|
||||||
{
|
|
||||||
window_close(w);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void window_tile_inspector_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height)
|
static void window_tile_inspector_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height)
|
||||||
{
|
{
|
||||||
*width = WW - 30;
|
*width = WW - 30;
|
||||||
|
|
Loading…
Reference in New Issue