From 8ed8b56abeb623b3c7450868dc92df0ef1b20971 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 12 May 2015 16:13:30 +0200 Subject: [PATCH] Introduce a config-file option for a RCT1-like colour scheme --- src/config.c | 1 + src/config.h | 1 + src/windows/finances.c | 19 +++++++++++++++---- src/windows/game_bottom_toolbar.c | 21 +++++++++++++++++---- src/windows/guest.c | 18 +++++++++++++++--- src/windows/guest_list.c | 19 +++++++++++++++---- src/windows/new_ride.c | 18 +++++++++++++++--- src/windows/ride.c | 16 +++++++++++++--- src/windows/ride_list.c | 12 ++++++++++++ src/windows/staff.c | 18 ++++++++++++++---- src/windows/staff_list.c | 19 +++++++++++++++---- src/windows/title_exit.c | 19 +++++++++++++++---- src/windows/title_menu.c | 17 ++++++++++++++--- src/windows/title_options.c | 19 +++++++++++++++---- src/windows/top_toolbar.c | 21 ++++++++++++++++----- 15 files changed, 193 insertions(+), 45 deletions(-) diff --git a/src/config.c b/src/config.c index ada958cbc6..5580ca2ee2 100644 --- a/src/config.c +++ b/src/config.c @@ -166,6 +166,7 @@ config_property_definition _interfaceDefinitions[] = { { offsetof(interface_configuration, toolbar_show_finances), "toolbar_show_finances", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL }, { offsetof(interface_configuration, toolbar_show_research), "toolbar_show_research", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL }, { offsetof(interface_configuration, allow_subtype_switching), "allow_subtype_switching", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL }, + { offsetof(interface_configuration, rct1_colour_scheme), "rct1_colour_scheme", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL }, }; config_property_definition _soundDefinitions[] = { diff --git a/src/config.h b/src/config.h index 7dfb68c5af..3511678ef4 100644 --- a/src/config.h +++ b/src/config.h @@ -135,6 +135,7 @@ typedef struct { uint8 toolbar_show_finances; uint8 toolbar_show_research; uint8 allow_subtype_switching; + uint8 rct1_colour_scheme; } interface_configuration; typedef struct { diff --git a/src/windows/finances.c b/src/windows/finances.c index bff2716d38..e1c6350a00 100644 --- a/src/windows/finances.c +++ b/src/windows/finances.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../interface/graph.h" #include "../interface/widget.h" @@ -540,9 +541,19 @@ void window_finances_open() w = window_create_auto_pos(530, 257, window_finances_page_events[0], WC_FINANCES, WF_10); w->number = 0; w->frame_no = 0; - w->colours[0] = 1; - w->colours[1] = 19; - w->colours[2] = 19; + + if(!gConfigInterface.rct1_colour_scheme) + { + w->colours[0] = 1; + w->colours[1] = 19; + w->colours[2] = 19; + } + else + { + w->colours[0] = 4; + w->colours[1] = 1; + w->colours[2] = 1; + } research_update_uncompleted_types(); } @@ -1554,4 +1565,4 @@ static void window_finances_draw_tab_images(rct_drawpixelinfo *dpi, rct_window * window_finances_draw_tab_image(dpi, w, WINDOW_FINANCES_PAGE_RESEARCH, SPR_TAB_FINANCES_RESEARCH_0); } -#pragma endregion \ No newline at end of file +#pragma endregion diff --git a/src/windows/game_bottom_toolbar.c b/src/windows/game_bottom_toolbar.c index dbcebd7522..3c8fabe69b 100644 --- a/src/windows/game_bottom_toolbar.c +++ b/src/windows/game_bottom_toolbar.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../localisation/date.h" #include "../localisation/localisation.h" #include "../interface/widget.h" @@ -148,9 +149,19 @@ void window_game_bottom_toolbar_open() window->frame_no = 0; window_init_scroll_widgets(window); - window->colours[0] = 140; - window->colours[1] = 140; - window->colours[2] = 0; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 140; + window->colours[1] = 140; + window->colours[2] = 0; + } + else + { + window->colours[0] = 129; + window->colours[1] = 129; + window->colours[2] = 0; + } } /** @@ -429,10 +440,12 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r ); // Draw park rating + int park_rating_bar_colour=!gConfigInterface.rct1_colour_scheme ? 14 : 18; + window_game_bottom_toolbar_draw_park_rating( dpi, w, - 14, + park_rating_bar_colour, w->x + window_game_bottom_toolbar_widgets[WIDX_PARK_RATING].left + 11, w->y + window_game_bottom_toolbar_widgets[WIDX_PARK_RATING].top, max(10, ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_RATING, sint16) / 4) * 263) / 256) diff --git a/src/windows/guest.c b/src/windows/guest.c index e1c7af4e7e..ce9189ad42 100644 --- a/src/windows/guest.c +++ b/src/windows/guest.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../world/map.h" #include "../management/marketing.h" @@ -507,9 +508,20 @@ void window_guest_open(rct_peep* peep){ window->flags = WF_RESIZABLE; window->no_list_items = 0; window->selected_list_item = -1; - window->colours[0] = 1; - window->colours[1] = 15; - window->colours[2] = 15; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 1; + window->colours[1] = 15; + window->colours[2] = 15; + } + else + { + window->colours[0] = 22; + window->colours[1] = 26; + window->colours[2] = 26; + } + window->viewport_focus_coordinates.y = -1; } diff --git a/src/windows/guest_list.c b/src/windows/guest_list.c index 4634aa33a6..b91ec5859d 100644 --- a/src/windows/guest_list.c +++ b/src/windows/guest_list.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../interface/widget.h" #include "../interface/window.h" @@ -173,9 +174,19 @@ void window_guest_list_open() window->max_width = 500; window->max_height = 450; window->flags |= WF_RESIZABLE; - window->colours[0] = 1; - window->colours[1] = 15; - window->colours[2] = 15; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 1; + window->colours[1] = 15; + window->colours[2] = 15; + } + else + { + window->colours[0] = 22; + window->colours[1] = 26; + window->colours[2] = 26; + } } /** @@ -956,4 +967,4 @@ static void window_guest_list_find_groups() nextPeep: ; } -} \ No newline at end of file +} diff --git a/src/windows/new_ride.c b/src/windows/new_ride.c index c86c884646..3ec32a087f 100644 --- a/src/windows/new_ride.c +++ b/src/windows/new_ride.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../audio/audio.h" #include "../game.h" #include "../management/news_item.h" @@ -410,9 +411,20 @@ rct_window *window_new_ride_open() window_init_scroll_widgets(w); w->frame_no = 0; - w->colours[0] = 24; - w->colours[1] = 26; - w->colours[2] = 26; + + if(!gConfigInterface.rct1_colour_scheme) + { + w->colours[0] = 24; + w->colours[1] = 26; + w->colours[2] = 26; + } + else + { + w->colours[0] = 26; + w->colours[1] = 1; + w->colours[2] = 1; + } + w->new_ride.selected_ride_id = -1; w->new_ride.highlighted_ride_id = -1; _lastTrackDesignCountRideType.type = 255; diff --git a/src/windows/ride.c b/src/windows/ride.c index 2e31744ec7..585cc0bed4 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -1172,9 +1172,19 @@ rct_window *window_ride_open(int rideIndex) w->max_width = 500; w->max_height = 450; w->flags |= WF_RESIZABLE; - w->colours[0] = 1; - w->colours[1] = 26; - w->colours[2] = 11; + + if(!gConfigInterface.rct1_colour_scheme) + { + w->colours[0] = 1; + w->colours[1] = 26; + w->colours[2] = 11; + } + else + { + w->colours[0] = 26; + w->colours[1] = 1; + w->colours[2] = 11; + } ride = GET_RIDE(rideIndex); numSubTypes = 0; diff --git a/src/windows/ride_list.c b/src/windows/ride_list.c index 329c6be84d..46bc65961a 100644 --- a/src/windows/ride_list.c +++ b/src/windows/ride_list.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../ride/ride.h" #include "../localisation/localisation.h" @@ -161,9 +162,20 @@ void window_ride_list_open() window->max_width = 400; window->max_height = 450; window->flags |= WF_RESIZABLE; + + if(!gConfigInterface.rct1_colour_scheme) + { window->colours[0] = 1; window->colours[1] = 26; window->colours[2] = 26; + } + else + { + window->colours[0] = 26; + window->colours[1] = 1; + window->colours[2] = 1; + } + } _window_ride_list_information_type = INFORMATION_TYPE_STATUS; window->list_information_type = 0; diff --git a/src/windows/staff.c b/src/windows/staff.c index 21bdf50562..e04d8c89d7 100644 --- a/src/windows/staff.c +++ b/src/windows/staff.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../interface/viewport.h" #include "../interface/widget.h" @@ -319,9 +320,18 @@ void window_staff_open(rct_peep* peep) w->flags = 1 << 8; - w->colours[0] = 1; - w->colours[1] = 4; - w->colours[2] = 4; + if(!gConfigInterface.rct1_colour_scheme) + { + w->colours[0] = 1; + w->colours[1] = 4; + w->colours[2] = 4; + } + else + { + w->colours[0] = 12; + w->colours[1] = 4; + w->colours[2] = 4; + } } w->page = 0; window_invalidate(w); @@ -1382,4 +1392,4 @@ void window_staff_options_dropdown() int costume = (RCT2_ADDRESS(0xF4391B, uint8)[dropdownIndex] - 4) | 0x80; game_do_command(peep->x, (costume << 8) | 1, peep->y, w->number, GAME_COMMAND_SET_STAFF_ORDER, (int)peep, 0); -} \ No newline at end of file +} diff --git a/src/windows/staff_list.c b/src/windows/staff_list.c index f7197f25ca..537bacf339 100644 --- a/src/windows/staff_list.c +++ b/src/windows/staff_list.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../drawing/drawing.h" #include "../input.h" @@ -167,9 +168,19 @@ void window_staff_list_open() window->max_width = 500; window->max_height = 450; window->flags |= WF_RESIZABLE; - window->colours[0] = 1; - window->colours[1] = 4; - window->colours[2] = 4; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 1; + window->colours[1] = 4; + window->colours[2] = 4; + } + else + { + window->colours[0] = 12; + window->colours[1] = 4; + window->colours[2] = 4; + } } void window_staff_list_cancel_tools(rct_window *w) { @@ -651,4 +662,4 @@ void window_staff_list_scrollpaint() i++; } } -} \ No newline at end of file +} diff --git a/src/windows/title_exit.c b/src/windows/title_exit.c index 73a0c33915..8998012890 100644 --- a/src/windows/title_exit.c +++ b/src/windows/title_exit.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../sprites.h" #include "../localisation/localisation.h" @@ -84,9 +85,19 @@ void window_title_exit_open() window->enabled_widgets |= 1; window_init_scroll_widgets(window); window->flags |= 16; - window->colours[0] = 140; - window->colours[1] = 140; - window->colours[2] = 140; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 140; + window->colours[1] = 140; + window->colours[2] = 140; + } + else + { + window->colours[0] = 129; + window->colours[1] = 129; + window->colours[2] = 129; + } } /** @@ -120,4 +131,4 @@ static void window_title_exit_paint() window_paint_get_registers(w, dpi); window_draw_widgets(w, dpi); -} \ No newline at end of file +} diff --git a/src/windows/title_menu.c b/src/windows/title_menu.c index 19c0cf3823..da2114c00d 100644 --- a/src/windows/title_menu.c +++ b/src/windows/title_menu.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../editor.h" #include "../game.h" #include "../interface/widget.h" @@ -100,9 +101,19 @@ void window_title_menu_open() window->enabled_widgets |= (8 | 4 | 2 | 1); window_init_scroll_widgets(window); window->flags |= 16; - window->colours[0] = 140; - window->colours[1] = 140; - window->colours[2] = 140; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 140; + window->colours[1] = 140; + window->colours[2] = 140; + } + else + { + window->colours[0] = 129; + window->colours[1] = 129; + window->colours[2] = 129; + } } static void window_title_menu_mouseup() diff --git a/src/windows/title_options.c b/src/windows/title_options.c index 7e5a2e4ecd..4484ed162c 100644 --- a/src/windows/title_options.c +++ b/src/windows/title_options.c @@ -19,6 +19,7 @@ *****************************************************************************/ #include "../addresses.h" +#include "../config.h" #include "../game.h" #include "../localisation/localisation.h" #include "../interface/widget.h" @@ -82,9 +83,19 @@ void window_title_options_open() window->enabled_widgets |= 1; window_init_scroll_widgets(window); window->flags |= 16; - window->colours[0] = 140; - window->colours[1] = 140; - window->colours[2] = 140; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 140; + window->colours[1] = 140; + window->colours[2] = 140; + } + else + { + window->colours[0] = 129; + window->colours[1] = 129; + window->colours[2] = 129; + } } static void window_title_options_mouseup() @@ -109,4 +120,4 @@ static void window_title_options_paint() window_paint_get_registers(w, dpi); window_draw_widgets(w, dpi); -} \ No newline at end of file +} diff --git a/src/windows/top_toolbar.c b/src/windows/top_toolbar.c index 5f5c543df2..b4b3a95805 100644 --- a/src/windows/top_toolbar.c +++ b/src/windows/top_toolbar.c @@ -216,10 +216,21 @@ void window_top_toolbar_open() window->widgets = window_top_toolbar_widgets; window_init_scroll_widgets(window); - window->colours[0] = 7; - window->colours[1] = 12; - window->colours[2] = 24; - window->colours[3] = 1; + + if(!gConfigInterface.rct1_colour_scheme) + { + window->colours[0] = 7; + window->colours[1] = 12; + window->colours[2] = 24; + window->colours[3] = 1; + } + else + { + window->colours[0] = 1; + window->colours[1] = 1; + window->colours[2] = 1; + window->colours[3] = 1; + } } /** @@ -1927,4 +1938,4 @@ void toggle_water_window(rct_window *topToolbar, int widgetIndex) RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 1; window_water_open(); } -} \ No newline at end of file +}