diff --git a/resource/common/locale/English.toml b/resource/common/locale/English.toml index 6bc6f89..bf26d12 100644 --- a/resource/common/locale/English.toml +++ b/resource/common/locale/English.toml @@ -191,8 +191,6 @@ Remove = "Remove" Favourites = "Add to favourites" FavouritesNone = "You don't have any favourites!" FavouritesRemove = "Remove from favourites" -FavouritesRemoveText = "Removed from favourites" -FavouritesText = "Added to favourites" Close = "Close" QuickSSKey = "Quick screenshot" QuickTPKey = "Toggle quick teleport" @@ -331,7 +329,7 @@ Custom skin allows to change player skins without replacing any existing game pe Steps to enable 'Custom Skins', 1. Download & install modloader -2. Create a folder inside 'modloader' folder with the name 'CustomSkins' +2. Create a folder inside 'modloader' folder with the name 'CustomSkinsLoader' 3. Download ped skins online ( .dff & .txd files) and put them inside. 4. Restart your game. diff --git a/resource/common/locale/Portuguese.toml b/resource/common/locale/Portuguese.toml index 2b8d0cf..89f98af 100644 --- a/resource/common/locale/Portuguese.toml +++ b/resource/common/locale/Portuguese.toml @@ -273,7 +273,7 @@ Etapas para ativar 'Skins personalizadas', 1. Baixe & instale o modloader -2. Crie uma pasta dentro da pasta 'modloader' com o nome 'CustomSkins' +2. Crie uma pasta dentro da pasta 'modloader' com o nome 'CustomSkinsLoader' 3. Baixe skins online (arquivos .dff & .txd) e coloque-os dentro. diff --git a/resource/common/locale/Russian.toml b/resource/common/locale/Russian.toml index 2c35e5b..ff7053d 100644 --- a/resource/common/locale/Russian.toml +++ b/resource/common/locale/Russian.toml @@ -205,8 +205,6 @@ Remove = "Удалить" Favourites = "Добавить в избранное" FavouritesNone = "У вас нет ничего в избранном!" FavouritesRemove = "Удалить из избранного" -FavouritesRemoveText = "Удалено из избранного" -FavouritesText = "Добавлено в избранное" Close = "Закрыть" QuickSSKey = "Снимок экрана" QuickTPKey = "Показать карту телепортации" diff --git a/resource/common/locale/Spanish.toml b/resource/common/locale/Spanish.toml index eff8e61..f82fa29 100644 --- a/resource/common/locale/Spanish.toml +++ b/resource/common/locale/Spanish.toml @@ -266,7 +266,7 @@ Pasos para activar 'Skins personalizadas', 1. Descarga e instala modloader -2. Crea una carpeta dentro de la carpeta 'modloader' con el nombre 'CustomSkins' +2. Crea una carpeta dentro de la carpeta 'modloader' con el nombre 'CustomSkinsLoader' 3. Descarga skins de peds online (archivos .dff y .txd) y ponlos adentro de la carpeta. diff --git a/resource/common/locale/chinese.toml b/resource/common/locale/chinese.toml index 2055ebd..a3620f8 100644 --- a/resource/common/locale/chinese.toml +++ b/resource/common/locale/chinese.toml @@ -189,8 +189,6 @@ Remove = "删除" Favourites = "添加到收藏夹" FavouritesNone = "你没有任何收藏夹!" FavouritesRemove = "从收藏夹中删除" -FavouritesRemoveText = "从收藏夹中删除" -FavouritesText = "添加到收藏夹" Close = "关闭" QuickSSKey = "快速屏幕截图" QuickTPKey = "快速传送" diff --git a/src/cheatmenu.cpp b/src/cheatmenu.cpp index e7ca1d2..13514e4 100644 --- a/src/cheatmenu.cpp +++ b/src/cheatmenu.cpp @@ -209,6 +209,7 @@ CheatMenuMgr::CheatMenuMgr() ApplyStyle(); Locale::Init(FILE_NAME "/locale/", "English", "English"); + Locale::SetLocaleByName(gConfig.Get("Menu.Language", "")); Overlay::Init(); // Load menu settings diff --git a/src/custom/customskins_sa.cpp b/src/custom/customskins_sa.cpp index 86fbbbc..2871a14 100644 --- a/src/custom/customskins_sa.cpp +++ b/src/custom/customskins_sa.cpp @@ -8,7 +8,7 @@ CustomSkinsMgr::CustomSkinsMgr() std::string path = GAME_PATH((char*)"modloader/"); if (GetModuleHandle("modloader.asi") && std::filesystem::is_directory(path)) { - path += "CustomSkins/"; + path += "CustomSkinsLoader/"; if (std::filesystem::is_directory(path)) { for (auto& p : std::filesystem::recursive_directory_iterator(path)) diff --git a/src/pages/menu.cpp b/src/pages/menu.cpp index 1c23da9..a6f7162 100644 --- a/src/pages/menu.cpp +++ b/src/pages/menu.cpp @@ -77,6 +77,7 @@ void MenuPage::Draw() { if (Locale::SetLocale(selected) == Locale::eReturnCodes::SUCCESS) { + gConfig.Set("Menu.Language", vec[selected]); // CheatMenu::GenHeaderList(); } else diff --git a/src/utils/locale.cpp b/src/utils/locale.cpp index 9d80276..e78d6d4 100644 --- a/src/utils/locale.cpp +++ b/src/utils/locale.cpp @@ -103,14 +103,7 @@ size_t Locale::GetCurrentLocaleIndex() void Locale::SetDefaultLocale() { - for (size_t i = 0; i < m_locales.size(); ++i) - { - if (m_locales[i] == "English") - { - SetLocale(i); - return; - } - } + SetLocaleByName("English"); } Locale::eReturnCodes Locale::SetLocale(size_t index) @@ -131,6 +124,19 @@ Locale::eReturnCodes Locale::SetLocale(size_t index) return eReturnCodes::SUCCESS; } +Locale::eReturnCodes Locale::SetLocaleByName(const std::string& name) +{ + for (size_t i = 0; i < m_locales.size(); ++i) + { + if (m_locales[i] == name) + { + return SetLocale(i); + } + } + + return eReturnCodes::NO_LOCALE_FOUND; +} + std::string Locale::GetText(std::string&& key, std::string&& defaultValue) { if (m_pData == nullptr) diff --git a/src/utils/locale.h b/src/utils/locale.h index 1c66ae0..f45a593 100644 --- a/src/utils/locale.h +++ b/src/utils/locale.h @@ -58,6 +58,7 @@ public: index is the index of the language in the GetLocaleList() list */ static eReturnCodes SetLocale(size_t index); + static eReturnCodes SetLocaleByName(const std::string &name); /* Sets the language back to default (aka English) diff --git a/src/utils/widget.cpp b/src/utils/widget.cpp index 163919d..9c94b38 100644 --- a/src/utils/widget.cpp +++ b/src/utils/widget.cpp @@ -142,7 +142,6 @@ void DrawClippedList(ResourceStore& data, fArg3_t clickFunc, bool favourites, bo { data.m_pData->Set(std::format("Favourites.{}", contextMenu.key).c_str(), contextMenu.val); data.m_pData->Save(); - Util::SetMessage(TEXT("Menu.FavouritesText")); } if (!favourites && ImGui::MenuItem(TEXT("Menu.Remove"))) { @@ -165,7 +164,6 @@ void DrawClippedList(ResourceStore& data, fArg3_t clickFunc, bool favourites, bo data.m_pData->RemoveKey("Favourites", contextMenu.key.c_str()); data.m_pData->Save(); data.UpdateSearchList(true); - Util::SetMessage(TEXT("Menu.FavouritesRemoveText")); } if (ImGui::MenuItem(TEXT("Menu.Close"))) @@ -354,7 +352,6 @@ void DrawClippedImages(ResourceStore& data, ImVec2 imgSz, size_t imagesInRow, bo { data.m_pData->Set(std::format("Favourites.{}", contextMenu.key).c_str(), contextMenu.val); data.m_pData->Save(); - Util::SetMessage(TEXT("Menu.FavouritesText")); } if (!favourites && contextMenu.added && ImGui::MenuItem(TEXT("Menu.Remove"))) { @@ -368,7 +365,6 @@ void DrawClippedImages(ResourceStore& data, ImVec2 imgSz, size_t imagesInRow, bo data.m_pData->RemoveKey("Favourites", contextMenu.key.c_str()); data.m_pData->Save(); data.UpdateSearchList(true, getNameFunc, verifyFunc); - Util::SetMessage(TEXT("Menu.FavouritesRemoveText")); } if (ImGui::MenuItem(TEXT("Menu.Close"))) { diff --git a/tools/premake5.lua b/tools/premake5.lua index 9e81eac..7982267 100644 --- a/tools/premake5.lua +++ b/tools/premake5.lua @@ -10,7 +10,7 @@ PSDK_DIR = os.getenv("PLUGIN_SDK_DIR") DX9SDK_DIR = os.getenv("DXSDK_DIR") if (DX9SDK_DIR == nil) then - error("DXSDK_DIR environment variable not set") + -- error("DXSDK_DIR environment variable not set") end if (PSDK_DIR == nil) then