diff options
Diffstat (limited to 'src/input')
43 files changed, 492 insertions, 288 deletions
diff --git a/src/input/inputactiondata.h b/src/input/inputactiondata.h index 71fafbaaf..1244c4bae 100644 --- a/src/input/inputactiondata.h +++ b/src/input/inputactiondata.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index e4c11fe2f..359f7ed27 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputactionoperators.cpp b/src/input/inputactionoperators.cpp index 08baa8566..44b4ded60 100644 --- a/src/input/inputactionoperators.cpp +++ b/src/input/inputactionoperators.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2015-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputactionoperators.h b/src/input/inputactionoperators.h index 9778481fb..0b472a864 100644 --- a/src/input/inputactionoperators.h +++ b/src/input/inputactionoperators.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2015-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputactionsortfunctor.h b/src/input/inputactionsortfunctor.h index f80b2ab79..eef65ed03 100644 --- a/src/input/inputactionsortfunctor.h +++ b/src/input/inputactionsortfunctor.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputfunction.h b/src/input/inputfunction.h index d20d9a7e7..ad266fb8d 100644 --- a/src/input/inputfunction.h +++ b/src/input/inputfunction.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputitem.h b/src/input/inputitem.h index dd2470cc3..de93336e5 100644 --- a/src/input/inputitem.h +++ b/src/input/inputitem.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index a379e0e86..fd850637c 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,6 +57,7 @@ #include "utils/checkutils.h" #include "utils/foreach.h" #include "utils/gettext.h" +#include "utils/performance.h" #include "utils/stdmove.h" #include "utils/timer.h" @@ -416,8 +417,45 @@ std::string InputManager::getKeyStringLong(const InputActionT index) const } else if (key.type == InputType::JOYSTICK) { - // TRANSLATORS: long joystick button name. must be short. - str = strprintf(_("JButton%d"), key.value + 1); + if (key.value < Joystick::MAX_BUTTONS) + { + // TRANSLATORS: joystick button name. must be short. + str = strprintf(_("JButton%d"), key.value + 1); + } + else if (key.value == Joystick::KEY_UP) + { + // TRANSLATORS: joystick up button. must be short. + str = _("JUp"); + } + else if (key.value == Joystick::KEY_DOWN) + { + // TRANSLATORS: joystick down button. must be short. + str = _("JDown"); + } + else if (key.value == Joystick::KEY_LEFT) + { + // TRANSLATORS: joystick left button. must be short. + str = _("JLeft"); + } + else if (key.value == Joystick::KEY_RIGHT) + { + // TRANSLATORS: joystick right button. must be short. + str = _("JRight"); + } + else if (key.value >= Joystick::KEY_NEGATIVE_AXIS_FIRST + && key.value < Joystick::KEY_POSITIVE_AXIS_FIRST) + { + // TRANSLATORS: joystick negative axis. must be short. + str = strprintf(_("JAxis%dMinus"), + key.value - Joystick::KEY_NEGATIVE_AXIS_FIRST); + } + else if (key.value >= Joystick::KEY_POSITIVE_AXIS_FIRST + && key.value < Joystick::KEY_END) + { + // TRANSLATORS: joystick positive axis. must be short. + str = strprintf(_("JAxis%dPlus"), + key.value - Joystick::KEY_POSITIVE_AXIS_FIRST); + } } if (!str.empty()) { @@ -459,8 +497,45 @@ void InputManager::updateKeyString(const InputFunction &ki, } else if (key.type == InputType::JOYSTICK) { - // TRANSLATORS: short joystick button name. muse be very short - str = strprintf(_("JB%d"), key.value + 1); + if (key.value < Joystick::MAX_BUTTONS) + { + // TRANSLATORS: joystick button name. must be very short + str = strprintf(_("JB%d"), key.value + 1); + } + else if (key.value == Joystick::KEY_UP) + { + // TRANSLATORS: joystick up button. must be very short + str = _("JUp"); + } + else if (key.value == Joystick::KEY_DOWN) + { + // TRANSLATORS: joystick down button. must be very short + str = _("JDn"); + } + else if (key.value == Joystick::KEY_LEFT) + { + // TRANSLATORS: joystick left button. must be very short + str = _("JLt"); + } + else if (key.value == Joystick::KEY_RIGHT) + { + // TRANSLATORS: joystick right button. must be very short + str = _("JRt"); + } + else if (key.value >= Joystick::KEY_NEGATIVE_AXIS_FIRST + && key.value < Joystick::KEY_POSITIVE_AXIS_FIRST) + { + // TRANSLATORS: joystick negative axis. must be very short. + str = strprintf(_("JA%d-"), + key.value - Joystick::KEY_NEGATIVE_AXIS_FIRST); + } + else if (key.value >= Joystick::KEY_POSITIVE_AXIS_FIRST + && key.value < Joystick::KEY_END) + { + // TRANSLATORS: joystick positive axis. must be very short. + str = strprintf(_("JA%d+"), + key.value - Joystick::KEY_POSITIVE_AXIS_FIRST); + } } if (!str.empty()) { @@ -617,21 +692,7 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 BLOCK_END("InputManager::handleEvent") return true; } - keyboard.handleActivateKey(event); - // send straight to gui for certain windows -#ifndef DYECMD - if ((quitDialog != nullptr) || TextDialog::isActive()) - { - if (guiInput != nullptr) - guiInput->pushInput(event); - if (gui != nullptr) - gui->handleInput(); - BLOCK_END("InputManager::handleEvent") - return true; - } -#endif // DYECMD - break; } case SDL_KEYUP: @@ -650,10 +711,13 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 break; } case SDL_JOYBUTTONDOWN: + case SDL_JOYHATMOTION: + case SDL_JOYAXISMOTION: { updateConditionMask(true); // joystick.handleActicateButton(event); - if (handleAssignKey(event, InputType::JOYSTICK)) + if (joystick != nullptr && joystick->isActionEvent(event) + && handleAssignKey(event, InputType::JOYSTICK)) { BLOCK_END("InputManager::handleEvent") return true; @@ -690,8 +754,16 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 guiInput->pushInput(event); if (gui != nullptr) { - const bool res = gui->handleInput(); - if (res && event.type == SDL_KEYDOWN) + bool res = gui->handleInput(); +#ifndef DYECMD + // always treat keyboard input as handled if a text dialog is active + if (event.type == SDL_KEYDOWN && TextDialog::isActive()) + res = true; +#endif // DYECMD + const bool joystickActionEvent = + joystick != nullptr && joystick->isActionEvent(event); + // stop processing input if event is consumed by the gui + if (res && (event.type == SDL_KEYDOWN || joystickActionEvent)) { BLOCK_END("InputManager::handleEvent") return true; @@ -724,6 +796,8 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 // break; case SDL_JOYBUTTONDOWN: + case SDL_JOYHATMOTION: + case SDL_JOYAXISMOTION: if ((joystick != nullptr) && joystick->validate()) { if (triggerAction(joystick->getActionVector(event))) @@ -1055,7 +1129,6 @@ InputActionT InputManager::getKeyIndex(const int value, InputActionT InputManager::getActionByKey(const SDL_Event &restrict event) const restrict2 { - // for now support only keyboard events if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP) { const InputActionT idx = keyboard.getActionId(event); @@ -1065,6 +1138,15 @@ InputActionT InputManager::getActionByKey(const SDL_Event &restrict event) return idx; } } + if (joystick != nullptr && joystick->isActionEvent(event)) + { + const InputActionT idx = joystick->getActionId(event); + if (CAST_S32(idx) >= 0 && + checkKey(&inputActionData[CAST_SIZE(idx)])) + { + return idx; + } + } return InputAction::NO_VALUE; } diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index bfe5a2bdd..98fe29c95 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index 52d9a7525..b6bfe9a74 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include "input/inputmanager.h" #include "utils/foreach.h" +#include "utils/performance.h" #include "utils/timer.h" PRAGMA48(GCC diagnostic push) @@ -47,21 +48,24 @@ bool Joystick::mInitialized = false; Joystick::Joystick(const int no) : mDirection(0), + mHatPosition(0), mJoystick(nullptr), - mUpTolerance(0), - mDownTolerance(0), - mLeftTolerance(0), - mRightTolerance(0), - mCalibrating(false), + mTolerance(0), mNumber(no >= joystickCount ? joystickCount : no), - mCalibrated(false), + mAxesNumber(MAX_AXES), mButtonsNumber(MAX_BUTTONS), + mUseHatForMovement(true), mUseInactive(false), mHaveHats(false), mKeyToAction(), mKeyToId(), mKeyTimeMap() { + for (int i = 0; i < MAX_AXES; i++) + { + mIsTrigger[i] = false; + mAxesPositions[i] = 0; + } for (int i = 0; i < MAX_BUTTONS; i++) mActiveButtons[i] = false; } @@ -130,7 +134,9 @@ bool Joystick::open() return false; } + mAxesNumber = SDL_JoystickNumAxes(mJoystick); mButtonsNumber = SDL_JoystickNumButtons(mJoystick); + logger->log("Joystick: %i ", mNumber); #ifdef USE_SDL2 logger->log("Name: %s", SDL_JoystickName(mJoystick)); @@ -189,32 +195,31 @@ bool Joystick::open() logger->log("Name: %s", SDL_JoystickName(mNumber)); #endif // USE_SDL2 - logger->log("Axes: %i ", SDL_JoystickNumAxes(mJoystick)); + logger->log("Axes: %i ", mAxesNumber); logger->log("Balls: %i", SDL_JoystickNumBalls(mJoystick)); logger->log("Hats: %i", SDL_JoystickNumHats(mJoystick)); logger->log("Buttons: %i", mButtonsNumber); mHaveHats = (SDL_JoystickNumHats(mJoystick) > 0); + if (mAxesNumber > MAX_AXES) + mAxesNumber = mAxesNumber; + if (mButtonsNumber > MAX_BUTTONS) mButtonsNumber = MAX_BUTTONS; -#ifdef __SWITCH__ - config.setValue("joystick" + toString(mNumber) + "calibrated", true); - config.setValue("leftTolerance" + toString(mNumber), -10000); - config.setValue("rightTolerance" + toString(mNumber), 10000); - config.setValue("upTolerance" + toString(mNumber), -10000); - config.setValue("downTolerance" + toString(mNumber), 10000); -#endif - mCalibrated = config.getValueBool("joystick" - + toString(mNumber) + "calibrated", false); - - mUpTolerance = config.getIntValue("upTolerance" + toString(mNumber)); - mDownTolerance = config.getIntValue("downTolerance" + toString(mNumber)); - mLeftTolerance = config.getIntValue("leftTolerance" + toString(mNumber)); - mRightTolerance = config.getIntValue("rightTolerance" + toString(mNumber)); + mTolerance = config.getFloatValue("joystickTolerance"); + mUseHatForMovement = config.getBoolValue("useHatForMovement"); mUseInactive = config.getBoolValue("useInactiveJoystick"); + for (int i = 0; i < mAxesNumber; i++) + { + // heuristic to detect controller triggers. + // their resting position is at SDL_JOYSTICK_AXIS_MIN = -32768 + if (SDL_JoystickGetAxis(mJoystick, i) == SDL_JOYSTICK_AXIS_MIN) + mIsTrigger[i] = true; + } + return true; } @@ -245,15 +250,7 @@ void Joystick::setNumber(const int n) void Joystick::logic() { BLOCK_START("Joystick::logic") - // When calibrating, don't bother the outside with our state - if (mCalibrating) - { - doCalibration(); - BLOCK_END("Joystick::logic") - return; - } - - if (!mEnabled || !mCalibrated) + if (!mEnabled) { BLOCK_END("Joystick::logic") return; @@ -264,18 +261,28 @@ void Joystick::logic() if (mUseInactive || settings.inputFocused != KeyboardFocus::Unfocused) { + for (int i = 0; i < mAxesNumber; i++) + { + int position = SDL_JoystickGetAxis(mJoystick, i); + // transform range [SDL_JOYSTICK_AXIS_MIN, SDL_JOYSTICK_AXIS_MAX] + // to [0, SDL_JOYSTICK_AXIS_MAX] + if (mIsTrigger[i]) + position = (position - SDL_JOYSTICK_AXIS_MIN) / 2; + mAxesPositions[i] = position; + } + // X-Axis - int position = SDL_JoystickGetAxis(mJoystick, 0); - if (position >= mRightTolerance) + int position = mAxesPositions[0]; + if (position >= mTolerance * SDL_JOYSTICK_AXIS_MAX) mDirection |= RIGHT; - else if (position <= mLeftTolerance) + else if (position <= mTolerance * SDL_JOYSTICK_AXIS_MIN) mDirection |= LEFT; // Y-Axis - position = SDL_JoystickGetAxis(mJoystick, 1); - if (position <= mUpTolerance) + position = mAxesPositions[1]; + if (position <= mTolerance * SDL_JOYSTICK_AXIS_MIN) mDirection |= UP; - else if (position >= mDownTolerance) + else if (position >= mTolerance * SDL_JOYSTICK_AXIS_MAX) mDirection |= DOWN; #ifdef DEBUG_JOYSTICK @@ -287,18 +294,21 @@ void Joystick::logic() logger->log("axis 4 pos: %d", SDL_JoystickGetAxis(mJoystick, 4)); #endif // DEBUG_JOYSTICK - if ((mDirection == 0U) && mHaveHats) + if (mHaveHats) { // reading only hat 0 const uint8_t hat = SDL_JoystickGetHat(mJoystick, 0); + mHatPosition = 0; if ((hat & SDL_HAT_RIGHT) != 0) - mDirection |= RIGHT; + mHatPosition |= RIGHT; else if ((hat & SDL_HAT_LEFT) != 0) - mDirection |= LEFT; + mHatPosition |= LEFT; if ((hat & SDL_HAT_UP) != 0) - mDirection |= UP; + mHatPosition |= UP; else if ((hat & SDL_HAT_DOWN) != 0) - mDirection |= DOWN; + mHatPosition |= DOWN; + if ((mDirection == 0U) && mUseHatForMovement) + mDirection = mHatPosition; } // Buttons @@ -316,52 +326,42 @@ void Joystick::logic() } else { + mHatPosition = 0; + for (int i = 0; i < mAxesNumber; i++) + mAxesPositions[i] = 0; for (int i = 0; i < mButtonsNumber; i++) mActiveButtons[i] = false; } BLOCK_END("Joystick::logic") } -void Joystick::startCalibration() -{ - mUpTolerance = 0; - mDownTolerance = 0; - mLeftTolerance = 0; - mRightTolerance = 0; - mCalibrating = true; -} - -void Joystick::doCalibration() +bool Joystick::buttonPressed(const int no) const { - // X-Axis - int position = SDL_JoystickGetAxis(mJoystick, 0); - if (position > mRightTolerance) - mRightTolerance = position; - else if (position < mLeftTolerance) - mLeftTolerance = position; - - // Y-Axis - position = SDL_JoystickGetAxis(mJoystick, 1); - if (position > mDownTolerance) - mDownTolerance = position; - else if (position < mUpTolerance) - mUpTolerance = position; -} + if (!mEnabled) + return false; + const int button = getButton(no); + if (button >= 0) + { + if (button < mButtonsNumber) + return mActiveButtons[button]; + if (button == KEY_UP) + return (mHatPosition & UP) != 0; + if (button == KEY_DOWN) + return (mHatPosition & DOWN) != 0; + if (button == KEY_LEFT) + return (mHatPosition & LEFT) != 0; + if (button == KEY_RIGHT) + return (mHatPosition & RIGHT) != 0; + } + const int naxis = getNegativeAxis(no); + if (naxis >= 0) + return mAxesPositions[naxis] < mTolerance * SDL_JOYSTICK_AXIS_MIN; -void Joystick::finishCalibration() -{ - mCalibrated = true; - mCalibrating = false; - config.setValue("joystick" + toString(mNumber) + "calibrated", true); - config.setValue("leftTolerance" + toString(mNumber), mLeftTolerance); - config.setValue("rightTolerance" + toString(mNumber), mRightTolerance); - config.setValue("upTolerance" + toString(mNumber), mUpTolerance); - config.setValue("downTolerance" + toString(mNumber), mDownTolerance); -} + const int paxis = getPositiveAxis(no); + if (paxis >= 0) + return mAxesPositions[paxis] > mTolerance * SDL_JOYSTICK_AXIS_MAX; -bool Joystick::buttonPressed(const unsigned char no) const -{ - return (mEnabled && no < MAX_BUTTONS) ? mActiveButtons[no] : false; + return false; } void Joystick::getNames(STD_VECTOR <std::string> &names) @@ -377,33 +377,128 @@ void Joystick::update() mKeyTimeMap, InputType::JOYSTICK); } +bool Joystick::isActionEvent(const SDL_Event &event) +{ + return getButtonFromEvent(event) >= 0; +} + KeysVector *Joystick::getActionVector(const SDL_Event &event) { const int i = getButtonFromEvent(event); - - if (i < 0 || i >= mButtonsNumber) - return nullptr; -// logger->log("button triggerAction: %d", i); - if (mKeyToAction.find(i) != mKeyToAction.end()) - return &mKeyToAction[i]; - return nullptr; + return getActionVectorByKey(i); } KeysVector *Joystick::getActionVectorByKey(const int i) { - if (i < 0 || i >= mButtonsNumber) + if (getButton(i) < 0 + && getNegativeAxis(i) < 0 + && getPositiveAxis(i) < 0) + { return nullptr; + } // logger->log("button triggerAction: %d", i); - if (mKeyToAction.find(i) != mKeyToAction.end()) - return &mKeyToAction[i]; + + KeyToActionMapIter it = mKeyToAction.find(i); + if (it != mKeyToAction.end()) + return &it->second; + return nullptr; } +InputActionT Joystick::getActionId(const SDL_Event &event) +{ + const int i = getButtonFromEvent(event); + if (i < 0) + return InputAction::NO_VALUE; + + KeyToIdMapIter it = mKeyToId.find(i); + if (it != mKeyToId.end()) + return it->second; + + return InputAction::NO_VALUE; +} + int Joystick::getButtonFromEvent(const SDL_Event &event) const { - if (event.jbutton.which != mNumber) + if (event.type == SDL_JOYBUTTONDOWN) + { + if (event.jbutton.which != mNumber) + return -1; + return event.jbutton.button; + } + if (!mUseHatForMovement && event.type == SDL_JOYHATMOTION) + { + // reading only hat 0 + if (event.jhat.which != mNumber || event.jhat.hat != 0) + return -1; + const int value = event.jhat.value; + // SDL reports new hat position, not when d-pad button is pressed. + // because of that we have to compare it to previously known state. + if ((mHatPosition & UP) == 0 && (value & SDL_HAT_UP) != 0) + return KEY_UP; + if ((mHatPosition & DOWN) == 0 && (value & SDL_HAT_DOWN) != 0) + return KEY_DOWN; + if ((mHatPosition & LEFT) == 0 && (value & SDL_HAT_LEFT) != 0) + return KEY_LEFT; + if ((mHatPosition & RIGHT) == 0 && (value & SDL_HAT_RIGHT) != 0) + return KEY_RIGHT; + } + if (event.type == SDL_JOYAXISMOTION) + { + if (event.jaxis.which != mNumber) + return -1; + const int axis = event.jaxis.axis; + if (axis < RESERVED_AXES) + return -1; + int position = event.jaxis.value; + // transform range [SDL_JOYSTICK_AXIS_MIN, SDL_JOYSTICK_AXIS_MAX] + // to [0, SDL_JOYSTICK_AXIS_MAX] + if (mIsTrigger[axis]) + position = (position - SDL_JOYSTICK_AXIS_MIN) / 2; + if (position < mTolerance * SDL_JOYSTICK_AXIS_MIN + && mAxesPositions[axis] > mTolerance * SDL_JOYSTICK_AXIS_MIN) + return KEY_NEGATIVE_AXIS_FIRST + axis; + if (position > mTolerance * SDL_JOYSTICK_AXIS_MAX + && mAxesPositions[axis] < mTolerance * SDL_JOYSTICK_AXIS_MAX) + return KEY_POSITIVE_AXIS_FIRST + axis; + } + return -1; +} + +int Joystick::getButton(const int key) const +{ + if (key < 0 + || (mButtonsNumber <= key && key < MAX_BUTTONS) + || (mUseHatForMovement && key >= MAX_BUTTONS) + || key >= KEY_NEGATIVE_AXIS_FIRST) + { + return -1; + } + return key; +} + +int Joystick::getNegativeAxis(const int key) const +{ + if (key < KEY_NEGATIVE_AXIS_FIRST || key >= KEY_POSITIVE_AXIS_FIRST) + return -1; + + const int axis = key - KEY_NEGATIVE_AXIS_FIRST; + if (axis < RESERVED_AXES || axis >= mAxesNumber) + return -1; + + return axis; +} + +int Joystick::getPositiveAxis(const int key) const +{ + if (key < KEY_POSITIVE_AXIS_FIRST || key >= KEY_END) return -1; - return event.jbutton.button; + + const int axis = key - KEY_POSITIVE_AXIS_FIRST; + if (axis < RESERVED_AXES || axis >= mAxesNumber) + return -1; + + return axis; } bool Joystick::isActionActive(const InputActionT index) const @@ -417,19 +512,14 @@ bool Joystick::isActionActive(const InputActionT index) const const InputItem &val = key.values[i]; if (val.type != InputType::JOYSTICK) continue; - const int value = val.value; - if (value >= 0 && value < mButtonsNumber) - { - if (mActiveButtons[value]) - return true; - } + return buttonPressed(val.value); } return false; } bool Joystick::validate() const { - if (mCalibrating || !mEnabled || !mCalibrated) + if (!mEnabled) return false; return mUseInactive || @@ -441,14 +531,8 @@ void Joystick::handleRepeat(const int time) BLOCK_START("Joystick::handleRepeat") FOR_EACH (KeyTimeMapIter, it, mKeyTimeMap) { - bool repeat(false); const int key = (*it).first; - if (key >= 0 && key < mButtonsNumber) - { - if (mActiveButtons[key]) - repeat = true; - } - if (repeat) + if (buttonPressed(key)) { int &keyTime = (*it).second; if (time > keyTime && abs(time - keyTime) diff --git a/src/input/joystick.h b/src/input/joystick.h index a3c129950..846adad2c 100644 --- a/src/input/joystick.h +++ b/src/input/joystick.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,15 @@ PRAGMA48(GCC diagnostic ignored "-Wshadow") #include <SDL_events.h> PRAGMA48(GCC diagnostic pop) +// defined first in SDL 2.0.6 +// not available on older distros +#ifndef SDL_JOYSTICK_AXIS_MIN +#define SDL_JOYSTICK_AXIS_MIN -32768 +#endif +#ifndef SDL_JOYSTICK_AXIS_MAX +#define SDL_JOYSTICK_AXIS_MAX 32767 +#endif + class Joystick final { public: @@ -42,6 +51,27 @@ class Joystick final MAX_BUTTONS = 64 }; + enum + { + RESERVED_AXES = 2, // reserved for movement + MAX_AXES = 8 // number of axes we can handle + }; + + /** + * Additional "buttons" for hat 0 (d-pad), + * sticks and triggers. + */ + enum + { + KEY_UP = MAX_BUTTONS, + KEY_DOWN, + KEY_LEFT, + KEY_RIGHT, + KEY_NEGATIVE_AXIS_FIRST, + KEY_POSITIVE_AXIS_FIRST = KEY_NEGATIVE_AXIS_FIRST + MAX_AXES, + KEY_END = KEY_POSITIVE_AXIS_FIRST + MAX_AXES + }; + /** * Directions, to be used as bitmask values. */ @@ -98,14 +128,7 @@ class Joystick final */ void logic(); - void startCalibration(); - - void finishCalibration(); - - bool isCalibrating() const noexcept2 A_WARN_UNUSED - { return mCalibrating; } - - bool buttonPressed(const unsigned char no) const A_WARN_UNUSED; + bool buttonPressed(const int no) const A_WARN_UNUSED; bool isUp() const noexcept2 A_WARN_UNUSED { return mEnabled && ((mDirection & UP) != 0); } @@ -122,15 +145,25 @@ class Joystick final int getNumber() const noexcept2 A_WARN_UNUSED { return mNumber; } + void setTolerance(const float tolerance) + { mTolerance = tolerance; } + + void setUseHatForMovement(const bool b) + { mUseHatForMovement = b; } + void setUseInactive(const bool b) { mUseInactive = b; } void update(); + bool isActionEvent(const SDL_Event &event) A_WARN_UNUSED; + KeysVector *getActionVector(const SDL_Event &event) A_WARN_UNUSED; KeysVector *getActionVectorByKey(const int i) A_WARN_UNUSED; + InputActionT getActionId(const SDL_Event &event) A_WARN_UNUSED; + int getButtonFromEvent(const SDL_Event &event) const A_WARN_UNUSED; bool isActionActive(const InputActionT index) const A_WARN_UNUSED; @@ -144,18 +177,18 @@ class Joystick final protected: unsigned char mDirection; + unsigned char mHatPosition; + int mAxesPositions[MAX_AXES]; + bool mIsTrigger[MAX_AXES]; bool mActiveButtons[MAX_BUTTONS]; SDL_Joystick *mJoystick; - int mUpTolerance; - int mDownTolerance; - int mLeftTolerance; - int mRightTolerance; - bool mCalibrating; + float mTolerance; int mNumber; - bool mCalibrated; + int mAxesNumber; int mButtonsNumber; + bool mUseHatForMovement; bool mUseInactive; bool mHaveHats; @@ -172,7 +205,11 @@ class Joystick final static bool mInitialized; static int joystickCount; - void doCalibration(); + int getButton(const int key) const A_WARN_UNUSED; + + int getNegativeAxis(const int key) const A_WARN_UNUSED; + + int getPositiveAxis(const int key) const A_WARN_UNUSED; }; extern Joystick *joystick; diff --git a/src/input/key.cpp b/src/input/key.cpp index 6875f2430..7a4cd6579 100644 --- a/src/input/key.cpp +++ b/src/input/key.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/key.h b/src/input/key.h index eaaddff5b..4a1e60862 100644 --- a/src/input/key.h +++ b/src/input/key.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/keyboardconfig.cpp b/src/input/keyboardconfig.cpp index 514b8a654..a530e81ef 100644 --- a/src/input/keyboardconfig.cpp +++ b/src/input/keyboardconfig.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #include "utils/foreach.h" #include "utils/gettext.h" +#include "utils/performance.h" #include "debug.h" diff --git a/src/input/keyboardconfig.h b/src/input/keyboardconfig.h index d2e9b8bd3..aa7469803 100644 --- a/src/input/keyboardconfig.h +++ b/src/input/keyboardconfig.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/keyinput.h b/src/input/keyinput.h index 2e5b2e669..19bff478e 100644 --- a/src/input/keyinput.h +++ b/src/input/keyinput.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/mouseinput.h b/src/input/mouseinput.h index 26ea5b01a..825c8c5d8 100644 --- a/src/input/mouseinput.h +++ b/src/input/mouseinput.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/basic.cpp b/src/input/pages/basic.cpp index 9631c3705..fd339409d 100644 --- a/src/input/pages/basic.cpp +++ b/src/input/pages/basic.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,24 +68,6 @@ SetupActionData setupActionDataBasic[] = }, { // TRANSLATORS: input action name - N_("Move to Home location"), - InputAction::MOVE_TO_HOME, - "", - }, - { - // TRANSLATORS: input action name - N_("Set home location"), - InputAction::SET_HOME, - "", - }, - { - // TRANSLATORS: input action name - N_("Move to navigation point"), - InputAction::MOVE_TO_POINT, - "", - }, - { - // TRANSLATORS: input action name N_("Talk"), InputAction::TALK, "", diff --git a/src/input/pages/basic.h b/src/input/pages/basic.h index d0396d170..fb7843fef 100644 --- a/src/input/pages/basic.h +++ b/src/input/pages/basic.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/chat.cpp b/src/input/pages/chat.cpp index a92a547e0..fe2286ce1 100644 --- a/src/input/pages/chat.cpp +++ b/src/input/pages/chat.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/chat.h b/src/input/pages/chat.h index 2d3f14ac2..381eaa2ae 100644 --- a/src/input/pages/chat.h +++ b/src/input/pages/chat.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/craft.cpp b/src/input/pages/craft.cpp index 93d232b4b..4ccfeca2c 100644 --- a/src/input/pages/craft.cpp +++ b/src/input/pages/craft.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/craft.h b/src/input/pages/craft.h index e8f61483e..873d2bd65 100644 --- a/src/input/pages/craft.h +++ b/src/input/pages/craft.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/emotes.cpp b/src/input/pages/emotes.cpp index 394ca971d..a7be8f36c 100644 --- a/src/input/pages/emotes.cpp +++ b/src/input/pages/emotes.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/emotes.h b/src/input/pages/emotes.h index b33f764b4..5be105f6d 100644 --- a/src/input/pages/emotes.h +++ b/src/input/pages/emotes.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/gui.cpp b/src/input/pages/gui.cpp index acf42817e..afec06331 100644 --- a/src/input/pages/gui.cpp +++ b/src/input/pages/gui.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/gui.h b/src/input/pages/gui.h index ea2fe3eb8..32b114ab9 100644 --- a/src/input/pages/gui.h +++ b/src/input/pages/gui.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/move.cpp b/src/input/pages/move.cpp index ebf8eea48..3abbb846a 100644 --- a/src/input/pages/move.cpp +++ b/src/input/pages/move.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,6 +105,24 @@ SetupActionData setupActionDataMove[] = }, { // TRANSLATORS: input action name + N_("Move to Home location"), + InputAction::MOVE_TO_HOME, + "", + }, + { + // TRANSLATORS: input action name + N_("Set home location"), + InputAction::SET_HOME, + "", + }, + { + // TRANSLATORS: input action name + N_("Move to point modifier"), + InputAction::MOVE_TO_POINT, + "", + }, + { + // TRANSLATORS: input action name N_("Move to navigation point shortcuts"), InputAction::NO_VALUE, "" diff --git a/src/input/pages/move.h b/src/input/pages/move.h index 411638ecd..e8cdace17 100644 --- a/src/input/pages/move.h +++ b/src/input/pages/move.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 02bd88d79..df6ad0391 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/other.h b/src/input/pages/other.h index baf614e3d..ceeaf5891 100644 --- a/src/input/pages/other.h +++ b/src/input/pages/other.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/outfits.cpp b/src/input/pages/outfits.cpp index b69e4bd1a..121c5357d 100644 --- a/src/input/pages/outfits.cpp +++ b/src/input/pages/outfits.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/outfits.h b/src/input/pages/outfits.h index 7e72935af..048178e18 100644 --- a/src/input/pages/outfits.h +++ b/src/input/pages/outfits.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/shortcuts.cpp b/src/input/pages/shortcuts.cpp index b8543702a..9f3e0ba2e 100644 --- a/src/input/pages/shortcuts.cpp +++ b/src/input/pages/shortcuts.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/shortcuts.h b/src/input/pages/shortcuts.h index 2400646aa..8c4c84645 100644 --- a/src/input/pages/shortcuts.h +++ b/src/input/pages/shortcuts.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/windows.cpp b/src/input/pages/windows.cpp index efd2a7223..52775f67d 100644 --- a/src/input/pages/windows.cpp +++ b/src/input/pages/windows.cpp @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/pages/windows.h b/src/input/pages/windows.h index 43d9c72de..1a8e33eb5 100644 --- a/src/input/pages/windows.h +++ b/src/input/pages/windows.h @@ -1,12 +1,12 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/touch/multitouchmanager.cpp b/src/input/touch/multitouchmanager.cpp index 502d5bca8..3e49b099d 100644 --- a/src/input/touch/multitouchmanager.cpp +++ b/src/input/touch/multitouchmanager.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2013-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/touch/multitouchmanager.h b/src/input/touch/multitouchmanager.h index 1c0c89bf3..22fed4bb2 100644 --- a/src/input/touch/multitouchmanager.h +++ b/src/input/touch/multitouchmanager.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2013-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/touch/touchactions.cpp b/src/input/touch/touchactions.cpp index 0442d8e63..aa90e9867 100644 --- a/src/input/touch/touchactions.cpp +++ b/src/input/touch/touchactions.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/touch/touchactions.h b/src/input/touch/touchactions.h index bb862a5ca..105be0c02 100644 --- a/src/input/touch/touchactions.h +++ b/src/input/touch/touchactions.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/touch/touchmanager.cpp b/src/input/touch/touchmanager.cpp index bcae1e5fb..cf8494202 100644 --- a/src/input/touch/touchmanager.cpp +++ b/src/input/touch/touchmanager.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2012-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/input/touch/touchmanager.h b/src/input/touch/touchmanager.h index d8c14a941..462a09137 100644 --- a/src/input/touch/touchmanager.h +++ b/src/input/touch/touchmanager.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by |