mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #1773 from Gymnasiast/inventions-in-debug-menu
Add Inventions List and Scenario Options to the Debug menu, closes #1770
This commit is contained in:
commit
d368aa9941
|
@ -3827,3 +3827,5 @@ STR_5487 :{SMALLFONT}{BLACK}Show recent messages
|
||||||
STR_5488 :No entrance
|
STR_5488 :No entrance
|
||||||
STR_5489 :{SMALLFONT}{BLACK}Show only tracked guests
|
STR_5489 :{SMALLFONT}{BLACK}Show only tracked guests
|
||||||
STR_5490 :Disable audio on focus loss
|
STR_5490 :Disable audio on focus loss
|
||||||
|
STR_5491 :Inventions list
|
||||||
|
STR_5492 :Scenario options
|
||||||
|
|
|
@ -462,7 +462,7 @@ static int editor_read_s6(const char *path)
|
||||||
|
|
||||||
RCT2_GLOBAL(0x013573DC, uint32) = min(RCT2_GLOBAL(0x013573DC, uint32), 100000);
|
RCT2_GLOBAL(0x013573DC, uint32) = min(RCT2_GLOBAL(0x013573DC, uint32), 100000);
|
||||||
finance_reset_cash_to_initial();
|
finance_reset_cash_to_initial();
|
||||||
sub_69E869();
|
finance_mark_loan_settings_as_legitimate();
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = clamp(
|
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = clamp(
|
||||||
MONEY(0,00),
|
MONEY(0,00),
|
||||||
|
|
|
@ -776,7 +776,7 @@ int game_load_save(const char *path)
|
||||||
window_new_ride_init_vars();
|
window_new_ride_init_vars();
|
||||||
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
||||||
if (RCT2_GLOBAL(0x0013587C4, uint32) == 0) // this check is not in scenario play
|
if (RCT2_GLOBAL(0x0013587C4, uint32) == 0) // this check is not in scenario play
|
||||||
sub_69E869();
|
finance_mark_loan_settings_as_legitimate();
|
||||||
|
|
||||||
load_palette();
|
load_palette();
|
||||||
gfx_invalidate_screen();
|
gfx_invalidate_screen();
|
||||||
|
|
|
@ -2027,6 +2027,9 @@ enum {
|
||||||
|
|
||||||
STR_AUDIO_FOCUS = 5490,
|
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
|
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
||||||
STR_COUNT = 32768
|
STR_COUNT = 32768
|
||||||
};
|
};
|
||||||
|
|
|
@ -188,7 +188,7 @@ void finance_init() {
|
||||||
|
|
||||||
RCT2_GLOBAL(0x013587D8, uint16) = 0x3F;
|
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);
|
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;
|
sint32 value = 0x70093A;
|
||||||
value -= RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32);
|
value -= RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32);
|
||||||
value = ror32(value, 5);
|
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_CURRENT_LOAN, money32) = newLoan;
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) = money;
|
RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32) = money;
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, money32) = ENCRYPT_MONEY(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);
|
window_invalidate_by_class(WC_FINANCES);
|
||||||
RCT2_GLOBAL(0x009A9804, uint16) |= 1;
|
RCT2_GLOBAL(0x009A9804, uint16) |= 1;
|
||||||
|
|
|
@ -61,7 +61,7 @@ void finance_reset_history();
|
||||||
void finance_init();
|
void finance_init();
|
||||||
void finance_update_daily_profit();
|
void finance_update_daily_profit();
|
||||||
void finance_shift_expenditure_table();
|
void finance_shift_expenditure_table();
|
||||||
void sub_69E869();
|
void finance_mark_loan_settings_as_legitimate();
|
||||||
void finance_reset_cash_to_initial();
|
void finance_reset_cash_to_initial();
|
||||||
|
|
||||||
void finance_set_loan(money32 loan);
|
void finance_set_loan(money32 loan);
|
||||||
|
|
|
@ -259,7 +259,7 @@ void rct1_fix_landscape()
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32)
|
RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32)
|
||||||
);
|
);
|
||||||
finance_reset_cash_to_initial();
|
finance_reset_cash_to_initial();
|
||||||
sub_69E869();
|
finance_mark_loan_settings_as_legitimate();
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = clamp(
|
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32) = clamp(
|
||||||
MONEY(0,00),
|
MONEY(0,00),
|
||||||
|
|
|
@ -276,7 +276,7 @@ void scenario_begin()
|
||||||
RCT2_GLOBAL(0x013587D0, money32) = RCT2_GLOBAL(0x013573DC, money32) - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32);
|
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));
|
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_DETAILS, s6Info->details);
|
||||||
strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, s6Info->name);
|
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_TOTAL_ADMISSIONS, uint32) = 0;
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0;
|
RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0;
|
||||||
RCT2_GLOBAL(0x013587D8, uint16) = 63;
|
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();
|
park_reset_history();
|
||||||
finance_reset_history();
|
finance_reset_history();
|
||||||
award_reset();
|
award_reset();
|
||||||
|
|
|
@ -554,6 +554,13 @@ void window_editor_inventions_list_open()
|
||||||
*/
|
*/
|
||||||
static void window_editor_inventions_list_close(rct_window *w)
|
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();
|
sub_685A79();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)) {
|
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_INITIAL_CASH, money32) += MONEY(500,00);
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, money32) = ENCRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32));
|
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 {
|
} else {
|
||||||
window_error_open(3248, STR_NONE);
|
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)) {
|
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_INITIAL_CASH, money32) -= MONEY(500,00);
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, money32) = ENCRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_INITIAL_CASH, money32));
|
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 {
|
} else {
|
||||||
window_error_open(3249, STR_NONE);
|
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)) {
|
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_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));
|
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 {
|
} else {
|
||||||
window_error_open(3250, STR_NONE);
|
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)) {
|
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_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));
|
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 {
|
} else {
|
||||||
window_error_open(3251, STR_NONE);
|
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)) {
|
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_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));
|
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 {
|
} else {
|
||||||
window_error_open(3252, STR_NONE);
|
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)) {
|
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_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));
|
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 {
|
} else {
|
||||||
window_error_open(3253, STR_NONE);
|
window_error_open(3253, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,9 @@ typedef enum {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DDIDX_CONSOLE = 0,
|
DDIDX_CONSOLE = 0,
|
||||||
DDIDX_TILE_INSPECTOR = 1,
|
DDIDX_TILE_INSPECTOR = 1,
|
||||||
DDIDX_OBJECT_SELECTION = 2
|
DDIDX_OBJECT_SELECTION = 2,
|
||||||
|
DDIDX_INVENTIONS_LIST = 3,
|
||||||
|
DDIDX_SCENARIO_OPTIONS = 4
|
||||||
} TOP_TOOLBAR_DEBUG_DDIDX;
|
} TOP_TOOLBAR_DEBUG_DDIDX;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -2845,6 +2847,8 @@ void top_toolbar_init_debug_menu(rct_window* w, rct_widget* widget) {
|
||||||
gDropdownItemsFormat[0] = STR_DEBUG_DROPDOWN_CONSOLE;
|
gDropdownItemsFormat[0] = STR_DEBUG_DROPDOWN_CONSOLE;
|
||||||
gDropdownItemsFormat[1] = STR_DEBUG_DROPDOWN_TILE_INSPECTOR;
|
gDropdownItemsFormat[1] = STR_DEBUG_DROPDOWN_TILE_INSPECTOR;
|
||||||
gDropdownItemsFormat[2] = STR_DEBUG_DROPDOWN_OBJECT_SELECTION;
|
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(
|
window_dropdown_show_text(
|
||||||
w->x + widget->left,
|
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,
|
widget->bottom - widget->top + 1,
|
||||||
w->colours[1] | 0x80,
|
w->colours[1] | 0x80,
|
||||||
0,
|
0,
|
||||||
3
|
5
|
||||||
);
|
);
|
||||||
|
|
||||||
RCT2_GLOBAL(0x9DEBA2, uint16) = 0;
|
RCT2_GLOBAL(0x9DEBA2, uint16) = 0;
|
||||||
|
@ -2873,6 +2877,12 @@ void top_toolbar_debug_menu_dropdown(short dropdownIndex) {
|
||||||
window_close_all();
|
window_close_all();
|
||||||
window_editor_object_selection_open();
|
window_editor_object_selection_open();
|
||||||
break;
|
break;
|
||||||
|
case DDIDX_INVENTIONS_LIST:
|
||||||
|
window_editor_inventions_list_open();
|
||||||
|
break;
|
||||||
|
case DDIDX_SCENARIO_OPTIONS:
|
||||||
|
window_editor_scenario_options_open();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue