mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Rename members of MouseState
This commit is contained in:
@@ -418,7 +418,7 @@ public:
|
||||
switch (e.button.button)
|
||||
{
|
||||
case SDL_BUTTON_LEFT:
|
||||
StoreMouseInput(MouseState::LeftPress, mousePos);
|
||||
StoreMouseInput(MouseState::leftPress, mousePos);
|
||||
_cursorState.left = CURSOR_PRESSED;
|
||||
_cursorState.old = 1;
|
||||
break;
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
_cursorState.middle = CURSOR_PRESSED;
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
StoreMouseInput(MouseState::RightPress, mousePos);
|
||||
StoreMouseInput(MouseState::rightPress, mousePos);
|
||||
_cursorState.right = CURSOR_PRESSED;
|
||||
_cursorState.old = 2;
|
||||
break;
|
||||
@@ -454,7 +454,7 @@ public:
|
||||
switch (e.button.button)
|
||||
{
|
||||
case SDL_BUTTON_LEFT:
|
||||
StoreMouseInput(MouseState::LeftRelease, mousePos);
|
||||
StoreMouseInput(MouseState::leftRelease, mousePos);
|
||||
_cursorState.left = CURSOR_RELEASED;
|
||||
_cursorState.old = 3;
|
||||
break;
|
||||
@@ -462,7 +462,7 @@ public:
|
||||
_cursorState.middle = CURSOR_RELEASED;
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
StoreMouseInput(MouseState::RightRelease, mousePos);
|
||||
StoreMouseInput(MouseState::rightRelease, mousePos);
|
||||
_cursorState.right = CURSOR_RELEASED;
|
||||
_cursorState.old = 4;
|
||||
break;
|
||||
@@ -496,13 +496,13 @@ public:
|
||||
|
||||
if (_cursorState.touchIsDouble)
|
||||
{
|
||||
StoreMouseInput(MouseState::RightPress, fingerPos);
|
||||
StoreMouseInput(MouseState::rightPress, fingerPos);
|
||||
_cursorState.right = CURSOR_PRESSED;
|
||||
_cursorState.old = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
StoreMouseInput(MouseState::LeftPress, fingerPos);
|
||||
StoreMouseInput(MouseState::leftPress, fingerPos);
|
||||
_cursorState.left = CURSOR_PRESSED;
|
||||
_cursorState.old = 1;
|
||||
}
|
||||
@@ -517,13 +517,13 @@ public:
|
||||
|
||||
if (_cursorState.touchIsDouble)
|
||||
{
|
||||
StoreMouseInput(MouseState::RightRelease, fingerPos);
|
||||
StoreMouseInput(MouseState::rightRelease, fingerPos);
|
||||
_cursorState.right = CURSOR_RELEASED;
|
||||
_cursorState.old = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
StoreMouseInput(MouseState::LeftRelease, fingerPos);
|
||||
StoreMouseInput(MouseState::leftRelease, fingerPos);
|
||||
_cursorState.left = CURSOR_RELEASED;
|
||||
_cursorState.old = 3;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace OpenRCT2
|
||||
|
||||
MouseState state;
|
||||
ScreenCoordsXY screenCoords;
|
||||
while ((state = GameGetNextInput(screenCoords)) != MouseState::Released)
|
||||
while ((state = GameGetNextInput(screenCoords)) != MouseState::released)
|
||||
{
|
||||
GameHandleInputMouse(screenCoords, state);
|
||||
}
|
||||
@@ -151,7 +151,7 @@ namespace OpenRCT2
|
||||
{
|
||||
const CursorState* cursorState = ContextGetCursorState();
|
||||
screenCoords = cursorState->position;
|
||||
return MouseState::Released;
|
||||
return MouseState::released;
|
||||
}
|
||||
|
||||
screenCoords.x = input->x;
|
||||
@@ -257,20 +257,20 @@ namespace OpenRCT2
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case MouseState::Released:
|
||||
case MouseState::released:
|
||||
if (screenCoords.x != 0 || screenCoords.y != 0)
|
||||
{
|
||||
_ticksSinceDragStart = std::nullopt;
|
||||
InputScrollDragContinue(screenCoords, w);
|
||||
}
|
||||
break;
|
||||
case MouseState::RightRelease:
|
||||
case MouseState::rightRelease:
|
||||
_inputState = InputState::Reset;
|
||||
ContextShowCursor();
|
||||
break;
|
||||
case MouseState::LeftPress:
|
||||
case MouseState::LeftRelease:
|
||||
case MouseState::RightPress:
|
||||
case MouseState::leftPress:
|
||||
case MouseState::leftRelease:
|
||||
case MouseState::rightPress:
|
||||
// Function only handles right button, so it's the only one relevant
|
||||
break;
|
||||
}
|
||||
@@ -301,13 +301,13 @@ namespace OpenRCT2
|
||||
case InputState::Normal:
|
||||
switch (state)
|
||||
{
|
||||
case MouseState::Released:
|
||||
case MouseState::released:
|
||||
InputWidgetOver(screenCoords, w, widgetIndex);
|
||||
break;
|
||||
case MouseState::LeftPress:
|
||||
case MouseState::leftPress:
|
||||
InputWidgetLeft(screenCoords, w, widgetIndex);
|
||||
break;
|
||||
case MouseState::RightPress:
|
||||
case MouseState::rightPress:
|
||||
windowMgr->CloseByClass(WindowClass::tooltip);
|
||||
|
||||
if (w != nullptr)
|
||||
@@ -334,8 +334,8 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MouseState::LeftRelease:
|
||||
case MouseState::RightRelease:
|
||||
case MouseState::leftRelease:
|
||||
case MouseState::rightRelease:
|
||||
// In this switch only button presses are relevant
|
||||
break;
|
||||
}
|
||||
@@ -352,18 +352,18 @@ namespace OpenRCT2
|
||||
else
|
||||
{
|
||||
InputWindowPositionContinue(*w, gInputDragLast, screenCoords);
|
||||
if (state == MouseState::LeftRelease)
|
||||
if (state == MouseState::leftRelease)
|
||||
{
|
||||
InputWindowPositionEnd(*w, screenCoords);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case InputState::ViewportRight:
|
||||
if (state == MouseState::Released)
|
||||
if (state == MouseState::released)
|
||||
{
|
||||
InputViewportDragContinue();
|
||||
}
|
||||
else if (state == MouseState::RightRelease)
|
||||
else if (state == MouseState::rightRelease)
|
||||
{
|
||||
InputViewportDragEnd();
|
||||
if (_ticksSinceDragStart.has_value() && gCurrentRealTimeTicks - _ticksSinceDragStart.value() < 500)
|
||||
@@ -386,7 +386,7 @@ namespace OpenRCT2
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case MouseState::Released:
|
||||
case MouseState::released:
|
||||
if (w->viewport == nullptr)
|
||||
{
|
||||
_inputState = InputState::Reset;
|
||||
@@ -410,7 +410,7 @@ namespace OpenRCT2
|
||||
|
||||
w->onToolDrag(gCurrentToolWidget.widgetIndex, screenCoords);
|
||||
break;
|
||||
case MouseState::LeftRelease:
|
||||
case MouseState::leftRelease:
|
||||
_inputState = InputState::Reset;
|
||||
if (_dragWidget.windowNumber == w->number)
|
||||
{
|
||||
@@ -429,9 +429,9 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MouseState::LeftPress:
|
||||
case MouseState::RightPress:
|
||||
case MouseState::RightRelease:
|
||||
case MouseState::leftPress:
|
||||
case MouseState::rightPress:
|
||||
case MouseState::rightRelease:
|
||||
// In this switch only left button release is relevant
|
||||
break;
|
||||
}
|
||||
@@ -439,15 +439,15 @@ namespace OpenRCT2
|
||||
case InputState::ScrollLeft:
|
||||
switch (state)
|
||||
{
|
||||
case MouseState::Released:
|
||||
case MouseState::released:
|
||||
InputScrollContinue(*w, widgetIndex, screenCoords);
|
||||
break;
|
||||
case MouseState::LeftRelease:
|
||||
case MouseState::leftRelease:
|
||||
InputScrollEnd();
|
||||
break;
|
||||
case MouseState::LeftPress:
|
||||
case MouseState::RightPress:
|
||||
case MouseState::RightRelease:
|
||||
case MouseState::leftPress:
|
||||
case MouseState::rightPress:
|
||||
case MouseState::rightRelease:
|
||||
// In this switch only left button release is relevant
|
||||
break;
|
||||
}
|
||||
@@ -460,11 +460,11 @@ namespace OpenRCT2
|
||||
}
|
||||
else
|
||||
{
|
||||
if (state == MouseState::LeftRelease)
|
||||
if (state == MouseState::leftRelease)
|
||||
{
|
||||
InputWindowResizeEnd();
|
||||
}
|
||||
if (state == MouseState::Released || state == MouseState::LeftRelease)
|
||||
if (state == MouseState::released || state == MouseState::leftRelease)
|
||||
{
|
||||
InputWindowResizeContinue(*w, screenCoords);
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ namespace OpenRCT2
|
||||
return;
|
||||
}
|
||||
|
||||
if (w != nullptr && state == MouseState::LeftRelease)
|
||||
if (w != nullptr && state == MouseState::leftRelease)
|
||||
{
|
||||
if (w->widgets[widgetIndex].type == WidgetType::closeBox && cursor_w_class == w->classification
|
||||
&& cursor_w_number == w->number && widgetIndex == cursor_widgetIndex)
|
||||
@@ -1282,7 +1282,7 @@ namespace OpenRCT2
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case MouseState::Released:
|
||||
case MouseState::released:
|
||||
if (w == nullptr || cursor_w_class != w->classification || cursor_w_number != w->number
|
||||
|| widgetIndex != cursor_widgetIndex)
|
||||
break;
|
||||
@@ -1328,8 +1328,8 @@ namespace OpenRCT2
|
||||
gInputFlags.set(InputFlag::widgetPressed);
|
||||
windowMgr->InvalidateWidgetByNumber(cursor_w_class, cursor_w_number, widgetIndex);
|
||||
return;
|
||||
case MouseState::LeftRelease:
|
||||
case MouseState::RightPress:
|
||||
case MouseState::leftRelease:
|
||||
case MouseState::rightPress:
|
||||
if (_inputState == InputState::DropdownActive)
|
||||
{
|
||||
if (w != nullptr)
|
||||
@@ -1404,7 +1404,7 @@ namespace OpenRCT2
|
||||
|
||||
_inputState = InputState::Normal;
|
||||
|
||||
if (state == MouseState::RightPress)
|
||||
if (state == MouseState::rightPress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace OpenRCT2
|
||||
{
|
||||
enum class MouseState : uint32_t
|
||||
{
|
||||
Released,
|
||||
LeftPress,
|
||||
LeftRelease,
|
||||
RightPress,
|
||||
RightRelease
|
||||
released,
|
||||
leftPress,
|
||||
leftRelease,
|
||||
rightPress,
|
||||
rightRelease,
|
||||
};
|
||||
|
||||
extern ScreenCoordsXY gInputDragLast;
|
||||
|
||||
Reference in New Issue
Block a user