diff --git a/data/language/english_uk.txt b/data/language/english_uk.txt index 00b93db9bc..13c0d8236b 100644 --- a/data/language/english_uk.txt +++ b/data/language/english_uk.txt @@ -3827,3 +3827,5 @@ STR_5487 :{SMALLFONT}{BLACK}Show recent messages STR_5488 :No entrance STR_5489 :{SMALLFONT}{BLACK}Show only tracked guests STR_5490 :Disable audio on focus loss +STR_5491 :Inventions list +STR_5492 :Scenario options diff --git a/src/editor.c b/src/editor.c index 43fe400d3e..921b30afb0 100644 --- a/src/editor.c +++ b/src/editor.c @@ -462,7 +462,7 @@ static int editor_read_s6(const char *path) RCT2_GLOBAL(0x013573DC, uint32) = min(RCT2_GLOBAL(0x013573DC, uint32), 100000); finance_reset_cash_to_initial(); - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = clamp( MONEY(0,00), diff --git a/src/game.c b/src/game.c index 76737a8c10..e6cb1f9c78 100644 --- a/src/game.c +++ b/src/game.c @@ -776,7 +776,7 @@ int game_load_save(const char *path) window_new_ride_init_vars(); RCT2_GLOBAL(0x009DEB7C, uint16) = 0; if (RCT2_GLOBAL(0x0013587C4, uint32) == 0) // this check is not in scenario play - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); load_palette(); gfx_invalidate_screen(); diff --git a/src/localisation/string_ids.h b/src/localisation/string_ids.h index 942ccc6b97..5ae91dcca2 100644 --- a/src/localisation/string_ids.h +++ b/src/localisation/string_ids.h @@ -2027,6 +2027,9 @@ enum { STR_AUDIO_FOCUS = 5490, + STR_DEBUG_DROPDOWN_INVENTIONS_LIST = 5491, + STR_DEBUG_DROPDOWN_SCENARIO_OPTIONS = 5492, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working STR_COUNT = 32768 }; diff --git a/src/management/finance.c b/src/management/finance.c index 8762949036..49f3db2970 100644 --- a/src/management/finance.c +++ b/src/management/finance.c @@ -188,7 +188,7 @@ void finance_init() { RCT2_GLOBAL(0x013587D8, uint16) = 0x3F; - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); } /** @@ -243,9 +243,9 @@ void finance_update_daily_profit() window_invalidate_by_class(WC_FINANCES); } -void sub_69E869() +// This subroutine is used to mark loan changes as 'legitimate', to prevent cheat detection from incorrectly interfering +void finance_mark_loan_settings_as_legitimate() { - // This subroutine is loan related and is used for cheat detection sint32 value = 0x70093A; value -= RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32); value = ror32(value, 5); @@ -314,7 +314,7 @@ void game_command_set_current_loan(int* eax, int* ebx, int* ecx, int* edx, int* RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = newLoan; RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) = money; RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, money32) = ENCRYPT_MONEY(money); - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); window_invalidate_by_class(WC_FINANCES); RCT2_GLOBAL(0x009A9804, uint16) |= 1; diff --git a/src/management/finance.h b/src/management/finance.h index fb4755a0cc..0650d31e6d 100644 --- a/src/management/finance.h +++ b/src/management/finance.h @@ -61,7 +61,7 @@ void finance_reset_history(); void finance_init(); void finance_update_daily_profit(); void finance_shift_expenditure_table(); -void sub_69E869(); +void finance_mark_loan_settings_as_legitimate(); void finance_reset_cash_to_initial(); void finance_set_loan(money32 loan); @@ -71,4 +71,4 @@ money32 finance_get_maximum_loan(); money32 finance_get_current_cash(); void game_command_set_current_loan(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp); -#endif \ No newline at end of file +#endif diff --git a/src/rct1.c b/src/rct1.c index 21d30629db..50e3287eff 100644 --- a/src/rct1.c +++ b/src/rct1.c @@ -259,7 +259,7 @@ void rct1_fix_landscape() RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) ); finance_reset_cash_to_initial(); - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = clamp( MONEY(0,00), diff --git a/src/scenario.c b/src/scenario.c index 9d00389e92..270d877eef 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -276,7 +276,7 @@ void scenario_begin() RCT2_GLOBAL(0x013587D0, money32) = RCT2_GLOBAL(0x013573DC, money32) - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(RCT2_GLOBAL(0x013573DC, sint32)); - sub_69E869(); // (loan related) + finance_mark_loan_settings_as_legitimate(); // (loan related) strcpy((char*)RCT2_ADDRESS_SCENARIO_DETAILS, s6Info->details); strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, s6Info->name); @@ -315,7 +315,7 @@ void scenario_begin() RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_ADMISSIONS, uint32) = 0; RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0; RCT2_GLOBAL(0x013587D8, uint16) = 63; - sub_69E869(); // (loan related, called above already) + finance_mark_loan_settings_as_legitimate(); // (loan related, called above already) park_reset_history(); finance_reset_history(); award_reset(); diff --git a/src/windows/editor_inventions_list.c b/src/windows/editor_inventions_list.c index 06ca44417d..8819a0632e 100644 --- a/src/windows/editor_inventions_list.c +++ b/src/windows/editor_inventions_list.c @@ -554,6 +554,13 @@ void window_editor_inventions_list_open() */ static void window_editor_inventions_list_close(rct_window *w) { + // When used in-game (as a cheat) + if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_EDITOR)) { + gSilentResearch = true; + sub_684AC3(); + gSilentResearch = false; + } + sub_685A79(); } diff --git a/src/windows/editor_scenario_options.c b/src/windows/editor_scenario_options.c index b6cf6abc0f..bae5cb49be 100644 --- a/src/windows/editor_scenario_options.c +++ b/src/windows/editor_scenario_options.c @@ -485,7 +485,7 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex, if (RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) < MONEY(1000000,00)) { RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) += MONEY(500,00); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, money32) = ENCRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32)); - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); } else { window_error_open(3248, STR_NONE); } @@ -495,7 +495,7 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex, if (RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) > MONEY(0,00)) { RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) -= MONEY(500,00); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, money32) = ENCRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32)); - sub_69E869(); + finance_mark_loan_settings_as_legitimate(); } else { window_error_open(3249, STR_NONE); } @@ -505,6 +505,7 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex, if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) < MONEY(5000000,00)) { RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) += MONEY(1000,00); RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32) = max(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32), RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32)); + finance_mark_loan_settings_as_legitimate(); } else { window_error_open(3250, STR_NONE); } @@ -514,6 +515,7 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex, if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) > MONEY(0,00)) { RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) -= MONEY(1000,00); RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32) = max(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32), RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32)); + finance_mark_loan_settings_as_legitimate(); } else { window_error_open(3251, STR_NONE); } @@ -523,6 +525,7 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex, if (RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32) < MONEY(5000000,00)) { RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32) += MONEY(1000,00); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = min(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32), RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32)); + finance_mark_loan_settings_as_legitimate(); } else { window_error_open(3252, STR_NONE); } @@ -532,6 +535,7 @@ static void window_editor_scenario_options_financial_mousedown(int widgetIndex, if (RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32) > MONEY(0,00)) { RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32) -= MONEY(1000,00); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = min(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32), RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, money32)); + finance_mark_loan_settings_as_legitimate(); } else { window_error_open(3253, STR_NONE); } diff --git a/src/windows/top_toolbar.c b/src/windows/top_toolbar.c index ed1e58b86b..c55bad4f31 100644 --- a/src/windows/top_toolbar.c +++ b/src/windows/top_toolbar.c @@ -100,7 +100,9 @@ typedef enum { typedef enum { DDIDX_CONSOLE = 0, DDIDX_TILE_INSPECTOR = 1, - DDIDX_OBJECT_SELECTION = 2 + DDIDX_OBJECT_SELECTION = 2, + DDIDX_INVENTIONS_LIST = 3, + DDIDX_SCENARIO_OPTIONS = 4 } TOP_TOOLBAR_DEBUG_DDIDX; enum { @@ -2845,6 +2847,8 @@ void top_toolbar_init_debug_menu(rct_window* w, rct_widget* widget) { gDropdownItemsFormat[0] = STR_DEBUG_DROPDOWN_CONSOLE; gDropdownItemsFormat[1] = STR_DEBUG_DROPDOWN_TILE_INSPECTOR; gDropdownItemsFormat[2] = STR_DEBUG_DROPDOWN_OBJECT_SELECTION; + gDropdownItemsFormat[3] = STR_DEBUG_DROPDOWN_INVENTIONS_LIST; + gDropdownItemsFormat[4] = STR_DEBUG_DROPDOWN_SCENARIO_OPTIONS; window_dropdown_show_text( w->x + widget->left, @@ -2852,7 +2856,7 @@ void top_toolbar_init_debug_menu(rct_window* w, rct_widget* widget) { widget->bottom - widget->top + 1, w->colours[1] | 0x80, 0, - 3 + 5 ); RCT2_GLOBAL(0x9DEBA2, uint16) = 0; @@ -2873,6 +2877,12 @@ void top_toolbar_debug_menu_dropdown(short dropdownIndex) { window_close_all(); window_editor_object_selection_open(); break; + case DDIDX_INVENTIONS_LIST: + window_editor_inventions_list_open(); + break; + case DDIDX_SCENARIO_OPTIONS: + window_editor_scenario_options_open(); + break; } } }