mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Merge pull request #11806 from michielbos/develop
Fix #11422 Add a shortcut key for disabling/enabling clearance checks
This commit is contained in:
@@ -3667,6 +3667,8 @@ STR_6369 :Allow building track at invalid heights
|
||||
STR_6370 :{SMALLFONT}{BLACK}Allows placing track pieces at any height interval
|
||||
STR_6371 :The specified path contains a RollerCoaster Tycoon 1 installation, but the “csg1i.dat” file is missing. This file needs to be copied from the RollerCoaster Tycoon 1 CD to the “Data” folder of the RollerCoaster Tycoon 1 install on your hard drive.
|
||||
STR_6372 :The specified path contains a RollerCoaster Tycoon 1 installation, but this version is not suitable. OpenRCT2 needs a Loopy Landscapes or RCT Deluxe install in order to use RollerCoaster Tycoon 1 assets.
|
||||
STR_6373 :Toggle clearance checks
|
||||
STR_6374 :C
|
||||
|
||||
#############
|
||||
# Scenarios #
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
- Feature: [#11298] Custom IP address can now be advertised to the master server to work around IPv6 issues.
|
||||
- Feature: [#11306] Path additions are now kept when replacing the path.
|
||||
- Feature: [#11320] Support for custom JavaScript plugins.
|
||||
- Feature: [#11422] Added a shortcut key for disabling/enabling clearance checks.
|
||||
- Feature: [#11788] Command to extract images from a .DAT file.
|
||||
- Change: [#11209] Warn when user is running OpenRCT2 through Wine.
|
||||
- Change: [#11358] Switch copy and paste button positions in tile inspector.
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <openrct2/Input.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/actions/LoadOrQuitAction.hpp>
|
||||
#include <openrct2/actions/SetCheatAction.hpp>
|
||||
#include <openrct2/audio/audio.h>
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/interface/Chat.h>
|
||||
@@ -1020,6 +1021,12 @@ static void shortcut_decrease_element_height()
|
||||
}
|
||||
}
|
||||
|
||||
static void shortcut_toggle_clearance_checks()
|
||||
{
|
||||
auto setCheatAction = SetCheatAction(CheatType::DisableClearanceChecks, gCheatsDisableClearanceChecks ? 1 : 0);
|
||||
GameActions::Execute(&setCheatAction);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
|
||||
@@ -1109,6 +1116,7 @@ namespace
|
||||
shortcut_decrease_y_coord,
|
||||
shortcut_increase_element_height,
|
||||
shortcut_decrease_element_height,
|
||||
shortcut_toggle_clearance_checks,
|
||||
};
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
@@ -371,4 +371,5 @@ const uint16_t KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] = {
|
||||
SHORTCUT_UNDEFINED, // SHORTCUT_SCENERY_PICKER
|
||||
SHORTCUT_UNDEFINED, // SHORTCUT_SCALE_UP
|
||||
SHORTCUT_UNDEFINED, // SHORTCUT_SCALE_DOWN
|
||||
SHORTCUT_UNDEFINED, // SHORTCUT_TOGGLE_CLEARANCE_CHECKS
|
||||
};
|
||||
|
||||
@@ -111,6 +111,7 @@ enum KeyboardShortcut
|
||||
SHORTCUT_DECREASE_Y_COORD,
|
||||
SHORTCUT_INCREASE_ELEM_HEIGHT,
|
||||
SHORTCUT_DECREASE_ELEM_HEIGHT,
|
||||
SHORTCUT_TOGGLE_CLEARANCE_CHECKS,
|
||||
|
||||
SHORTCUT_COUNT,
|
||||
|
||||
|
||||
@@ -102,7 +102,11 @@ static const ShortcutStringPair ShortcutList[] =
|
||||
{ SHORTCUT_SHOW_OPTIONS, STR_SHORTCUT_SHOW_OPTIONS },
|
||||
{ SHORTCUT_SCREENSHOT, STR_SHORTCUT_SCREENSHOT },
|
||||
{ SHORTCUT_MUTE_SOUND, STR_SHORTCUT_MUTE_SOUND },
|
||||
|
||||
{ SHORTCUT_UNDEFINED, STR_NONE },
|
||||
|
||||
{ SHORTCUT_OPEN_CHEAT_WINDOW, STR_SHORTCUT_OPEN_CHEATS_WINDOW },
|
||||
{ SHORTCUT_TOGGLE_CLEARANCE_CHECKS, STR_SHORTCUT_TOGGLE_CLEARANCE_CHECKS },
|
||||
|
||||
{ SHORTCUT_UNDEFINED, STR_NONE },
|
||||
|
||||
|
||||
@@ -887,6 +887,13 @@ static void window_top_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
y++;
|
||||
imgId = SPR_G2_SANDBOX;
|
||||
gfx_draw_sprite(dpi, imgId, x, y, 3);
|
||||
|
||||
// Draw an overlay if clearance checks are disabled
|
||||
if (gCheatsDisableClearanceChecks)
|
||||
{
|
||||
gfx_draw_string_right(
|
||||
dpi, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, nullptr, COLOUR_DARK_ORANGE | COLOUR_FLAG_OUTLINE, x + 26, y + 2);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw chat button
|
||||
|
||||
@@ -104,6 +104,8 @@ public:
|
||||
break;
|
||||
case CheatType::DisableClearanceChecks:
|
||||
gCheatsDisableClearanceChecks = _param1 != 0;
|
||||
// Required to update the clearance checks overlay on the Cheats button.
|
||||
window_invalidate_by_class(WC_TOP_TOOLBAR);
|
||||
break;
|
||||
case CheatType::DisableSupportLimits:
|
||||
gCheatsDisableSupportLimits = _param1 != 0;
|
||||
|
||||
@@ -3906,6 +3906,9 @@ enum
|
||||
STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT = 6371,
|
||||
STR_PATH_TO_RCT1_IS_WRONG_VERSION = 6372,
|
||||
|
||||
STR_SHORTCUT_TOGGLE_CLEARANCE_CHECKS = 6373,
|
||||
STR_OVERLAY_CLEARANCE_CHECKS_DISABLED = 6374,
|
||||
|
||||
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
||||
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user