mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Move window shim definitions into Widget.h (#22412)
* Move window shim definitions into Widget.h * Remove unnecessary TileInspectorGlobals.h include from Window.h * Remove Ride.h include from Window.h
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <openrct2/interface/Viewport.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/rct2/T6Exporter.h>
|
||||
#include <openrct2/ride/Ride.h>
|
||||
#include <openrct2/ride/RideConstruction.h>
|
||||
#include <openrct2/ride/Vehicle.h>
|
||||
#include <openrct2/ui/WindowManager.h>
|
||||
|
||||
@@ -17,6 +17,16 @@
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
// clang-format off
|
||||
#define WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, CLOSE_STR) \
|
||||
{ WindowWidgetType::Frame, 0, 0, WIDTH - 1, 0, HEIGHT - 1, 0xFFFFFFFF, STR_NONE }, \
|
||||
{ WindowWidgetType::Caption, 0, 1, WIDTH - 2, 1, 14, TITLE, STR_WINDOW_TITLE_TIP }, \
|
||||
{ WindowWidgetType::CloseBox, 0, WIDTH - 13, WIDTH - 3, 2, 13, CLOSE_STR, STR_CLOSE_WINDOW_TIP }
|
||||
|
||||
#define WINDOW_SHIM(TITLE, WIDTH, HEIGHT) WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, STR_CLOSE_X)
|
||||
#define WINDOW_SHIM_WHITE(TITLE, WIDTH, HEIGHT) WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, STR_CLOSE_X_WHITE)
|
||||
// clang-format on
|
||||
|
||||
ImageId GetColourButtonImage(colour_t colour);
|
||||
Widget* GetWidgetByIndex(const WindowBase& w, WidgetIndex widgetIndex);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/drawing/Drawing.h>
|
||||
#include <openrct2/entity/EntityRegistry.h>
|
||||
#include <openrct2/interface/Viewport.h>
|
||||
#include <openrct2/interface/Widget.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/sprites.h>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <openrct2/object/TerrainSurfaceObject.h>
|
||||
#include <openrct2/util/Util.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/world/Map.h>
|
||||
#include <openrct2/world/MapGen.h>
|
||||
#include <openrct2/world/Surface.h>
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/world/Map.h>
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
|
||||
@@ -11,19 +11,19 @@
|
||||
|
||||
#include <openrct2-ui/interface/Window.h>
|
||||
#include <openrct2/Identifiers.h>
|
||||
#include <openrct2/ride/Ride.h>
|
||||
#include <openrct2/windows/TileInspectorGlobals.h>
|
||||
#include <string_view>
|
||||
|
||||
// TODO: only for WINDOW_SHIM_RAW below; we can do better.
|
||||
#include "../UiStringIds.h"
|
||||
|
||||
struct ObjectEntryDescriptor;
|
||||
struct Peep;
|
||||
struct Ride;
|
||||
struct RideSelection;
|
||||
struct TileElement;
|
||||
struct Vehicle;
|
||||
struct TrackDesign;
|
||||
struct Vehicle;
|
||||
|
||||
enum class GuestListFilterType : int32_t;
|
||||
enum class ScatterToolDensity : uint8_t;
|
||||
|
||||
using loadsave_callback = void (*)(int32_t result, const utf8* path);
|
||||
using scenarioselect_callback = void (*)(const utf8* path);
|
||||
|
||||
@@ -224,15 +224,4 @@ namespace OpenRCT2::Ui::Windows
|
||||
WindowBase* SceneryScatterOpen();
|
||||
WindowBase* PatrolAreaOpen(EntityId staffId);
|
||||
EntityId WindowPatrolAreaGetCurrentStaffId();
|
||||
|
||||
// clang-format off
|
||||
#define WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, CLOSE_STR) \
|
||||
{ WindowWidgetType::Frame, 0, 0, WIDTH - 1, 0, HEIGHT - 1, 0xFFFFFFFF, STR_NONE }, \
|
||||
{ WindowWidgetType::Caption, 0, 1, WIDTH - 2, 1, 14, TITLE, STR_WINDOW_TITLE_TIP }, \
|
||||
{ WindowWidgetType::CloseBox, 0, WIDTH - 13, WIDTH - 3, 2, 13, CLOSE_STR, STR_CLOSE_WINDOW_TIP }
|
||||
|
||||
#define WINDOW_SHIM(TITLE, WIDTH, HEIGHT) WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, STR_CLOSE_X)
|
||||
#define WINDOW_SHIM_WHITE(TITLE, WIDTH, HEIGHT) WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, STR_CLOSE_X_WHITE)
|
||||
|
||||
// clang-format on
|
||||
} // namespace OpenRCT2::Ui::Windows
|
||||
|
||||
Reference in New Issue
Block a user