1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

change naming

This commit is contained in:
Laserlicht
2024-07-19 03:44:45 +02:00
parent fb980bdb74
commit 26b164b7ca
7 changed files with 32 additions and 32 deletions

View File

@ -427,7 +427,7 @@ QuickSpellPanel::QuickSpellPanel(BattleInterface & owner)
{ {
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE); OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
addUsedEvents(LCLICK | SHOW_POPUP | MOVE | INPUT_MODI_CHANGE); addUsedEvents(LCLICK | SHOW_POPUP | MOVE | INPUT_MODUS_CHANGE);
pos = Rect(0, 0, 52, 600); pos = Rect(0, 0, 52, 600);
background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), pos); background = std::make_shared<CFilledTexture>(ImagePath::builtin("DIBOXBCK"), pos);
@ -483,7 +483,7 @@ void QuickSpellPanel::create()
{ {
buttonsDisabled.push_back(std::make_shared<TransparentFilledRectangle>(Rect(2, 7 + 50 * i, 48, 36), ColorRGBA(0, 0, 0, 172))); buttonsDisabled.push_back(std::make_shared<TransparentFilledRectangle>(Rect(2, 7 + 50 * i, 48, 36), ColorRGBA(0, 0, 0, 172)));
} }
if(GH.input().getCurrentInputModi() == InputModi::MOUSE) if(GH.input().getCurrentInputModus() == InputModus::MOUSE)
labels.push_back(std::make_shared<CLabel>(7, 10 + 50 * i, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, config["keyboard"]["battleSpellShortcut" + std::to_string(i)].String())); labels.push_back(std::make_shared<CLabel>(7, 10 + 50 * i, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, config["keyboard"]["battleSpellShortcut" + std::to_string(i)].String()));
buttons.push_back(button); buttons.push_back(button);
@ -496,7 +496,7 @@ void QuickSpellPanel::show(Canvas & to)
CIntObject::show(to); CIntObject::show(to);
} }
void QuickSpellPanel::inputModiChanged(InputModi modi) void QuickSpellPanel::inputModusChanged(InputModus modi)
{ {
create(); create();
redraw(); redraw();

View File

@ -167,7 +167,7 @@ public:
void create(); void create();
void show(Canvas & to) override; void show(Canvas & to) override;
void inputModiChanged(InputModi modi) override; void inputModusChanged(InputModus modi) override;
}; };
class HeroInfoBasicPanel : public CIntObject //extracted from InfoWindow to fit better as non-popup embed element class HeroInfoBasicPanel : public CIntObject //extracted from InfoWindow to fit better as non-popup embed element

View File

