1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

changed naming

This commit is contained in:
Laserlicht
2024-07-19 11:41:00 +02:00
parent 68213eb5a0
commit ac30f7757b
8 changed files with 33 additions and 33 deletions

View File

@@ -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<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().getCurrentInputModus() == InputModus::MOUSE)
if(GH.input().getCurrentInputMode() == InputMode::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::inputModusChanged(InputModus modi)
void QuickSpellPanel::inputModeChanged(InputMode modi)
{
create();
redraw();

View File

@@ -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

View File

@@ -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<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)
{
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<SDL_Event> InputHandler::acquireEvents()
@@ -368,7 +368,7 @@ void InputHandler::stopTextInput()
void InputHandler::hapticFeedback()
{
if(currentInputModus == InputModus::TOUCH)
if(currentInputMode == InputMode::TOUCH)
fingerHandler->hapticFeedback();
}

View File

@@ -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<SDL_Event> acquireEvents();
@@ -102,5 +102,5 @@ public:
bool isKeyboardCtrlDown() const;
bool isKeyboardShiftDown() const;
InputModus getCurrentInputModus();
InputMode getCurrentInputMode();
};

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_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);
}
}

View File

@@ -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);
};

View File

@@ -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

View File

@@ -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();