Move windows to UI project

This commit is contained in:
Marijn van der Werf 2017-08-06 05:22:00 +02:00 committed by Michał Janiszewski
parent f3ef92edcb
commit 4d90940d21
35 changed files with 400 additions and 369 deletions

View File

@ -15,6 +15,7 @@
#pragma endregion
#include <openrct2/ui/WindowManager.h>
#include <openrct2-ui/windows/Window.h>
#include "input/input.h"
#include "input/KeyboardShortcuts.h"
#include "WindowManager.h"
@ -27,8 +28,50 @@ public:
rct_window * OpenWindow(rct_windowclass wc) override
{
switch (wc) {
case WC_ABOUT:
return window_about_open();
case WC_CHANGELOG:
return window_changelog_open();
case WC_CHEATS:
return window_cheats_open();
case WC_CUSTOM_CURRENCY_CONFIG:
return custom_currency_window_open();
case WC_DEBUG_PAINT:
return window_debug_paint_open();
case WC_LAND_RIGHTS:
return window_land_rights_open();
case WC_MAPGEN:
return window_mapgen_open();
case WC_MULTIPLAYER:
return window_multiplayer_open();
case WC_MUSIC_CREDITS:
return window_music_credits_open();
case WC_RECENT_NEWS:
return window_news_open();
case WC_NOTIFICATION_OPTIONS:
return window_news_options_open();
case WC_OPTIONS:
return window_options_open();
case WC_SAVE_PROMPT:
return window_save_prompt_open();
case WC_SERVER_LIST:
return window_server_list_open();
case WC_SERVER_START:
return window_server_start_open();
case WC_KEYBOARD_SHORTCUT_LIST:
return window_shortcut_keys_open();
case WC_THEMES:
return window_themes_open();
case WC_TITLE_EXIT:
return window_title_exit_open();
case WC_TITLE_LOGO:
return window_title_logo_open();
case WC_TITLE_MENU:
return window_title_menu_open();
case WC_TITLE_OPTIONS:
return window_title_options_open();
case WC_VIEWPORT:
return window_viewport_open();
default:
return nullptr;
}

View File

@ -156,9 +156,6 @@ extern "C"
sint32 keyboard_shortcuts_get_from_key(sint32 key);
void keyboard_shortcuts_format_string(char * buffer, size_t bufferSize, sint32 shortcut);
rct_window * window_shortcut_keys_open();
rct_window * window_shortcut_change_open(sint32 selected_key);
void keyboard_shortcut_handle(sint32 key);
void keyboard_shortcut_handle_command(sint32 shortcutIndex);
void keyboard_shortcut_format_string(char *buffer, size_t size, uint16 shortcutKey);

View File

@ -32,6 +32,7 @@
#include <openrct2/interface/viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/window.h>
#include <openrct2/Context.h>
#include "KeyboardShortcuts.h"
uint8 gKeyboardShortcutChangeId;
@ -446,7 +447,7 @@ static void shortcut_show_recent_messages()
return;
if (!(gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
window_news_open();
context_open_window(WC_RECENT_NEWS);
}
static void shortcut_show_map()
@ -493,7 +494,7 @@ static void shortcut_open_cheat_window()
window_close(window);
return;
}
window_cheats_open();
context_open_window(WC_CHEATS);
}
static void shortcut_clear_scenery()
@ -535,7 +536,7 @@ static void shortcut_quick_save_game()
static void shortcut_show_options()
{
window_options_open();
context_open_window(WC_OPTIONS);
}
static void shortcut_mute_sound()
@ -551,7 +552,7 @@ static void shortcut_windowed_mode_toggle()
static void shortcut_show_multiplayer()
{
if (network_get_mode() != NETWORK_MODE_NONE)
window_multiplayer_open();
context_open_window(WC_MULTIPLAYER);
}
static void shortcut_orginal_painting_toggle()
@ -567,7 +568,7 @@ static void shortcut_debug_paint_toggle()
if (window != NULL) {
window_close(window);
} else {
window_debug_paint_open();
context_open_window(WC_DEBUG_PAINT);
}
}

View File

@ -14,13 +14,14 @@
*****************************************************************************/
#pragma endregion
#include "../OpenRCT2.h"
#include <openrct2/OpenRCT2.h>
#include <openrct2/Context.h>
extern "C"
{
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
}
#define WW 400
@ -163,14 +164,14 @@ static void window_about_set_page(rct_window *w, sint32 page);
*
* rct2: 0x0066D2AC
*/
static void _window_about_open()
rct_window * window_about_open()
{
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_ABOUT);
if (window != NULL)
return;
return window;
window = window_create_centred(
WW,
@ -186,6 +187,8 @@ static void _window_about_open()
window->colours[0] = COLOUR_GREY;
window->colours[1] = COLOUR_LIGHT_BLUE;
window->colours[2] = COLOUR_LIGHT_BLUE;
return window;
}
#pragma region OpenRCT2
@ -201,7 +204,7 @@ static void window_about_openrct2_mouseup(rct_window *w, rct_widgetindex widgetI
window_about_set_page(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2);
break;
case WIDX_CHANGELOG:
window_changelog_open();
context_open_window(WC_CHANGELOG);
break;
}
}
@ -269,7 +272,7 @@ static void window_about_rct2_mouseup(rct_window *w, rct_widgetindex widgetIndex
window_about_set_page(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2);
break;
case WIDX_MUSIC_CREDITS:
window_music_credits_open();
context_open_window(WC_MUSIC_CREDITS);
break;
}
}
@ -331,11 +334,3 @@ static void window_about_set_page(rct_window *w, sint32 page)
window_init_scroll_widgets(w);
window_invalidate(w);
}
extern "C"
{
void window_about_open()
{
_window_about_open();
}
}

