mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-18 13:32:32 +01:00
Rename members of InputEventState
This commit is contained in:
@@ -438,7 +438,7 @@ public:
|
|||||||
ie.DeviceKind = InputDeviceKind::mouse;
|
ie.DeviceKind = InputDeviceKind::mouse;
|
||||||
ie.Modifiers = SDL_GetModState();
|
ie.Modifiers = SDL_GetModState();
|
||||||
ie.Button = e.button.button;
|
ie.Button = e.button.button;
|
||||||
ie.State = InputEventState::Down;
|
ie.State = InputEventState::down;
|
||||||
_inputManager.QueueInputEvent(std::move(ie));
|
_inputManager.QueueInputEvent(std::move(ie));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -474,7 +474,7 @@ public:
|
|||||||
ie.DeviceKind = InputDeviceKind::mouse;
|
ie.DeviceKind = InputDeviceKind::mouse;
|
||||||
ie.Modifiers = SDL_GetModState();
|
ie.Modifiers = SDL_GetModState();
|
||||||
ie.Button = e.button.button;
|
ie.Button = e.button.button;
|
||||||
ie.State = InputEventState::Release;
|
ie.State = InputEventState::release;
|
||||||
_inputManager.QueueInputEvent(std::move(ie));
|
_inputManager.QueueInputEvent(std::move(ie));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -544,14 +544,14 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
_textComposition.HandleMessage(&e);
|
_textComposition.HandleMessage(&e);
|
||||||
auto ie = GetInputEventFromSDLEvent(e);
|
auto ie = GetInputEventFromSDLEvent(e);
|
||||||
ie.State = InputEventState::Down;
|
ie.State = InputEventState::down;
|
||||||
_inputManager.QueueInputEvent(std::move(ie));
|
_inputManager.QueueInputEvent(std::move(ie));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
{
|
{
|
||||||
auto ie = GetInputEventFromSDLEvent(e);
|
auto ie = GetInputEventFromSDLEvent(e);
|
||||||
ie.State = InputEventState::Release;
|
ie.State = InputEventState::release;
|
||||||
_inputManager.QueueInputEvent(std::move(ie));
|
_inputManager.QueueInputEvent(std::move(ie));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e)
|
|||||||
ie.DeviceKind = InputDeviceKind::joyAxis;
|
ie.DeviceKind = InputDeviceKind::joyAxis;
|
||||||
ie.Modifiers = SDL_GetModState();
|
ie.Modifiers = SDL_GetModState();
|
||||||
ie.Button = e.caxis.axis;
|
ie.Button = e.caxis.axis;
|
||||||
ie.State = InputEventState::Down;
|
ie.State = InputEventState::down;
|
||||||
ie.AxisValue = e.caxis.value;
|
ie.AxisValue = e.caxis.value;
|
||||||
QueueInputEvent(std::move(ie));
|
QueueInputEvent(std::move(ie));
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e)
|
|||||||
ie.DeviceKind = InputDeviceKind::joyHat;
|
ie.DeviceKind = InputDeviceKind::joyHat;
|
||||||
ie.Modifiers = SDL_GetModState();
|
ie.Modifiers = SDL_GetModState();
|
||||||
ie.Button = e.jhat.value;
|
ie.Button = e.jhat.value;
|
||||||
ie.State = InputEventState::Down;
|
ie.State = InputEventState::down;
|
||||||
ie.AxisValue = 0;
|
ie.AxisValue = 0;
|
||||||
QueueInputEvent(std::move(ie));
|
QueueInputEvent(std::move(ie));
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e)
|
|||||||
ie.DeviceKind = InputDeviceKind::joyButton;
|
ie.DeviceKind = InputDeviceKind::joyButton;
|
||||||
ie.Modifiers = SDL_GetModState();
|
ie.Modifiers = SDL_GetModState();
|
||||||
ie.Button = e.cbutton.button;
|
ie.Button = e.cbutton.button;
|
||||||
ie.State = InputEventState::Down;
|
ie.State = InputEventState::down;
|
||||||
ie.AxisValue = 0;
|
ie.AxisValue = 0;
|
||||||
QueueInputEvent(std::move(ie));
|
QueueInputEvent(std::move(ie));
|
||||||
break;
|
break;
|
||||||
@@ -90,7 +90,7 @@ void InputManager::QueueInputEvent(const SDL_Event& e)
|
|||||||
ie.DeviceKind = InputDeviceKind::joyButton;
|
ie.DeviceKind = InputDeviceKind::joyButton;
|
||||||
ie.Modifiers = SDL_GetModState();
|
ie.Modifiers = SDL_GetModState();
|
||||||
ie.Button = e.cbutton.button;
|
ie.Button = e.cbutton.button;
|
||||||
ie.State = InputEventState::Release;
|
ie.State = InputEventState::release;
|
||||||
ie.AxisValue = 0;
|
ie.AxisValue = 0;
|
||||||
QueueInputEvent(std::move(ie));
|
QueueInputEvent(std::move(ie));
|
||||||
break;
|
break;
|
||||||
@@ -352,7 +352,7 @@ void InputManager::Process(const InputEvent& e)
|
|||||||
auto w = windowMgr->FindByClass(WindowClass::textinput);
|
auto w = windowMgr->FindByClass(WindowClass::textinput);
|
||||||
if (w != nullptr)
|
if (w != nullptr)
|
||||||
{
|
{
|
||||||
if (e.State == InputEventState::Release)
|
if (e.State == InputEventState::release)
|
||||||
{
|
{
|
||||||
OpenRCT2::Ui::Windows::WindowTextInputKey(w, e.Button);
|
OpenRCT2::Ui::Windows::WindowTextInputKey(w, e.Button);
|
||||||
}
|
}
|
||||||
@@ -363,7 +363,7 @@ void InputManager::Process(const InputEvent& e)
|
|||||||
w = windowMgr->FindByClass(WindowClass::loadsaveOverwritePrompt);
|
w = windowMgr->FindByClass(WindowClass::loadsaveOverwritePrompt);
|
||||||
if (w != nullptr)
|
if (w != nullptr)
|
||||||
{
|
{
|
||||||
if (e.State == InputEventState::Release)
|
if (e.State == InputEventState::release)
|
||||||
{
|
{
|
||||||
OpenRCT2::Ui::Windows::WindowLoadSaveOverwritePromptInputKey(w, e.Button);
|
OpenRCT2::Ui::Windows::WindowLoadSaveOverwritePromptInputKey(w, e.Button);
|
||||||
}
|
}
|
||||||
@@ -374,7 +374,7 @@ void InputManager::Process(const InputEvent& e)
|
|||||||
w = windowMgr->FindByClass(WindowClass::loadsave);
|
w = windowMgr->FindByClass(WindowClass::loadsave);
|
||||||
if (w != nullptr)
|
if (w != nullptr)
|
||||||
{
|
{
|
||||||
if (e.State == InputEventState::Release)
|
if (e.State == InputEventState::release)
|
||||||
{
|
{
|
||||||
OpenRCT2::Ui::Windows::WindowLoadSaveInputKey(w, e.Button);
|
OpenRCT2::Ui::Windows::WindowLoadSaveInputKey(w, e.Button);
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ void InputManager::Process(const InputEvent& e)
|
|||||||
|
|
||||||
void InputManager::ProcessInGameConsole(const InputEvent& e)
|
void InputManager::ProcessInGameConsole(const InputEvent& e)
|
||||||
{
|
{
|
||||||
if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::Release)
|
if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::release)
|
||||||
{
|
{
|
||||||
auto input = ConsoleInput::None;
|
auto input = ConsoleInput::None;
|
||||||
switch (e.Button)
|
switch (e.Button)
|
||||||
@@ -427,7 +427,7 @@ void InputManager::ProcessInGameConsole(const InputEvent& e)
|
|||||||
|
|
||||||
void InputManager::ProcessChat(const InputEvent& e)
|
void InputManager::ProcessChat(const InputEvent& e)
|
||||||
{
|
{
|
||||||
if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::Down)
|
if (e.DeviceKind == InputDeviceKind::keyboard && e.State == InputEventState::down)
|
||||||
{
|
{
|
||||||
auto input = ChatInput::None;
|
auto input = ChatInput::None;
|
||||||
switch (e.Button)
|
switch (e.Button)
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ namespace OpenRCT2::Ui
|
|||||||
|
|
||||||
enum class InputEventState
|
enum class InputEventState
|
||||||
{
|
{
|
||||||
Down,
|
down,
|
||||||
Release,
|
release,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InputEvent
|
struct InputEvent
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ bool RegisteredShortcut::Matches(const InputEvent& e) const
|
|||||||
bool RegisteredShortcut::IsSuitableInputEvent(const InputEvent& e) const
|
bool RegisteredShortcut::IsSuitableInputEvent(const InputEvent& e) const
|
||||||
{
|
{
|
||||||
// Do not intercept button releases
|
// Do not intercept button releases
|
||||||
if (e.State == InputEventState::Release)
|
if (e.State == InputEventState::release)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user