From f444ef80ab94be381a0cd5da2237edbb25f472df Mon Sep 17 00:00:00 2001 From: Ludwig Date: Wed, 26 Feb 2025 08:39:57 +0100 Subject: [PATCH 1/9] fix build and add enabled hook lists for performance improvement --- src/mod_congratsonlevel.cpp | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 1fc52c1..eb4b9de 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -117,25 +117,27 @@ class CongratsAnnounce : public PlayerScript public: - CongratsAnnounce() : PlayerScript("CongratsAnnounce") {} + CongratsAnnounce() : PlayerScript("CongratsAnnounce", { + PLAYERHOOK_ON_LOGIN + }) {} - void OnLogin(Player* player) + void OnPlayerLogin(Player* player) { // Announce Module if (col.congratsAnnounce) - { ChatHandler(player->GetSession()).SendSysMessage(col.acoreMessageId); - } } }; class CongratsOnLevel : public PlayerScript { public: - CongratsOnLevel() : PlayerScript("CongratsOnLevel") { } + CongratsOnLevel() : PlayerScript("CongratsOnLevel", { + PLAYERHOOK_ON_LEVEL_CHANGED + }) { } // Level Up Rewards - void OnLevelChanged(Player* player, uint8 oldLevel) override + void OnPlayerLevelChanged(Player* player, uint8 oldLevel) override { // If enabled... if (col.congratsEnable) @@ -148,72 +150,56 @@ public: case 10: { if (oldLevel < 10) - { money = giveAward(player); - } } break; case 20: { if (oldLevel < 20) - { money = giveAward(player); - } } break; case 30: { if (oldLevel < 30) - { money = giveAward(player); - } } break; case 40: { if (oldLevel < 40) - { money = giveAward(player); - } } break; case 50: { if (oldLevel < 50) - { money = giveAward(player); - } } break; case 60: { if (oldLevel < 60) - { money = giveAward(player); - } } break; case 70: { if (oldLevel < 70) - { money = giveAward(player); - } } break; case 80: { if (oldLevel < 80) - { money = giveAward(player); - } } break; @@ -311,7 +297,9 @@ public: class ModCongratsLevelWorldScript : public WorldScript { public: - ModCongratsLevelWorldScript() : WorldScript("ModCongratsLevelWorldScript") { } + ModCongratsLevelWorldScript() : WorldScript("ModCongratsLevelWorldScript", { + WORLDHOOK_ON_BEFORE_CONFIG_LOAD + }) { } void OnBeforeConfigLoad(bool reload) override { From 793fc6ade3fa846d803ae76ecba399d0997f2c48 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Wed, 26 Feb 2025 08:49:55 +0100 Subject: [PATCH 2/9] restore braces --- src/mod_congratsonlevel.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index eb4b9de..0385ef9 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -150,56 +150,72 @@ public: case 10: { if (oldLevel < 10) + { money = giveAward(player); + } } break; case 20: { if (oldLevel < 20) + { money = giveAward(player); + } } break; case 30: { if (oldLevel < 30) + { money = giveAward(player); + } } break; case 40: { if (oldLevel < 40) + { money = giveAward(player); + } } break; case 50: { if (oldLevel < 50) + { money = giveAward(player); + } } break; case 60: { if (oldLevel < 60) + { money = giveAward(player); + } } break; case 70: { if (oldLevel < 70) + { money = giveAward(player); + } } break; case 80: { if (oldLevel < 80) + { money = giveAward(player); + } } break; @@ -237,7 +253,7 @@ public: } // If level is defined, they hit a reward level. - if (!level && col.CongratsPerLevelEnable) + if (!level) { // Issue a server notification for the player on level up. std::ostringstream ss; From 0f8ee189b1bf20239507d4cd7cd2f7a7e8286c00 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Wed, 26 Feb 2025 08:50:31 +0100 Subject: [PATCH 3/9] fix unintended changes --- src/mod_congratsonlevel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 0385ef9..54b1148 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -253,7 +253,7 @@ public: } // If level is defined, they hit a reward level. - if (!level) + if (!level && col.CongratsPerLevelEnable) { // Issue a server notification for the player on level up. std::ostringstream ss; From d1336842062b68ffca23b91c3650e51a3e68bc45 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Wed, 26 Feb 2025 10:12:16 +0100 Subject: [PATCH 4/9] fix for WorldSessionMgr --- src/mod_congratsonlevel.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 54b1148..9861aaf 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -64,9 +64,10 @@ config file for quick modifications. */ #include "Configuration/Config.h" -#include "ScriptMgr.h" -#include "Player.h" #include "Chat.h" +#include "Player.h" +#include "ScriptMgr.h" +#include "WorldSessionMgr.h" struct COL { @@ -249,7 +250,7 @@ public: default: break; } - sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); + sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); } // If level is defined, they hit a reward level. @@ -278,7 +279,7 @@ public: default: break; } - sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); + sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); // Issue a raid warning to the player std::ostringstream ss2; From 239bae9d5b41102d54b109239de18847d4c8d950 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Wed, 26 Feb 2025 20:25:04 +0100 Subject: [PATCH 5/9] fix messages not showing level correctly --- src/mod_congratsonlevel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 166345b..9f49ac1 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -214,13 +214,13 @@ public: case LOCALE_zhTW: case LOCALE_ruRU: { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << level << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << level << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; } default: break; @@ -239,13 +239,13 @@ public: case LOCALE_zhTW: case LOCALE_ruRU: { - ss2 << "Congrats on Level " << level << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!"; + ss2 << "Congrats on Level " << std::to_string(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss2 << "¡Felicidades por el nivel " << level << " " << player->GetName() << " Se le ha concedido " << money << " oro y unos cuantos tesoros!"; + ss2 << "¡Felicidades por el nivel " << std::to_string(player->GetLevel()) << " " << player->GetName() << " Se le ha concedido " << money << " oro y unos cuantos tesoros!"; } default: break; From 0d233e2c338ad057e104730ab535d8e59d10bf3c Mon Sep 17 00:00:00 2001 From: jamssismy <126220036+jamssismy@users.noreply.github.com> Date: Thu, 27 Feb 2025 10:02:34 +0800 Subject: [PATCH 6/9] Update mod_congratsonlevel.cpp The software or game now supports user interface prompts in both Simplified Chinese and Traditional Chinese, making it more accessible to a wider range of Chinese-speaking users. A correction has been made to the on-screen display of currency amounts. Specifically, where small amounts of currency were being shown, the unit was incorrectly displayed as "Gold." This has been corrected so that it now accurately displays "Copper," which is the appropriate unit for smaller denominations in games like World of Warcraft. --- src/mod_congratsonlevel.cpp | 58 ++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 9f49ac1..0b490ca 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -182,7 +182,23 @@ public: case LOCALE_frFR: case LOCALE_deDE: case LOCALE_zhCN: + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已达到 |cff4CFF00" + << std::to_string(player->GetLevel()) + << " 级|cffFFFFFF!"; + break; +} case LOCALE_zhTW: + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已達到 |cff4CFF00" + << std::to_string(player->GetLevel()) + << " 級|cffFFFFFF!"; + break; +} case LOCALE_ruRU: { ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; @@ -210,17 +226,33 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: - case LOCALE_zhCN: - case LOCALE_zhTW: + case LOCALE_zhCN: // 简体中文 +{ + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已达到 |cff4CFF00" + << static_cast(player->GetLevel()) + << " 级|cffFFFFFF!"; + break; +} +case LOCALE_zhTW: // 繁体中文 +{ + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " + << player->GetName() + << " |cffFFFFFF已達到 |cff4CFF00" + << static_cast(player->GetLevel()) + << " 級|cffFFFFFF!"; + break; +} case LOCALE_ruRU: { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; } default: break; @@ -235,17 +267,27 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: - case LOCALE_zhCN: - case LOCALE_zhTW: + case LOCALE_zhCN: // 简体中文 +{ + ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() + << "!您获得了 " << money << " 钱币和一些宝藏!"; + break; +} +case LOCALE_zhTW: // 繁体中文 +{ + ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() + << "!您獲得了 " << money << " 錢幣和一些寶藏!"; + break; +} case LOCALE_ruRU: { - ss2 << "Congrats on Level " << std::to_string(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!"; + ss2 << "Congrats on Level " << static_cast(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss2 << "¡Felicidades por el nivel " << std::to_string(player->GetLevel()) << " " << player->GetName() << " Se le ha concedido " << money << " oro y unos cuantos tesoros!"; + ss2 << "¡Felicidades por el nivel " << static_cast(player->GetLevel()) << " " << player->GetName() << " Se le ha concedido " << money << " cobre y unos cuantos tesoros!"; } default: break; From 4fe199845ee54c7d516d86e542febf9e4e15616a Mon Sep 17 00:00:00 2001 From: jamssismy <126220036+jamssismy@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:41:14 +0800 Subject: [PATCH 7/9] Update mod_congratsonlevel.cpp The calling method for levels has been standardized << static_cast(player->GetLevel()) << --- src/mod_congratsonlevel.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 0b490ca..0783deb 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -186,8 +186,7 @@ public: ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" - << std::to_string(player->GetLevel()) - << " 级|cffFFFFFF!"; + << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; break; } case LOCALE_zhTW: @@ -195,19 +194,18 @@ public: ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" - << std::to_string(player->GetLevel()) - << " 級|cffFFFFFF!"; + << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; break; } case LOCALE_ruRU: { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; break; } case LOCALE_esES: case LOCALE_esMX: { - ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << std::to_string(player->GetLevel()) << "|cffFFFFFF!"; + ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; } default: break; From ae5e5d3b28dcda796d1094450adecfcbe05a30a8 Mon Sep 17 00:00:00 2001 From: jamssismy <126220036+jamssismy@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:29:09 +0800 Subject: [PATCH 8/9] Update mod_congratsonlevel.cpp I aligned the code, and actually, our communication is done through AI translation. I initially thought your mention of alignment referred to the unification of the level display function calls. Thank you for the reminder. I'm not a professional programmer and haven't received formal training, so I don't have good code alignment habits. Thanks again for your reminder!~ --- src/mod_congratsonlevel.cpp | 64 ++++++++++++++----------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 0783deb..1a5a9cb 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -183,20 +183,14 @@ public: case LOCALE_deDE: case LOCALE_zhCN: { - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已达到 |cff4CFF00" - << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; - break; -} + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; + break; + } case LOCALE_zhTW: { - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已達到 |cff4CFF00" - << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; - break; -} + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; + break; + } case LOCALE_ruRU: { ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; @@ -225,23 +219,15 @@ public: case LOCALE_frFR: case LOCALE_deDE: case LOCALE_zhCN: // 简体中文 -{ - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已达到 |cff4CFF00" - << static_cast(player->GetLevel()) - << " 级|cffFFFFFF!"; - break; -} -case LOCALE_zhTW: // 繁体中文 -{ - ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " - << player->GetName() - << " |cffFFFFFF已達到 |cff4CFF00" - << static_cast(player->GetLevel()) - << " 級|cffFFFFFF!"; - break; -} + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; + break; + } + case LOCALE_zhTW: // 繁体中文 + { + ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; + break; + } case LOCALE_ruRU: { ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; @@ -266,17 +252,15 @@ case LOCALE_zhTW: // 繁体中文 case LOCALE_frFR: case LOCALE_deDE: case LOCALE_zhCN: // 简体中文 -{ - ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() - << "!您获得了 " << money << " 钱币和一些宝藏!"; - break; -} -case LOCALE_zhTW: // 繁体中文 -{ - ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() - << "!您獲得了 " << money << " 錢幣和一些寶藏!"; - break; -} + { + ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() << "!您获得了 " << money << " 钱币和一些宝藏!"; + break; + } + case LOCALE_zhTW: // 繁体中文 + { + ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() << "!您獲得了 " << money << " 錢幣和一些寶藏!"; + break; + } case LOCALE_ruRU: { ss2 << "Congrats on Level " << static_cast(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!"; From 66f9e0a4f515486549f72795c69f28e21a6f7767 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Fri, 28 Feb 2025 13:59:52 +0100 Subject: [PATCH 9/9] fix order of language entries --- src/mod_congratsonlevel.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mod_congratsonlevel.cpp b/src/mod_congratsonlevel.cpp index 1a5a9cb..265914e 100644 --- a/src/mod_congratsonlevel.cpp +++ b/src/mod_congratsonlevel.cpp @@ -181,6 +181,11 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: + case LOCALE_ruRU: + { + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; + break; + } case LOCALE_zhCN: { ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; @@ -191,11 +196,6 @@ public: ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; break; } - case LOCALE_ruRU: - { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; - break; - } case LOCALE_esES: case LOCALE_esMX: { @@ -218,8 +218,13 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: + case LOCALE_ruRU: + { + ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; + break; + } case LOCALE_zhCN: // 简体中文 - { + { ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast(player->GetLevel()) << " 级|cffFFFFFF!"; break; } @@ -228,11 +233,6 @@ public: ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast(player->GetLevel()) << " 級|cffFFFFFF!"; break; } - case LOCALE_ruRU: - { - ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast(player->GetLevel()) << "|cffFFFFFF!"; - break; - } case LOCALE_esES: case LOCALE_esMX: { @@ -251,6 +251,11 @@ public: case LOCALE_koKR: case LOCALE_frFR: case LOCALE_deDE: + case LOCALE_ruRU: + { + ss2 << "Congrats on Level " << static_cast(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!"; + break; + } case LOCALE_zhCN: // 简体中文 { ss2 << "恭喜达到等级 " << static_cast(player->GetLevel()) << "," << player->GetName() << "!您获得了 " << money << " 钱币和一些宝藏!"; @@ -261,11 +266,6 @@ public: ss2 << "恭喜達到等級 " << static_cast(player->GetLevel()) << "," << player->GetName() << "!您獲得了 " << money << " 錢幣和一些寶藏!"; break; } - case LOCALE_ruRU: - { - ss2 << "Congrats on Level " << static_cast(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!"; - break; - } case LOCALE_esES: case LOCALE_esMX: {