mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 23:34:37 +01:00
Rework modifier key state into strong enum class (#22558)
* Rework modifier key state into strong enum class * Move modifier key state into InputManager
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../interface/Theme.h"
|
||||
|
||||
#include <openrct2-ui/UiContext.h>
|
||||
#include <openrct2-ui/input/InputManager.h>
|
||||
#include <openrct2-ui/interface/Theme.h>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
@@ -96,10 +97,9 @@ static Widget window_map_tooltip_widgets[] = {
|
||||
StringId stringId;
|
||||
std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId));
|
||||
|
||||
if (_cursorHoldDuration < 25 || stringId == STR_NONE
|
||||
|| InputTestPlaceObjectModifier(
|
||||
static_cast<PLACE_OBJECT_MODIFIER>(PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z))
|
||||
|| WindowFindByClass(WindowClass::Error) != nullptr)
|
||||
auto& im = GetInputManager();
|
||||
if (_cursorHoldDuration < 25 || stringId == STR_NONE || im.IsModifierKeyPressed(ModifierKey::ctrl)
|
||||
|| im.IsModifierKeyPressed(ModifierKey::shift) || WindowFindByClass(WindowClass::Error) != nullptr)
|
||||
{
|
||||
WindowCloseByClass(WindowClass::MapTooltip);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user