Skip to content

Commit

Permalink
Fix OpenRCT2#8927: Make cheats menu partially accessible in scenario …
Browse files Browse the repository at this point in the history
…editor.
  • Loading branch information
AaronVanGeffen committed Mar 20, 2019
1 parent e64aafa commit aeaa45c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/openrct2-ui/windows/TopToolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ static void window_top_toolbar_invalidate(rct_window* w)
window_top_toolbar_widgets[WIDX_GUESTS].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_FINANCES].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_RESEARCH].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_CHEATS].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_NEWS].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_NETWORK].type = WWT_EMPTY;

Expand Down Expand Up @@ -3268,6 +3267,15 @@ static void top_toolbar_init_cheats_menu(rct_window* w, rct_widget* widget)
dropdown_set_disabled(DDIDX_INVENTIONS_LIST, true);
}

if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))
{
dropdown_set_disabled(DDIDX_CHEATS, true);
dropdown_set_disabled(DDIDX_OBJECT_SELECTION, true);
dropdown_set_disabled(DDIDX_INVENTIONS_LIST, true);
dropdown_set_disabled(DDIDX_SCENARIO_OPTIONS, true);
dropdown_set_disabled(DDIDX_ENABLE_SANDBOX_MODE, true);
}

if (gCheatsSandboxMode)
{
dropdown_set_checked(DDIDX_ENABLE_SANDBOX_MODE, true);
Expand All @@ -3281,7 +3289,10 @@ static void top_toolbar_init_cheats_menu(rct_window* w, rct_widget* widget)
dropdown_set_checked(DDIDX_DISABLE_SUPPORT_LIMITS, true);
}

gDropdownDefaultIndex = DDIDX_CHEATS;
if (!dropdown_is_disabled(DDIDX_CHEATS))
gDropdownDefaultIndex = DDIDX_CHEATS;
else
gDropdownDefaultIndex = DDIDX_TILE_INSPECTOR;
}

static void top_toolbar_cheats_menu_dropdown(int16_t dropdownIndex)
Expand Down

0 comments on commit aeaa45c

Please sign in to comment.