mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Move tooltip to UI project
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
#include <openrct2/platform/platform.h>
|
||||
#include <openrct2/ride/ride_data.h>
|
||||
#include <openrct2/scenario/scenario.h>
|
||||
#include <openrct2/windows/tooltip.h>
|
||||
#include <openrct2/windows/dropdown.h>
|
||||
#include <openrct2/world/banner.h>
|
||||
#include <openrct2/world/map.h>
|
||||
@@ -38,6 +37,7 @@
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/core/Util.hpp>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
typedef struct rct_mouse_data {
|
||||
uint32 x;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/util/Util.h>
|
||||
#include <openrct2/windows/dropdown.h>
|
||||
#include <openrct2/windows/tooltip.h>
|
||||
|
||||
#define WWIDTH_MIN 500
|
||||
#define WHEIGHT_MIN 300
|
||||
|
||||
@@ -14,13 +14,12 @@
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../Context.h"
|
||||
#include "../core/Math.hpp"
|
||||
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../Input.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "tooltip.h"
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
enum {
|
||||
WIDX_BACKGROUND
|
||||
@@ -68,7 +67,7 @@ static rct_window_event_list window_tooltip_events = {
|
||||
static utf8 _tooltipText[sizeof(gCommonStringFormatBuffer)];
|
||||
static sint16 _tooltipNumLines;
|
||||
|
||||
static void _window_tooltip_reset(sint32 x, sint32 y)
|
||||
void window_tooltip_reset(sint32 x, sint32 y)
|
||||
{
|
||||
gTooltipCursorX = x;
|
||||
gTooltipCursorY = y;
|
||||
@@ -78,7 +77,7 @@ static void _window_tooltip_reset(sint32 x, sint32 y)
|
||||
input_set_flag(INPUT_FLAG_4, false);
|
||||
}
|
||||
|
||||
static void _window_tooltip_show(rct_string_id id, sint32 x, sint32 y)
|
||||
void window_tooltip_show(rct_string_id id, sint32 x, sint32 y)
|
||||
{
|
||||
rct_window *w;
|
||||
sint32 width, height;
|
||||
@@ -143,7 +142,7 @@ static void _window_tooltip_show(rct_string_id id, sint32 x, sint32 y)
|
||||
*
|
||||
* rct2: 0x006EA10D
|
||||
*/
|
||||
static void _window_tooltip_open(rct_window *widgetWindow, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
void window_tooltip_open(rct_window *widgetWindow, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
{
|
||||
rct_widget *widget;
|
||||
|
||||
@@ -169,7 +168,7 @@ static void _window_tooltip_open(rct_window *widgetWindow, rct_widgetindex widge
|
||||
*
|
||||
* rct2: 0x006E98C6
|
||||
*/
|
||||
static void _window_tooltip_close()
|
||||
void window_tooltip_close()
|
||||
{
|
||||
window_close_by_class(WC_TOOLTIP);
|
||||
gTooltipTimeout = 0;
|
||||
@@ -217,26 +216,3 @@ static void window_tooltip_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
top = w->y + 1;
|
||||
draw_string_centred_raw(dpi, left, top, _tooltipNumLines, _tooltipText);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void window_tooltip_reset(sint32 x, sint32 y)
|
||||
{
|
||||
_window_tooltip_reset(x, y);
|
||||
}
|
||||
|
||||
void window_tooltip_show(rct_string_id id, sint32 x, sint32 y)
|
||||
{
|
||||
_window_tooltip_show(id, x, y);
|
||||
}
|
||||
|
||||
void window_tooltip_open(rct_window *widgetWindow, rct_widgetindex widgetIndex, sint32 x, sint32 y)
|
||||
{
|
||||
_window_tooltip_open(widgetWindow, widgetIndex, x, y);
|
||||
}
|
||||
|
||||
void window_tooltip_close()
|
||||
{
|
||||
_window_tooltip_close();
|
||||
}
|
||||
}
|
||||
@@ -161,3 +161,8 @@ void window_tile_inspector_set_page(rct_window *w, tile_inspector_page page);
|
||||
void window_tile_inspector_auto_set_buttons(rct_window *w);
|
||||
|
||||
rct_window * window_editor_object_selection_open();
|
||||
|
||||
void window_tooltip_reset(sint32 x, sint32 y);
|
||||
void window_tooltip_show(rct_string_id id, sint32 x, sint32 y);
|
||||
void window_tooltip_open(rct_window * widgetWindow, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
void window_tooltip_close();
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
#include "util/SawyerCoding.h"
|
||||
#include "util/Util.h"
|
||||
#include "windows/Intent.h"
|
||||
#include "windows/tooltip.h"
|
||||
#include "world/banner.h"
|
||||
#include "world/Climate.h"
|
||||
#include "world/entrance.h"
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
||||
/*****************************************************************************
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
||||
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* A full copy of the GNU General Public License can be found in licence.txt
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#ifndef _WINDOW_TOOLTIP_H_
|
||||
#define _WINDOW_TOOLTIP_H_
|
||||
|
||||
#include "../interface/window.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void window_tooltip_reset(sint32 x, sint32 y);
|
||||
void window_tooltip_show(rct_string_id id, sint32 x, sint32 y);
|
||||
void window_tooltip_open(rct_window *widgetWindow, rct_widgetindex widgetIndex, sint32 x, sint32 y);
|
||||
void window_tooltip_close();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user