Add translation support for Animation page

This commit is contained in:
Grinch_ 2022-02-14 23:31:05 +06:00
parent 1606869430
commit 5aca6bd92d
3 changed files with 152 additions and 124 deletions

View File

@ -1,99 +1,127 @@
{ {
"Main" : "Animation": {
{ "AddAnimation": "Add animation",
"TranslatorName" : "Grinch_", "AddParticle": "Add particle",
"TranslationLanguage" : "English", "AnimationRemoved": "Animation removed",
"TranslationLanguageDisclaimer" : "Translated to English by Grinch_" "AnimationTab": "Animation##TABBAR",
"AnimName": "Anim name",
"CustomAnimsOnly": "You can only remove custom animations",
"CustomParticlesOnly": "You can only remove custom particles",
"CutsceneRunning": "Another cutscene is running",
"CutsceneTab": "Cutscene##TABBAR",
"FightingStyle": "Fighting style",
"FightingStyleSet": "Fighting style set",
"IFPName": "IFP name",
"InvisiblePlayer": "Invisible player",
"LoopCheckbox": "Loop",
"LoopCheckboxText": "Keep playing the animation on repeat",
"NoTarget": "No player target found. Aim a ped with a weapon to select it for animation player.",
"ParticleName": "Particle name",
"ParticleRemoved": "Particle removed",
"ParticleTab": "Particle##TABBAR",
"PedAnim": "Ped anim",
"PedAnimText": "Play animation on other peds.\nSelect with weapon target.",
"RemoveAll": "Remove all",
"RemoveLatest": "Remove latest",
"SecondaryCheckbox": "Secondary",
"SecondaryCheckboxText": "Player can move while playing the animation",
"StopAnimation": "Stop Animation",
"StopCutscene": "Stop cutscene",
"Styles": "Styles",
"WalkingStyle": "Walking style",
"WalkingStyleSet": "Walking style set"
}, },
"Teleport" : "Main": {
{ "TranslationLanguage": "English",
"TargetBlipText" : "Target blip not found. You need to place it on the map first", "TranslationLanguageDisclaimer": "Translated to English by Grinch_",
"InvalidLocation" : "Invalid location", "TranslatorName": "Grinch_"
"LocationRemoved" : "Location removed",
"CustomLocationRemoveOnly" : "You can only remove custom location",
"InsertCoord" : "Insert coordinates",
"QuickTeleport" : "Quick teleport",
"QuickTeleportHint" : "Teleport to the location of your radar\ntarget blip using ",
"Coordinates" : "Coordinates",
"TeleportToCoord" : "Teleport to coordinates",
"InvalidCoord" : "Invalid coordinates",
"TeleportMarker" : "Teleport to marker",
"TeleportCenter" : "Teleport to center",
"Location" : "Location",
"LocationHint" : "Groove Street",
"AddLocation" : "Add location"
}, },
"Window" : "Menu": {
{ "About": "About",
"TeleportPage" : "Teleport", "Author": "Author",
"PlayerPage" : "Player", "BugDisclaimer": "If you find bugs or have suggestions, let me know on discord.",
"PedPage" : "Ped", "Build": "Build",
"VehiclePage" : "Vehicle", "CheckUpdate": "Check update",
"WeaponPage" : "Weapon", "Commands": "Commands",
"AnimationPage" : "Animation", "Config": "Config",
"GamePage" : "Game", "CopyrightDisclaimer": "Copyright Grinch_ 2019-2022. All rights reserved.",
"VisualPage" : "Visual", "Credits": "Credits",
"MenuPage" : "Menu", "DiscordServer": "Discord server",
"Search" : "Search", "FixVehKey": "Fix current vehicle",
"AddNew" : "Add new" "FlipVehKey": "Flip current vehicle",
"FreecamKey": "Toggle freecam",
"GitHubRepo": "GitHub repo",
"GodModeKey": "Toggle god mode",
"Hotkeys": "Hotkeys",
"Language": "Language",
"LanguageChangeFailed": "Failed to change language!",
"Name": "Name",
"NoBG": "No background",
"OpenCMDKey": "Open/ close command window",
"OpenCMDUsing": "Open or close command window using %s",
"OpenMenuKey": "Open/ close cheat menu",
"Overlay": "Overlay",
"Position": "Position",
"QuickSSKey": "Quick screenshot",
"QuickTPKey": "Toogle quick teleport",
"QuickVehSpawnerCMD": "Quick vehicle spawner",
"QuickVehSpawnerCMDText": "Spawn vehicles by typing their model names.\nExample: veh (veh_name)",
"QuickWepSpawnerCMD": "Quick weapon spawner",
"QuickWepSpawnerCMDText": "Spawn weapons by typing their model names.\nExample: wep (wep_name)",
"ResetConfig": "Reset config",
"ResetConfigMSG": "Config has been reset. Restart the game for it to take effect.",
"ResetSize": "Reset sonfig",
"SetHealthCMD": "Set health",
"SetHealthCMDText": "Set player health.\nExample: hp (health).",
"SetTimeCMD": "Set time",
"SetTimeCMDText": "Set current game time.\nExample: time (hour) (minute).\n",
"SetTimeCMDText2": "Writing something like 'time 12' would be interpreted as 'time 12 12'",
"ShowCoords": "Show coordinates",
"ShowCPU": "Show CPU usage",
"ShowFPS": "Show FPS",
"ShowLocation": "Show location",
"ShowRAM": "Show RAM usage",
"ShowVehHealth": "Show veh health",
"ShowVehSpeed": "Show veh speed",
"SkinChangerKey": "Activate aim skin changer",
"TeleportCMD": "Teleport",
"TeleportCMDText": "Teleports player to specified coordinates.\nExample: tp x y z",
"TextColor": "Text color",
"Usage": "Usage",
"UsageText": "Left-click selects hotkey.\nLeft clicking outside deselects.\nRight click disables hotkey.",
"VehEngineKey": "Toggle vehicle engine",
"VehStartKey": "Vehicle instant start",
"VehStopKey": "Vehicle instant start",
"Version": "Version"
}, },
"Menu" : "Teleport": {
{ "AddLocation": "Add location",
"BugDisclaimer" : "If you find bugs or have suggestions, let me know on discord.", "Coordinates": "Coordinates",
"CopyrightDisclaimer" : "Copyright Grinch_ 2019-2022. All rights reserved.", "CustomLocationRemoveOnly": "You can only remove custom location",
"Author" : "Author", "InsertCoord": "Insert coordinates",
"Version" : "Version", "InvalidCoord": "Invalid coordinates",
"Build" : "Build", "InvalidLocation": "Invalid location",
"CheckUpdate" : "Check update", "Location": "Location",
"DiscordServer" : "Discord server", "LocationHint": "Groove Street",
"GitHubRepo" : "GitHub repo", "LocationRemoved": "Location removed",
"Usage" : "Usage", "QuickTeleport": "Quick teleport",
"UsageText" : "Left-click selects hotkey.\nLeft clicking outside deselects.\nRight click disables hotkey.", "QuickTeleportHint": "Teleport to the location of your radar\ntarget blip using ",
"OpenMenuKey" : "Open/ close cheat menu", "TargetBlipText": "Target blip not found. You need to place it on the map first",
"OpenCMDKey" : "Open/ close command window", "TeleportCenter": "Teleport to center",
"SkinChangerKey" : "Activate aim skin changer", "TeleportMarker": "Teleport to marker",
"Config" : "Config", "TeleportToCoord": "Teleport to coordinates"
"Name" : "Name", },
"Credits" : "Credits", "Window": {
"FreecamKey" : "Toggle freecam", "AddNew": "Add new",
"QuickTPKey" : "Toogle quick teleport", "AnimationPage": "Animation",
"ResetConfig" : "Reset config", "GamePage": "Game",
"FixVehKey" : "Fix current vehicle", "MenuPage": "Menu",
"FlipVehKey" : "Flip current vehicle", "PedPage": "Ped",
"GodModeKey" : "Toggle god mode", "PlayerPage": "Player",
"VehEngineKey" : "Toggle vehicle engine", "Search": "Search",
"VehStartKey" : "Vehicle instant start", "TeleportPage": "Teleport",
"VehStopKey" : "Vehicle instant start", "VehiclePage": "Vehicle",
"QuickSSKey" : "Quick screenshot", "VisualPage": "Visual",
"OpenCMDUsing" : "Open or close command window using %s", "WeaponPage": "Weapon"
"SetHealthCMD" : "Set health",
"SetHealthCMDText" : "Set player health.\nExample: hp (health).",
"SetTimeCMD" : "Set time",
"SetTimeCMDText" : "Set current game time.\nExample: time (hour) (minute).\n",
"SetTimeCMDText2" : "Writing something like 'time 12' would be interpreted as 'time 12 12'",
"TeleportCMD" : "Teleport",
"TeleportCMDText" : "Teleports player to specified coordinates.\nExample: tp x y z",
"ResetConfigMSG" : "Config has been reset. Restart the game for it to take effect.",
"QuickVehSpawnerCMD" : "Quick vehicle spawner",
"QuickVehSpawnerCMDText" : "Spawn vehicles by typing their model names.\nExample: veh (veh_name)",
"QuickWepSpawnerCMD" : "Quick weapon spawner",
"QuickWepSpawnerCMDText" : "Spawn weapons by typing their model names.\nExample: wep (wep_name)",
"ResetSize" : "Reset sonfig",
"Overlay" : "Overlay",
"Position" : "Position",
"Language" : "Language",
"TextColor" : "Text color",
"NoBG" : "No background",
"ShowCoords" : "Show coordinates",
"ShowCPU" : "Show CPU usage",
"ShowFPS" : "Show FPS",
"ShowLocation" : "Show location",
"ShowRAM" : "Show RAM usage",
"ShowVehHealth" : "Show veh health",
"ShowVehSpeed" : "Show veh speed",
"Hotkeys" : "Hotkeys",
"Commands" : "Commands",
"About" : "About",
"LanguageChangeFailed" : "Failed to change language!"
} }
} }

View File

@ -23,7 +23,7 @@ void Animation::PlayCutscene(std::string& rootKey, std::string& cutsceneId, std:
{ {
if (Util::IsOnCutscene()) if (Util::IsOnCutscene())
{ {
SetHelpMessage("Another cutscene is running", false, false, false); SetHelpMessage(TEXT("Animation.CutsceneRunning"), false, false, false);
return; return;
} }
@ -62,11 +62,11 @@ void Animation::RemoveParticle(std::string& ifp, std::string& particle, std::str
{ {
m_Particle::m_Data.m_pJson->m_Data["Custom"].erase(particle); m_Particle::m_Data.m_pJson->m_Data["Custom"].erase(particle);
m_Particle::m_Data.m_pJson->WriteToDisk(); m_Particle::m_Data.m_pJson->WriteToDisk();
SetHelpMessage("Particle removed", false, false, false); SetHelpMessage(TEXT("Animation.ParticleRemoved"));
} }
else else
{ {
SetHelpMessage("You can only remove custom particles", false, false, false); SetHelpMessage(TEXT("Animation.CustomParticlesOnly"));
} }
} }
@ -285,10 +285,10 @@ void Animation::ShowPage()
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::BeginTabItem("Animation##TABBAR")) if (ImGui::BeginTabItem(TEXT("Animation.AnimationTab")))
{ {
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button("Stop animation", Ui::GetSize())) if (ImGui::Button(TEXT("Animation.StopAnimation"), Ui::GetSize()))
{ {
if (hPlayer) if (hPlayer)
{ {
@ -302,27 +302,27 @@ void Animation::ShowPage()
ImGui::Spacing(); ImGui::Spacing();
ImGui::Columns(2, nullptr, false); ImGui::Columns(2, nullptr, false);
Ui::CheckboxWithHint("Loop", &m_Loop, "Keep playing the animation on repeat"); Ui::CheckboxWithHint(TEXT("Animation.LoopCheckbox"), &m_Loop, TEXT("Animation.LoopCheckboxText"));
Ui::CheckboxWithHint("Secondary", &m_bSecondary, "Player can move while playing the animation"); Ui::CheckboxWithHint(TEXT("Animation.SecondaryCheckbox"), &m_bSecondary, TEXT("Animation.SecondaryCheckboxText"));
ImGui::NextColumn(); ImGui::NextColumn();
#ifdef GTASA #ifdef GTASA
Ui::CheckboxWithHint("Ped anim", &m_PedAnim, "Play animation on other peds.\nSelect with weapon target."); Ui::CheckboxWithHint(TEXT("Animation.PedAnim"), &m_PedAnim, TEXT("Animation.PedAnimText"));
#endif #endif
ImGui::Columns(1); ImGui::Columns(1);
ImGui::Spacing(); ImGui::Spacing();
if (m_PedAnim && !m_pTarget) if (m_PedAnim && !m_pTarget)
{ {
ImGui::TextWrapped("No player target found. Aim a ped with a weapon to select it for animation player."); ImGui::TextWrapped(TEXT("Animation.NoTarget"));
} }
else else
{ {
if (ImGui::CollapsingHeader("Add new")) if (ImGui::CollapsingHeader(TEXT("Window.AddNew")))
{ {
ImGui::InputTextWithHint("IFP name", "ped", m_nIfpBuffer, INPUT_BUFFER_SIZE); ImGui::InputTextWithHint(TEXT("Animation.IFPName"), "ped", m_nIfpBuffer, INPUT_BUFFER_SIZE);
ImGui::InputTextWithHint("Anim name", "cower", m_nAnimBuffer, INPUT_BUFFER_SIZE); ImGui::InputTextWithHint(TEXT("Animation.AnimName"), "cower", m_nAnimBuffer, INPUT_BUFFER_SIZE);
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button("Add animation", Ui::GetSize())) if (ImGui::Button(TEXT("Animation.AddAnimation"), Ui::GetSize()))
{ {
m_AnimData.m_pJson->m_Data["Custom"][m_nAnimBuffer] = ("0, " + std::string(m_nIfpBuffer)); m_AnimData.m_pJson->m_Data["Custom"][m_nAnimBuffer] = ("0, " + std::string(m_nIfpBuffer));
m_AnimData.m_pJson->WriteToDisk(); m_AnimData.m_pJson->WriteToDisk();
@ -340,10 +340,10 @@ void Animation::ShowPage()
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
#ifdef GTASA #ifdef GTASA
if (ImGui::BeginTabItem("Cutscene")) if (ImGui::BeginTabItem(TEXT("Animation.CutsceneTab")))
{ {
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button("Stop cutscene", Ui::GetSize())) if (ImGui::Button(TEXT("Animation.StopCutscene"), Ui::GetSize()))
{ {
if (m_Cutscene::m_bRunning) if (m_Cutscene::m_bRunning)
{ {
@ -367,10 +367,10 @@ void Animation::ShowPage()
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem("Particle##TABBAR")) if (ImGui::BeginTabItem(TEXT("Animation.ParticleTab")))
{ {
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button("Remove all", Ui::GetSize(2))) if (ImGui::Button(TEXT("Animation.RemoveAll"), Ui::GetSize(2)))
{ {
for (int& p : m_Particle::m_nParticleList) for (int& p : m_Particle::m_nParticleList)
{ {
@ -379,22 +379,22 @@ void Animation::ShowPage()
m_Particle::m_nParticleList.clear(); m_Particle::m_nParticleList.clear();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Remove latest", Ui::GetSize(2))) if (ImGui::Button(TEXT("Animation.RemoveLatest"), Ui::GetSize(2)))
{ {
Command<Commands::KILL_FX_SYSTEM>(m_Particle::m_nParticleList.back()); // stop if anything is running Command<Commands::KILL_FX_SYSTEM>(m_Particle::m_nParticleList.back()); // stop if anything is running
m_Particle::m_nParticleList.pop_back(); m_Particle::m_nParticleList.pop_back();
} }
ImGui::Spacing(); ImGui::Spacing();
if (Ui::CheckboxBitFlag("Invisible player", pPlayer->m_nPedFlags.bDontRender)) if (Ui::CheckboxBitFlag(TEXT("Animation.InvisiblePlayer"), pPlayer->m_nPedFlags.bDontRender))
{ {
pPlayer->m_nPedFlags.bDontRender = (pPlayer->m_nPedFlags.bDontRender == 1) ? 0 : 1; pPlayer->m_nPedFlags.bDontRender = (pPlayer->m_nPedFlags.bDontRender == 1) ? 0 : 1;
} }
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::CollapsingHeader("Add new")) if (ImGui::CollapsingHeader(TEXT("Window.AddNew")))
{ {
ImGui::InputTextWithHint("Particle name", "kkjj_on_fire", m_Particle::m_NameBuffer, INPUT_BUFFER_SIZE); ImGui::InputTextWithHint(TEXT("Animation.ParticleName"), "kkjj_on_fire", m_Particle::m_NameBuffer, INPUT_BUFFER_SIZE);
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button("Add animation", Ui::GetSize())) if (ImGui::Button(TEXT("Animation.AddParticle"), Ui::GetSize()))
{ {
m_Particle::m_Data.m_pJson->m_Data["Custom"][m_Particle::m_NameBuffer] = "Dummy"; m_Particle::m_Data.m_pJson->m_Data["Custom"][m_Particle::m_NameBuffer] = "Dummy";
m_Particle::m_Data.m_pJson->WriteToDisk(); m_Particle::m_Data.m_pJson->WriteToDisk();
@ -409,15 +409,15 @@ void Animation::ShowPage()
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem("Style")) if (ImGui::BeginTabItem(TEXT("Animation.Styles")))
{ {
ImGui::Spacing(); ImGui::Spacing();
if (Ui::ListBox("Fighting style", m_FightingStyleList, m_nFightingStyle)) if (Ui::ListBox(TEXT("Animation.FightingStyle"), m_FightingStyleList, m_nFightingStyle))
{ {
Command<Commands::GIVE_MELEE_ATTACK_TO_CHAR>(hPlayer, m_nFightingStyle + 4, 6); Command<Commands::GIVE_MELEE_ATTACK_TO_CHAR>(hPlayer, m_nFightingStyle + 4, 6);
SetHelpMessage("Fighting anim set", false, false, false); SetHelpMessage(TEXT("Animation.FightingStyleSet"));
} }
if (Ui::ListBoxStr("Walking style", m_WalkingStyleList, m_nWalkingStyle)) if (Ui::ListBoxStr(TEXT("Animation.WalkingStyle"), m_WalkingStyleList, m_nWalkingStyle))
{ {
if (m_nWalkingStyle == "default") if (m_nWalkingStyle == "default")
{ {
@ -432,7 +432,7 @@ void Animation::ShowPage()
Command<Commands::SET_ANIM_GROUP_FOR_CHAR>(hPlayer, m_nWalkingStyle.c_str()); Command<Commands::SET_ANIM_GROUP_FOR_CHAR>(hPlayer, m_nWalkingStyle.c_str());
Command<Commands::REMOVE_ANIMATION>(m_nWalkingStyle.c_str()); Command<Commands::REMOVE_ANIMATION>(m_nWalkingStyle.c_str());
} }
SetHelpMessage("Walking anim set", false, false, false); SetHelpMessage(TEXT("Animation.WalkingStyleSet"));
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -447,10 +447,10 @@ void Animation::RemoveAnimation(std::string& ifp, std::string& anim, std::string
{ {
m_AnimData.m_pJson->m_Data["Custom"].erase(anim); m_AnimData.m_pJson->m_Data["Custom"].erase(anim);
m_AnimData.m_pJson->WriteToDisk(); m_AnimData.m_pJson->WriteToDisk();
SetHelpMessage("Animation removed", false, false, false); SetHelpMessage(TEXT("Animation.AnimationRemoved"));
} }
else else
{ {
SetHelpMessage("You can only remove custom anims", false, false, false); SetHelpMessage(TEXT("Animation.CustomAnimsOnly"));
} }
} }

View File

@ -2,5 +2,5 @@
#define MENU_NAME "Cheat Menu" #define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "3.2" #define MENU_VERSION_NUMBER "3.2"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta" #define MENU_VERSION MENU_VERSION_NUMBER"-beta"
#define BUILD_NUMBER "20220212" #define BUILD_NUMBER "20220214"
#define MENU_TITLE MENU_NAME " v" MENU_VERSION #define MENU_TITLE MENU_NAME " v" MENU_VERSION