diff options
Diffstat (limited to 'src/progs')
-rw-r--r-- | src/progs/dyecmd/actions/actions.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/chat.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/commands.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/move.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/pets.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/statusbar.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/tabs.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/target.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/actions/windows.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/client.cpp | 31 | ||||
-rw-r--r-- | src/progs/dyecmd/client.h | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/dyemain.cpp | 6 | ||||
-rw-r--r-- | src/progs/dyecmd/gui/viewport.cpp | 8 | ||||
-rw-r--r-- | src/progs/dyecmd/gui/viewport.h | 6 | ||||
-rw-r--r-- | src/progs/manaverse/actions/actions.cpp (renamed from src/progs/manaplus/actions/actions.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/chat.cpp (renamed from src/progs/manaplus/actions/chat.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/commands.cpp (renamed from src/progs/manaplus/actions/commands.cpp) | 40 | ||||
-rw-r--r-- | src/progs/manaverse/actions/move.cpp (renamed from src/progs/manaplus/actions/move.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/pets.cpp (renamed from src/progs/manaplus/actions/pets.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/statusbar.cpp (renamed from src/progs/manaplus/actions/statusbar.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/tabs.cpp (renamed from src/progs/manaplus/actions/tabs.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/target.cpp (renamed from src/progs/manaplus/actions/target.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/actions/windows.cpp (renamed from src/progs/manaplus/actions/windows.cpp) | 7 | ||||
-rw-r--r-- | src/progs/manaverse/client.cpp (renamed from src/progs/manaplus/client.cpp) | 59 | ||||
-rw-r--r-- | src/progs/manaverse/client.h (renamed from src/progs/manaplus/client.h) | 13 | ||||
-rw-r--r-- | src/progs/manaverse/gui/viewport.cpp (renamed from src/progs/manaplus/gui/viewport.cpp) | 34 | ||||
-rw-r--r-- | src/progs/manaverse/gui/viewport.h (renamed from src/progs/manaplus/gui/viewport.h) | 13 |
27 files changed, 194 insertions, 132 deletions
diff --git a/src/progs/dyecmd/actions/actions.cpp b/src/progs/dyecmd/actions/actions.cpp index 0b7827c62..d63037399 100644 --- a/src/progs/dyecmd/actions/actions.cpp +++ b/src/progs/dyecmd/actions/actions.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/progs/dyecmd/actions/chat.cpp b/src/progs/dyecmd/actions/chat.cpp index 3a07fae46..897972e46 100644 --- a/src/progs/dyecmd/actions/chat.cpp +++ b/src/progs/dyecmd/actions/chat.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/progs/dyecmd/actions/commands.cpp b/src/progs/dyecmd/actions/commands.cpp index 6de28b1ef..5ee075bb7 100644 --- a/src/progs/dyecmd/actions/commands.cpp +++ b/src/progs/dyecmd/actions/commands.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/progs/dyecmd/actions/move.cpp b/src/progs/dyecmd/actions/move.cpp index 081cfb25f..21c0608c8 100644 --- a/src/progs/dyecmd/actions/move.cpp +++ b/src/progs/dyecmd/actions/move.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/progs/dyecmd/actions/pets.cpp b/src/progs/dyecmd/actions/pets.cpp index d2f4ffaa6..5ab1dc1d6 100644 --- a/src/progs/dyecmd/actions/pets.cpp +++ b/src/progs/dyecmd/actions/pets.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/progs/dyecmd/actions/statusbar.cpp b/src/progs/dyecmd/actions/statusbar.cpp index e832c69f6..dfd1d082c 100644 --- a/src/progs/dyecmd/actions/statusbar.cpp +++ b/src/progs/dyecmd/actions/statusbar.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/progs/dyecmd/actions/tabs.cpp b/src/progs/dyecmd/actions/tabs.cpp index 32a50df4e..4747fd997 100644 --- a/src/progs/dyecmd/actions/tabs.cpp +++ b/src/progs/dyecmd/actions/tabs.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/progs/dyecmd/actions/target.cpp b/src/progs/dyecmd/actions/target.cpp index 31498c4fd..a0eefd9be 100644 --- a/src/progs/dyecmd/actions/target.cpp +++ b/src/progs/dyecmd/actions/target.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/progs/dyecmd/actions/windows.cpp b/src/progs/dyecmd/actions/windows.cpp index eca631b23..8b40fd77f 100644 --- a/src/progs/dyecmd/actions/windows.cpp +++ b/src/progs/dyecmd/actions/windows.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/progs/dyecmd/client.cpp b/src/progs/dyecmd/client.cpp index ec88650c1..a1d69fd30 100644 --- a/src/progs/dyecmd/client.cpp +++ b/src/progs/dyecmd/client.cpp @@ -1,10 +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-2019 The ManaPlus Developers + * Copyright (C) 2011-2020 The ManaPlus 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 @@ -64,6 +65,7 @@ #include "utils/gettext.h" #include "utils/gettexthelper.h" #include "utils/mrand.h" +#include "utils/performance.h" #ifdef ANDROID #include "fs/paths.h" #endif // ANDROID @@ -77,7 +79,7 @@ #include "net/ipc.h" -#ifdef WIN32 +#ifdef _WIN32 PRAGMA48(GCC diagnostic push) PRAGMA48(GCC diagnostic ignored "-Wshadow") #include <SDL_syswm.h> @@ -85,9 +87,9 @@ PRAGMA48(GCC diagnostic pop) #include <sys/time.h> #include "fs/specialfolder.h" #undef ERROR -#else // WIN32 +#else // _WIN32 #include <ctime> -#endif // WIN32 +#endif // _WIN32 #ifdef ANDROID #ifndef USE_SDL2 @@ -191,7 +193,7 @@ void Client::gameInit() else { settings.logFileName = pathJoin(settings.localDataDir, - "manaplus.log"); + "manaverse.log"); } logger->setLogFile(settings.logFileName); @@ -259,9 +261,10 @@ void Client::gameInit() eventsManager.init(); eventsManager.enableEvents(); -#ifdef WIN32 +#ifdef _WIN32 Dirs::mountDataDir(); -#endif // WIN32 +#endif // _WIN32 + #ifndef USE_SDL2 WindowManager::setIcon(); #endif // USE_SDL2 @@ -285,10 +288,10 @@ void Client::gameInit() SDL::allowScreenSaver(config.getBoolValue("allowscreensaver")); initGraphics(); -#ifndef WIN32 +#ifndef _WIN32 Dirs::extractDataDir(); Dirs::mountDataDir(); -#endif // WIN32 +#endif // _WIN32 Dirs::updateDataPath(); @@ -506,7 +509,7 @@ void Client::gameClear() logger->log1("Quitting11"); #ifdef USE_PROFILER - Perfomance::clear(); + Performance::clear(); #endif // USE_PROFILER #ifdef DEBUG_OPENGL_LEAKS @@ -774,7 +777,7 @@ void Client::moveButtons(const int width) { int x = width - mSetupButton->getWidth() - mButtonPadding; mSetupButton->setPosition(x, mButtonPadding); -#ifndef WIN32 +#ifndef _WIN32 x -= mPerfomanceButton->getWidth() + mButtonSpacing; mPerfomanceButton->setPosition(x, mButtonPadding); @@ -793,7 +796,7 @@ void Client::moveButtons(const int width) x -= mCloseButton->getWidth() + mButtonSpacing; mCloseButton->setPosition(x, mButtonPadding); #endif // ANDROID -#endif // WIN32 +#endif // _WIN32 } } diff --git a/src/progs/dyecmd/client.h b/src/progs/dyecmd/client.h index fd5e9806c..016144470 100644 --- a/src/progs/dyecmd/client.h +++ b/src/progs/dyecmd/client.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 diff --git a/src/progs/dyecmd/dyemain.cpp b/src/progs/dyecmd/dyemain.cpp index 78d2e4cfa..8412396c9 100644 --- a/src/progs/dyecmd/dyemain.cpp +++ b/src/progs/dyecmd/dyemain.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/progs/dyecmd/gui/viewport.cpp b/src/progs/dyecmd/gui/viewport.cpp index 740e0d63b..574f0b19e 100644 --- a/src/progs/dyecmd/gui/viewport.cpp +++ b/src/progs/dyecmd/gui/viewport.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,8 @@ #include "render/graphics.h" +#include "utils/performance.h" + #include "debug.h" Viewport *viewport = nullptr; diff --git a/src/progs/dyecmd/gui/viewport.h b/src/progs/dyecmd/gui/viewport.h index ae17dc7a4..021cb4c84 100644 --- a/src/progs/dyecmd/gui/viewport.h +++ b/src/progs/dyecmd/gui/viewport.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 diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaverse/actions/actions.cpp index 92c0f0050..966c51b41 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaverse/actions/actions.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/chat.cpp b/src/progs/manaverse/actions/chat.cpp index 22d0656cb..77bbffc2a 100644 --- a/src/progs/manaplus/actions/chat.cpp +++ b/src/progs/manaverse/actions/chat.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/commands.cpp b/src/progs/manaverse/actions/commands.cpp index ff0d91e3d..668c54b80 100644 --- a/src/progs/manaplus/actions/commands.cpp +++ b/src/progs/manaverse/actions/commands.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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 +58,7 @@ #include "input/inputactionoperators.h" #include "listeners/inputactionreplaylistener.h" +#include "listeners/inputactionreplayconfirmlistener.h" #include "net/adminhandler.h" #include "net/chathandler.h" @@ -483,11 +485,10 @@ impHandler(navigate) return false; } - int x = 0; - int y = 0; + Position dest {0, 0}; - if (parse2Int(event.args, x, y)) - localPlayer->navigateTo(x, y); + if (parse2Int(event.args, dest.x, dest.y)) + localPlayer->navigateTo(dest); else localPlayer->navigateClean(); return true; @@ -509,7 +510,7 @@ impHandler(navigateTo) ActorType::Unknown); if (being != nullptr) { - localPlayer->navigateTo(being->getTileX(), being->getTileY()); + localPlayer->navigateTo({being->getTileX(), being->getTileY()}); } else if (localPlayer->isInParty()) { @@ -523,7 +524,7 @@ impHandler(navigateTo) o != nullptr && m->getMap() == o->getMap()) { - localPlayer->navigateTo(m->getX(), m->getY()); + localPlayer->navigateTo({m->getX(), m->getY()}); } } } @@ -966,7 +967,22 @@ impHandler(setHomunculusName) impHandler0(fireHomunculus) { - if (homunculusHandler != nullptr) + const HomunculusInfo *const info = PlayerInfo::getHomunculus(); + if (info == nullptr) + return false; + + const std::string &args = event.args; + if (args.empty()) + { + inputActionReplayConfirmListener.openDialog( + // TRANSLATORS: dialog title + _("Really?"), + // TRANSLATORS: dialog question + _("Really kill your homunculous? This is irreversible!"), + InputAction::HOMUNCULUS_FIRE); + return true; + } + else if (args == "yes" && homunculusHandler != nullptr) { homunculusHandler->fire(); return true; @@ -986,11 +1002,11 @@ impHandler0(leaveParty) impHandler0(leaveGuild) { - if ((guildHandler != nullptr) && (localPlayer != nullptr)) + if ((socialWindow != nullptr) && (localPlayer != nullptr)) { const Guild *const guild = localPlayer->getGuild(); if (guild != nullptr) - guildHandler->leave(guild->getId()); + socialWindow->confirmGuildLeave(); return true; } return false; diff --git a/src/progs/manaplus/actions/move.cpp b/src/progs/manaverse/actions/move.cpp index b9e658f81..8f997967f 100644 --- a/src/progs/manaplus/actions/move.cpp +++ b/src/progs/manaverse/actions/move.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/pets.cpp b/src/progs/manaverse/actions/pets.cpp index fd8c959f8..d6f822114 100644 --- a/src/progs/manaplus/actions/pets.cpp +++ b/src/progs/manaverse/actions/pets.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/statusbar.cpp b/src/progs/manaverse/actions/statusbar.cpp index 50ae32935..235184793 100644 --- a/src/progs/manaplus/actions/statusbar.cpp +++ b/src/progs/manaverse/actions/statusbar.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/tabs.cpp b/src/progs/manaverse/actions/tabs.cpp index 9a421bfa6..175a6eba4 100644 --- a/src/progs/manaplus/actions/tabs.cpp +++ b/src/progs/manaverse/actions/tabs.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/target.cpp b/src/progs/manaverse/actions/target.cpp index 7760ff746..f767a5189 100644 --- a/src/progs/manaplus/actions/target.cpp +++ b/src/progs/manaverse/actions/target.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/actions/windows.cpp b/src/progs/manaverse/actions/windows.cpp index 2f803923e..7f1faef3e 100644 --- a/src/progs/manaplus/actions/windows.cpp +++ b/src/progs/manaverse/actions/windows.cpp @@ -1,8 +1,9 @@ /* - * The ManaPlus Client - * Copyright (C) 2012-2019 The ManaPlus Developers + * The ManaVerse Client + * Copyright (C) 2012-2020 The ManaPlus 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/progs/manaplus/client.cpp b/src/progs/manaverse/client.cpp index d8ba7e1c2..980ffdc91 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaverse/client.cpp @@ -1,10 +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-2019 The ManaPlus Developers + * Copyright (C) 2011-2020 The ManaPlus 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 @@ -20,7 +21,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "progs/manaplus/client.h" +#include "progs/manaverse/client.h" #include "chatlogger.h" #include "configmanager.h" @@ -127,6 +128,7 @@ #ifdef ANDROID #include "fs/paths.h" #endif // ANDROID +#include "utils/performance.h" #include "utils/perfstat.h" #include "utils/sdlcheckutils.h" #include "utils/sdlhelper.h" @@ -144,14 +146,14 @@ #include "configuration.h" #endif // USE_OPENGL -#ifdef WIN32 +#ifdef _WIN32 PRAGMA48(GCC diagnostic push) PRAGMA48(GCC diagnostic ignored "-Wshadow") #include <SDL_syswm.h> PRAGMA48(GCC diagnostic pop) #include "fs/specialfolder.h" #undef ERROR -#endif // WIN32 +#endif // _WIN32 #ifdef ANDROID #ifndef USE_SDL2 @@ -311,7 +313,7 @@ void Client::gameInit() else { settings.logFileName = pathJoin(settings.localDataDir, - "manaplus.log"); + "manaverse.log"); } logger->log("Log file: " + settings.logFileName); logger->setLogFile(settings.logFileName); @@ -391,9 +393,9 @@ void Client::gameInit() eventsManager.init(); eventsManager.enableEvents(); -#ifdef WIN32 +#ifdef _WIN32 Dirs::mountDataDir(); -#endif // WIN32 +#endif // _WIN32 #ifndef USE_SDL2 WindowManager::setIcon(); #endif // USE_SDL2 @@ -423,10 +425,10 @@ void Client::gameInit() touchManager.init(); -#ifndef WIN32 +#ifndef _WIN32 Dirs::extractDataDir(); Dirs::mountDataDir(); -#endif // WIN32 +#endif // _WIN32 Dirs::updateDataPath(); @@ -753,7 +755,7 @@ void Client::gameClear() logger->log1("Quitting11"); #ifdef USE_PROFILER - Perfomance::clear(); + Performance::clear(); #endif // USE_PROFILER #ifdef DEBUG_OPENGL_LEAKS @@ -1342,6 +1344,7 @@ int Client::gameExec() // Choosing character on the command line should work only // once, clear it so that 'switch character' works. settings.options.character.clear(); + settings.options.chooseDefault = false; BLOCK_END("Client::gameExec State::CHAR_SELECT") break; @@ -1577,6 +1580,34 @@ int Client::gameExec() BLOCK_END("Client::gameExec State::SWITCH_SERVER") break; + case State::SWITCH_WORLD: + BLOCK_START("Client::gameExec State::SWITCH_WORLD") + logger->log1("State: SWITCH WORLD"); + + if (loginHandler != nullptr) + { + loginHandler->logout(); + loginHandler->disconnect(); + } + if (gameHandler != nullptr) + gameHandler->disconnect(); + if (loginHandler != nullptr) + loginHandler->connect(); + + if (loginHandler != nullptr && + loginHandler->getWorlds().size() > 1) + { + mState = State::LOGIN_ATTEMPT; + } + else + { + settings.login.clear(); + WindowManager::updateTitle(); + mState = State::LOGIN; + } + BLOCK_END("Client::gameExec State::SWITCH_WORLD") + break; + case State::SWITCH_LOGIN: BLOCK_START("Client::gameExec State::SWITCH_LOGIN") logger->log1("State: SWITCH LOGIN"); @@ -1878,7 +1909,7 @@ void Client::moveButtons(const int width) { int x = width - mSetupButton->getWidth() - mButtonPadding; mSetupButton->setPosition(x, mButtonPadding); -#ifndef WIN32 +#ifndef _WIN32 x -= mPerfomanceButton->getWidth() + mButtonSpacing; mPerfomanceButton->setPosition(x, mButtonPadding); @@ -1897,7 +1928,7 @@ void Client::moveButtons(const int width) x -= mCloseButton->getWidth() + mButtonSpacing; mCloseButton->setPosition(x, mButtonPadding); #endif // ANDROID -#endif // WIN32 +#endif // _WIN32 } } diff --git a/src/progs/manaplus/client.h b/src/progs/manaverse/client.h index 26152270d..4d988f799 100644 --- a/src/progs/manaplus/client.h +++ b/src/progs/manaverse/client.h @@ -1,10 +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-2019 The ManaPlus Developers + * Copyright (C) 2011-2020 The ManaPlus 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 @@ -20,8 +21,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef PROGS_MANAPLUS_CLIENT_H -#define PROGS_MANAPLUS_CLIENT_H +#ifndef PROGS_MANAVERSE_CLIENT_H +#define PROGS_MANAVERSE_CLIENT_H #include "enums/state.h" @@ -168,4 +169,4 @@ extern Client *client; extern unsigned int mLastHost; extern unsigned long mSearchHash; -#endif // PROGS_MANAPLUS_CLIENT_H +#endif // PROGS_MANAVERSE_CLIENT_H diff --git a/src/progs/manaplus/gui/viewport.cpp b/src/progs/manaverse/gui/viewport.cpp index 5483b3d0e..654559967 100644 --- a/src/progs/manaplus/gui/viewport.cpp +++ b/src/progs/manaverse/gui/viewport.cpp @@ -1,10 +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-2019 The ManaPlus Developers + * Copyright (C) 2011-2020 The ManaPlus 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 @@ -20,7 +21,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "progs/manaplus/gui/viewport.h" +#include "progs/manaverse/gui/viewport.h" #include "actormanager.h" #include "configuration.h" @@ -52,6 +53,7 @@ #include "utils/checkutils.h" #include "utils/foreach.h" +#include "utils/performance.h" #include "resources/map/map.h" #include "resources/map/mapitem.h" @@ -724,7 +726,7 @@ void Viewport::walkByMouse(const MouseEvent &event) BlockMask::WATER | BlockMask::PLAYERWALL)) { - localPlayer->navigateTo(playerX + dx, playerY + dy); + localPlayer->navigateTo({playerX + dx, playerY + dy}); } else { @@ -810,29 +812,27 @@ void Viewport::walkByMouse(const MouseEvent &event) } } } - localPlayer->navigateTo(playerX + dx, playerY + dy); + localPlayer->navigateTo({playerX + dx, playerY + dy}); } } else { - int destX; - int destY; - getMouseTile(event.getX(), event.getY(), - destX, destY); - if (playerX != destX || playerY != destY) + Position dest {0, 0}; + getMouseTile(event.getX(), event.getY(), dest.x, dest.y); + if (playerX != dest.x || playerY != dest.y) { - if (!localPlayer->navigateTo(destX, destY)) + if (!localPlayer->navigateTo(dest)) { - if (playerX > destX) + if (playerX > dest.x) playerX --; - else if (playerX < destX) + else if (playerX < dest.x) playerX ++; - if (playerY > destY) + if (playerY > dest.y) playerY --; - else if (playerY < destY) + else if (playerY < dest.y) playerY ++; if (mMap->getWalk(playerX, playerY, 0)) - localPlayer->navigateTo(playerX, playerY); + localPlayer->navigateTo({playerX, playerY}); } } } diff --git a/src/progs/manaplus/gui/viewport.h b/src/progs/manaverse/gui/viewport.h index ae92c7ccd..6ffb4ba1a 100644 --- a/src/progs/manaplus/gui/viewport.h +++ b/src/progs/manaverse/gui/viewport.h @@ -1,10 +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-2019 The ManaPlus Developers + * Copyright (C) 2011-2020 The ManaPlus 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 @@ -20,8 +21,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef PROGS_MANAPLUS_GUI_VIEWPORT_H -#define PROGS_MANAPLUS_GUI_VIEWPORT_H +#ifndef PROGS_MANAVERSE_GUI_VIEWPORT_H +#define PROGS_MANAVERSE_GUI_VIEWPORT_H #include "position.h" @@ -246,4 +247,4 @@ class Viewport final : public WindowContainer, extern Viewport *viewport; /**< The viewport. */ -#endif // PROGS_MANAPLUS_GUI_VIEWPORT_H +#endif // PROGS_MANAVERSE_GUI_VIEWPORT_H |