mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 11:33:03 +01:00
Fix rebase errors and re-add invisibility toggle
This commit is contained in:
@@ -1,171 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2020 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openrct2/common.h>
|
||||
|
||||
#define SHIFT 0x100
|
||||
#define CTRL 0x200
|
||||
#define ALT 0x400
|
||||
#define CMD 0x800
|
||||
#ifdef __MACOSX__
|
||||
# define PLATFORM_MODIFIER CMD
|
||||
#else
|
||||
# define PLATFORM_MODIFIER CTRL
|
||||
#endif
|
||||
|
||||
struct ScreenCoordsXY;
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct IPlatformEnvironment;
|
||||
|
||||
namespace Input
|
||||
{
|
||||
enum class Shortcut : size_t
|
||||
{
|
||||
CloseTopMostWindow,
|
||||
CloseAllFloatingWindows,
|
||||
CancelConstructionMode,
|
||||
PauseGame,
|
||||
ZoomViewOut,
|
||||
ZoomViewIn,
|
||||
RotateViewClockwise,
|
||||
RotateViewAnticlockwise,
|
||||
RotateConstructionObject,
|
||||
UndergroundViewToggle,
|
||||
RemoveBaseLandToggle,
|
||||
RemoveVerticalLandToggle,
|
||||
SeeThroughRidesToggle,
|
||||
SeeThroughSceneryToggle,
|
||||
InvisibleSupportsToggle,
|
||||
InvisiblePeopleToggle,
|
||||
HeightMarksOnLandToggle,
|
||||
HeightMarksOnRideTracksToggle,
|
||||
HeightMarksOnPathsToggle,
|
||||
AdjustLand,
|
||||
AdjustWater,
|
||||
BuildScenery,
|
||||
BuildPaths,
|
||||
BuildNewRide,
|
||||
ShowFinancialInformation,
|
||||
ShowResearchInformation,
|
||||
ShowRidesList,
|
||||
ShowParkInformation,
|
||||
ShowGuestList,
|
||||
ShowStaffList,
|
||||
ShowRecentMessages,
|
||||
ShowMap,
|
||||
Screenshot,
|
||||
|
||||
// New
|
||||
ReduceGameSpeed,
|
||||
IncreaseGameSpeed,
|
||||
OpenCheatWindow,
|
||||
RemoveTopBottomToolbarToggle,
|
||||
ScrollMapUp,
|
||||
ScrollMapLeft,
|
||||
ScrollMapDown,
|
||||
ScrollMapRight,
|
||||
OpenChatWindow,
|
||||
QuickSaveGame,
|
||||
ShowOptions,
|
||||
MuteSound,
|
||||
WindowedModeToggle,
|
||||
ShowMultiplayer,
|
||||
PaintOriginalToggle,
|
||||
DebugPaintToggle,
|
||||
SeeThroughPathsToggle,
|
||||
RideConstructionTurnLeft,
|
||||
RideConstructionTurnRight,
|
||||
RideConstructionUseTrackDefault,
|
||||
RideConstructionSlopeDown,
|
||||
RideConstructionSlopeUp,
|
||||
RideConstructionChainLiftToggle,
|
||||
RideConstructionBankLeft,
|
||||
RideConstructionBankRight,
|
||||
RideConstructionPreviousTrack,
|
||||
RideConstructionNextTrack,
|
||||
RideConstructionBuildCurrent,
|
||||
RideConstructionDemolishCurrent,
|
||||
LoadGame,
|
||||
ClearScenery,
|
||||
GridlinesDisplayToggle,
|
||||
ViewClipping,
|
||||
HighlightPathIssuesToggle,
|
||||
TileInspector,
|
||||
AdvanceToNextTick,
|
||||
SceneryPicker,
|
||||
ScaleUp,
|
||||
ScaleDown,
|
||||
ToggleInvisibility,
|
||||
CopyElement,
|
||||
PasteElement,
|
||||
RemoveElement,
|
||||
MoveElementUp,
|
||||
MoveElementDown,
|
||||
IncreaseXCoord,
|
||||
DecreaseXCoord,
|
||||
IncreaseYCoord,
|
||||
DecreaseYCoord,
|
||||
IncreaseElementHeight,
|
||||
DecreaseElementHeight,
|
||||
ToggleClearanceChecks,
|
||||
|
||||
Count,
|
||||
|
||||
Undefined = 0xFFFF,
|
||||
};
|
||||
constexpr size_t ShortcutsCount = static_cast<size_t>(Shortcut::Count);
|
||||
|
||||
class KeyboardShortcuts
|
||||
{
|
||||
private:
|
||||
constexpr static int32_t CURRENT_FILE_VERSION = 1;
|
||||
static const uint16_t DefaultKeys[ShortcutsCount];
|
||||
|
||||
std::shared_ptr<IPlatformEnvironment> const _env;
|
||||
uint16_t _keys[ShortcutsCount];
|
||||
|
||||
public:
|
||||
KeyboardShortcuts(const std::shared_ptr<IPlatformEnvironment>& env);
|
||||
~KeyboardShortcuts();
|
||||
|
||||
void Reset();
|
||||
bool Load();
|
||||
bool Save();
|
||||
|
||||
std::string GetShortcutString(int32_t shortcut) const;
|
||||
|
||||
void Set(int32_t key);
|
||||
Shortcut GetFromKey(int32_t key);
|
||||
ScreenCoordsXY GetKeyboardMapScroll(const uint8_t* keysState) const;
|
||||
};
|
||||
const uint16_t ScanCodeUndefined = 0xFFFF;
|
||||
} // namespace Input
|
||||
} // namespace OpenRCT2
|
||||
|
||||
// The current shortcut being changed.
|
||||
extern OpenRCT2::Input::Shortcut gKeyboardShortcutChangeId;
|
||||
|
||||
void KeyboardShortcutsReset();
|
||||
bool KeyboardShortcutsLoad();
|
||||
bool KeyboardShortcutsSave();
|
||||
void KeyboardShortcutsSet(int32_t key);
|
||||
OpenRCT2::Input::Shortcut KeyboardShortcutsGetFromKey(int32_t key);
|
||||
void KeyboardShortcutsFormatString(char* buffer, size_t bufferSize, int32_t shortcut);
|
||||
|
||||
void KeyboardShortcutHandle(int32_t key);
|
||||
void KeyboardShortcutHandleCommand(OpenRCT2::Input::Shortcut shortcut);
|
||||
|
||||
ScreenCoordsXY GetKeyboardMapScroll(const uint8_t* keysState);
|
||||
@@ -98,7 +98,7 @@ namespace OpenRCT2::Ui::ShortcutId
|
||||
constexpr std::string_view WindowRideConstructionDemolish = "window.rideconstruction.demolish";
|
||||
|
||||
// Window / tile inspector
|
||||
constexpr std::string_view WindowTileInspectorInsertCorrupt = "window.tileinspector.insert_corrupt";
|
||||
constexpr std::string_view WindowTileInspectorToggleInvisibility = "window.tileinspector.toggle_invisibility";
|
||||
constexpr std::string_view WindowTileInspectorCopy = "window.tileinspector.copy";
|
||||
constexpr std::string_view WindowTileInspectorPaste = "window.tileinspector.paste";
|
||||
constexpr std::string_view WindowTileInspectorRemove = "window.tileinspector.remove";
|
||||
|
||||
@@ -429,7 +429,7 @@ std::string_view ShortcutManager::GetLegacyShortcutId(size_t index)
|
||||
ShortcutId::InterfaceSceneryPicker,
|
||||
ShortcutId::InterfaceScaleIncrease,
|
||||
ShortcutId::InterfaceScaleDecrease,
|
||||
ShortcutId::WindowTileInspectorInsertCorrupt,
|
||||
ShortcutId::WindowTileInspectorToggleInvisibility,
|
||||
ShortcutId::WindowTileInspectorCopy,
|
||||
ShortcutId::WindowTileInspectorPaste,
|
||||
ShortcutId::WindowTileInspectorRemove,
|
||||
|
||||
@@ -839,6 +839,7 @@ void ShortcutManager::RegisterDefaultShortcuts()
|
||||
RegisterShortcut(ShortcutId::WindowRideConstructionBuild, STR_SHORTCUT_CONSTRUCTION_BUILD_CURRENT, "NUMPAD 0", []() { ShortcutConstructionBuildCurrent(); });
|
||||
RegisterShortcut(ShortcutId::WindowRideConstructionDemolish, STR_SHORTCUT_CONSTRUCTION_DEMOLISH_CURRENT, "NUMPAD -", []() { ShortcutConstructionDemolishCurrent(); });
|
||||
|
||||
RegisterShortcut(ShortcutId::WindowTileInspectorToggleInvisibility, STR_SHORTCUT_TOGGLE_INVISIBILITY, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_TOGGLE_INVISIBILITY); });
|
||||
RegisterShortcut(ShortcutId::WindowTileInspectorCopy, STR_SHORTCUT_COPY_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_COPY); });
|
||||
RegisterShortcut(ShortcutId::WindowTileInspectorPaste, STR_SHORTCUT_PASTE_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE); });
|
||||
RegisterShortcut(ShortcutId::WindowTileInspectorRemove, STR_SHORTCUT_REMOVE_ELEMENT, []() { TileInspectorMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE); });
|
||||
|
||||
Reference in New Issue
Block a user