mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
add default ride inspection interval option, closes #1455
This commit is contained in:
parent
d324084fa2
commit
c60e05fc99
7 changed files with 49 additions and 1 deletions
|
@ -4092,6 +4092,7 @@ STR_5784 :{BLACK}Complete earlier scenarios to unlock this scenario.
|
|||
STR_5785 :Can't rename group...
|
||||
STR_5786 :Invalid group name
|
||||
STR_5787 :{COMMA32} players online
|
||||
STR_5788 :Default inspection interval:
|
||||
|
||||
#############
|
||||
# Scenarios #
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
- Feature: Weather cheat now allows for more types of weather.
|
||||
- Feature: Use fontconfig on Linux and Objective-C APIs on OS X to detect fonts and provide a fallback if necessary.
|
||||
- Feature: Ability to automatically open shops after placing them.
|
||||
- Feature: Ability to change the default inspection interval for rides.
|
||||
- Change: Server IP addresses are no longer shown in the server list.
|
||||
- Change: Theme format changed from INI to JSON (INI format no longer supported).
|
||||
- Change: Sound controls re-worked to control sound effects and ride music separately.
|
||||
|
|
|
@ -199,6 +199,7 @@ config_property_definition _generalDefinitions[] = {
|
|||
{ offsetof(general_configuration, date_format), "date_format", CONFIG_VALUE_TYPE_UINT8, DATE_FORMAT_DMY, _dateFormatEnum },
|
||||
{ offsetof(general_configuration, auto_staff_placement), "auto_staff", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(general_configuration, handymen_mow_default), "handymen_mow_default", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(general_configuration, default_inspection_interval), "default_inspection_interval", CONFIG_VALUE_TYPE_UINT8, 2, NULL },
|
||||
{ offsetof(general_configuration, last_run_version), "last_run_version", CONFIG_VALUE_TYPE_STRING, { .value_string = NULL }, NULL },
|
||||
{ offsetof(general_configuration, invert_viewport_drag), "invert_viewport_drag", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
|
||||
{ offsetof(general_configuration, load_save_sort), "load_save_sort", CONFIG_VALUE_TYPE_UINT8, SORT_NAME_ASCENDING, NULL },
|
||||
|
|
|
@ -168,6 +168,7 @@ typedef struct {
|
|||
uint8 date_format;
|
||||
uint8 auto_staff_placement;
|
||||
uint8 handymen_mow_default;
|
||||
uint8 default_inspection_interval;
|
||||
utf8string last_run_version;
|
||||
uint8 invert_viewport_drag;
|
||||
uint8 load_save_sort;
|
||||
|
|
|
@ -2407,6 +2407,8 @@ enum {
|
|||
|
||||
STR_X_PLAYERS_ONLINE = 5787,
|
||||
|
||||
STR_DEFAULT_INSPECTION_INTERVAL = 5788,
|
||||
|
||||
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
||||
STR_COUNT = 32768
|
||||
};
|
||||
|
|
|
@ -161,6 +161,8 @@ enum WINDOW_OPTIONS_WIDGET_IDX {
|
|||
WIDX_AUTO_STAFF_PLACEMENT,
|
||||
WIDX_HANDYMEN_MOW_DEFAULT,
|
||||
WIDX_AUTO_OPEN_SHOPS,
|
||||
WIDX_DEFAULT_INSPECTION_INTERVAL,
|
||||
WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN,
|
||||
|
||||
// Twitch
|
||||
WIDX_CHANNEL_BUTTON = WIDX_PAGE_START,
|
||||
|
@ -304,6 +306,8 @@ static rct_widget window_options_misc_widgets[] = {
|
|||
{ WWT_CHECKBOX, 2, 10, 299, 189, 200, STR_AUTO_STAFF_PLACEMENT, STR_NONE }, // auto staff placement
|
||||
{ WWT_CHECKBOX, 2, 10, 299, 204, 215, STR_HANDYMEN_MOW_BY_DEFAULT, STR_NONE }, // handymen mow by default
|
||||
{ WWT_CHECKBOX, 2, 10, 299, 219, 230, STR_AUTO_OPEN_SHOPS, STR_AUTO_OPEN_SHOPS_TIP }, // Automatically open shops & stalls
|
||||
{ WWT_DROPDOWN, 1, 155, 299, 234, 245, STR_NONE, STR_NONE }, // default inspection time dropdown
|
||||
{ WWT_DROPDOWN_BUTTON, 1, 288, 298, 235, 244, STR_DROPDOWN_GLYPH, STR_NONE }, // default inspection time dropdown button
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
|
@ -478,7 +482,9 @@ static uint32 window_options_page_enabled_widgets[] = {
|
|||
(1 << WIDX_TITLE_SEQUENCE_BUTTON) |
|
||||
(1 << WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM) |
|
||||
(1 << WIDX_STAY_CONNECTED_AFTER_DESYNC) |
|
||||
(1 << WIDX_AUTO_OPEN_SHOPS),
|
||||
(1 << WIDX_AUTO_OPEN_SHOPS) |
|
||||
(1 << WIDX_DEFAULT_INSPECTION_INTERVAL) |
|
||||
(1 << WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN),
|
||||
|
||||
MAIN_OPTIONS_ENABLED_WIDGETS |
|
||||
(1 << WIDX_CHANNEL_BUTTON) |
|
||||
|
@ -1064,6 +1070,15 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget*
|
|||
|
||||
dropdown_set_checked(gCurrentPreviewTitleSequence, true);
|
||||
break;
|
||||
case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN:
|
||||
for (i = 0; i < 7; i++) {
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = STR_EVERY_10_MINUTES + i;
|
||||
}
|
||||
|
||||
window_options_show_dropdown(w, widget, 7);
|
||||
dropdown_set_checked(gConfigGeneral.default_inspection_interval, true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1268,6 +1283,13 @@ static void window_options_dropdown(rct_window *w, int widgetIndex, int dropdown
|
|||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN:
|
||||
if (dropdownIndex != gConfigGeneral.default_inspection_interval) {
|
||||
gConfigGeneral.default_inspection_interval = (uint8)dropdownIndex;
|
||||
config_save_default();
|
||||
window_invalidate(w);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1508,6 +1530,8 @@ static void window_options_invalidate(rct_window *w)
|
|||
window_options_misc_widgets[WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM].type = WWT_CHECKBOX;
|
||||
window_options_misc_widgets[WIDX_STAY_CONNECTED_AFTER_DESYNC].type = WWT_CHECKBOX;
|
||||
window_options_misc_widgets[WIDX_AUTO_OPEN_SHOPS].type = WWT_CHECKBOX;
|
||||
window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].type = WWT_DROPDOWN;
|
||||
window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN].type = WWT_DROPDOWN_BUTTON;
|
||||
break;
|
||||
|
||||
case WINDOW_OPTIONS_PAGE_TWITCH:
|
||||
|
@ -1683,6 +1707,16 @@ static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
w->y + window_options_misc_widgets[WIDX_TITLE_SEQUENCE].top,
|
||||
window_options_misc_widgets[WIDX_TITLE_SEQUENCE_DROPDOWN].left - window_options_misc_widgets[WIDX_TITLE_SEQUENCE].left - 4
|
||||
);
|
||||
|
||||
gfx_draw_string_left(dpi, STR_DEFAULT_INSPECTION_INTERVAL, w, w->colours[1], w->x + 10, w->y + window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top + 1);
|
||||
gfx_draw_string_left(
|
||||
dpi,
|
||||
STR_EVERY_10_MINUTES + gConfigGeneral.default_inspection_interval,
|
||||
NULL,
|
||||
w->colours[1],
|
||||
w->x + window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].left + 1,
|
||||
w->y + window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].top
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -596,6 +596,14 @@ static void window_ride_construction_close(rct_window *w)
|
|||
ride_set_status(rideIndex, RIDE_STATUS_OPEN);
|
||||
}
|
||||
|
||||
uint8 defaultInspectionInterval = gConfigGeneral.default_inspection_interval;
|
||||
if (ride->inspection_interval != defaultInspectionInterval) {
|
||||
if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_CHANGE_OPERATING_MODE;
|
||||
game_do_command(0, (defaultInspectionInterval << 8) | 1, 0, (5 << 8) | w->number, GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
window_ride_main_open(rideIndex);
|
||||
} else {
|
||||
int eax = RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8);
|
||||
|
|
Loading…
Reference in a new issue