mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 23:34:37 +01:00
Added options button to title screen
This commit is contained in:
@@ -123,6 +123,7 @@
|
||||
<ClCompile Include="..\src\windows\title_exit.c" />
|
||||
<ClCompile Include="..\src\windows\title_logo.c" />
|
||||
<ClCompile Include="..\src\windows\title_menu.c" />
|
||||
<ClCompile Include="..\src\windows\title_options.c" />
|
||||
<ClCompile Include="..\src\windows\title_scenarioselect.c" />
|
||||
<ClCompile Include="..\src\windows\tooltip.c" />
|
||||
<ClCompile Include="..\src\windows\top_toolbar.c" />
|
||||
|
||||
@@ -425,6 +425,9 @@
|
||||
<ClCompile Include="..\src\config.c">
|
||||
<Filter>Source</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\windows\title_options.c">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\management\award.h">
|
||||
|
||||
@@ -400,7 +400,8 @@ enum {
|
||||
WC_TEXTINPUT = 113,
|
||||
WC_MAPGEN = 114,
|
||||
WC_LOADSAVE = 115,
|
||||
WC_LOADSAVE_OVERWRITE_PROMPT = 116
|
||||
WC_LOADSAVE_OVERWRITE_PROMPT = 116,
|
||||
WC_TITLE_OPTIONS = 117
|
||||
} WINDOW_CLASS;
|
||||
|
||||
enum PROMPT_MODE {
|
||||
@@ -504,6 +505,7 @@ void window_footpath_open();
|
||||
void window_save_prompt_open();
|
||||
void window_title_menu_open();
|
||||
void window_title_exit_open();
|
||||
void window_title_options_open();
|
||||
void window_title_logo_open();
|
||||
void window_news_open();
|
||||
void window_scenarioselect_open();
|
||||
|
||||
@@ -135,6 +135,7 @@ static void title_create_windows()
|
||||
window_main_open();
|
||||
window_title_menu_open();
|
||||
window_title_exit_open();
|
||||
window_title_options_open();
|
||||
window_title_logo_open();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066B905);
|
||||
}
|
||||
|
||||
112
src/windows/title_options.c
Normal file
112
src/windows/title_options.c
Normal file
@@ -0,0 +1,112 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John, Timmy Weerwag
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of 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.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../addresses.h"
|
||||
#include "../game.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
|
||||
static rct_widget window_title_options_widgets[] = {
|
||||
{ WWT_DROPDOWN_BUTTON, 2, 0, 79, 0, 11, STR_OPTIONS, STR_NONE },
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
static void window_title_options_emptysub() {}
|
||||
static void window_title_options_paint();
|
||||
static void window_title_options_mouseup();
|
||||
|
||||
static void* window_title_options_events[] = {
|
||||
window_title_options_emptysub,
|
||||
window_title_options_mouseup,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_emptysub,
|
||||
window_title_options_paint,
|
||||
window_title_options_emptysub
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates the window containing the options button on the title screen.
|
||||
*/
|
||||
void window_title_options_open()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
window = window_create(
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16) - 80, 0,
|
||||
80, 12,
|
||||
(uint32*)window_title_options_events,
|
||||
WC_TITLE_OPTIONS,
|
||||
WF_STICK_TO_FRONT
|
||||
);
|
||||
window->widgets = window_title_options_widgets;
|
||||
window->enabled_widgets |= 1;
|
||||
window_init_scroll_widgets(window);
|
||||
window->flags |= 16;
|
||||
window->colours[0] = 140;
|
||||
window->colours[1] = 140;
|
||||
window->colours[2] = 140;
|
||||
}
|
||||
|
||||
static void window_title_options_mouseup()
|
||||
{
|
||||
short widgetIndex;
|
||||
rct_window *w;
|
||||
|
||||
window_widget_get_registers(w, widgetIndex);
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) != 0)
|
||||
return;
|
||||
|
||||
if (widgetIndex == 0)
|
||||
window_options_open();
|
||||
}
|
||||
|
||||
static void window_title_options_paint()
|
||||
{
|
||||
rct_window *w;
|
||||
rct_drawpixelinfo *dpi;
|
||||
|
||||
window_paint_get_registers(w, dpi);
|
||||
|
||||
window_draw_widgets(w, dpi);
|
||||
}
|
||||
Reference in New Issue
Block a user