mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add cheat option to disable breakdowns completely.
This commit is contained in:
parent
8f82175fec
commit
dc524c1b6a
|
@ -3474,3 +3474,4 @@ STR_5137 :Allow lift hill and launch speeds{NEWLINE}up to {VELOCITY}
|
|||
STR_5138 :{SMALLFONT}{WINDOW_COLOUR_2}{STRINGID}
|
||||
STR_5139 :{WHITE}{STRINGID}
|
||||
STR_5140 :Disable brakes failure
|
||||
STR_5141 :Disable all breakdowns
|
||||
|
|
|
@ -180,6 +180,7 @@ config_property_definition _soundDefinitions[] = {
|
|||
config_property_definition _cheatDefinitions[] = {
|
||||
{ offsetof(cheat_configuration, fast_lift_hill), "fast_lift_hill", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(cheat_configuration, disable_brakes_failure), "disable_brakes_failure", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(cheat_configuration, disable_all_breakdowns), "disable_all_breakdowns", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
};
|
||||
|
||||
config_section_definition _sectionDefinitions[] = {
|
||||
|
|
|
@ -149,6 +149,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
uint8 fast_lift_hill;
|
||||
uint8 disable_brakes_failure;
|
||||
uint8 disable_all_breakdowns;
|
||||
} cheat_configuration;
|
||||
|
||||
|
||||
|
|
|
@ -1553,7 +1553,7 @@ static void ride_breakdown_update(int rideIndex)
|
|||
//
|
||||
// a 0.8% chance, less the breakdown factor which accumulates as the game
|
||||
// continues.
|
||||
if (ride->reliability == 0 || (int)(scenario_rand() & 0x2FFFFF) <= 1 + RIDE_INITIAL_RELIABILITY - ride->reliability) {
|
||||
if ((ride->reliability == 0 || (int)(scenario_rand() & 0x2FFFFF) <= 1 + RIDE_INITIAL_RELIABILITY - ride->reliability) && !gConfigCheat.disable_all_breakdowns) {
|
||||
breakdownReason = ride_get_new_breakdown_problem(ride);
|
||||
if (breakdownReason != -1)
|
||||
ride_prepare_breakdown(rideIndex, breakdownReason);
|
||||
|
|
|
@ -76,7 +76,8 @@ enum WINDOW_CHEATS_WIDGET_IDX {
|
|||
WIDX_MAKE_DESTRUCTIBLE,
|
||||
WIDX_FIX_ALL,
|
||||
WIDX_FAST_LIFT_HILL,
|
||||
WIDX_DISABLE_BRAKES_FAILURE
|
||||
WIDX_DISABLE_BRAKES_FAILURE,
|
||||
WIDX_DISABLE_ALL_BREAKDOWNS
|
||||
};
|
||||
|
||||
#pragma region MEASUREMENTS
|
||||
|
@ -170,7 +171,8 @@ static rct_widget window_cheats_rides_widgets[] = {
|
|||
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(1), HPL(1), 5125, STR_NONE}, // Make destructable
|
||||
{ WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(1), HPL(1), 5132, STR_NONE }, // Fix all rides
|
||||
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(8),OHPL(8), 5137, STR_NONE }, // 410 km/h lift hill
|
||||
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(7),OHPL(7), 5140, STR_NONE }, // Disable brakes failure
|
||||
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(6),OHPL(6), 5140, STR_NONE }, // Disable brakes failure
|
||||
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(7),OHPL(7), 5141, STR_NONE }, // Disable all breakdowns
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
|
@ -329,7 +331,7 @@ static uint32 window_cheats_page_enabled_widgets[] = {
|
|||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HIGH_MONEY) | (1 << WIDX_PARK_ENTRANCE_FEE),
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS),
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_DECREASE_GAME_SPEED) | (1 << WIDX_INCREASE_GAME_SPEED) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO),
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_RENEW_RIDES) | (1 << WIDX_REMOVE_SIX_FLAGS) | (1 << WIDX_MAKE_DESTRUCTIBLE) | (1 << WIDX_FIX_ALL) | (1 << WIDX_FAST_LIFT_HILL) | (1 << WIDX_DISABLE_BRAKES_FAILURE)
|
||||
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_RENEW_RIDES) | (1 << WIDX_REMOVE_SIX_FLAGS) | (1 << WIDX_MAKE_DESTRUCTIBLE) | (1 << WIDX_FIX_ALL) | (1 << WIDX_FAST_LIFT_HILL) | (1 << WIDX_DISABLE_BRAKES_FAILURE) | (1 << WIDX_DISABLE_ALL_BREAKDOWNS)
|
||||
};
|
||||
|
||||
static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
|
@ -682,6 +684,11 @@ static void window_cheats_rides_mouseup()
|
|||
config_save_default();
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_DISABLE_ALL_BREAKDOWNS:
|
||||
gConfigCheat.disable_all_breakdowns ^= 1;
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -719,6 +726,7 @@ static void window_cheats_invalidate()
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 0, uint16) = 255;
|
||||
widget_set_checkbox_value(w, WIDX_FAST_LIFT_HILL, gConfigCheat.fast_lift_hill);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_BRAKES_FAILURE, gConfigCheat.disable_brakes_failure);
|
||||
widget_set_checkbox_value(w, WIDX_DISABLE_ALL_BREAKDOWNS, gConfigCheat.disable_all_breakdowns);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue