diff --git a/China/HeliumClient/Commands/Commands/ConfigCommand.cpp b/China/HeliumClient/Commands/Commands/ConfigCommand.cpp index 293670e32dfe98eb58e8931c1ad41b87ad18f80b..b499572cd81d9023c424b6b1f2e26e3a4d034b4f 100644 --- a/China/HeliumClient/Commands/Commands/ConfigCommand.cpp +++ b/China/HeliumClient/Commands/Commands/ConfigCommand.cpp @@ -1,4 +1,4 @@ -#include "ConfigCommand.h" +#include "ConfigCommand.h" #include @@ -495,7 +495,7 @@ bool listCommand_ConfigCommand(fast_io::vector*) { configs_ConfigCommand.clear(); configs_ConfigCommand.reserve(configsString.size()); for (auto& i : configsString) - configs_ConfigCommand.emplace_back_unchecked(string_Object{i, nullptr}); + configs_ConfigCommand.emplace_back_unchecked(string_Object{std::move(i), nullptr}); // MOVE!!! return true; } diff --git a/China/HeliumClient/Commands/Commands/FriendCommand.cpp b/China/HeliumClient/Commands/Commands/FriendCommand.cpp index a87d3e362ce384077e7f5977bd127fc75b7302ae..3b90600a9d8eca6dc8a331d314bc9b4691a70541 100644 --- a/China/HeliumClient/Commands/Commands/FriendCommand.cpp +++ b/China/HeliumClient/Commands/Commands/FriendCommand.cpp @@ -1,4 +1,4 @@ -#include "FriendCommand.h" +#include "FriendCommand.h" #include "../../../Memory/GameData.h" @@ -8,6 +8,26 @@ fast_io::vector Friend_playerList{}; fast_io::vector Friend_friendList{}; bool FriendCommand_onExecute(const fast_io::vector& args) { + if (args.size() == 2) { + if (args[1] == u8"list") { + if (FriendList.empty()) { + C_GuiData::displayClientMessageC(Utils::TextColor::LIGHT_PURPLE, + u8"[Helium] ", + Utils::TextColor::RED, + u8"No Players in Friend List"); + } else { + C_GuiData::displayClientMessageC(Utils::TextColor::LIGHT_PURPLE, + u8"[Helium] ", + Utils::TextColor::YELLOW, + u8"Friend List:"); + for (auto& i : FriendList) + C_GuiData::displayClientMessageC(Utils::TextColor::GRAY, i); + } + return true; + } else + return false; + } + if (args.size() < 3) return false; @@ -180,14 +200,6 @@ bool FriendCommand_onExecute(const fast_io::vector& args) { std::unreachable(); } } - } else if (args[1] == u8"list") { - C_GuiData::displayClientMessageC(Utils::TextColor::LIGHT_PURPLE, - u8"[Helium] ", - Utils::TextColor::YELLOW, - u8"Friend List:"); - for (auto& i : FriendList) - C_GuiData::displayClientMessageC(Utils::TextColor::GRAY, i); - } else return false; @@ -205,14 +217,23 @@ bool listPlayer_FriendCommand(fast_io::vector*) { return true; } +bool listFriend_FriendCommand(fast_io::vector*) { + Friend_friendList.clear(); + Friend_friendList.reserve(FriendList.size()); + for (auto& i : FriendList) + Friend_friendList.emplace_back(stringview_Object{i, nullptr}); + + return true; +} + ICommand FriendCommand{u8"friend", u8".friend [add/ remove] , list", {u8"Add or remove friendly players", u8"添加或删除友好玩家", u8"添加或刪除友好玩家", u8"味方プレイヤーの追加または削除"}, {}, fast_io::vector{ aliasList_struct{stringview_Judge{u8"add", &Friend_playerList, &listPlayer_FriendCommand}}, - aliasList_struct{stringview_Judge{u8"remove", &Friend_friendList, &listPlayer_FriendCommand}}, - aliasList_struct{stringview_Judge{u8"list", nullptr, &listPlayer_FriendCommand}}, + aliasList_struct{stringview_Judge{u8"remove", &Friend_friendList, &listFriend_FriendCommand}}, + aliasList_struct{stringview_Judge{u8"list", nullptr, &listFriend_FriendCommand}}, }, // If empty must use fast_io::vector{} nullptr, &FriendCommand_onExecute}; \ No newline at end of file diff --git a/China/HeliumClient/Commands/Commands/SetLanguageCommand.cpp b/China/HeliumClient/Commands/Commands/SetLanguageCommand.cpp index 04657dba9386901a3c7a3f8fc1c1907a7ed3017a..12988c2db3894121d05d37d56a343dad8d6a8bd1 100644 --- a/China/HeliumClient/Commands/Commands/SetLanguageCommand.cpp +++ b/China/HeliumClient/Commands/Commands/SetLanguageCommand.cpp @@ -1,4 +1,4 @@ -#include "SetLanguageCommand.h" +#include "SetLanguageCommand.h" #include "../../Setting/SettingManager.h" #include "../../../Memory/GameData.h" @@ -42,17 +42,17 @@ ICommand SetLanguageCommand{u8"setlanguage", {u8"Set Language", u8"设置语言", u8"設置語言", u8"言語を設定する"}, {}, fast_io::vector{ - aliasList_struct{stringview_Judge{u8"en_US", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh_CN", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh_HK", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh_SG", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh_TW", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh_ZA", nullptr}}, - aliasList_struct{stringview_Judge{u8"ja_JP", nullptr}}, - aliasList_struct{stringview_Judge{u8"0", nullptr}}, - aliasList_struct{stringview_Judge{u8"1", nullptr}}, - aliasList_struct{stringview_Judge{u8"2", nullptr}}, - aliasList_struct{stringview_Judge{u8"3", nullptr}}, + aliasList_struct{stringview_Object{u8"en_US", nullptr}}, + aliasList_struct{stringview_Object{u8"zh_CN", nullptr}}, + aliasList_struct{stringview_Object{u8"zh_HK", nullptr}}, + aliasList_struct{stringview_Object{u8"zh_SG", nullptr}}, + aliasList_struct{stringview_Object{u8"zh_TW", nullptr}}, + aliasList_struct{stringview_Object{u8"zh_ZA", nullptr}}, + aliasList_struct{stringview_Object{u8"ja_JP", nullptr}}, + aliasList_struct{stringview_Object{u8"0", nullptr}}, + aliasList_struct{stringview_Object{u8"1", nullptr}}, + aliasList_struct{stringview_Object{u8"2", nullptr}}, + aliasList_struct{stringview_Object{u8"3", nullptr}}, }, // If empty must use fast_io::vector{} nullptr, &SetLanguageCommand_onExecute}; \ No newline at end of file diff --git a/China/HeliumClient/Commands/Commands/TranslateCommand.cpp b/China/HeliumClient/Commands/Commands/TranslateCommand.cpp index 895f2050550de3064f6a0a62e475a1218c82da1e..6e58826f72e117c84cb35e1c4a4d2aab44576eb1 100644 --- a/China/HeliumClient/Commands/Commands/TranslateCommand.cpp +++ b/China/HeliumClient/Commands/Commands/TranslateCommand.cpp @@ -1,4 +1,4 @@ -#include "TranslateCommand.h" +#include "TranslateCommand.h" #include #include @@ -377,80 +377,80 @@ bool TranslateCommand_onExecute(const fast_io::vector& args) { } fast_io::vector languageto{ - aliasList_struct{stringview_Judge{u8"yue", nullptr}}, - aliasList_struct{stringview_Judge{u8"kor", nullptr}}, - aliasList_struct{stringview_Judge{u8"th", nullptr}}, - aliasList_struct{stringview_Judge{u8"pt", nullptr}}, - aliasList_struct{stringview_Judge{u8"el", nullptr}}, - aliasList_struct{stringview_Judge{u8"bul", nullptr}}, - aliasList_struct{stringview_Judge{u8"fin", nullptr}}, - aliasList_struct{stringview_Judge{u8"slo", nullptr}}, - aliasList_struct{stringview_Judge{u8"cht", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh", nullptr}}, - aliasList_struct{stringview_Judge{u8"wyw", nullptr}}, - aliasList_struct{stringview_Judge{u8"fra", nullptr}}, - aliasList_struct{stringview_Judge{u8"ara", nullptr}}, - aliasList_struct{stringview_Judge{u8"de", nullptr}}, - aliasList_struct{stringview_Judge{u8"nl", nullptr}}, - aliasList_struct{stringview_Judge{u8"est", nullptr}}, - aliasList_struct{stringview_Judge{u8"cs", nullptr}}, - aliasList_struct{stringview_Judge{u8"swe", nullptr}}, - aliasList_struct{stringview_Judge{u8"vie", nullptr}}, - aliasList_struct{stringview_Judge{u8"en", nullptr}}, - aliasList_struct{stringview_Judge{u8"jp", nullptr}}, - aliasList_struct{stringview_Judge{u8"spa", nullptr}}, - aliasList_struct{stringview_Judge{u8"ru", nullptr}}, - aliasList_struct{stringview_Judge{u8"it", nullptr}}, - aliasList_struct{stringview_Judge{u8"pl", nullptr}}, - aliasList_struct{stringview_Judge{u8"dan", nullptr}}, - aliasList_struct{stringview_Judge{u8"rom", nullptr}}, - aliasList_struct{stringview_Judge{u8"hu", nullptr}}}; + aliasList_struct{stringview_Object{u8"yue", nullptr}}, + aliasList_struct{stringview_Object{u8"kor", nullptr}}, + aliasList_struct{stringview_Object{u8"th", nullptr}}, + aliasList_struct{stringview_Object{u8"pt", nullptr}}, + aliasList_struct{stringview_Object{u8"el", nullptr}}, + aliasList_struct{stringview_Object{u8"bul", nullptr}}, + aliasList_struct{stringview_Object{u8"fin", nullptr}}, + aliasList_struct{stringview_Object{u8"slo", nullptr}}, + aliasList_struct{stringview_Object{u8"cht", nullptr}}, + aliasList_struct{stringview_Object{u8"zh", nullptr}}, + aliasList_struct{stringview_Object{u8"wyw", nullptr}}, + aliasList_struct{stringview_Object{u8"fra", nullptr}}, + aliasList_struct{stringview_Object{u8"ara", nullptr}}, + aliasList_struct{stringview_Object{u8"de", nullptr}}, + aliasList_struct{stringview_Object{u8"nl", nullptr}}, + aliasList_struct{stringview_Object{u8"est", nullptr}}, + aliasList_struct{stringview_Object{u8"cs", nullptr}}, + aliasList_struct{stringview_Object{u8"swe", nullptr}}, + aliasList_struct{stringview_Object{u8"vie", nullptr}}, + aliasList_struct{stringview_Object{u8"en", nullptr}}, + aliasList_struct{stringview_Object{u8"jp", nullptr}}, + aliasList_struct{stringview_Object{u8"spa", nullptr}}, + aliasList_struct{stringview_Object{u8"ru", nullptr}}, + aliasList_struct{stringview_Object{u8"it", nullptr}}, + aliasList_struct{stringview_Object{u8"pl", nullptr}}, + aliasList_struct{stringview_Object{u8"dan", nullptr}}, + aliasList_struct{stringview_Object{u8"rom", nullptr}}, + aliasList_struct{stringview_Object{u8"hu", nullptr}}}; fast_io::vector languagefrom{ - aliasList_struct{stringview_Judge{u8"auto", nullptr}}, - aliasList_struct{stringview_Judge{u8"yue", nullptr}}, - aliasList_struct{stringview_Judge{u8"kor", nullptr}}, - aliasList_struct{stringview_Judge{u8"th", nullptr}}, - aliasList_struct{stringview_Judge{u8"pt", nullptr}}, - aliasList_struct{stringview_Judge{u8"el", nullptr}}, - aliasList_struct{stringview_Judge{u8"bul", nullptr}}, - aliasList_struct{stringview_Judge{u8"fin", nullptr}}, - aliasList_struct{stringview_Judge{u8"slo", nullptr}}, - aliasList_struct{stringview_Judge{u8"cht", nullptr}}, - aliasList_struct{stringview_Judge{u8"zh", nullptr}}, - aliasList_struct{stringview_Judge{u8"wyw", nullptr}}, - aliasList_struct{stringview_Judge{u8"fra", nullptr}}, - aliasList_struct{stringview_Judge{u8"ara", nullptr}}, - aliasList_struct{stringview_Judge{u8"de", nullptr}}, - aliasList_struct{stringview_Judge{u8"nl", nullptr}}, - aliasList_struct{stringview_Judge{u8"est", nullptr}}, - aliasList_struct{stringview_Judge{u8"cs", nullptr}}, - aliasList_struct{stringview_Judge{u8"swe", nullptr}}, - aliasList_struct{stringview_Judge{u8"vie", nullptr}}, - aliasList_struct{stringview_Judge{u8"en", nullptr}}, - aliasList_struct{stringview_Judge{u8"jp", nullptr}}, - aliasList_struct{stringview_Judge{u8"spa", nullptr}}, - aliasList_struct{stringview_Judge{u8"ru", nullptr}}, - aliasList_struct{stringview_Judge{u8"it", nullptr}}, - aliasList_struct{stringview_Judge{u8"pl", nullptr}}, - aliasList_struct{stringview_Judge{u8"dan", nullptr}}, - aliasList_struct{stringview_Judge{u8"rom", nullptr}}, - aliasList_struct{stringview_Judge{u8"hu", nullptr}}}; + aliasList_struct{stringview_Object{u8"auto", &languageto}}, + aliasList_struct{stringview_Object{u8"yue", &languageto}}, + aliasList_struct{stringview_Object{u8"kor", &languageto}}, + aliasList_struct{stringview_Object{u8"th", &languageto}}, + aliasList_struct{stringview_Object{u8"pt", &languageto}}, + aliasList_struct{stringview_Object{u8"el", &languageto}}, + aliasList_struct{stringview_Object{u8"bul", &languageto}}, + aliasList_struct{stringview_Object{u8"fin", &languageto}}, + aliasList_struct{stringview_Object{u8"slo", &languageto}}, + aliasList_struct{stringview_Object{u8"cht", &languageto}}, + aliasList_struct{stringview_Object{u8"zh", &languageto}}, + aliasList_struct{stringview_Object{u8"wyw", &languageto}}, + aliasList_struct{stringview_Object{u8"fra", &languageto}}, + aliasList_struct{stringview_Object{u8"ara", &languageto}}, + aliasList_struct{stringview_Object{u8"de", &languageto}}, + aliasList_struct{stringview_Object{u8"nl", &languageto}}, + aliasList_struct{stringview_Object{u8"est", &languageto}}, + aliasList_struct{stringview_Object{u8"cs", &languageto}}, + aliasList_struct{stringview_Object{u8"swe", &languageto}}, + aliasList_struct{stringview_Object{u8"vie", &languageto}}, + aliasList_struct{stringview_Object{u8"en", &languageto}}, + aliasList_struct{stringview_Object{u8"jp", &languageto}}, + aliasList_struct{stringview_Object{u8"spa", &languageto}}, + aliasList_struct{stringview_Object{u8"ru", &languageto}}, + aliasList_struct{stringview_Object{u8"it", &languageto}}, + aliasList_struct{stringview_Object{u8"pl", &languageto}}, + aliasList_struct{stringview_Object{u8"dan", &languageto}}, + aliasList_struct{stringview_Object{u8"rom", &languageto}}, + aliasList_struct{stringview_Object{u8"hu", &languageto}}}; fast_io::vector com{ - aliasList_struct{stringview_Judge{u8"appid", nullptr}}, - aliasList_struct{stringview_Judge{u8"key", nullptr}}, - aliasList_struct{stringview_Judge{u8"local", &languagefrom}}, - aliasList_struct{stringview_Judge{u8"server", &languagefrom}}}; + aliasList_struct{stringview_Object{u8"appid", nullptr}}, + aliasList_struct{stringview_Object{u8"key", nullptr}}, + aliasList_struct{stringview_Object{u8"local", &languagefrom}}, + aliasList_struct{stringview_Object{u8"server", &languagefrom}}}; ICommand TranslateCommand{ u8"translate", u8".translate or .transl [set [[loacl, server] , appid , key ], send , display ]", {u8"Translate with Baidu Translator", u8"使用百度翻译器翻译", u8"使用百度翻譯器翻譯", u8"Baidu Translator で翻訳する"}, {u8"transl"}, - fast_io::vector{aliasList_struct{stringview_Judge{u8"set", &com}}, - aliasList_struct{stringview_Judge{u8"send", nullptr}}, - aliasList_struct{stringview_Judge{u8"display", nullptr}}}, // If empty must use fast_io::vector{} + fast_io::vector{aliasList_struct{stringview_Object{u8"set", &com}}, + aliasList_struct{stringview_Object{u8"send", nullptr}}, + aliasList_struct{stringview_Object{u8"display", nullptr}}}, // If empty must use fast_io::vector{} nullptr, &TranslateCommand_onExecute};