From 8a7a265639ba4348fe47d40cd7c374cca5528bef Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 17 Sep 2025 18:30:48 +0200 Subject: [PATCH] Rename member of WidgetIdentifier and WidgetRef --- src/openrct2-ui/input/MouseInput.cpp | 116 +++++++++--------- src/openrct2-ui/interface/Widget.cpp | 14 +-- src/openrct2-ui/interface/Window.cpp | 10 +- .../windows/EditorBottomToolbar.cpp | 8 +- .../windows/EditorInventionsList.cpp | 2 +- .../windows/EditorParkEntrance.cpp | 4 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/TextInput.cpp | 6 +- src/openrct2-ui/windows/Tooltip.cpp | 16 +-- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/interface/Window.cpp | 27 ++-- src/openrct2/interface/Window.h | 8 +- 12 files changed, 107 insertions(+), 108 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index d0261ded82..fe2b544f45 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -184,9 +184,9 @@ namespace OpenRCT2 { _inputState = InputState::ScrollRight; gInputDragLast = screenCoords; - _dragWidget.window_classification = w->classification; - _dragWidget.window_number = w->number; - _dragWidget.widget_index = widgetIndex; + _dragWidget.windowClassification = w->classification; + _dragWidget.windowNumber = w->number; + _dragWidget.widgetIndex = widgetIndex; _ticksSinceDragStart = gCurrentRealTimeTicks; _dragScrollIndex = WindowGetScrollDataIndex(*w, widgetIndex); @@ -199,7 +199,7 @@ namespace OpenRCT2 */ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, WindowBase* w) { - WidgetIndex widgetIndex = _dragWidget.widget_index; + WidgetIndex widgetIndex = _dragWidget.widgetIndex; uint8_t scrollIndex = _dragScrollIndex; const auto& widget = w->widgets[widgetIndex]; @@ -247,7 +247,7 @@ namespace OpenRCT2 static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState state) { auto* windowMgr = GetWindowManager(); - WindowBase* w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); + WindowBase* w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { ContextShowCursor(); @@ -344,7 +344,7 @@ namespace OpenRCT2 InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget); break; case InputState::PositioningWindow: - w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); + w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { _inputState = InputState::Reset; @@ -377,7 +377,7 @@ namespace OpenRCT2 InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget); break; case InputState::ViewportLeft: - w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); + w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { _inputState = InputState::Reset; @@ -396,31 +396,31 @@ namespace OpenRCT2 if (!gInputFlags.has(InputFlag::leftMousePressed)) break; - if (w->classification != _dragWidget.window_classification || w->number != _dragWidget.window_number + if (w->classification != _dragWidget.windowClassification || w->number != _dragWidget.windowNumber || !(gInputFlags.has(InputFlag::toolActive))) { break; } - w = windowMgr->FindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + w = windowMgr->FindByNumber(gCurrentToolWidget.windowClassification, gCurrentToolWidget.windowNumber); if (w == nullptr) { break; } - w->OnToolDrag(gCurrentToolWidget.widget_index, screenCoords); + w->OnToolDrag(gCurrentToolWidget.widgetIndex, screenCoords); break; case MouseState::LeftRelease: _inputState = InputState::Reset; - if (_dragWidget.window_number == w->number) + if (_dragWidget.windowNumber == w->number) { if (gInputFlags.has(InputFlag::toolActive)) { w = windowMgr->FindByNumber( - gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + gCurrentToolWidget.windowClassification, gCurrentToolWidget.windowNumber); if (w != nullptr) { - w->OnToolUp(gCurrentToolWidget.widget_index, screenCoords); + w->OnToolUp(gCurrentToolWidget.widgetIndex, screenCoords); } } else if (!gInputFlags.has(InputFlag::leftMousePressed)) @@ -453,7 +453,7 @@ namespace OpenRCT2 } break; case InputState::Resizing: - w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); + w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { _inputState = InputState::Reset; @@ -482,9 +482,9 @@ namespace OpenRCT2 { _inputState = InputState::PositioningWindow; gInputDragLast = screenCoords - w.windowPos; - _dragWidget.window_classification = w.classification; - _dragWidget.window_number = w.number; - _dragWidget.widget_index = widgetIndex; + _dragWidget.windowClassification = w.classification; + _dragWidget.windowNumber = w.number; + _dragWidget.widgetIndex = widgetIndex; } static void InputWindowPositionContinue( @@ -508,9 +508,9 @@ namespace OpenRCT2 { _inputState = InputState::Resizing; gInputDragLast = screenCoords; - _dragWidget.window_classification = w.classification; - _dragWidget.window_number = w.number; - _dragWidget.widget_index = widgetIndex; + _dragWidget.windowClassification = w.classification; + _dragWidget.windowNumber = w.number; + _dragWidget.widgetIndex = widgetIndex; _originalWindowWidth = w.width; _originalWindowHeight = w.height; } @@ -542,8 +542,8 @@ namespace OpenRCT2 { w.flags &= ~WF_SCROLLING_TO_LOCATION; _inputState = InputState::ViewportRight; - _dragWidget.window_classification = w.classification; - _dragWidget.window_number = w.number; + _dragWidget.windowClassification = w.classification; + _dragWidget.windowNumber = w.number; _ticksSinceDragStart = gCurrentRealTimeTicks; auto cursorPosition = ContextGetCursorPosition(); gInputDragLast = cursorPosition; @@ -573,7 +573,7 @@ namespace OpenRCT2 return; auto* windowMgr = GetWindowManager(); - w = windowMgr->FindByNumber(_dragWidget.window_classification, _dragWidget.window_number); + w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); // #3294: Window can be closed during a drag session, so just finish // the session if the window no longer exists @@ -649,9 +649,9 @@ namespace OpenRCT2 const auto& widget = w.widgets[widgetIndex]; _inputState = InputState::ScrollLeft; - gPressedWidget.window_classification = w.classification; - gPressedWidget.window_number = w.number; - gPressedWidget.widget_index = widgetIndex; + gPressedWidget.windowClassification = w.classification; + gPressedWidget.windowNumber = w.number; + gPressedWidget.widgetIndex = widgetIndex; gTooltipCursor = screenCoords; int32_t scroll_area, scroll_id; @@ -721,8 +721,8 @@ namespace OpenRCT2 int32_t scroll_part, scroll_id; const auto& widget = w.widgets[widgetIndex]; - if (w.classification != gPressedWidget.window_classification || w.number != gPressedWidget.window_number - || widgetIndex != gPressedWidget.widget_index) + if (w.classification != gPressedWidget.windowClassification || w.number != gPressedWidget.windowNumber + || widgetIndex != gPressedWidget.widgetIndex) { InvalidateScroll(); return; @@ -1000,16 +1000,16 @@ namespace OpenRCT2 return; // Check if the widget that the cursor was over, has changed - if (windowClass != gHoverWidget.window_classification || windowNumber != gHoverWidget.window_number - || widgetIndex != gHoverWidget.widget_index) + if (windowClass != gHoverWidget.windowClassification || windowNumber != gHoverWidget.windowNumber + || widgetIndex != gHoverWidget.widgetIndex) { // Invalidate last widget cursor was on if widget is a flat button InputWidgetOverFlatbuttonInvalidate(); // Set new cursor over widget - gHoverWidget.window_classification = windowClass; - gHoverWidget.window_number = windowNumber; - gHoverWidget.widget_index = widgetIndex; + gHoverWidget.windowClassification = windowClass; + gHoverWidget.windowNumber = windowNumber; + gHoverWidget.widgetIndex = widgetIndex; // Invalidate new widget cursor is on if widget is a flat button if (windowClass != WindowClass::Null) @@ -1024,14 +1024,14 @@ namespace OpenRCT2 static void InputWidgetOverFlatbuttonInvalidate() { auto* windowMgr = GetWindowManager(); - WindowBase* w = windowMgr->FindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number); + WindowBase* w = windowMgr->FindByNumber(gHoverWidget.windowClassification, gHoverWidget.windowNumber); if (w != nullptr) { w->OnPrepareDraw(); - if (w->widgets[gHoverWidget.widget_index].type == WidgetType::flatBtn) + if (w->widgets[gHoverWidget.widgetIndex].type == WidgetType::flatBtn) { windowMgr->InvalidateWidgetByNumber( - gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index); + gHoverWidget.windowClassification, gHoverWidget.windowNumber, gHoverWidget.widgetIndex); } } } @@ -1065,7 +1065,7 @@ namespace OpenRCT2 return; if (windowClass != GetCurrentTextBox().window.classification || windowNumber != GetCurrentTextBox().window.number - || widgetIndex != GetCurrentTextBox().widget_index) + || widgetIndex != GetCurrentTextBox().widgetIndex) { WindowCancelTextbox(); } @@ -1083,15 +1083,15 @@ namespace OpenRCT2 case WidgetType::viewport: _inputState = InputState::ViewportLeft; gInputDragLast = screenCoords; - _dragWidget.window_classification = windowClass; - _dragWidget.window_number = windowNumber; + _dragWidget.windowClassification = windowClass; + _dragWidget.windowNumber = windowNumber; if (gInputFlags.has(InputFlag::toolActive)) { - w = windowMgr->FindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + w = windowMgr->FindByNumber(gCurrentToolWidget.windowClassification, gCurrentToolWidget.windowNumber); if (w != nullptr) { gInputFlags.set(InputFlag::leftMousePressed); - w->OnToolDown(gCurrentToolWidget.widget_index, screenCoords); + w->OnToolDown(gCurrentToolWidget.widgetIndex, screenCoords); } } break; @@ -1128,9 +1128,9 @@ namespace OpenRCT2 OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + widget.midX()); // Set new cursor down widget - gPressedWidget.window_classification = windowClass; - gPressedWidget.window_number = windowNumber; - gPressedWidget.widget_index = widgetIndex; + gPressedWidget.windowClassification = windowClass; + gPressedWidget.windowNumber = windowNumber; + gPressedWidget.widgetIndex = widgetIndex; gInputFlags.set(InputFlag::widgetPressed); _inputState = InputState::WidgetPressed; _clickRepeatTicks = gCurrentRealTimeTicks; @@ -1229,12 +1229,12 @@ namespace OpenRCT2 if (gInputFlags.has(InputFlag::toolActive)) { auto* windowMgr = GetWindowManager(); - WindowBase* w = windowMgr->FindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + WindowBase* w = windowMgr->FindByNumber(gCurrentToolWidget.windowClassification, gCurrentToolWidget.windowNumber); if (w == nullptr) ToolCancel(); else if (InputGetState() != InputState::ViewportRight) - w->OnToolUpdate(gCurrentToolWidget.widget_index, screenCoords); + w->OnToolUpdate(gCurrentToolWidget.widgetIndex, screenCoords); } } @@ -1247,9 +1247,9 @@ namespace OpenRCT2 { WindowClass cursor_w_class; rct_windownumber cursor_w_number; - cursor_w_class = gPressedWidget.window_classification; - cursor_w_number = gPressedWidget.window_number; - WidgetIndex cursor_widgetIndex = gPressedWidget.widget_index; + cursor_w_class = gPressedWidget.windowClassification; + cursor_w_number = gPressedWidget.windowNumber; + WidgetIndex cursor_widgetIndex = gPressedWidget.widgetIndex; auto* windowMgr = GetWindowManager(); WindowBase* cursor_w = windowMgr->FindByNumber(cursor_w_class, cursor_w_number); @@ -1386,9 +1386,9 @@ namespace OpenRCT2 _inputState = InputState::Normal; gTooltipCloseTimeout = 0; - gTooltipWidget.widget_index = cursor_widgetIndex; - gTooltipWidget.window_classification = cursor_w_class; - gTooltipWidget.window_number = cursor_w_number; + gTooltipWidget.widgetIndex = cursor_widgetIndex; + gTooltipWidget.windowClassification = cursor_w_class; + gTooltipWidget.windowNumber = cursor_w_number; if (dropdown_index == -1) { @@ -1410,7 +1410,7 @@ namespace OpenRCT2 } gTooltipCloseTimeout = 0; - gTooltipWidget.widget_index = cursor_widgetIndex; + gTooltipWidget.widgetIndex = cursor_widgetIndex; if (w == nullptr) break; @@ -1498,7 +1498,7 @@ namespace OpenRCT2 static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { - if (gTooltipWidget.window_classification == WindowClass::Null) + if (gTooltipWidget.windowClassification == WindowClass::Null) { if (gTooltipCursor == screenCoords) { @@ -1522,8 +1522,8 @@ namespace OpenRCT2 gTooltipCursor = screenCoords; ResetTooltipNotShown(); - if (w == nullptr || gTooltipWidget.window_classification != w->classification - || gTooltipWidget.window_number != w->number || gTooltipWidget.widget_index != widgetIndex + if (w == nullptr || gTooltipWidget.windowClassification != w->classification + || gTooltipWidget.windowNumber != w->number || gTooltipWidget.widgetIndex != widgetIndex || !widgetIsVisible(*w, widgetIndex)) { WindowTooltipClose(); @@ -1560,12 +1560,12 @@ namespace OpenRCT2 void InvalidateScroll() { auto* windowMgr = GetWindowManager(); - WindowBase* w = windowMgr->FindByNumber(gPressedWidget.window_classification, gPressedWidget.window_number); + WindowBase* w = windowMgr->FindByNumber(gPressedWidget.windowClassification, gPressedWidget.windowNumber); if (w != nullptr) { // Reset to basic scroll w->scrolls[_currentScrollIndex].flags &= 0xFF11; - windowMgr->InvalidateByNumber(gPressedWidget.window_classification, gPressedWidget.window_number); + windowMgr->InvalidateByNumber(gPressedWidget.windowClassification, gPressedWidget.windowNumber); } } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 8db8c6aa2b..2995f204f6 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -902,11 +902,11 @@ namespace OpenRCT2::Ui { if (!gInputFlags.has(InputFlag::widgetPressed)) return false; - if (gPressedWidget.window_classification != w.classification) + if (gPressedWidget.windowClassification != w.classification) return false; - if (gPressedWidget.window_number != w.number) + if (gPressedWidget.windowNumber != w.number) return false; - if (gPressedWidget.widget_index != widgetIndex) + if (gPressedWidget.widgetIndex != widgetIndex) return false; return true; } @@ -915,11 +915,11 @@ namespace OpenRCT2::Ui bool widgetIsHighlighted(const WindowBase& w, WidgetIndex widgetIndex) { - if (gHoverWidget.window_classification != w.classification) + if (gHoverWidget.windowClassification != w.classification) return false; - if (gHoverWidget.window_number != w.number) + if (gHoverWidget.windowNumber != w.number) return false; - if (gHoverWidget.widget_index != widgetIndex) + if (gHoverWidget.widgetIndex != widgetIndex) return false; return true; } @@ -1126,7 +1126,7 @@ namespace OpenRCT2::Ui auto& tbIdent = OpenRCT2::Ui::Windows::GetCurrentTextBox(); bool active = w.classification == tbIdent.window.classification && w.number == tbIdent.window.number - && widgetIndex == tbIdent.widget_index; + && widgetIndex == tbIdent.widgetIndex; // GfxFillRectInset(rt, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00)); GfxFillRectInset(rt, { topLeft, bottomRight }, w.colours[widget.colour], INSET_RECT_F_60); diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index bf5fa1a7f6..7f9e54926f 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -560,7 +560,7 @@ namespace OpenRCT2::Ui::Windows _usingWidgetTextBox = true; _currentTextBox.window.classification = callW.classification; _currentTextBox.window.number = callW.number; - _currentTextBox.widget_index = callWidget; + _currentTextBox.widgetIndex = callWidget; _textBoxFrameNo = 0; auto* windowMgr = Ui::GetWindowManager(); @@ -583,9 +583,9 @@ namespace OpenRCT2::Ui::Windows _usingWidgetTextBox = false; if (w != nullptr) { - windowMgr->InvalidateWidget(*w, _currentTextBox.widget_index); + windowMgr->InvalidateWidget(*w, _currentTextBox.widgetIndex); } - _currentTextBox.widget_index = kWidgetIndexNull; + _currentTextBox.widgetIndex = kWidgetIndexNull; } } @@ -603,8 +603,8 @@ namespace OpenRCT2::Ui::Windows _textBoxFrameNo = 0; auto* windowMgr = GetWindowManager(); WindowBase* w = windowMgr->FindByNumber(_currentTextBox.window.classification, _currentTextBox.window.number); - windowMgr->InvalidateWidget(*w, _currentTextBox.widget_index); - w->OnTextInput(_currentTextBox.widget_index, _textBoxInput); + windowMgr->InvalidateWidget(*w, _currentTextBox.widgetIndex); + w->OnTextInput(_currentTextBox.widgetIndex, _textBoxInput); } } const TextInputSession* GetTextboxSession() diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 2fc4619c4f..fbfc912d5c 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -352,8 +352,8 @@ namespace OpenRCT2::Ui::Windows windowPos + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 6, widgets[WIDX_PREVIOUS_IMAGE].top + 6 }); colour_t textColour = colours[1].colour; - if (gHoverWidget.window_classification == WindowClass::BottomToolbar - && gHoverWidget.widget_index == WIDX_PREVIOUS_STEP_BUTTON) + if (gHoverWidget.windowClassification == WindowClass::BottomToolbar + && gHoverWidget.widgetIndex == WIDX_PREVIOUS_STEP_BUTTON) { textColour = COLOUR_WHITE; } @@ -391,8 +391,8 @@ namespace OpenRCT2::Ui::Windows colour_t textColour = colours[1].colour; - if (gHoverWidget.window_classification == WindowClass::BottomToolbar - && gHoverWidget.widget_index == WIDX_NEXT_STEP_BUTTON) + if (gHoverWidget.windowClassification == WindowClass::BottomToolbar + && gHoverWidget.widgetIndex == WIDX_NEXT_STEP_BUTTON) { textColour = COLOUR_WHITE; } diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index f7a8e413d1..25600780a2 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -487,7 +487,7 @@ namespace OpenRCT2::Ui::Windows auto& widget = widgets[widgetIndex]; if (widgetIndex == WIDX_PRE_RESEARCHED_SCROLL || widgetIndex == WIDX_RESEARCH_ORDER_SCROLL) { - gPressedWidget.widget_index = widgetIndex; + gPressedWidget.widgetIndex = widgetIndex; int32_t outScrollArea{}; ScreenCoordsXY outScrollCoords{}; int32_t outScrollId{}; diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 9efffac883..51fe28f706 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -280,13 +280,13 @@ namespace OpenRCT2::Ui::Windows void OnClose() override { - if (gCurrentToolWidget.window_classification == classification) + if (gCurrentToolWidget.windowClassification == classification) ToolCancel(); } void OnUpdate() override { - if (gCurrentToolWidget.window_classification != classification) + if (gCurrentToolWidget.windowClassification != classification) Close(); } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index abf9833d25..3944734358 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -80,7 +80,7 @@ namespace OpenRCT2::Ui::Windows colour_t GetHoverWidgetColour(WidgetIndex index) { return ( - gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == index + gHoverWidget.windowClassification == WindowClass::BottomToolbar && gHoverWidget.widgetIndex == index ? static_cast(COLOUR_WHITE) : colours[0].colour); } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 00d3514e83..da156a0aa2 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -73,7 +73,7 @@ namespace OpenRCT2::Ui::Windows { _parentWidget.window.classification = WindowClass::Null; _parentWidget.window.number = 0; - _parentWidget.widget_index = 0; + _parentWidget.widgetIndex = 0; colours[0] = COLOUR_GREY; colours[1] = COLOUR_GREY; @@ -83,7 +83,7 @@ namespace OpenRCT2::Ui::Windows { _parentWidget.window.classification = parentWindow->classification; _parentWidget.window.number = parentWindow->number; - _parentWidget.widget_index = widgetIndex; + _parentWidget.widgetIndex = widgetIndex; colours[0] = parentWindow->colours[1]; colours[1] = parentWindow->colours[1]; @@ -329,7 +329,7 @@ namespace OpenRCT2::Ui::Windows auto w = GetParentWindow(); if (w != nullptr) { - w->OnTextInput(_parentWidget.widget_index, _buffer); + w->OnTextInput(_parentWidget.widgetIndex, _buffer); } } } diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 55024abcf1..964cd8031c 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -153,7 +153,7 @@ namespace OpenRCT2::Ui::Windows { gTooltipCursor = screenCoords; gTooltipCloseTimeout = 0; - gTooltipWidget.window_classification = WindowClass::Null; + gTooltipWidget.windowClassification = WindowClass::Null; InputSetState(InputState::Normal); gInputFlags.unset(InputFlag::leftMousePressed); } @@ -190,16 +190,16 @@ namespace OpenRCT2::Ui::Windows result.args = Formatter(); result.args.Add(tooltipString); - gTooltipWidget.window_classification = widgetWindow->classification; - gTooltipWidget.window_number = widgetWindow->number; - gTooltipWidget.widget_index = widgetIndex; + gTooltipWidget.windowClassification = widgetWindow->classification; + gTooltipWidget.windowNumber = widgetWindow->number; + gTooltipWidget.widgetIndex = widgetIndex; } else { auto stringId = widget->tooltip; - gTooltipWidget.window_classification = widgetWindow->classification; - gTooltipWidget.window_number = widgetWindow->number; - gTooltipWidget.widget_index = widgetIndex; + gTooltipWidget.windowClassification = widgetWindow->classification; + gTooltipWidget.windowNumber = widgetWindow->number; + gTooltipWidget.widgetIndex = widgetIndex; result = widgetWindow->OnTooltip(widgetIndex, stringId); if (result.str == kStringIdNone) return; @@ -214,6 +214,6 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseByClass(WindowClass::Tooltip); gTooltipCloseTimeout = 0; - gTooltipWidget.window_classification = WindowClass::Null; + gTooltipWidget.windowClassification = WindowClass::Null; } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 8a74724e43..40af28e14f 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -105,7 +105,7 @@ namespace OpenRCT2 // ? gInputFlags.clearAll(); InputSetState(InputState::Reset); - gPressedWidget.window_classification = WindowClass::Null; + gPressedWidget.windowClassification = WindowClass::Null; gPickupPeepImage = ImageId(); ResetTooltipNotShown(); gMapSelectFlags.clearAll(); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 47bf951117..83bbdb5013 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -629,22 +629,22 @@ static constexpr float kWindowScrollLocations[][2] = { bool isToolActive(WindowClass cls) { - return gInputFlags.has(InputFlag::toolActive) && gCurrentToolWidget.window_classification == cls; + return gInputFlags.has(InputFlag::toolActive) && gCurrentToolWidget.windowClassification == cls; } bool isToolActive(WindowClass cls, rct_windownumber number) { - return isToolActive(cls) && gCurrentToolWidget.window_number == number; + return isToolActive(cls) && gCurrentToolWidget.windowNumber == number; } bool isToolActive(WindowClass cls, WidgetIndex widgetIndex) { - return isToolActive(cls) && gCurrentToolWidget.widget_index == widgetIndex; + return isToolActive(cls) && gCurrentToolWidget.widgetIndex == widgetIndex; } bool isToolActive(WindowClass cls, WidgetIndex widgetIndex, rct_windownumber number) { - return isToolActive(cls, widgetIndex) && gCurrentToolWidget.window_number == number; + return isToolActive(cls, widgetIndex) && gCurrentToolWidget.windowNumber == number; } bool isToolActive(const WindowBase& w, WidgetIndex widgetIndex) @@ -664,8 +664,8 @@ static constexpr float kWindowScrollLocations[][2] = { { if (gInputFlags.has(InputFlag::toolActive)) { - if (w.classification == gCurrentToolWidget.window_classification && w.number == gCurrentToolWidget.window_number - && widgetIndex == gCurrentToolWidget.widget_index) + if (w.classification == gCurrentToolWidget.windowClassification && w.number == gCurrentToolWidget.windowNumber + && widgetIndex == gCurrentToolWidget.widgetIndex) { ToolCancel(); return true; @@ -678,9 +678,9 @@ static constexpr float kWindowScrollLocations[][2] = { gInputFlags.unset(InputFlag::leftMousePressed); gInputFlags.unset(InputFlag::unk6); gCurrentToolId = tool; - gCurrentToolWidget.window_classification = w.classification; - gCurrentToolWidget.window_number = w.number; - gCurrentToolWidget.widget_index = widgetIndex; + gCurrentToolWidget.windowClassification = w.classification; + gCurrentToolWidget.windowNumber = w.number; + gCurrentToolWidget.widgetIndex = widgetIndex; return false; } @@ -700,20 +700,19 @@ static constexpr float kWindowScrollLocations[][2] = { // Reset map selection gMapSelectFlags.clearAll(); - if (gCurrentToolWidget.widget_index != kWidgetIndexNull) + if (gCurrentToolWidget.widgetIndex != kWidgetIndexNull) { auto* windowMgr = Ui::GetWindowManager(); // Invalidate tool widget windowMgr->InvalidateWidgetByNumber( - gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number, - gCurrentToolWidget.widget_index); + gCurrentToolWidget.windowClassification, gCurrentToolWidget.windowNumber, gCurrentToolWidget.widgetIndex); // Abort tool event WindowBase* w = windowMgr->FindByNumber( - gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); + gCurrentToolWidget.windowClassification, gCurrentToolWidget.windowNumber); if (w != nullptr) - w->OnToolAbort(gCurrentToolWidget.widget_index); + w->OnToolAbort(gCurrentToolWidget.widgetIndex); } } } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 8c896b3e13..f300a33ce5 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -47,7 +47,7 @@ namespace OpenRCT2 struct WidgetIdentifier { WindowIdentifier window; - WidgetIndex widget_index; + WidgetIndex widgetIndex; }; extern WindowCloseModifier gLastCloseModifier; @@ -266,9 +266,9 @@ namespace OpenRCT2 { struct WidgetRef { - WindowClass window_classification; - rct_windownumber window_number; - WidgetIndex widget_index; + WindowClass windowClassification; + rct_windownumber windowNumber; + WidgetIndex widgetIndex; }; extern Tool gCurrentToolId;