View File

@ -14,15 +14,16 @@
*****************************************************************************/
#pragma endregion
#include "../Context.h"
#include "../OpenRCT2.h"
#include "../core/Math.hpp"
#include "../core/Memory.hpp"
#include <openrct2/Context.h>
#include <openrct2/OpenRCT2.h>
#include <openrct2/core/Math.hpp>
#include <openrct2/core/Memory.hpp>
extern "C" {
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../util/util.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/platform/platform.h>
#include <openrct2/util/util.h>
}
enum {
@ -95,7 +96,7 @@ static char **_changelogLines = NULL;
static sint32 _changelogNumLines = 0;
static sint32 _changelogLongestLineWidth = 0;
static rct_window *_window_changelog_open()
rct_window * window_changelog_open()
{
rct_window* window;
@ -271,11 +272,3 @@ static void window_changelog_dispose_file()
_changelogTextSize = 0;
_changelogNumLines = 0;
}
extern "C"
{
rct_window *window_changelog_open()
{
return _window_changelog_open();
}
}

View File

@ -14,18 +14,18 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../network/network.h"
#include "../world/Climate.h"
#include "../core/Math.hpp"
#include <openrct2/config/Config.h>
#include <openrct2/network/network.h>
#include <openrct2/world/Climate.h>
#include <openrct2/core/Math.hpp>
extern "C" {
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "../util/util.h"
#include "error.h"
#include "dropdown.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/util/util.h>
#include <openrct2/windows/error.h>
#include <openrct2/windows/dropdown.h>
}
#define CHEATS_MONEY_DEFAULT MONEY(10000,00)
@ -476,14 +476,14 @@ static rct_string_id window_cheats_page_titles[] = {
static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
static void _window_cheats_open()
rct_window * window_cheats_open()
{
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_CHEATS);
if (window != NULL)
return;
return window;
window = window_create(32, 32, WW, WH, &window_cheats_money_events, WC_CHEATS, 0);
window->widgets = window_cheats_money_widgets;
@ -492,6 +492,8 @@ static void _window_cheats_open()
window_init_scroll_widgets(window);
window_cheats_set_page(window, WINDOW_CHEATS_PAGE_MONEY);
park_rating_spinner_value = get_forced_park_rating() >= 0 ? get_forced_park_rating() : 999;
return window;
}
static void window_cheats_money_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget)
@ -1015,11 +1017,3 @@ static void window_cheats_set_page(rct_window *w, sint32 page)
w->widgets[WIDX_PAGE_BACKGROUND].bottom = maxY - 1;
window_invalidate(w);
}
extern "C"
{
void window_cheats_open()
{
_window_cheats_open();
}
}

View File

@ -14,13 +14,13 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include <openrct2/config/Config.h>
extern "C" {
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include "../util/util.h"
#include "dropdown.h"
#include <openrct2/localisation/localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/util/util.h>
#include <openrct2/windows/dropdown.h>
}
enum WINDOW_CUSTOM_CURRENCY_WIDGET_IDX {
@ -88,14 +88,14 @@ static rct_window_event_list _windowCustomCurrencyEvents = {
};
static void _custom_currency_window_open()
rct_window * custom_currency_window_open()
{
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_CUSTOM_CURRENCY_CONFIG);
if(window != NULL)
return;
return window;
window = window_create_centred(
400,
@ -119,6 +119,8 @@ static void _custom_currency_window_open()
window->colours[0] = COLOUR_LIGHT_BROWN;
window->colours[1] = COLOUR_LIGHT_BROWN;
window->colours[2] = COLOUR_LIGHT_BROWN;
return window;
}
@ -315,11 +317,3 @@ static void custom_currency_window_paint(rct_window *w, rct_drawpixelinfo *dpi)
);
}
}
extern "C"
{
void custom_currency_window_open()
{
_custom_currency_window_open();
}
}

View File