@ -37,7 +37,7 @@ InputHandler::InputHandler()
: enableMouse(settings["input"]["enableMouse"].Bool()) : enableMouse(settings["input"]["enableMouse"].Bool())
, enableTouch(settings["input"]["enableTouch"].Bool()) , enableTouch(settings["input"]["enableTouch"].Bool())
, enableController(settings["input"]["enableController"].Bool()) , enableController(settings["input"]["enableController"].Bool())
, currentInputModi(InputModi::MOUSE) , currentInputModus(InputModus::MOUSE)
, mouseHandler(std::make_unique<InputSourceMouse>()) , mouseHandler(std::make_unique<InputSourceMouse>())
, keyboardHandler(std::make_unique<InputSourceKeyboard>()) , keyboardHandler(std::make_unique<InputSourceKeyboard>())
, fingerHandler(std::make_unique<InputSourceTouch>()) , fingerHandler(std::make_unique<InputSourceTouch>())
@ -62,14 +62,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
if (enableMouse) if (enableMouse)
{ {
setCurrentInputModi(InputModi::MOUSE); setCurrentInputModus(InputModus::MOUSE);
mouseHandler->handleEventMouseMotion(current.motion); mouseHandler->handleEventMouseMotion(current.motion);
} }
return; return;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
if (enableMouse) if (enableMouse)
{ {
setCurrentInputModi(InputModi::MOUSE); setCurrentInputModus(InputModus::MOUSE);
mouseHandler->handleEventMouseButtonDown(current.button); mouseHandler->handleEventMouseButtonDown(current.button);
} }
return; return;
@ -91,14 +91,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
case SDL_FINGERMOTION: case SDL_FINGERMOTION:
if (enableTouch) if (enableTouch)
{ {
setCurrentInputModi(InputModi::TOUCH); setCurrentInputModus(InputModus::TOUCH);
fingerHandler->handleEventFingerMotion(current.tfinger); fingerHandler->handleEventFingerMotion(current.tfinger);
} }
return; return;
case SDL_FINGERDOWN: case SDL_FINGERDOWN:
if (enableTouch) if (enableTouch)
{ {
setCurrentInputModi(InputModi::TOUCH); setCurrentInputModus(InputModus::TOUCH);
fingerHandler->handleEventFingerDown(current.tfinger); fingerHandler->handleEventFingerDown(current.tfinger);
} }
return; return;
@ -109,14 +109,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
case SDL_CONTROLLERAXISMOTION: case SDL_CONTROLLERAXISMOTION:
if (enableController) if (enableController)
{ {
setCurrentInputModi(InputModi::CONTROLLER); setCurrentInputModus(InputModus::CONTROLLER);
gameControllerHandler->handleEventAxisMotion(current.caxis); gameControllerHandler->handleEventAxisMotion(current.caxis);
} }
return; return;
case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONDOWN:
if (enableController) if (enableController)
{ {
setCurrentInputModi(InputModi::CONTROLLER); setCurrentInputModus(InputModus::CONTROLLER);
gameControllerHandler->handleEventButtonDown(current.cbutton); gameControllerHandler->handleEventButtonDown(current.cbutton);
} }
return; return;
@ -127,18 +127,18 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
} }
} }
void InputHandler::setCurrentInputModi(InputModi modi) void InputHandler::setCurrentInputModus(InputModus modi)
{ {
if(currentInputModi != modi) if(currentInputModus != modi)
{ {
currentInputModi = modi; currentInputModus = modi;
GH.events().dispatchInputModiChanged(modi); GH.events().dispatchInputModusChanged(modi);
} }
} }
InputModi InputHandler::getCurrentInputModi() InputModus InputHandler::getCurrentInputModus()
{ {
return currentInputModi; return currentInputModus;
} }
std::vector<SDL_Event> InputHandler::acquireEvents() std::vector<SDL_Event> InputHandler::acquireEvents()
@ -368,7 +368,7 @@ void InputHandler::stopTextInput()
void InputHandler::hapticFeedback() void InputHandler::hapticFeedback()
{ {
if(currentInputModi == InputModi::TOUCH) if(currentInputModus == InputModus::TOUCH)
fingerHandler->hapticFeedback(); fingerHandler->hapticFeedback();
} }

View File

@ -23,7 +23,7 @@ class InputSourceTouch;
class InputSourceText; class InputSourceText;
class InputSourceGameController; class InputSourceGameController;
enum class InputModi enum class InputModus
{ {
MOUSE, MOUSE,
TOUCH, TOUCH,
@ -41,8 +41,8 @@ class InputHandler
const bool enableTouch; const bool enableTouch;
const bool enableController; const bool enableController;
InputModi currentInputModi; InputModus currentInputModus;
void setCurrentInputModi(InputModi modi); void setCurrentInputModus(InputModus modi);
std::vector<SDL_Event> acquireEvents(); std::vector<SDL_Event> acquireEvents();
@ -102,5 +102,5 @@ public:
bool isKeyboardCtrlDown() const; bool isKeyboardCtrlDown() const;
bool isKeyboardShiftDown() const; bool isKeyboardShiftDown() const;
InputModi getCurrentInputModi(); InputModus getCurrentInputModus();
}; };

