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);
addUsedEvents(LCLICK | SHOW_POPUP | MOVE | INPUT_MODI_CHANGE);
addUsedEvents(LCLICK | SHOW_POPUP | MOVE | INPUT_MODUS_CHANGE);
pos = Rect(0, 0, 52, 600);
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)));
}
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()));
buttons.push_back(button);
@ -496,7 +496,7 @@ void QuickSpellPanel::show(Canvas & to)
CIntObject::show(to);
}
void QuickSpellPanel::inputModiChanged(InputModi modi)
void QuickSpellPanel::inputModusChanged(InputModus modi)
{
create();
redraw();

View File

@ -167,7 +167,7 @@ public:
void create();
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

View File

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

View File

@ -23,7 +23,7 @@ class InputSourceTouch;
class InputSourceText;
class InputSourceGameController;
enum class InputModi
enum class InputModus
{
MOUSE,
TOUCH,
@ -41,8 +41,8 @@ class InputHandler
const bool enableTouch;
const bool enableController;
InputModi currentInputModi;
void setCurrentInputModi(InputModi modi);
InputModus currentInputModus;
void setCurrentInputModus(InputModus modi);
std::vector<SDL_Event> acquireEvents();
@ -102,5 +102,5 @@ public:
bool isKeyboardCtrlDown() 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::TEXTINPUT, textInterested);
processList(AEventsReceiver::GESTURE, panningInterested);
processList(AEventsReceiver::INPUT_MODI_CHANGE, inputModiChangeInterested);
processList(AEventsReceiver::INPUT_MODUS_CHANGE, inputModusChangeInterested);
}
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;
enum class MouseButton;
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 EventDispatcher
@ -35,7 +35,7 @@ class EventDispatcher
EventReceiversList doubleClickInterested;
EventReceiversList textInterested;
EventReceiversList panningInterested;
EventReceiversList inputModiChangeInterested;
EventReceiversList inputModusChangeInterested;
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 dispatchInputModiChanged(const InputModi & modi);
void dispatchInputModusChanged(const InputModus & modi);
};

View File

@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_END
class EventDispatcher;
enum class EShortcut;
enum class InputModi;
enum class InputModus;
/// 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 inputModiChanged(InputModi modi) {}
virtual void inputModusChanged(InputModus modi) {}
public:
AEventsReceiver();
@ -97,7 +97,7 @@ public:
TEXTINPUT = 512,
GESTURE = 1024,
DRAG = 2048,
INPUT_MODI_CHANGE = 4096
INPUT_MODUS_CHANGE = 4096
};
/// Returns true if element is currently hovered by mouse