OpenRCT2/src/openrct2/windows/TitleOptions.cpp

112 lines
2.6 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-02-18 16:45:10 +01:00
#include "../config/Config.h"
#include "../Context.h"
2017-08-02 00:20:32 +02:00
extern "C"
{
#include "../intro.h"
2017-08-02 00:20:32 +02:00
#include "../localisation/localisation.h"
#include "../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_DROPDOWN_BUTTON, 2, 0, 79, 0, 11, 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 = {
NULL,
window_title_options_mouseup,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
window_title_options_paint,
NULL
2015-02-20 01:35:29 +01:00
};
/**
* Creates the window containing the options button on the title screen.
*/
2017-08-02 00:20:32 +02:00
static void _window_title_options_open()
2015-02-20 01:35:29 +01:00
{
rct_window * window = window_create(
context_get_width() - 80, 0,
80, 12,
&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);
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:
window_options_open();
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
extern "C"
{
void window_title_options_open()
{
_window_title_options_open();
}
}