2015-02-20 01:35:29 +01:00
|
|
|
/*****************************************************************************
|
2019-03-17 08:16:15 +01:00
|
|
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
2015-02-20 01:35:29 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2015-02-20 01:35:29 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2015-02-20 01:35:29 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2-ui/interface/Widget.h>
|
2017-08-06 21:20:05 +02:00
|
|
|
#include <openrct2-ui/windows/Window.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/Context.h>
|
2017-12-12 14:52:57 +01:00
|
|
|
#include <openrct2/Intro.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/config/Config.h>
|
2018-01-06 18:32:25 +01:00
|
|
|
#include <openrct2/localisation/Localisation.h>
|
2015-02-20 01:35:29 +01:00
|
|
|
|
2018-05-16 20:41:29 +02:00
|
|
|
// clang-format off
|
2017-03-11 21:47:06 +01:00
|
|
|
enum WINDOW_TITLE_OPTIONS_WIDGET_IDX {
|
2017-06-06 23:24:18 +02:00
|
|
|
WIDX_OPTIONS,
|
2017-03-11 21:47:06 +01:00
|
|
|
};
|
|
|
|
|
2015-02-20 01:35:29 +01:00
|
|
|
static rct_widget window_title_options_widgets[] = {
|
2018-01-04 16:17:12 +01:00
|
|
|
{ WWT_BUTTON, 2, 0, 79, 0, 14, STR_OPTIONS, STR_OPTIONS_TIP },
|
2017-06-06 23:24:18 +02:00
|
|
|
{ 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);
|
2015-07-10 02:39:16 +02:00
|
|
|
static void window_title_options_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
2015-02-20 01:35:29 +01:00
|
|
|
|
2015-07-10 02:39:16 +02:00
|
|
|
static rct_window_event_list window_title_options_events = {
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
2017-06-06 23:24:18 +02:00
|
|
|
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,
|
2017-06-06 23:24:18 +02:00
|
|
|
window_title_options_paint,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr
|
2015-02-20 01:35:29 +01:00
|
|
|
};
|
2018-05-16 20:41:29 +02:00
|
|
|
// clang-format on
|
2015-02-20 01:35:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates the window containing the options button on the title screen.
|
|
|
|
*/
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_window* window_title_options_open()
|
2015-02-20 01:35:29 +01:00
|
|
|
{
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_window* window = window_create(
|
2019-10-19 13:07:03 +02:00
|
|
|
ScreenCoordsXY(context_get_width() - 80, 0), 80, 15, &window_title_options_events, WC_TITLE_OPTIONS,
|
|
|
|
WF_STICK_TO_BACK | WF_TRANSPARENT);
|
2017-06-06 23:24:18 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
static void window_title_options_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
2015-02-20 01:35:29 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
if (gIntroState != INTRO_STATE_NONE)
|
|
|
|
return;
|
2015-02-20 01:35:29 +01:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
switch (widgetIndex)
|
|
|
|
{
|
|
|
|
case WIDX_OPTIONS:
|
|
|
|
context_open_window(WC_OPTIONS);
|
|
|
|
break;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2015-02-20 01:35:29 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
static void window_title_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
2015-02-20 01:35:29 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_draw_widgets(w, dpi);
|
2015-05-12 16:13:30 +02:00
|
|
|
}
|