@ -14,14 +14,14 @@
*****************************************************************************/
#pragma endregion
#include "../Context.h"
#include <openrct2/Context.h>
extern "C" {
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../paint/map_element/map_element.h"
#include "../paint/paint.h"
#include "../ride/track_paint.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/paint/map_element/map_element.h>
#include <openrct2/paint/paint.h>
#include <openrct2/ride/track_paint.h>
}
enum WINDOW_DEBUG_PAINT_WIDGET_IDX
@ -78,13 +78,16 @@ static rct_window_event_list window_debug_paint_events = {
NULL
};
static void _window_debug_paint_open()
rct_window * window_debug_paint_open()
{
// Check if window is already open
if (window_find_by_class(WC_DEBUG_PAINT) != NULL)
return;
rct_window * window;
rct_window * window = window_create(
// Check if window is already open
window = window_find_by_class(WC_DEBUG_PAINT);
if (window != NULL)
return window;
window = window_create(
16,
context_get_height() - 16 - 33 - WINDOW_HEIGHT,
WINDOW_WIDTH,
@ -101,6 +104,8 @@ static void _window_debug_paint_open()
window->colours[0] = TRANSLUCENT(COLOUR_BLACK);
window->colours[1] = COLOUR_GREY;
return window;
}
static void window_debug_paint_mouseup(rct_window * w, rct_widgetindex widgetIndex)
@ -134,11 +139,3 @@ static void window_debug_paint_paint(rct_window * w, rct_drawpixelinfo * dpi)
{
window_draw_widgets(w, dpi);
}
extern "C"
{
void window_debug_paint_open()
{
_window_debug_paint_open();
}
}

View File

@ -14,17 +14,17 @@
*****************************************************************************/
#pragma endregion
#include "../Context.h"
#include "../core/Math.hpp"
#include <openrct2/Context.h>
#include <openrct2/core/Math.hpp>
extern "C"
{
#include "../game.h"
#include "../input.h"
#include "../interface/land_tool.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include <openrct2/game.h>
#include <openrct2/input.h>
#include <openrct2/interface/land_tool.h>
#include <openrct2/interface/viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
}
enum WINDOW_WATER_WIDGET_IDX {
@ -104,13 +104,14 @@ static rct_window_event_list window_land_rights_events = {
static uint8 _landRightsMode;
static money32 _landRightsCost;
void window_land_rights_open()
rct_window * window_land_rights_open()
{
rct_window* window;
// Check if window is already open
if (window_find_by_class(WC_LAND_RIGHTS) != NULL)
return;
window = window_find_by_class(WC_LAND_RIGHTS);
if (window != NULL)
return window;
window = window_create(context_get_width() - 98, 29, 98, 94, &window_land_rights_events, WC_LAND_RIGHTS, 0);
window->widgets = window_land_rights_widgets;
@ -134,6 +135,8 @@ void window_land_rights_open()
if (gLandRemainingConstructionSales == 0) {
show_construction_rights();
}
return window;
}
static void window_land_rights_close(rct_window *w)

View File

@ -14,18 +14,18 @@
*****************************************************************************/
#pragma endregion
#include "../core/Math.hpp"
#include <openrct2/Context.h>
#include <openrct2/core/Math.hpp>
extern "C"
{
#include "../localisation/localisation.h"
#include "../input.h"
#include "../interface/land_tool.h"
#include "../interface/widget.h"
#include "../util/util.h"
#include "../world/mapgen.h"
#include "dropdown.h"
#include <openrct2/localisation/localisation.h>
#include <openrct2/input.h>
#include <openrct2/interface/land_tool.h>
#include <openrct2/interface/widget.h>
#include <openrct2/util/util.h>
#include <openrct2/world/mapgen.h>
#include <openrct2/windows/dropdown.h>
}
enum {
@ -1138,7 +1138,7 @@ static void window_mapgen_heightmap_loadsave_callback(sint32 result, const utf8
}
// The window needs to be open while using the map
rct_window *const w = window_mapgen_open();
rct_window *const w = context_open_window(WC_MAPGEN);
_heightmapLoaded = true;
window_mapgen_set_page(w, WINDOW_MAPGEN_PAGE_HEIGHTMAP);

View File

@ -14,16 +14,16 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../network/network.h"
#include <openrct2/config/Config.h>
#include <openrct2/network/network.h>
extern "C"
{
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "../util/util.h"
#include "dropdown.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/util/util.h>
#include <openrct2/windows/dropdown.h>
}
enum {
@ -292,7 +292,7 @@ static void window_multiplayer_set_page(rct_window* w, sint32 page);
static bool _windowInformationSizeDirty;
static rct_xy16 _windowInformationSize;
void window_multiplayer_open()
rct_window * window_multiplayer_open()
{
// Check if window is already open
rct_window *window = window_bring_to_front_by_class(WC_MULTIPLAYER);
@ -300,6 +300,8 @@ void window_multiplayer_open()
window = window_create_auto_pos(320, 144, &window_multiplayer_players_events, WC_MULTIPLAYER, WF_10 | WF_RESIZABLE);
window_multiplayer_set_page(window, WINDOW_MULTIPLAYER_PAGE_INFORMATION);
}
return window;
}
static void window_multiplayer_set_page(rct_window* w, sint32 page)

View File

@ -15,12 +15,12 @@
#pragma endregion
#include "../core/Util.hpp"
#include <openrct2/core/Util.hpp>
extern "C"
{
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include <openrct2/localisation/localisation.h>
#include <openrct2/interface/widget.h>
}
enum WINDOW_MUSIC_CREDITS_WIDGET_IDX {
@ -125,14 +125,14 @@ static rct_window_event_list window_music_credits_events = {
*
* rct2: 0x0066D55B
*/
void window_music_credits_open()
rct_window * window_music_credits_open()
{
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_MUSIC_CREDITS);
if (window != NULL)
return;
return window;
window = window_create_centred(
510,
@ -150,6 +150,7 @@ void window_music_credits_open()
window->colours[1] = COLOUR_LIGHT_BLUE;
window->colours[2] = COLOUR_LIGHT_BLUE;
return window;
}
/**

View File

@ -14,17 +14,18 @@
*****************************************************************************/
#pragma endregion
#include "../core/Math.hpp"
#include <openrct2/core/Math.hpp>
#include <openrct2/Context.h>
extern "C"
{
#include "../audio/audio.h"
#include "../management/news_item.h"
#include "../localisation/localisation.h"
#include "../world/sprite.h"
#include "../peep/staff.h"
#include "../sprites.h"
#include "../interface/widget.h"
#include <openrct2/audio/audio.h>
#include <openrct2/management/news_item.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/world/sprite.h>
#include <openrct2/peep/staff.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/widget.h>
}
enum WINDOW_NEWS_WIDGET_IDX {
@ -87,7 +88,7 @@ static rct_window_event_list window_news_events = {
*
* rct2: 0x0066E464
*/
void window_news_open()
rct_window * window_news_open()
{
rct_window* window;
@ -117,6 +118,7 @@ void window_news_open()
window->scrolls[0].v_top = Math::Max(0, height - (widget->bottom - widget->top - 1));
widget_scroll_update_thumbs(window, WIDX_SCROLL);
return window;
}
/**
@ -130,7 +132,7 @@ static void window_news_mouseup(rct_window *w, rct_widgetindex widgetIndex)
window_close(w);
break;
case WIDX_SETTINGS:
window_news_options_open();
context_open_window(WC_NOTIFICATION_OPTIONS);
break;
}
}

View File

@ -14,14 +14,14 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../core/Util.hpp"
#include <openrct2/config/Config.h>
#include <openrct2/core/Util.hpp>
extern "C"
{
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
}
enum {
@ -129,7 +129,7 @@ static void window_news_options_set_page(rct_window *w, sint32 page);
static void window_news_options_draw_tab_images(rct_window *w, rct_drawpixelinfo *dpi);
static bool *get_notification_value_ptr(const notification_def *ndef);
void window_news_options_open()
rct_window * window_news_options_open()
{
rct_window* window;
@ -154,6 +154,8 @@ void window_news_options_open()
window->colours[1] = COLOUR_LIGHT_BLUE;
window->colours[2] = COLOUR_LIGHT_BLUE;
}
return window;
}
static void window_news_options_mouseup(rct_window *w, rct_widgetindex widgetIndex)

View File

@ -22,31 +22,31 @@
* Padding between the widgets and the window needs reducing, an artifact from originally being inside group boxes.
*/
#include "../audio/AudioMixer.h"
#include "../config/Config.h"
#include "../Context.h"
#include "../drawing/IDrawingEngine.h"
#include "../network/network.h"
#include "../title/TitleScreen.h"
#include "../title/TitleSequenceManager.h"
#include "../core/Math.hpp"
#include "../ui/UiContext.h"
#include <openrct2/audio/AudioMixer.h>
#include <openrct2/config/Config.h>
#include <openrct2/Context.h>
#include <openrct2/drawing/IDrawingEngine.h>
#include <openrct2/network/network.h>
#include <openrct2/title/TitleScreen.h>
#include <openrct2/title/TitleSequenceManager.h>
#include <openrct2/core/Math.hpp>
#include <openrct2/ui/UiContext.h>
extern "C"
{
#include "../audio/audio.h"
#include "../interface/themes.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include "../localisation/currency.h"
#include "../localisation/date.h"
#include "../localisation/language.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
#include "../sprites.h"
#include "../util/util.h"
#include "dropdown.h"
#include "error.h"
#include <openrct2/audio/audio.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/currency.h>
#include <openrct2/localisation/date.h>
#include <openrct2/localisation/language.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/platform/platform.h>
#include <openrct2/sprites.h>
#include <openrct2/util/util.h>
#include <openrct2/windows/dropdown.h>
#include <openrct2/windows/error.h>
}
enum WINDOW_OPTIONS_PAGE {
@ -580,14 +580,14 @@ static sint32 _numResolutions = 0;
*
* rct2: 0x006BAC5B
*/
void window_options_open()
rct_window * window_options_open()
{
rct_window* w;
// Check if window is already open
w = window_bring_to_front_by_class(WC_OPTIONS);
if (w != NULL)
return;
return w;
w = window_create_centred(WW, WH, &window_options_events, WC_OPTIONS, 0);
w->widgets = window_options_display_widgets;
@ -595,6 +595,8 @@ void window_options_open()
w->page = WINDOW_OPTIONS_PAGE_DISPLAY;
w->frame_no = 0;
window_init_scroll_widgets(w);
return w;
}
static void window_options_close(rct_window *w)
@ -795,7 +797,7 @@ static void window_options_mouseup(rct_window *w, rct_widgetindex widgetIndex)
window_invalidate(w);
break;
case WIDX_THEMES_BUTTON:
window_themes_open();
context_open_window(WC_THEMES);
window_invalidate(w);
break;
case WIDX_SELECT_BY_TRACK_TYPE:
@ -1356,7 +1358,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
case WIDX_CURRENCY_DROPDOWN:
if(dropdownIndex == CURRENCY_CUSTOM + 1) { // Add 1 because the separator occupies a position
gConfigGeneral.currency_format = (sint8)dropdownIndex - 1;
custom_currency_window_open();
context_open_window(WC_CUSTOM_CURRENCY_CONFIG);
} else {
gConfigGeneral.currency_format = (sint8)dropdownIndex;
}

View File

@ -14,16 +14,16 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../OpenRCT2.h"
#include "../core/Util.hpp"
#include <openrct2/config/Config.h>
#include <openrct2/OpenRCT2.h>
#include <openrct2/core/Util.hpp>
extern "C"
{
#include "../audio/audio.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include <openrct2/audio/audio.h>
#include <openrct2/game.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/interface/widget.h>
}
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
@ -111,7 +111,7 @@ static rct_window_event_list window_save_prompt_events = {
*
* rct2: 0x0066DCBE
*/
void window_save_prompt_open()
rct_window * window_save_prompt_open()
{
sint32 width, height;
rct_string_id stringId;
@ -127,7 +127,7 @@ void window_save_prompt_open()
// do not show save prompt if we're in the title demo and click on load game
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) {
game_load_or_quit_no_save_prompt();
return;
return nullptr;
}
if (!gConfigGeneral.confirmation_prompt) {
@ -139,7 +139,7 @@ void window_save_prompt_open()
if (gScreenAge < 3840) {
game_load_or_quit_no_save_prompt();
return;
return nullptr;
}
}
@ -170,7 +170,7 @@ void window_save_prompt_open()
if (prompt_mode >= Util::CountOf(window_save_prompt_labels)) {
log_warning("Invalid save prompt mode %u", prompt_mode);
return;
return nullptr;
}
window = window_create_centred(
width,
@ -196,6 +196,8 @@ void window_save_prompt_open()
stringId = STR_QUIT_SCENARIO_EDITOR;
window_save_prompt_widgets[WIDX_TITLE].text = stringId;
window_save_prompt_widgets[WIDX_LABEL].text = window_save_prompt_labels[prompt_mode][1];
return window;
}
/**

View File

@ -15,20 +15,21 @@
#pragma endregion
#include <mutex>
#include "../config/Config.h"
#include "../network/network.h"
#include "../network/ServerList.h"
#include <openrct2/config/Config.h>
#include <openrct2/network/network.h>
#include <openrct2/network/ServerList.h>
#include <openrct2/Context.h>
extern "C"
{
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../network/http.h"
#include "../sprites.h"
#include "../util/util.h"
#include "../windows/dropdown.h"
#include "../windows/tooltip.h"
#include "error.h"
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/network/http.h>
#include <openrct2/sprites.h>
#include <openrct2/util/util.h>
#include <openrct2/windows/dropdown.h>
#include <openrct2/windows/tooltip.h>
#include <openrct2/windows/error.h>
}
#define WWIDTH_MIN 500
@ -137,49 +138,48 @@ static void fetch_servers();
static void fetch_servers_callback(http_response_t* response);
#endif
extern "C"
rct_window * window_server_list_open()
{
void window_server_list_open()
{
rct_window* window;
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_SERVER_LIST);
if (window != NULL)
return;
// Check if window is already open
window = window_bring_to_front_by_class(WC_SERVER_LIST);
if (window != NULL)
return window;
window = window_create_centred(WWIDTH_MIN, WHEIGHT_MIN, &window_server_list_events, WC_SERVER_LIST, WF_10 | WF_RESIZABLE);
window = window_create_centred(WWIDTH_MIN, WHEIGHT_MIN, &window_server_list_events, WC_SERVER_LIST, WF_10 | WF_RESIZABLE);
window_server_list_widgets[WIDX_PLAYER_NAME_INPUT].string = _playerName;
window->widgets = window_server_list_widgets;
window->enabled_widgets = (
(1 << WIDX_CLOSE) |
(1 << WIDX_PLAYER_NAME_INPUT) |
(1 << WIDX_FETCH_SERVERS) |
(1 << WIDX_ADD_SERVER) |
(1 << WIDX_START_SERVER)
);
window_init_scroll_widgets(window);
window->no_list_items = 0;
window->selected_list_item = -1;
window->frame_no = 0;
window->min_width = 320;
window->min_height = 90;
window->max_width = window->min_width;
window->max_height = window->min_height;
window_server_list_widgets[WIDX_PLAYER_NAME_INPUT].string = _playerName;
window->widgets = window_server_list_widgets;
window->enabled_widgets = (
(1 << WIDX_CLOSE) |
(1 << WIDX_PLAYER_NAME_INPUT) |
(1 << WIDX_FETCH_SERVERS) |
(1 << WIDX_ADD_SERVER) |
(1 << WIDX_START_SERVER)
);
window_init_scroll_widgets(window);
window->no_list_items = 0;
window->selected_list_item = -1;
window->frame_no = 0;
window->min_width = 320;
window->min_height = 90;
window->max_width = window->min_width;
window->max_height = window->min_height;
window->page = 0;
window->list_information_type = 0;
window->page = 0;
window->list_information_type = 0;
window_set_resize(window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX);
window_set_resize(window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX);
safe_strcpy(_playerName, gConfigNetwork.player_name, sizeof(_playerName));
safe_strcpy(_playerName, gConfigNetwork.player_name, sizeof(_playerName));
server_list_load_server_entries();
window->no_list_items = _numServerEntries;
server_list_load_server_entries();
window->no_list_items = _numServerEntries;
fetch_servers();
}
fetch_servers();
return window;
}
static void window_server_list_close(rct_window *w)
@ -216,7 +216,7 @@ static void window_server_list_mouseup(rct_window *w, rct_widgetindex widgetInde
window_text_input_open(w, widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, STR_NONE, 0, 128);
break;
case WIDX_START_SERVER:
window_server_start_open();
context_open_window(WC_SERVER_START);
break;
}
}

View File

@ -14,17 +14,17 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../ParkImporter.h"
#include "../network/network.h"
#include <openrct2/config/Config.h>
#include <openrct2/ParkImporter.h>
#include <openrct2/network/network.h>
extern "C"
{
#include "../interface/chat.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../util/util.h"
#include <openrct2/interface/chat.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/util/util.h>
}
static char _port[7];
@ -109,14 +109,14 @@ static rct_window_event_list window_server_start_events = {
NULL
};
void window_server_start_open()
rct_window * window_server_start_open()
{
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_SERVER_START);
if (window != NULL)
return;
return window;
window = window_create_centred(WW, WH, &window_server_start_events, WC_SERVER_START, WF_10);
@ -156,6 +156,8 @@ void window_server_start_open()
safe_strcpy(_name, gConfigNetwork.server_name, sizeof(_name));
safe_strcpy(_description, gConfigNetwork.server_description, sizeof(_description));
safe_strcpy(_greeting, gConfigNetwork.server_greeting, sizeof(_greeting));
return window;
}
static void window_server_start_close(rct_window *w)

View File

@ -16,13 +16,12 @@
#include <openrct2/config/Config.h>
#include "../input/KeyboardShortcuts.h"
#include "Window.h"
extern "C"
{
#include <openrct2/interface/window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/platform/platform.h>
}
#define WW 420

View File

@ -14,19 +14,19 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include <openrct2/config/Config.h>
extern "C"
{
#include "../game.h"
#include "../input.h"
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "dropdown.h"
#include "../interface/themes.h"
#include "error.h"
#include "../util/util.h"
#include <openrct2/game.h>
#include <openrct2/input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/windows/dropdown.h>
#include <openrct2/interface/themes.h>
#include <openrct2/windows/error.h>
#include <openrct2/util/util.h>
}
enum {
@ -309,14 +309,14 @@ static void window_themes_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w)
}
}
void window_themes_open()
rct_window * window_themes_open()
{
rct_window* window;
// Check if window is already open
window = window_bring_to_front_by_class(WC_THEMES);
if (window != NULL)
return;
return window;
window = window_create_auto_pos(320, 107, &window_themes_events, WC_THEMES, WF_10 | WF_RESIZABLE);
window->widgets = window_themes_widgets;
@ -351,6 +351,8 @@ void window_themes_open()
window->min_height = 107;
window->max_width = 320;
window->max_height = 107;
return window;
}
static void window_themes_mouseup(rct_window *w, rct_widgetindex widgetIndex)

View File

@ -14,15 +14,15 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../Context.h"
#include <openrct2/config/Config.h>
#include <openrct2/Context.h>
extern "C"
{
#include "../sprites.h"
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include "../intro.h"
#include <openrct2/sprites.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/intro.h>
}
enum WINDOW_TITLE_EXIT_WIDGET_IDX {
@ -72,7 +72,7 @@ static rct_window_event_list window_title_exit_events = {
* Creates the window containing the exit button on the title screen.
* rct2: 0x0066B624 (part of 0x0066B3E8)
*/
static void _window_title_exit_open()
rct_window * window_title_exit_open()
{
rct_window* window;
@ -86,6 +86,8 @@ static void _window_title_exit_open()
window->widgets = window_title_exit_widgets;
window->enabled_widgets |= (1ULL << WIDX_EXIT);
window_init_scroll_widgets(window);
return window;
}
/**
@ -113,11 +115,3 @@ static void window_title_exit_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
window_draw_widgets(w, dpi);
}
extern "C"
{
void window_title_exit_open()
{
_window_title_exit_open();
}
}

View File

@ -16,9 +16,9 @@
extern "C"
{
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "../interface/widget.h"
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/widget.h>
}
static rct_widget window_title_logo_widgets[] = {
@ -62,7 +62,7 @@ static rct_window_event_list window_title_logo_events = {
* Creates the window containing the logo and the expansion packs on the title screen.
* rct2: 0x0066B679 (part of 0x0066B3E8)
*/
static void _window_title_logo_open()
rct_window * window_title_logo_open()
{
rct_window *window = window_create(0, 0, 200, 106, &window_title_logo_events, WC_TITLE_LOGO, WF_STICK_TO_BACK | WF_TRANSPARENT);
window->widgets = window_title_logo_widgets;
@ -70,6 +70,8 @@ static void _window_title_logo_open()
window->colours[0] = TRANSLUCENT(COLOUR_GREY);
window->colours[1] = TRANSLUCENT(COLOUR_GREY);
window->colours[2] = TRANSLUCENT(COLOUR_GREY);
return window;
}
/**
@ -83,11 +85,3 @@ static void window_title_logo_paint(rct_window *w, rct_drawpixelinfo *dpi)
gfx_draw_sprite(dpi, SPR_G2_LOGO, w->x + x, w->y + y, 0);
gfx_draw_sprite(dpi, SPR_G2_TITLE, w->x + x + 104, w->y + y + 18, 0);
}
extern "C"
{
void window_title_logo_open()
{
_window_title_logo_open();
}
}

View File

@ -14,19 +14,19 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../Context.h"
#include "../ParkImporter.h"
#include <openrct2/config/Config.h>
#include <openrct2/Context.h>
#include <openrct2/ParkImporter.h>
extern "C"
{
#include "../editor.h"
#include "../game.h"
#include "../input.h"
#include "../interface/widget.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "dropdown.h"
#include <openrct2/editor.h>
#include <openrct2/game.h>
#include <openrct2/input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/windows/dropdown.h>
}
enum {
@ -87,7 +87,7 @@ static rct_window_event_list window_title_menu_events = {
* Creates the window containing the menu buttons on the title screen.
* rct2: 0x0066B5C0 (part of 0x0066B3E8)
*/
static void _window_title_menu_open()
rct_window * window_title_menu_open()
{
rct_window* window;
@ -127,6 +127,8 @@ static void _window_title_menu_open()
window->x = (context_get_width() - window->width) / 2;
window_init_scroll_widgets(window);
return window;
}
static void window_title_menu_scenarioselect_callback(const utf8 *path)
@ -171,7 +173,7 @@ static void window_title_menu_mouseup(rct_window *w, rct_widgetindex widgetIndex
else {
window_close_by_class(WC_SCENARIO_SELECT);
window_close_by_class(WC_LOADSAVE);
window_server_list_open();
context_open_window(WC_SERVER_LIST);
}
break;
}
@ -225,11 +227,3 @@ static void window_title_menu_paint(rct_window *w, rct_drawpixelinfo *dpi)
gfx_filter_rect(dpi, w->x, w->y, w->x + w->width - 1, w->y + 82 - 1, PALETTE_51);
window_draw_widgets(w, dpi);
}
extern "C"
{
void window_title_menu_open()
{
_window_title_menu_open();
}
}

View File

@ -14,14 +14,14 @@
*****************************************************************************/
#pragma endregion
#include "../config/Config.h"
#include "../Context.h"
#include <openrct2/config/Config.h>
#include <openrct2/Context.h>
extern "C"
{
#include "../intro.h"
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include <openrct2/intro.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/interface/widget.h>
}
enum WINDOW_TITLE_OPTIONS_WIDGET_IDX {
@ -70,7 +70,7 @@ static rct_window_event_list window_title_options_events = {
/**
* Creates the window containing the options button on the title screen.
*/
static void _window_title_options_open()
rct_window * window_title_options_open()
{
rct_window * window = window_create(
context_get_width() - 80, 0,
@ -82,6 +82,8 @@ static void _window_title_options_open()
window->widgets = window_title_options_widgets;
window->enabled_widgets |= (1ULL << WIDX_OPTIONS);
window_init_scroll_widgets(window);
return window;
}
static void window_title_options_mouseup(rct_window *w, rct_widgetindex widgetIndex)
@ -91,7 +93,7 @@ static void window_title_options_mouseup(rct_window *w, rct_widgetindex widgetIn
switch (widgetIndex) {
case WIDX_OPTIONS:
window_options_open();
context_open_window(WC_OPTIONS);
break;
}
}
@ -101,11 +103,3 @@ static void window_title_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
window_draw_widgets(w, dpi);
}
extern "C"
{
void window_title_options_open()
{
_window_title_options_open();
}
}

View File

@ -16,12 +16,12 @@
extern "C"
{
#include "../audio/audio.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../sprites.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"
#include <openrct2/audio/audio.h>
#include <openrct2/game.h>
#include <openrct2/localisation/localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/viewport.h>
#include <openrct2/interface/widget.h>
}
#define INITIAL_WIDTH 500
@ -93,7 +93,7 @@ static sint32 _viewportNumber = 1;
/**
* Creates a custom viewport window.
*/
static void _window_viewport_open()
rct_window * window_viewport_open()
{
rct_window *w = window_create_auto_pos(
INITIAL_WIDTH, INITIAL_HEIGHT,
@ -121,6 +121,8 @@ static void _window_viewport_open()
}
w->viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
return w;
}
static void window_viewport_anchor_border_widgets(rct_window *w)
@ -232,11 +234,3 @@ static void window_viewport_paint(rct_window *w, rct_drawpixelinfo *dpi)
if (w->viewport != NULL)
window_draw_viewport(dpi, w);
}
extern "C"
{
void window_viewport_open()
{
_window_viewport_open();
}
}

View File

@ -0,0 +1,48 @@
#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
#pragma once
#include <openrct2/common.h>
extern "C"
{
#include <openrct2/interface/window.h>
}
rct_window * window_about_open();
rct_window * window_changelog_open();
rct_window * window_cheats_open();
rct_window * custom_currency_window_open();
rct_window * window_debug_paint_open();
rct_window * window_land_rights_open();
rct_window * window_mapgen_open();
rct_window * window_multiplayer_open();
rct_window * window_music_credits_open();
rct_window * window_news_open();
rct_window * window_news_options_open();
rct_window * window_options_open();
rct_window * window_save_prompt_open();
rct_window * window_server_list_open();
rct_window * window_server_start_open();
rct_window * window_shortcut_change_open(sint32 selected_key);
rct_window * window_shortcut_keys_open();
rct_window * window_themes_open();
rct_window * window_title_exit_open();
rct_window * window_title_logo_open();
rct_window * window_title_menu_open();
rct_window * window_title_options_open();
rct_window * window_viewport_open();

View File

@ -169,7 +169,7 @@ namespace OpenRCT2
void Quit() override
{
gSavePromptMode = PM_QUIT;
window_save_prompt_open();
context_open_window(WC_SAVE_PROMPT);
}
std::string GetPathLegacy(sint32 pathId) override

View File

@ -899,7 +899,7 @@ static void game_load_or_quit(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx
switch (*edx & 0xFF) {
case 0:
gSavePromptMode = *edi & 0xFF;
window_save_prompt_open();
context_open_window(WC_SAVE_PROMPT);
break;
case 1:
window_close_by_class(WC_SAVE_PROMPT);

View File

@ -1189,9 +1189,9 @@ static sint32 cc_open(const utf8 **argv, sint32 argc) {
} else if (strcmp(argv[0], "scenario_options") == 0 && invalidArguments(&invalidTitle, !title)) {
window_editor_scenario_options_open();
} else if (strcmp(argv[0], "options") == 0) {
window_options_open();
context_open_window(WC_OPTIONS);
} else if (strcmp(argv[0], "themes") == 0) {
window_themes_open();
context_open_window(WC_THEMES);
} else if (strcmp(argv[0], "title_sequences") == 0) {
window_title_editor_open(0);
} else if (invalidTitle) {

View File

@ -687,25 +687,16 @@ void window_resize_gui_scenario_editor(sint32 width, sint32 height);
void window_top_toolbar_open();
void window_game_bottom_toolbar_open();
void window_game_bottom_toolbar_invalidate_news_item();
void window_about_open();
void window_footpath_open();
void window_save_prompt_open();
void window_title_menu_open();
void window_title_exit_open();
void window_title_options_open();
void window_title_logo_open();
void window_news_open();
void window_scenarioselect_open(scenarioselect_callback callback);
void window_track_list_open(ride_list_item item);
void window_clear_scenery_open();
void window_land_open();
void window_water_open();
void window_land_rights_open();
void window_staff_list_open();
void window_guest_list_open();
void window_guest_list_open_with_filter(sint32 type, sint32 index);
void window_map_open();
void window_options_open();
void window_guest_open(rct_peep* peep);
rct_window *window_staff_open(rct_peep* peep);
void window_staff_fire_prompt_open(rct_peep* peep);
@ -730,7 +721,6 @@ void ride_construction_toolupdate_entrance_exit(sint32 screenX, sint32 screenY);
void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY);
void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY);
void custom_currency_window_open();
void window_maze_construction_update_pressed_widgets();
void window_track_place_open(const struct track_design_file_ref *tdFileRef);
@ -740,35 +730,26 @@ void window_install_track_open(const char* path);
void window_banner_open(rct_windownumber number);
void window_sign_open(rct_windownumber number);
void window_sign_small_open(rct_windownumber number);
void window_news_options_open();
void window_cheats_open();
void window_multiplayer_open();
void window_player_open(uint8 id);
void window_network_status_open(const char* text, close_callback onClose);
void window_network_status_close();
void window_network_status_open_password();
void window_server_list_open();
void window_server_start_open();
void window_research_open();
void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dpi, rct_widgetindex baseWidgetIndex);
void window_research_funding_page_paint(rct_window *w, rct_drawpixelinfo *dpi, rct_widgetindex baseWidgetIndex);
void window_scenery_open();
void window_music_credits_open();
void window_track_manage_open(struct track_design_file_ref *tdFileRef);
void window_viewport_open();
void window_themes_open();
void window_title_editor_open(sint32 tab);
void window_title_command_editor_open(struct TitleSequence * sequence, sint32 command, bool insert);
void window_tile_inspector_open();
void window_tile_inspector_clear_clipboard();
void window_text_input_open(rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, rct_string_id existing_text, uintptr_t existing_args, sint32 maxLength);
void window_text_input_raw_open(rct_window* call_w, rct_widgetindex call_widget, rct_string_id title, rct_string_id description, utf8string existing_text, sint32 maxLength);
rct_window *window_mapgen_open();
rct_window *window_loadsave_open(sint32 type, char *defaultName);
rct_window *window_changelog_open();
void window_debug_paint_open();
rct_window * window_object_load_error_open(utf8 * path, size_t numMissingObjects, const rct_object_entry * missingObjects);
rct_window * window_editor_main_open();

View File

@ -100,7 +100,7 @@ void TitleScreen::Load()
if (gOpenRCT2ShowChangelog)
{
gOpenRCT2ShowChangelog = false;
window_changelog_open();
context_open_window(WC_CHANGELOG);
}
if (_sequencePlayer != nullptr)
@ -174,10 +174,10 @@ void TitleScreen::ChangeSequence(sint32 preset)
*/
void TitleScreen::CreateWindows()
{
window_title_menu_open();
window_title_exit_open();
window_title_options_open();
window_title_logo_open();
context_open_window(WC_TITLE_MENU);
context_open_window(WC_TITLE_EXIT);
context_open_window(WC_TITLE_OPTIONS);
context_open_window(WC_TITLE_LOGO);
window_resize_gui(context_get_width(), context_get_height());
_hideVersionInfo = false;
}

View File

@ -206,7 +206,7 @@ static void window_game_bottom_toolbar_mouseup(rct_window *w, rct_widgetindex wi
break;
case WIDX_RIGHT_OUTSET:
case WIDX_DATE:
window_news_open();
context_open_window(WC_RECENT_NEWS);
break;
}
}

View File

@ -18,6 +18,7 @@
#include "../core/Math.hpp"
#include "../core/Util.hpp"
#include "../core/Memory.hpp"
#include "../Context.h"
extern "C"
{
@ -374,7 +375,7 @@ static void window_map_mouseup(rct_window *w, rct_widgetindex widgetIndex)
window_map_inputsize_map(w);
break;
case WIDX_MAP_GENERATOR:
window_mapgen_open();
context_open_window(WC_MAPGEN);
break;
default:
if (widgetIndex >= WIDX_PEOPLE_TAB && widgetIndex <= WIDX_RIDES_TAB) {

View File

@ -649,7 +649,7 @@ static void window_park_entrance_mouseup(rct_window *w, rct_widgetindex widgetIn
window_park_set_page(w, widgetIndex - WIDX_TAB_1);
break;
case WIDX_BUY_LAND_RIGHTS:
window_land_rights_open();
context_open_window(WC_LAND_RIGHTS);
break;
case WIDX_LOCATE:
window_scroll_to_viewport(w);

View File

@ -367,7 +367,7 @@ static void window_top_toolbar_mouseup(rct_window *w, rct_widgetindex widgetInde
window_research_open();
break;
case WIDX_NEWS:
window_news_open();
context_open_window(WC_RECENT_NEWS);
break;
case WIDX_MUTE:
audio_toggle_all_sounds();
@ -567,10 +567,10 @@ static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetInd
}
break;
case DDIDX_ABOUT:
window_about_open();
context_open_window(WC_ABOUT);
break;
case DDIDX_OPTIONS:
window_options_open();
context_open_window(WC_OPTIONS);
break;
case DDIDX_SCREENSHOT:
gScreenshotCountdown = 10;
@ -596,7 +596,7 @@ static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetInd
case WIDX_CHEATS:
switch (dropdownIndex) {
case DDIDX_CHEATS:
window_cheats_open();
context_open_window(WC_CHEATS);
break;
case DDIDX_ENABLE_SANDBOX_MODE:
game_do_command(0, GAME_COMMAND_FLAG_APPLY, CHEAT_SANDBOXMODE, !gCheatsSandboxMode, GAME_COMMAND_CHEAT, 0, 0);
@ -618,10 +618,10 @@ static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetInd
window_map_open();
break;
case 1:
window_viewport_open();
context_open_window(WC_VIEWPORT);
break;
case 2:
window_mapgen_open();
context_open_window(WC_MAPGEN);
break;
}
break;
@ -3100,7 +3100,7 @@ void top_toolbar_debug_menu_dropdown(sint16 dropdownIndex)
break;
case DDIDX_DEBUG_PAINT:
if (window_find_by_class(WC_DEBUG_PAINT) == NULL) {
window_debug_paint_open();
context_open_window(WC_DEBUG_PAINT);
} else {
window_close_by_class(WC_DEBUG_PAINT);
}
@ -3115,7 +3115,7 @@ void top_toolbar_network_menu_dropdown(sint16 dropdownIndex)
if (w) {
switch (dropdownIndex) {
case DDIDX_MULTIPLAYER:
window_multiplayer_open();
context_open_window(WC_MULTIPLAYER);
break;
}
}