diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index b10955b7f..37554ad27 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -427,7 +427,7 @@ QuickSpellPanel::QuickSpellPanel(BattleInterface & owner) { OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE); - addUsedEvents(LCLICK | SHOW_POPUP | MOVE | INPUT_MODUS_CHANGE); + addUsedEvents(LCLICK | SHOW_POPUP | MOVE | INPUT_MODE_CHANGE); pos = Rect(0, 0, 52, 600); background = std::make_shared(ImagePath::builtin("DIBOXBCK"), pos); @@ -483,7 +483,7 @@ void QuickSpellPanel::create() { buttonsDisabled.push_back(std::make_shared(Rect(2, 7 + 50 * i, 48, 36), ColorRGBA(0, 0, 0, 172))); } - if(GH.input().getCurrentInputModus() == InputModus::MOUSE) + if(GH.input().getCurrentInputMode() == InputMode::MOUSE) labels.push_back(std::make_shared(7, 10 + 50 * i, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, config["keyboard"]["battleSpellShortcut" + std::to_string(i)].String())); buttons.push_back(button); @@ -496,7 +496,7 @@ void QuickSpellPanel::show(Canvas & to) CIntObject::show(to); } -void QuickSpellPanel::inputModusChanged(InputModus modi) +void QuickSpellPanel::inputModeChanged(InputMode modi) { create(); redraw(); diff --git a/client/battle/BattleInterfaceClasses.h b/client/battle/BattleInterfaceClasses.h index cd49f9f81..a9cc930f0 100644 --- a/client/battle/BattleInterfaceClasses.h +++ b/client/battle/BattleInterfaceClasses.h @@ -167,7 +167,7 @@ public: void create(); void show(Canvas & to) override; - void inputModusChanged(InputModus modi) override; + void inputModeChanged(InputMode modi) override; }; class HeroInfoBasicPanel : public CIntObject //extracted from InfoWindow to fit better as non-popup embed element diff --git a/client/eventsSDL/InputHandler.cpp b/client/eventsSDL/InputHandler.cpp index 0b71bea57..4035753ac 100644 --- a/client/eventsSDL/InputHandler.cpp +++ b/client/eventsSDL/InputHandler.cpp @@ -37,7 +37,7 @@ InputHandler::InputHandler() : enableMouse(settings["input"]["enableMouse"].Bool()) , enableTouch(settings["input"]["enableTouch"].Bool()) , enableController(settings["input"]["enableController"].Bool()) - , currentInputModus(InputModus::MOUSE) + , currentInputMode(InputMode::MOUSE) , mouseHandler(std::make_unique()) , keyboardHandler(std::make_unique()) , fingerHandler(std::make_unique()) @@ -62,14 +62,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) case SDL_MOUSEMOTION: if (enableMouse) { - setCurrentInputModus(InputModus::MOUSE); + setCurrentInputMode(InputMode::MOUSE); mouseHandler->handleEventMouseMotion(current.motion); } return; case SDL_MOUSEBUTTONDOWN: if (enableMouse) { - setCurrentInputModus(InputModus::MOUSE); + setCurrentInputMode(InputMode::MOUSE); mouseHandler->handleEventMouseButtonDown(current.button); } return; @@ -91,14 +91,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) case SDL_FINGERMOTION: if (enableTouch) { - setCurrentInputModus(InputModus::TOUCH); + setCurrentInputMode(InputMode::TOUCH); fingerHandler->handleEventFingerMotion(current.tfinger); } return; case SDL_FINGERDOWN: if (enableTouch) { - setCurrentInputModus(InputModus::TOUCH); + setCurrentInputMode(InputMode::TOUCH); fingerHandler->handleEventFingerDown(current.tfinger); } return; @@ -109,14 +109,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) case SDL_CONTROLLERAXISMOTION: if (enableController) { - setCurrentInputModus(InputModus::CONTROLLER); + setCurrentInputMode(InputMode::CONTROLLER); gameControllerHandler->handleEventAxisMotion(current.caxis); } return; case SDL_CONTROLLERBUTTONDOWN: if (enableController) { - setCurrentInputModus(InputModus::CONTROLLER); + setCurrentInputMode(InputMode::CONTROLLER); gameControllerHandler->handleEventButtonDown(current.cbutton); } return; @@ -127,18 +127,18 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current) } } -void InputHandler::setCurrentInputModus(InputModus modi) +void InputHandler::setCurrentInputMode(InputMode modi) { - if(currentInputModus != modi) + if(currentInputMode != modi) { - currentInputModus = modi; - GH.events().dispatchInputModusChanged(modi); + currentInputMode = modi; + GH.events().dispatchInputModeChanged(modi); } } -InputModus InputHandler::getCurrentInputModus() +InputMode InputHandler::getCurrentInputMode() { - return currentInputModus; + return currentInputMode; } std::vector InputHandler::acquireEvents() @@ -368,7 +368,7 @@ void InputHandler::stopTextInput() void InputHandler::hapticFeedback() { - if(currentInputModus == InputModus::TOUCH) + if(currentInputMode == InputMode::TOUCH) fingerHandler->hapticFeedback(); } diff --git a/client/eventsSDL/InputHandler.h b/client/eventsSDL/InputHandler.h index 73c81ab5b..5d6d82ec4 100644 --- a/client/eventsSDL/InputHandler.h +++ b/client/eventsSDL/InputHandler.h @@ -23,7 +23,7 @@ class InputSourceTouch; class InputSourceText; class InputSourceGameController; -enum class InputModus +enum class InputMode { MOUSE, TOUCH, @@ -41,8 +41,8 @@ class InputHandler const bool enableTouch; const bool enableController; - InputModus currentInputModus; - void setCurrentInputModus(InputModus modi); + InputMode currentInputMode; + void setCurrentInputMode(InputMode modi); std::vector acquireEvents(); @@ -102,5 +102,5 @@ public: bool isKeyboardCtrlDown() const; bool isKeyboardShiftDown() const; - InputModus getCurrentInputModus(); + InputMode getCurrentInputMode(); }; diff --git a/client/gui/EventDispatcher.cpp b/client/gui/EventDispatcher.cpp index 3fe923a50..0518d305f 100644 --- a/client/gui/EventDispatcher.cpp +++ b/client/gui/EventDispatcher.cpp @@ -41,7 +41,7 @@ void EventDispatcher::processLists(ui16 activityFlag, const Functor & cb) processList(AEventsReceiver::DOUBLECLICK, doubleClickInterested); processList(AEventsReceiver::TEXTINPUT, textInterested); processList(AEventsReceiver::GESTURE, panningInterested); - processList(AEventsReceiver::INPUT_MODUS_CHANGE, inputModusChangeInterested); + processList(AEventsReceiver::INPUT_MODE_CHANGE, inputModeChangeInterested); } void EventDispatcher::activateElement(AEventsReceiver * elem, ui16 activityFlag) @@ -318,11 +318,11 @@ void EventDispatcher::dispatchTextEditing(const std::string & text) } } -void EventDispatcher::dispatchInputModusChanged(const InputModus & modi) +void EventDispatcher::dispatchInputModeChanged(const InputMode & modi) { - for(auto it : inputModusChangeInterested) + for(auto it : inputModeChangeInterested) { - it->inputModusChanged(modi); + it->inputModeChanged(modi); } } diff --git a/client/gui/EventDispatcher.h b/client/gui/EventDispatcher.h index 51c6eee5a..cd61a6b0c 100644 --- a/client/gui/EventDispatcher.h +++ b/client/gui/EventDispatcher.h @@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_END class AEventsReceiver; enum class MouseButton; enum class EShortcut; -enum class InputModus; +enum class InputMode; /// Class that receives events from event producers and dispatches it to UI elements that are interested in this event class EventDispatcher @@ -35,7 +35,7 @@ class EventDispatcher EventReceiversList doubleClickInterested; EventReceiversList textInterested; EventReceiversList panningInterested; - EventReceiversList inputModusChangeInterested; + EventReceiversList inputModeChangeInterested; void handleLeftButtonClick(const Point & position, int tolerance, bool isPressed); void handleDoubleButtonClick(const Point & position, int tolerance); @@ -79,5 +79,5 @@ public: void dispatchTextInput(const std::string & text); void dispatchTextEditing(const std::string & text); - void dispatchInputModusChanged(const InputModus & modi); + void dispatchInputModeChanged(const InputMode & modi); }; diff --git a/client/gui/EventsReceiver.h b/client/gui/EventsReceiver.h index c9d553fb3..6727dec87 100644 --- a/client/gui/EventsReceiver.h +++ b/client/gui/EventsReceiver.h @@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_END class EventDispatcher; enum class EShortcut; -enum class InputModus; +enum class InputMode; /// Class that is capable of subscribing and receiving input events /// Acts as base class for all UI elements @@ -76,7 +76,7 @@ public: virtual void tick(uint32_t msPassed) {} - virtual void inputModusChanged(InputModus modi) {} + virtual void inputModeChanged(InputMode modi) {} public: AEventsReceiver(); @@ -97,7 +97,7 @@ public: TEXTINPUT = 512, GESTURE = 1024, DRAG = 2048, - INPUT_MODUS_CHANGE = 4096 + INPUT_MODE_CHANGE = 4096 }; /// Returns true if element is currently hovered by mouse diff --git a/client/windows/CTutorialWindow.cpp b/client/windows/CTutorialWindow.cpp index 555e21120..6677bf057 100644 --- a/client/windows/CTutorialWindow.cpp +++ b/client/windows/CTutorialWindow.cpp @@ -67,7 +67,7 @@ void CTutorialWindow::setContent() void CTutorialWindow::openWindowFirstTime(const TutorialMode & m) { - if(GH.input().getCurrentInputModus() == InputModus::TOUCH && !persistentStorage["gui"]["tutorialCompleted" + std::to_string(m)].Bool()) + if(GH.input().getCurrentInputMode() == InputMode::TOUCH && !persistentStorage["gui"]["tutorialCompleted" + std::to_string(m)].Bool()) { if(LOCPLINT) LOCPLINT->showingDialog->setBusy();