mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Move map tooltip to ui module
This commit is contained in:
@@ -263,6 +263,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateMapTooltip() override
|
||||||
|
{
|
||||||
|
window_map_tooltip_update_visibility();
|
||||||
|
}
|
||||||
|
|
||||||
void HandleKeyboard(bool isTitle) override
|
void HandleKeyboard(bool isTitle) override
|
||||||
{
|
{
|
||||||
input_handle_keyboard(isTitle);
|
input_handle_keyboard(isTitle);
|
||||||
|
|||||||
@@ -14,12 +14,13 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#include "../Context.h"
|
#include <openrct2-ui/windows/Window.h>
|
||||||
|
|
||||||
#include "../input.h"
|
#include <openrct2/Context.h>
|
||||||
#include "../interface/themes.h"
|
#include <openrct2/input.h>
|
||||||
#include "../interface/widget.h"
|
#include <openrct2/interface/themes.h>
|
||||||
#include "../localisation/localisation.h"
|
#include <openrct2/interface/widget.h>
|
||||||
|
#include <openrct2/localisation/localisation.h>
|
||||||
|
|
||||||
static rct_widget window_map_tooltip_widgets[] = {
|
static rct_widget window_map_tooltip_widgets[] = {
|
||||||
{ WWT_IMGBTN, 0, 0, 199, 0, 29, 0xFFFFFFFF, STR_NONE },
|
{ WWT_IMGBTN, 0, 0, 199, 0, 29, 0xFFFFFFFF, STR_NONE },
|
||||||
@@ -116,3 +116,5 @@ void window_ride_measurements_design_cancel();
|
|||||||
// rct2: 0x00F635EE
|
// rct2: 0x00F635EE
|
||||||
extern ride_list_item _window_track_list_item;
|
extern ride_list_item _window_track_list_item;
|
||||||
rct_window * window_track_list_open(ride_list_item item);
|
rct_window * window_track_list_open(ride_list_item item);
|
||||||
|
|
||||||
|
void window_map_tooltip_update_visibility();
|
||||||
|
|||||||
@@ -1039,6 +1039,12 @@ extern "C"
|
|||||||
return windowManager->ShowError(title, message);
|
return windowManager->ShowError(title, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void context_update_map_tooltip()
|
||||||
|
{
|
||||||
|
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||||
|
windowManager->UpdateMapTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
void context_input_handle_keyboard(bool isTitle)
|
void context_input_handle_keyboard(bool isTitle)
|
||||||
{
|
{
|
||||||
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ extern "C"
|
|||||||
rct_window * context_show_error(rct_string_id title, rct_string_id message);
|
rct_window * context_show_error(rct_string_id title, rct_string_id message);
|
||||||
rct_window * context_open_intent(Intent * intent);
|
rct_window * context_open_intent(Intent * intent);
|
||||||
void context_broadcast_intent(Intent * intent);
|
void context_broadcast_intent(Intent * intent);
|
||||||
|
void context_update_map_tooltip();
|
||||||
void context_input_handle_keyboard(bool isTitle);
|
void context_input_handle_keyboard(bool isTitle);
|
||||||
bool context_read_bmp(void * * outPixels, uint32 * outWidth, uint32 * outHeight, const utf8 * path);
|
bool context_read_bmp(void * * outPixels, uint32 * outWidth, uint32 * outHeight, const utf8 * path);
|
||||||
void context_quit();
|
void context_quit();
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ void game_update()
|
|||||||
gWindowMapFlashingFlags |= (1 << 3);
|
gWindowMapFlashingFlags |= (1 << 3);
|
||||||
gWindowMapFlashingFlags &= ~(1 << 2);
|
gWindowMapFlashingFlags &= ~(1 << 2);
|
||||||
|
|
||||||
window_map_tooltip_update_visibility();
|
context_update_map_tooltip();
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
gUnk141F568 = gUnk13CA740;
|
gUnk141F568 = gUnk13CA740;
|
||||||
|
|||||||
@@ -745,8 +745,6 @@ void window_bubble_list_item(rct_window* w, sint32 item_position);
|
|||||||
|
|
||||||
void window_align_tabs( rct_window *w, rct_widgetindex start_tab_id, rct_widgetindex end_tab_id );
|
void window_align_tabs( rct_window *w, rct_widgetindex start_tab_id, rct_widgetindex end_tab_id );
|
||||||
|
|
||||||
void window_map_tooltip_update_visibility();
|
|
||||||
|
|
||||||
void window_staff_list_init_vars();
|
void window_staff_list_init_vars();
|
||||||
|
|
||||||
void game_command_callback_pickup_guest(sint32 eax, sint32 ebx, sint32 ecx, sint32 edx, sint32 esi, sint32 edi, sint32 ebp);
|
void game_command_callback_pickup_guest(sint32 eax, sint32 ebx, sint32 ecx, sint32 edx, sint32 esi, sint32 edi, sint32 ebp);
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ void TitleScreen::Update()
|
|||||||
|
|
||||||
input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false);
|
input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false);
|
||||||
|
|
||||||
window_map_tooltip_update_visibility();
|
context_update_map_tooltip();
|
||||||
window_dispatch_update_all();
|
window_dispatch_update_all();
|
||||||
|
|
||||||
gSavedAge++;
|
gSavedAge++;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace OpenRCT2 { namespace Ui
|
|||||||
rct_window * ShowError(rct_string_id title, rct_string_id message) override { return nullptr; }
|
rct_window * ShowError(rct_string_id title, rct_string_id message) override { return nullptr; }
|
||||||
rct_window * OpenIntent(Intent * intent) override { return nullptr; };
|
rct_window * OpenIntent(Intent * intent) override { return nullptr; };
|
||||||
void BroadcastIntent(Intent * intent) override { }
|
void BroadcastIntent(Intent * intent) override { }
|
||||||
|
void UpdateMapTooltip() override { }
|
||||||
void HandleKeyboard(bool isTitle) override { }
|
void HandleKeyboard(bool isTitle) override { }
|
||||||
std::string GetKeyboardShortcutString(sint32 shortcut) override { return std::string(); }
|
std::string GetKeyboardShortcutString(sint32 shortcut) override { return std::string(); }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace OpenRCT2
|
|||||||
virtual rct_window * OpenIntent(Intent * intent) abstract;
|
virtual rct_window * OpenIntent(Intent * intent) abstract;
|
||||||
virtual void BroadcastIntent(Intent * intent) abstract;
|
virtual void BroadcastIntent(Intent * intent) abstract;
|
||||||
virtual rct_window * ShowError(rct_string_id title, rct_string_id message) abstract;
|
virtual rct_window * ShowError(rct_string_id title, rct_string_id message) abstract;
|
||||||
|
virtual void UpdateMapTooltip() abstract;
|
||||||
virtual void HandleKeyboard(bool isTitle) abstract;
|
virtual void HandleKeyboard(bool isTitle) abstract;
|
||||||
virtual std::string GetKeyboardShortcutString(sint32 shortcut) abstract;
|
virtual std::string GetKeyboardShortcutString(sint32 shortcut) abstract;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user