1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00
Files
OpenRCT2/src/openrct2-ui/WindowManager.cpp
2017-09-24 22:41:49 +02:00

140 lines
4.6 KiB
C++

#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
#include <openrct2/ui/WindowManager.h>
#include <openrct2-ui/windows/Window.h>
#include "input/input.h"
#include "input/KeyboardShortcuts.h"
#include "WindowManager.h"
using namespace OpenRCT2::Ui;
class WindowManager final : public IWindowManager
{
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_CLEAR_SCENERY:
return window_clear_scenery_open();
case WC_CUSTOM_CURRENCY_CONFIG:
return custom_currency_window_open();
case WC_DEBUG_PAINT:
return window_debug_paint_open();
case WC_EDITOR_INVENTION_LIST:
return window_editor_inventions_list_open();
case WC_EDTIOR_OBJECTIVE_OPTIONS:
return window_editor_objective_options_open();
case WC_EDITOR_SCENARIO_OPTIONS:
return window_editor_scenario_options_open();
case WC_FINANCES:
return window_finances_open();
case WC_FOOTPATH:
return window_footpath_open();
case WC_LAND:
return window_land_open();
case WC_LAND_RIGHTS:
return window_land_rights_open();
case WC_MAIN_WINDOW:
return window_main_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_PARK_INFORMATION:
return window_park_entrance_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_STAFF_LIST:
return window_staff_list_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_VIEW_CLIPPING:
return window_view_clipping_open();
case WC_VIEWPORT:
return window_viewport_open();
case WC_WATER:
return window_water_open();
default:
return nullptr;
}
}
rct_window * OpenView(uint8 view) override
{
switch (view) {
case WV_PARK_AWARDS:
return window_park_awards_open();
case WV_PARK_RATING:
return window_park_rating_open();
case WV_PARK_OBJECTIVE:
return window_park_objective_open();
case WV_PARK_GUESTS:
return window_park_guests_open();
case WV_FINANCES_RESEARCH:
return window_finances_research_open();
default:
return nullptr;
}
}
void HandleKeyboard(bool isTitle) override
{
input_handle_keyboard(isTitle);
}
std::string GetKeyboardShortcutString(sint32 shortcut) override
{
utf8 buffer[256];
keyboard_shortcuts_format_string(buffer, sizeof(buffer), shortcut);
return std::string(buffer);
}
};
IWindowManager * OpenRCT2::Ui::CreateWindowManager()
{
return new WindowManager();
}