View File

@ -41,7 +41,7 @@ void EventDispatcher::processLists(ui16 activityFlag, const Functor & cb)
processList(AEventsReceiver::DOUBLECLICK, doubleClickInterested); processList(AEventsReceiver::DOUBLECLICK, doubleClickInterested);
processList(AEventsReceiver::TEXTINPUT, textInterested); processList(AEventsReceiver::TEXTINPUT, textInterested);
processList(AEventsReceiver::GESTURE, panningInterested); processList(AEventsReceiver::GESTURE, panningInterested);
processList(AEventsReceiver::INPUT_MODI_CHANGE, inputModiChangeInterested); processList(AEventsReceiver::INPUT_MODUS_CHANGE, inputModusChangeInterested);
} }
void EventDispatcher::activateElement(AEventsReceiver * elem, ui16 activityFlag) void EventDispatcher::activateElement(AEventsReceiver * elem, ui16 activityFlag)
@ -318,11 +318,11 @@ void EventDispatcher::dispatchTextEditing(const std::string & text)
} }
} }
void EventDispatcher::dispatchInputModiChanged(const InputModi & modi) void EventDispatcher::dispatchInputModusChanged(const InputModus & modi)
{ {
for(auto it : inputModiChangeInterested) for(auto it : inputModusChangeInterested)
{ {
it->inputModiChanged(modi); it->inputModusChanged(modi);
} }
} }

View File

@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_END
class AEventsReceiver; class AEventsReceiver;
enum class MouseButton; enum class MouseButton;
enum class EShortcut; enum class EShortcut;
enum class InputModi; enum class InputModus;
/// Class that receives events from event producers and dispatches it to UI elements that are interested in this event /// Class that receives events from event producers and dispatches it to UI elements that are interested in this event
class EventDispatcher class EventDispatcher
@ -35,7 +35,7 @@ class EventDispatcher
EventReceiversList doubleClickInterested; EventReceiversList doubleClickInterested;
EventReceiversList textInterested; EventReceiversList textInterested;
EventReceiversList panningInterested; EventReceiversList panningInterested;
EventReceiversList inputModiChangeInterested; EventReceiversList inputModusChangeInterested;
void handleLeftButtonClick(const Point & position, int tolerance, bool isPressed); void handleLeftButtonClick(const Point & position, int tolerance, bool isPressed);
void handleDoubleButtonClick(const Point & position, int tolerance); void handleDoubleButtonClick(const Point & position, int tolerance);
@ -79,5 +79,5 @@ public:
void dispatchTextInput(const std::string & text); void dispatchTextInput(const std::string & text);
void dispatchTextEditing(const std::string & text); void dispatchTextEditing(const std::string & text);
void dispatchInputModiChanged(const InputModi & modi); void dispatchInputModusChanged(const InputModus & modi);
}; };

View File

@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_END
class EventDispatcher; class EventDispatcher;
enum class EShortcut; enum class EShortcut;
enum class InputModi; enum class InputModus;
/// Class that is capable of subscribing and receiving input events /// Class that is capable of subscribing and receiving input events
/// Acts as base class for all UI elements /// Acts as base class for all UI elements
@ -76,7 +76,7 @@ public:
virtual void tick(uint32_t msPassed) {} virtual void tick(uint32_t msPassed) {}
virtual void inputModiChanged(InputModi modi) {} virtual void inputModusChanged(InputModus modi) {}
public: public:
AEventsReceiver(); AEventsReceiver();
@ -97,7 +97,7 @@ public:
TEXTINPUT = 512, TEXTINPUT = 512,
GESTURE = 1024, GESTURE = 1024,
DRAG = 2048, DRAG = 2048,
INPUT_MODI_CHANGE = 4096 INPUT_MODUS_CHANGE = 4096
}; };
/// Returns true if element is currently hovered by mouse /// Returns true if element is currently hovered by mouse