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); 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); 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().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())); 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::inputModusChanged(InputModus modi) void QuickSpellPanel::inputModeChanged(InputMode 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 inputModusChanged(InputModus modi) override; void inputModeChanged(InputMode 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())
, currentInputModus(InputModus::MOUSE) , currentInputMode(InputMode::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)
{ {
setCurrentInputModus(InputModus::MOUSE); setCurrentInputMode(InputMode::MOUSE);
mouseHandler->handleEventMouseMotion(current.motion); mouseHandler->handleEventMouseMotion(current.motion);
} }
return; return;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
if (enableMouse) if (enableMouse)
{ {
setCurrentInputModus(InputModus::MOUSE); setCurrentInputMode(InputMode::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)
{ {
setCurrentInputModus(InputModus::TOUCH); setCurrentInputMode(InputMode::TOUCH);
fingerHandler->handleEventFingerMotion(current.tfinger); fingerHandler->handleEventFingerMotion(current.tfinger);
} }
return; return;
case SDL_FINGERDOWN: case SDL_FINGERDOWN:
if (enableTouch) if (enableTouch)
{ {
setCurrentInputModus(InputModus::TOUCH); setCurrentInputMode(InputMode::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)
{ {
setCurrentInputModus(InputModus::CONTROLLER); setCurrentInputMode(InputMode::CONTROLLER);
gameControllerHandler->handleEventAxisMotion(current.caxis); gameControllerHandler->handleEventAxisMotion(current.caxis);
} }
return; return;
case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONDOWN:
if (enableController) if (enableController)
{ {
setCurrentInputModus(InputModus::CONTROLLER); setCurrentInputMode(InputMode::CONTROLLER);
gameControllerHandler->handleEventButtonDown(current.cbutton); gameControllerHandler->handleEventButtonDown(current.cbutton);
} }
return; 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; currentInputMode = modi;
GH.events().dispatchInputModusChanged(modi); GH.events().dispatchInputModeChanged(modi);
} }
} }
InputModus InputHandler::getCurrentInputModus() InputMode InputHandler::getCurrentInputMode()
{ {
return currentInputModus; return currentInputMode;
} }
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(currentInputModus == InputModus::TOUCH) if(currentInputMode == InputMode::TOUCH)
fingerHandler->hapticFeedback(); fingerHandler->hapticFeedback();
} }

View File

@@ -23,7 +23,7 @@ class InputSourceTouch;
class InputSourceText; class InputSourceText;
class InputSourceGameController; class InputSourceGameController;
enum class InputModus enum class InputMode
{ {
MOUSE, MOUSE,
TOUCH, TOUCH,
@@ -41,8 +41,8 @@ class InputHandler
const bool enableTouch; const bool enableTouch;
const bool enableController; const bool enableController;
InputModus currentInputModus; InputMode currentInputMode;
void setCurrentInputModus(InputModus modi); void setCurrentInputMode(InputMode 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;
InputModus getCurrentInputModus(); InputMode getCurrentInputMode();
}; };

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_MODUS_CHANGE, inputModusChangeInterested); processList(AEventsReceiver::INPUT_MODE_CHANGE, inputModeChangeInterested);
} }
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::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; class AEventsReceiver;
enum class MouseButton; enum class MouseButton;
enum class EShortcut; 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 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 inputModusChangeInterested; EventReceiversList inputModeChangeInterested;
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 dispatchInputModusChanged(const InputModus & modi); void dispatchInputModeChanged(const InputMode & modi);
}; };

View File

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

View File

@@ -67,7 +67,7 @@ void CTutorialWindow::setContent()
void CTutorialWindow::openWindowFirstTime(const TutorialMode & m) 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) if(LOCPLINT)
LOCPLINT->showingDialog->setBusy(); LOCPLINT->showingDialog->setBusy();