OpenRCT2/src/openrct2-ui/windows/TitleOptions.cpp

104 lines
2.7 KiB
C++
Raw Normal View History

#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
2015-02-20 01:35:29 +01:00
/*****************************************************************************
* 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
2015-02-20 01:35:29 +01:00
*
* 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
2015-02-20 01:35:29 +01:00
*****************************************************************************/
#pragma endregion
2015-02-20 01:35:29 +01:00
2017-08-06 05:22:00 +02:00
#include <openrct2/config/Config.h>
#include <openrct2/Context.h>
2017-08-06 21:20:05 +02:00
#include <openrct2-ui/windows/Window.h>
2017-08-02 00:20:32 +02:00
2017-12-12 14:52:57 +01:00
#include <openrct2/Intro.h>
2018-01-06 18:32:25 +01:00
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
2015-02-20 01:35:29 +01:00
enum WINDOW_TITLE_OPTIONS_WIDGET_IDX {
WIDX_OPTIONS,
};
2015-02-20 01:35:29 +01:00
static rct_widget window_title_options_widgets[] = {
{ WWT_CLOSEBOX, 2, 0, 79, 0, 14, STR_OPTIONS, STR_OPTIONS_TIP },
{ WIDGETS_END },
2015-02-20 01:35:29 +01:00
};
2017-05-01 15:41:45 +02:00
static void window_title_options_mouseup(rct_window *w, rct_widgetindex widgetIndex);
static void window_title_options_paint(rct_window *w, rct_drawpixelinfo *dpi);
2015-02-20 01:35:29 +01:00
static rct_window_event_list window_title_options_events = {
2017-08-15 10:07:44 +02:00
nullptr,
window_title_options_mouseup,
2017-08-15 10:07:44 +02:00
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
window_title_options_paint,
2017-08-15 10:07:44 +02:00
nullptr
2015-02-20 01:35:29 +01:00
};
/**
* Creates the window containing the options button on the title screen.
*/
2017-08-06 05:22:00 +02:00
rct_window * window_title_options_open()
2015-02-20 01:35:29 +01:00
{
rct_window * window = window_create(
context_get_width() - 80, 0,
80, 15,
&window_title_options_events,
WC_TITLE_OPTIONS,
WF_STICK_TO_BACK | WF_TRANSPARENT
);
window->widgets = window_title_options_widgets;
window->enabled_widgets |= (1ULL << WIDX_OPTIONS);
window_init_scroll_widgets(window);
2017-08-06 05:22:00 +02:00
return window;
2015-02-20 01:35:29 +01:00
}
2017-05-01 15:41:45 +02:00
static void window_title_options_mouseup(rct_window *w, rct_widgetindex widgetIndex)
2015-02-20 01:35:29 +01:00
{
if (gIntroState != INTRO_STATE_NONE)
return;
2015-02-20 01:35:29 +01:00
switch (widgetIndex) {
case WIDX_OPTIONS:
2017-08-06 05:22:00 +02:00
context_open_window(WC_OPTIONS);
break;
}
2015-02-20 01:35:29 +01:00
}
static void window_title_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
2015-02-20 01:35:29 +01:00
{
window_draw_widgets(w, dpi);
}
2017-08-02 00:20:32 +02:00