From be32cbb4139ed7e10bf174c95ffec18c6db62103 Mon Sep 17 00:00:00 2001 From: Andrew Lanzone Date: Sat, 7 Jun 2025 22:51:29 -0700 Subject: [PATCH] Fix clang format issues --- apps/openmw/mwgui/alchemywindow.cpp | 3 ++- apps/openmw/mwgui/class.cpp | 4 ++-- apps/openmw/mwgui/confirmationdialog.cpp | 4 ++-- apps/openmw/mwgui/container.cpp | 11 ++++----- .../openmw/mwgui/controllerbuttonsoverlay.cpp | 3 ++- apps/openmw/mwgui/dialogue.cpp | 11 +++++---- apps/openmw/mwgui/inventorywindow.cpp | 24 ++++++++++++------- apps/openmw/mwgui/itemview.cpp | 4 ++-- apps/openmw/mwgui/journalwindow.cpp | 15 ++++++++---- apps/openmw/mwgui/levelupdialog.cpp | 2 +- apps/openmw/mwgui/mapwindow.cpp | 6 ++--- apps/openmw/mwgui/quickkeysmenu.cpp | 3 +-- apps/openmw/mwgui/recharge.cpp | 3 +-- apps/openmw/mwgui/repair.cpp | 3 +-- apps/openmw/mwgui/review.cpp | 8 +++---- apps/openmw/mwgui/savegamedialog.cpp | 11 +++++---- apps/openmw/mwgui/spellcreationdialog.cpp | 18 +++++--------- apps/openmw/mwgui/spellcreationdialog.hpp | 2 +- apps/openmw/mwgui/spellview.cpp | 2 +- apps/openmw/mwgui/spellview.hpp | 2 +- apps/openmw/mwgui/tradewindow.cpp | 8 +++---- apps/openmw/mwgui/windowmanagerimp.cpp | 9 ++++--- apps/openmw/mwinput/controllermanager.cpp | 4 +--- 23 files changed, 80 insertions(+), 80 deletions(-) diff --git a/apps/openmw/mwgui/alchemywindow.cpp b/apps/openmw/mwgui/alchemywindow.cpp index f79abf11c5..074250985c 100644 --- a/apps/openmw/mwgui/alchemywindow.cpp +++ b/apps/openmw/mwgui/alchemywindow.cpp @@ -552,7 +552,8 @@ namespace MWGui bool AlchemyWindow::onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) { MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget(); - bool isFilterListOpen = focus != nullptr && focus->getParent() != nullptr && focus->getParent()->getParent() == mFilterValue; + bool isFilterListOpen + = focus != nullptr && focus->getParent() != nullptr && focus->getParent()->getParent() == mFilterValue; if (isFilterListOpen) { diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp index f0fe5537da..730ade1615 100644 --- a/apps/openmw/mwgui/class.cpp +++ b/apps/openmw/mwgui/class.cpp @@ -91,8 +91,8 @@ namespace MWGui { onBackClicked(mBackButton); } - else if ((arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT && mOkButtonFocus) || - (arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT && !mOkButtonFocus)) + else if ((arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT && mOkButtonFocus) + || (arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT && !mOkButtonFocus)) { mOkButtonFocus = !mOkButtonFocus; mOkButton->setStateSelected(mOkButtonFocus); diff --git a/apps/openmw/mwgui/confirmationdialog.cpp b/apps/openmw/mwgui/confirmationdialog.cpp index 36b01112e5..f858b9628a 100644 --- a/apps/openmw/mwgui/confirmationdialog.cpp +++ b/apps/openmw/mwgui/confirmationdialog.cpp @@ -86,8 +86,8 @@ namespace MWGui { onCancelButtonClicked(mCancelButton); } - else if ((arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT && !mOkButtonFocus) || - (arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT && mOkButtonFocus)) + else if ((arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT && !mOkButtonFocus) + || (arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT && mOkButtonFocus)) { mOkButtonFocus = !mOkButtonFocus; mOkButton->setStateSelected(mOkButtonFocus); diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 9fe098f6d5..0be99d38a0 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -127,8 +127,7 @@ namespace MWGui if (!onTakeItem(item, count)) return; - MWGui::InventoryWindow* inventoryWindow - = MWBase::Environment::get().getWindowManager()->getInventoryWindow(); + MWGui::InventoryWindow* inventoryWindow = MWBase::Environment::get().getWindowManager()->getInventoryWindow(); ItemModel* playerModel = inventoryWindow->getModel(); mModel->moveItem(item, count, playerModel); @@ -385,11 +384,9 @@ namespace MWGui if (mDisposeCorpseButton->getVisible()) onDisposeCorpseButtonClicked(mDisposeCorpseButton); } - else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) + else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK || arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP + || arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT + || arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) { mItemView->onControllerButton(arg.button); } diff --git a/apps/openmw/mwgui/controllerbuttonsoverlay.cpp b/apps/openmw/mwgui/controllerbuttonsoverlay.cpp index f4b35ac4de..96438fa583 100644 --- a/apps/openmw/mwgui/controllerbuttonsoverlay.cpp +++ b/apps/openmw/mwgui/controllerbuttonsoverlay.cpp @@ -75,7 +75,8 @@ namespace MWGui setVisible(buttonCount > 0); } - int ControllerButtonsOverlay::updateButton(MyGUI::TextBox* text, MyGUI::ImageBox* image, const std::string& buttonStr) + int ControllerButtonsOverlay::updateButton( + MyGUI::TextBox* text, MyGUI::ImageBox* image, const std::string& buttonStr) { if (buttonStr.length() > 0) { diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index d409cd8856..5c325a52d3 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -603,10 +603,10 @@ namespace MWGui void DialogueWindow::updateTopicsPane() { - const std::string focusedTopic = - Settings::gui().mControllerMenus && mControllerFocus < mTopicsList->getItemCount() - ? mTopicsList->getItemNameAt(mControllerFocus) - : ""; + const std::string focusedTopic + = Settings::gui().mControllerMenus && mControllerFocus < mTopicsList->getItemCount() + ? mTopicsList->getItemNameAt(mControllerFocus) + : ""; mTopicsList->clear(); for (auto& linkPair : mTopicLinks) @@ -931,7 +931,8 @@ namespace MWGui { mGoodbyeButton->setStateSelected(focused); } - else { + else + { std::string keyword = mTopicsList->getItemNameAt(mControllerFocus); if (keyword.length() == 0) return; diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index b735d89cf8..fd06286a6c 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -941,15 +941,19 @@ namespace MWGui else if (mGuiMode == MWGui::GM_Companion && mDragAndDrop->mIsOnDragAndDrop) { // Drag and drop the item on the companion's window. - MWGui::CompanionWindow* companionWindow = - (MWGui::CompanionWindow *)MWBase::Environment::get().getWindowManager()->getGuiModeWindows(mGuiMode).at(0); + MWGui::CompanionWindow* companionWindow = (MWGui::CompanionWindow*)MWBase::Environment::get() + .getWindowManager() + ->getGuiModeWindows(mGuiMode) + .at(0); mDragAndDrop->drop(companionWindow->getModel(), companionWindow->getItemView()); } else if (mGuiMode == MWGui::GM_Container && mDragAndDrop->mIsOnDragAndDrop) { // Drag and drop the item on the container window. - MWGui::ContainerWindow* containerWindow = - (MWGui::ContainerWindow *)MWBase::Environment::get().getWindowManager()->getGuiModeWindows(mGuiMode).at(0); + MWGui::ContainerWindow* containerWindow = (MWGui::ContainerWindow*)MWBase::Environment::get() + .getWindowManager() + ->getGuiModeWindows(mGuiMode) + .at(0); mDragAndDrop->drop(containerWindow->getModel(), containerWindow->getItemView()); } // GM_Barter is handled by onControllerButtonEvent. No other steps are necessary. @@ -967,16 +971,20 @@ namespace MWGui { // Take all. Pass the button press to the container window and let it do the // logic of taking all. - MWGui::ContainerWindow* containerWindow = - (MWGui::ContainerWindow *)MWBase::Environment::get().getWindowManager()->getGuiModeWindows(mGuiMode).at(0); + MWGui::ContainerWindow* containerWindow = (MWGui::ContainerWindow*)MWBase::Environment::get() + .getWindowManager() + ->getGuiModeWindows(mGuiMode) + .at(0); containerWindow->onControllerButtonEvent(arg); } else if (mGuiMode == MWGui::GM_Barter) { // Offer. Pass the button press to the barter window and let it do the logic // of making an offer. - MWGui::TradeWindow* tradeWindow = - (MWGui::TradeWindow*)MWBase::Environment::get().getWindowManager()->getGuiModeWindows(mGuiMode).at(1); + MWGui::TradeWindow* tradeWindow = (MWGui::TradeWindow*)MWBase::Environment::get() + .getWindowManager() + ->getGuiModeWindows(mGuiMode) + .at(1); tradeWindow->onControllerButtonEvent(arg); } } diff --git a/apps/openmw/mwgui/itemview.cpp b/apps/openmw/mwgui/itemview.cpp index 3d8cf91f8a..464cec5800 100644 --- a/apps/openmw/mwgui/itemview.cpp +++ b/apps/openmw/mwgui/itemview.cpp @@ -268,14 +268,14 @@ namespace MWGui if (prevFocus >= 0 && prevFocus < mItemCount) { - ItemWidget* prev = (ItemWidget *)dragArea->getChildAt(prevFocus); + ItemWidget* prev = (ItemWidget*)dragArea->getChildAt(prevFocus); if (prev) prev->setControllerFocus(false); } if (mControllerActiveWindow && newFocus >= 0 && newFocus < mItemCount) { - ItemWidget* focused = (ItemWidget *)dragArea->getChildAt(newFocus); + ItemWidget* focused = (ItemWidget*)dragArea->getChildAt(newFocus); if (focused) { focused->setControllerFocus(true); diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index bff4b66c72..77918f2a89 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -496,7 +496,8 @@ namespace MyGUI::Button* listItem = _list->getItemWidget(_list->getItemNameAt(i)); if (listItem) { - listItem->setTextColour(mButtons.size() == _selectedIndex ? MWGui::journalHeaderColour : MyGUI::Colour::Black); + listItem->setTextColour( + mButtons.size() == _selectedIndex ? MWGui::journalHeaderColour : MyGUI::Colour::Black); mButtons.push_back(listItem); } } @@ -737,8 +738,10 @@ namespace // Choose an index. Cyrillic capital A is a 0xd090 in UTF-8. // Words can not be started with characters 26 or 28. int russianOffset = 0xd090; - if (mSelectedIndex >= 26) russianOffset++; - if (mSelectedIndex >= 27) russianOffset++; // 27, not 28, because of skipping char 26 + if (mSelectedIndex >= 26) + russianOffset++; + if (mSelectedIndex >= 27) + russianOffset++; // 27, not 28, because of skipping char 26 notifyIndexLinkClicked(isRussian ? mSelectedIndex + russianOffset : mSelectedIndex + 'A'); } return true; @@ -776,7 +779,8 @@ namespace notifyCancel(getWidget(CancelBTN)); mQuestMode = false; } - else { + else + { // Show the quest overlay if viewing a journal entry or the topics if (!mOptionsMode) notifyOptions(getWidget(OptionsBTN)); @@ -793,7 +797,8 @@ namespace notifyCancel(getWidget(CancelBTN)); mQuestMode = false; } - else { + else + { // Show the topics overlay if viewing a journal entry or the quest list if (!mOptionsMode) notifyOptions(getWidget(OptionsBTN)); diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index de79e2a8b3..8b022258cf 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -387,7 +387,7 @@ namespace MWGui if (arg.button == SDL_CONTROLLER_BUTTON_A) { if (mControllerFocus >= 0 && mControllerFocus < mAttributeButtons.size()) - onAttributeClicked(mAttributeButtons[mControllerFocus]); + onAttributeClicked(mAttributeButtons[mControllerFocus]); MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Item Gold Up")); } else if (arg.button == SDL_CONTROLLER_BUTTON_X) diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 1c1920f0b2..fb2074570f 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -1440,14 +1440,12 @@ namespace MWGui { mNeedDoorMarkersUpdate = true; mLocalMap->setViewOffset( - MyGUI::IntPoint( - mLocalMap->getViewOffset().left + dx, mLocalMap->getViewOffset().top + dy)); + MyGUI::IntPoint(mLocalMap->getViewOffset().left + dx, mLocalMap->getViewOffset().top + dy)); } else { mGlobalMap->setViewOffset( - MyGUI::IntPoint( - mGlobalMap->getViewOffset().left + dx, mGlobalMap->getViewOffset().top + dy)); + MyGUI::IntPoint(mGlobalMap->getViewOffset().left + dx, mGlobalMap->getViewOffset().top + dy)); } } diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index daf49e1101..b834df83e2 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -469,8 +469,7 @@ namespace MWGui onQuickKeyButtonClicked(mKey[mControllerFocus].button); if (arg.button == SDL_CONTROLLER_BUTTON_B) onOkButtonClicked(mOkButton); - else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN) + else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP || arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN) mControllerFocus = (mControllerFocus + 5) % 10; else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT) { diff --git a/apps/openmw/mwgui/recharge.cpp b/apps/openmw/mwgui/recharge.cpp index bf71972d0d..cfe7fedc60 100644 --- a/apps/openmw/mwgui/recharge.cpp +++ b/apps/openmw/mwgui/recharge.cpp @@ -142,8 +142,7 @@ namespace MWGui bool Recharge::onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) { - if ((arg.button == SDL_CONTROLLER_BUTTON_A && !mGemBox->getVisible()) - || arg.button == SDL_CONTROLLER_BUTTON_Y) + if ((arg.button == SDL_CONTROLLER_BUTTON_A && !mGemBox->getVisible()) || arg.button == SDL_CONTROLLER_BUTTON_Y) { onSelectItem(mGemIcon); MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click")); diff --git a/apps/openmw/mwgui/repair.cpp b/apps/openmw/mwgui/repair.cpp index c1241f53f5..8dbac7ef48 100644 --- a/apps/openmw/mwgui/repair.cpp +++ b/apps/openmw/mwgui/repair.cpp @@ -156,8 +156,7 @@ namespace MWGui bool Repair::onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) { - if ((arg.button == SDL_CONTROLLER_BUTTON_A && !mToolBox->getVisible()) - || arg.button == SDL_CONTROLLER_BUTTON_Y) + if ((arg.button == SDL_CONTROLLER_BUTTON_A && !mToolBox->getVisible()) || arg.button == SDL_CONTROLLER_BUTTON_Y) { onSelectItem(mToolIcon); MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click")); diff --git a/apps/openmw/mwgui/review.cpp b/apps/openmw/mwgui/review.cpp index 003cdb49cb..dcaa49b1e2 100644 --- a/apps/openmw/mwgui/review.cpp +++ b/apps/openmw/mwgui/review.cpp @@ -542,7 +542,7 @@ namespace MWGui { if (arg.button == SDL_CONTROLLER_BUTTON_A) { - switch(mControllerFocus) + switch (mControllerFocus) { case 0: onNameClicked(mButtons[0]); @@ -573,15 +573,13 @@ namespace MWGui { onOkClicked(mButtons[5]); } - else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT) + else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP || arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT) { setControllerFocus(mButtons, mControllerFocus, false); mControllerFocus = wrap(mControllerFocus - 1, mButtons.size()); setControllerFocus(mButtons, mControllerFocus, true); } - else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) + else if (arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) { setControllerFocus(mButtons, mControllerFocus, false); mControllerFocus = wrap(mControllerFocus + 1, mButtons.size()); diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 7e9067b81a..61cbae81f0 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -163,10 +163,11 @@ namespace MWGui hour = 12; ESM::EpochTimeStamp currentDate = timeManager.getEpochTimeStamp(); - std::string daysPassed = Misc::StringUtils::format("#{Calendar:day} %i", timeManager.getTimeStamp().getDay()); + std::string daysPassed + = Misc::StringUtils::format("#{Calendar:day} %i", timeManager.getTimeStamp().getDay()); std::string_view formattedHour(pm ? "#{Calendar:pm}" : "#{Calendar:am}"); - std::string autoFilename - = Misc::StringUtils::format("%s - %i %s %i %s", daysPassed, currentDate.mDay, month, hour, formattedHour); + std::string autoFilename = Misc::StringUtils::format( + "%s - %i %s %i %s", daysPassed, currentDate.mDay, month, hour, formattedHour); mSaveNameEdit->setCaptionWithReplacing(autoFilename); } @@ -561,8 +562,8 @@ namespace MWGui winMgr->setKeyFocusWidget(mSaveList); winMgr->injectKeyPress(MyGUI::KeyCode::ArrowDown, 0, false); } - else if ((arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT && !mOkButtonFocus) || - (arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT && mOkButtonFocus)) + else if ((arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT && !mOkButtonFocus) + || (arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT && mOkButtonFocus)) { mOkButtonFocus = !mOkButtonFocus; mOkButton->setStateSelected(mOkButtonFocus); diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index 119a32ffea..5085464fdb 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -13,8 +13,8 @@ #include #include "../mwbase/environment.hpp" -#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/inputmanager.hpp" +#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/windowmanager.hpp" #include "../mwworld/class.hpp" @@ -550,10 +550,8 @@ namespace MWGui if (prevFocus >= 0 && prevFocus < mButtons.size()) { MyGUI::TextBox* button = mButtons[prevFocus]; - if (button == mMagnitudeMinValue || - button == mMagnitudeMaxValue || - button == mDurationValue || - button == mAreaValue) + if (button == mMagnitudeMinValue || button == mMagnitudeMaxValue || button == mDurationValue + || button == mAreaValue) { button->setTextColour(textColours.normal); } @@ -566,10 +564,8 @@ namespace MWGui if (newFocus >= 0 && newFocus < mButtons.size()) { MyGUI::TextBox* button = mButtons[newFocus]; - if (button == mMagnitudeMinValue || - button == mMagnitudeMaxValue || - button == mDurationValue || - button == mAreaValue) + if (button == mMagnitudeMinValue || button == mMagnitudeMaxValue || button == mDurationValue + || button == mAreaValue) { button->setTextColour(textColours.link); } @@ -744,7 +740,6 @@ namespace MWGui mSuccessChance->setCaption(MyGUI::utility::toString(intChance)); } - bool SpellCreationDialog::onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) { if (arg.button == SDL_CONTROLLER_BUTTON_B) @@ -761,7 +756,6 @@ namespace MWGui return EffectEditorBase::onControllerButtonEvent(arg); } - // ------------------------------------------------------------------------------------------------ EffectEditorBase::EffectEditorBase(Type type) @@ -856,7 +850,7 @@ namespace MWGui mEffectFocus = 0; mRightColumn = false; if (mAvailableButtons.size() > 0) - mAvailableButtons[0]->setStateSelected(true); + mAvailableButtons[0]->setStateSelected(true); } } diff --git a/apps/openmw/mwgui/spellcreationdialog.hpp b/apps/openmw/mwgui/spellcreationdialog.hpp index cbd57014ce..2a4f5dcbb3 100644 --- a/apps/openmw/mwgui/spellcreationdialog.hpp +++ b/apps/openmw/mwgui/spellcreationdialog.hpp @@ -1,8 +1,8 @@ #ifndef MWGUI_SPELLCREATION_H #define MWGUI_SPELLCREATION_H -#include #include +#include #include #include diff --git a/apps/openmw/mwgui/spellview.cpp b/apps/openmw/mwgui/spellview.cpp index 8a18eb440f..b05d0c0435 100644 --- a/apps/openmw/mwgui/spellview.cpp +++ b/apps/openmw/mwgui/spellview.cpp @@ -393,7 +393,7 @@ namespace MWGui void SpellView::updateControllerFocus(int prevFocus, int newFocus) { if (mButtons.empty()) - return; + return; if (prevFocus >= 0 && prevFocus < mButtons.size()) { diff --git a/apps/openmw/mwgui/spellview.hpp b/apps/openmw/mwgui/spellview.hpp index 5a22dcb4d9..234ce08626 100644 --- a/apps/openmw/mwgui/spellview.hpp +++ b/apps/openmw/mwgui/spellview.hpp @@ -95,7 +95,7 @@ namespace MWGui void adjustSpellWidget(const Spell& spell, SpellModel::ModelIndex index, MyGUI::Widget* widget); /// Keep a list of buttons for controller navigation and their index in the full list. - std::vector> mButtons; + std::vector> mButtons; /// Keep a list of group offsets for controller navigation std::vector mGroupIndices; diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index fbbd98cc31..f4f88dda04 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -733,11 +733,9 @@ namespace MWGui onFilterChanged(mFilterAll); MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click")); } - else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT || - arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) + else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK || arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP + || arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT + || arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) { mItemView->onControllerButton(arg.button); } diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 5b32cb8709..7ab909983e 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -898,7 +898,8 @@ namespace MWGui int activeIndex = std::clamp(mActiveControllerWindows[mode], 0, (int)state.mWindows.size() - 1); - Log(Debug::Debug) << "Getting active controller window: mode=" << mode << ", " << state.mWindows.size() << " window(s), activeIndex=" << activeIndex; + Log(Debug::Debug) << "Getting active controller window: mode=" << mode << ", " << state.mWindows.size() + << " window(s), activeIndex=" << activeIndex; // If the active window is no longer visible, find the next visible window. if (!state.mWindows[activeIndex]->isVisible()) @@ -1903,7 +1904,8 @@ namespace MWGui { // If using controller menus, don't persist changes to size of the stats or magic // windows. - if (Settings::gui().mControllerMenus && (window == (MyGUI::Window*)mStatsWindow || window == (MyGUI::Window*)mSpellWindow)) + if (Settings::gui().mControllerMenus + && (window == (MyGUI::Window*)mStatsWindow || window == (MyGUI::Window*)mSpellWindow)) return; const auto it = mTrackedWindows.find(window); @@ -2616,7 +2618,8 @@ namespace MWGui // setButtons will handle setting visibility based on if any buttons are defined. mControllerButtonsOverlay->setButtons(topWin->getControllerButtons()); - if (getMode() == GM_Inventory) { + if (getMode() == GM_Inventory) + { mInventoryTabsOverlay->setVisible(true); mInventoryTabsOverlay->setTab(mActiveControllerWindows[GM_Inventory]); } diff --git a/apps/openmw/mwinput/controllermanager.cpp b/apps/openmw/mwinput/controllermanager.cpp index ac2e07e0cc..b6994cc3d6 100644 --- a/apps/openmw/mwinput/controllermanager.cpp +++ b/apps/openmw/mwinput/controllermanager.cpp @@ -255,9 +255,7 @@ namespace MWInput { // When the inventory tooltip is visible, we don't actually want the A button to // act like a mouse button; it should act normally. - if (treatAsMouse - && arg.button == SDL_CONTROLLER_BUTTON_A - && winMgr->getControllerTooltip()) + if (treatAsMouse && arg.button == SDL_CONTROLLER_BUTTON_A && winMgr->getControllerTooltip()) treatAsMouse = false; mGamepadGuiCursorEnabled = topWin->isGamepadCursorAllowed();