2017-06-01 21:55:10 +02:00
|
|
|
#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.
|
|
|
|
*
|
2016-05-04 19:24:41 +02:00
|
|
|
* 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.
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
2015-02-20 01:35:29 +01:00
|
|
|
*****************************************************************************/
|
2016-05-04 19:24:41 +02: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>
|
2018-01-03 00:13:37 +01:00
|
|
|
#include <openrct2-ui/interface/Widget.h>
|
2015-02-20 01:35:29 +01:00
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
rct_window * window = window_create(
|
|
|
|
context_get_width() - 80, 0,
|
2017-11-02 22:49:37 +01:00
|
|
|
80, 15,
|
2017-06-06 23:24:18 +02:00
|
|
|
&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
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
if (gIntroState != INTRO_STATE_NONE)
|
|
|
|
return;
|
2015-02-20 01:35:29 +01:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
switch (widgetIndex) {
|
|
|
|
case WIDX_OPTIONS:
|
2017-08-06 05:22:00 +02:00
|
|
|
context_open_window(WC_OPTIONS);
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-02-20 01:35:29 +01:00
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_draw_widgets(w, dpi);
|
2015-05-12 16:13:30 +02:00
|
|
|
}
|
2017-08-02 00:20:32 +02:00
|
|
|
|