mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 14:54:30 +01:00
add better disable clearance cheat
This commit is contained in:
@@ -933,7 +933,7 @@ static void window_cheats_misc_mouseup(rct_window *w, int widgetIndex)
|
||||
window_invalidate_by_class(WC_PARK_INFORMATION);
|
||||
break;
|
||||
case WIDX_SANDBOX_MODE:
|
||||
gSandboxMode = !gSandboxMode;
|
||||
gCheatsSandboxMode = !gCheatsSandboxMode;
|
||||
w->widgets[widgetIndex].image = w->widgets[widgetIndex].image == STR_CHEAT_SANDBOX_MODE ? STR_CHEAT_SANDBOX_MODE_DISABLE : STR_CHEAT_SANDBOX_MODE;
|
||||
// To prevent tools from staying active after disabling cheat
|
||||
tool_cancel();
|
||||
|
||||
@@ -209,7 +209,7 @@ void window_footpath_open()
|
||||
// If a restricted path was selected when the game is no longer in Sandbox mode, reset it
|
||||
pathId = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16);
|
||||
pathType = g_pathTypeEntries[pathId];
|
||||
if((pathType->flags & 4) && !gSandboxMode) {
|
||||
if((pathType->flags & 4) && !gCheatsSandboxMode) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = 0;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ static void window_footpath_dropdown(rct_window *w, int widgetIndex, int dropdow
|
||||
pathId = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16);
|
||||
} else {
|
||||
int flags = 4;
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode)
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode)
|
||||
flags = 0;
|
||||
|
||||
j = 0;
|
||||
@@ -581,7 +581,7 @@ static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget
|
||||
numPathTypes = 0;
|
||||
flags = 4;
|
||||
// If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor, but not their queues (since these usually shouldn't have one)
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || (gSandboxMode && !showQueues))
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || (gCheatsSandboxMode && !showQueues))
|
||||
flags = 0;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
||||
@@ -698,7 +698,7 @@ static void window_map_invalidate(rct_window *w)
|
||||
w->widgets[WIDX_CLOSE].right = w->width - 2 - 11 + 10;
|
||||
w->widgets[WIDX_MAP].right = w->width - 4;
|
||||
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode)
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode)
|
||||
w->widgets[WIDX_MAP].bottom = w->height - 1 - 72;
|
||||
else if (w->selected_tab == PAGE_RIDES)
|
||||
w->widgets[WIDX_MAP].bottom = w->height - 1 - 44;
|
||||
@@ -742,7 +742,7 @@ static void window_map_invalidate(rct_window *w)
|
||||
w->widgets[i].type = WWT_EMPTY;
|
||||
}
|
||||
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode) {
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) {
|
||||
// scenario editor: build park entrance selected, show rotate button
|
||||
if (
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE) &&
|
||||
@@ -813,7 +813,7 @@ static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
gfx_draw_sprite(dpi, 0x0B6E0190A, x, y, 0);
|
||||
}
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode) {
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) {
|
||||
// Render the map legend
|
||||
if (w->selected_tab == PAGE_RIDES) {
|
||||
x = w->x + 4;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../addresses.h"
|
||||
#include "../cheats.h"
|
||||
#include "../config.h"
|
||||
#include "../editor.h"
|
||||
#include "../game.h"
|
||||
@@ -101,6 +102,12 @@ typedef enum {
|
||||
DDIDX_OBJECT_SELECTION = 2
|
||||
} TOP_TOOLBAR_DEBUG_DDIDX;
|
||||
|
||||
enum {
|
||||
DDIDX_CHEATS,
|
||||
DDIDX_DISABLE_CLEARANCE_CHECKS = 2,
|
||||
DDIDX_DISABLE_SUPPORT_LIMITS
|
||||
};
|
||||
|
||||
#pragma region Toolbar_widget_ordering
|
||||
|
||||
// from left to right
|
||||
@@ -311,9 +318,6 @@ static void window_top_toolbar_mouseup(rct_window *w, int widgetIndex)
|
||||
case WIDX_RESEARCH:
|
||||
window_research_open();
|
||||
break;
|
||||
case WIDX_CHEATS:
|
||||
window_cheats_open();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,6 +394,28 @@ static void window_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct_widg
|
||||
gDropdownItemsChecked |= (1 << 11);
|
||||
#endif
|
||||
break;
|
||||
case WIDX_CHEATS:
|
||||
gDropdownItemsFormat[0] = 1156;
|
||||
gDropdownItemsFormat[1] = 0;
|
||||
gDropdownItemsFormat[2] = 1156;
|
||||
gDropdownItemsFormat[3] = 1156;
|
||||
gDropdownItemsArgs[0] = 5217;
|
||||
gDropdownItemsArgs[2] = STR_DISABLE_CLEARANCE_CHECKS;
|
||||
gDropdownItemsArgs[3] = STR_DISABLE_SUPPORT_LIMITS;
|
||||
window_dropdown_show_text(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[0] | 0x80,
|
||||
0,
|
||||
4
|
||||
);
|
||||
if (gCheatsDisableClearanceChecks)
|
||||
gDropdownItemsChecked |= (1 << DDIDX_DISABLE_CLEARANCE_CHECKS);
|
||||
if (gCheatsDisableSupportLimits)
|
||||
gDropdownItemsChecked |= (1 << DDIDX_DISABLE_SUPPORT_LIMITS);
|
||||
RCT2_GLOBAL(0x009DEBA2, uint16) = 0;
|
||||
break;
|
||||
case WIDX_VIEW_MENU:
|
||||
top_toolbar_init_view_menu(w, widget);
|
||||
break;
|
||||
@@ -410,7 +436,7 @@ static void window_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct_widg
|
||||
w->colours[1] | 0x80,
|
||||
0,
|
||||
numItems
|
||||
);
|
||||
);
|
||||
RCT2_GLOBAL(0x009DEBA2, uint16) = 0;
|
||||
break;
|
||||
case WIDX_FASTFORWARD:
|
||||
@@ -426,7 +452,7 @@ static void window_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct_widg
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* rct2: 0x0066C9EA
|
||||
*/
|
||||
static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int dropdownIndex)
|
||||
@@ -476,6 +502,20 @@ static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int drop
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case WIDX_CHEATS:
|
||||
if (dropdownIndex == -1) dropdownIndex = RCT2_GLOBAL(0x009DEBA2, uint16);
|
||||
switch (dropdownIndex) {
|
||||
case DDIDX_CHEATS:
|
||||
window_cheats_open();
|
||||
break;
|
||||
case DDIDX_DISABLE_CLEARANCE_CHECKS:
|
||||
gCheatsDisableClearanceChecks = !gCheatsDisableClearanceChecks;
|
||||
break;
|
||||
case DDIDX_DISABLE_SUPPORT_LIMITS:
|
||||
gCheatsDisableSupportLimits = !gCheatsDisableSupportLimits;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WIDX_VIEW_MENU:
|
||||
top_toolbar_view_menu_dropdown(dropdownIndex);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user