From 3cf3e8dd5ac652d482be6d2a2d65d6ad1583b77c Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Sun, 31 Jul 2022 03:57:09 +0600 Subject: [PATCH] Add showmodelinfo & showpedtasks to overlay --- .vscode/c_cpp_properties.json | 1 - resource/common/locale/English.toml | 7 +- src/animation.cpp | 62 +- src/animation.h | 4 + src/cheatmenu.cpp | 55 +- src/cheatmenu.h | 2 +- src/game.cpp | 16 +- src/menu.cpp | 373 +----- src/menu.h | 43 - src/overlay.cpp | 489 ++++++++ src/overlay.h | 64 + src/pch.h | 18 +- src/ped.cpp | 4 +- src/player.cpp | 8 +- src/tasknames.cpp | 1806 +++++++++++++++++++++++++++ src/teleport.cpp | 14 +- src/updater.cpp | 6 +- src/util.cpp | 15 + src/util.h | 2 +- src/vehicle.cpp | 28 +- src/visual.cpp | 121 +- src/visual.h | 16 +- src/widget.cpp | 8 +- 23 files changed, 2545 insertions(+), 617 deletions(-) create mode 100644 src/overlay.cpp create mode 100644 src/overlay.h create mode 100644 src/tasknames.cpp diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 4ca2b8c..3166d94 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -5,7 +5,6 @@ "includePath": [ "${workspaceFolder}/**", "${PLUGIN_SDK_DIR}/*", - "${DIRECTX9_SDK_DIR}/Include/*", "${PLUGIN_SDK_DIR}/plugin_sa/*", "${PLUGIN_SDK_DIR}/plugin_sa/game_sa/*", "${PLUGIN_SDK_DIR}/shared/*", diff --git a/resource/common/locale/English.toml b/resource/common/locale/English.toml index 14bc1b5..46df4a5 100644 --- a/resource/common/locale/English.toml +++ b/resource/common/locale/English.toml @@ -35,6 +35,9 @@ SecondaryCheckboxText = "Player can move while playing the animation" StopAnimation = "Stop Animation" StopCutscene = "Stop cutscene" Styles = "Styles" +Tasks = "Tasks" +PrimaryTasks = "Primary tasks" +SecondaryTasks = "Secondary tasks" WalkingStyle = "Walking style" WalkingStyleSet = "Walking style set" @@ -223,6 +226,8 @@ ShowCoords = "Show coordinates" ShowCPU = "Show CPU usage" ShowFPS = "Show FPS" ShowLocation = "Show location" +ShowModelInfo = "Show model info" +ShowPedTasks = "Show ped tasks" ShowRAM = "Show RAM usage" ShowVehHealth = "Show veh health" ShowVehSpeed = "Show veh speed" @@ -704,7 +709,6 @@ RadioStationColor = "Radio station color" ResetTimecyc = "Reset timecyc" ShadowStrength = "Shadow strength" ShowHud = "Show HUD" -ShowModelInfo = "Show model info" ShowRadar = "Show radar" SkyBottom = "Sky bottom" SkyTop = "Sky top" @@ -779,6 +783,7 @@ to every ped weapon type""" AddNew = "Add new" AnimationPage = "Animation" CheckboxTab = "Checkboxes" +CopiedToClipboard = "Copied to clipboard" Default = "Def" Enabled = "Enabled" GamePage = "Game" diff --git a/src/animation.cpp b/src/animation.cpp index 6ea76cb..46d9e5c 100644 --- a/src/animation.cpp +++ b/src/animation.cpp @@ -20,11 +20,13 @@ #endif #ifdef GTASA +#include "overlay.h" + void Cutscene::Play(std::string& rootKey, std::string& cutsceneId, std::string& interior) { if (Util::IsOnCutscene()) { - SetHelpMessage(TEXT("Animation.CutsceneRunning")); + Util::SetMessage(TEXT("Animation.CutsceneRunning")); return; } @@ -73,11 +75,11 @@ void Particle::Remove(std::string& ifp, std::string& particle, std::string& dumm { Particle::m_Data.m_pData->RemoveKey("Custom", particle.c_str()); Particle::m_Data.m_pData->Save(); - SetHelpMessage(TEXT("Animation.ParticleRemoved")); + Util::SetMessage(TEXT("Animation.ParticleRemoved")); } else { - SetHelpMessage(TEXT("Animation.CustomParticlesOnly")); + Util::SetMessage(TEXT("Animation.CustomParticlesOnly")); } } @@ -234,11 +236,11 @@ void Animation::Remove(std::string& ifp, std::string& anim, std::string& ifpRepe { m_AnimData.m_pData->RemoveKey("Custom", anim.c_str()); m_AnimData.m_pData->Save(); - SetHelpMessage(TEXT("Animation.AnimationRemoved")); + Util::SetMessage(TEXT("Animation.AnimationRemoved")); } else { - SetHelpMessage(TEXT("Animation.CustomAnimsOnly")); + Util::SetMessage(TEXT("Animation.CustomAnimsOnly")); } } @@ -365,6 +367,52 @@ void Animation::ShowPage() ImGui::EndTabItem(); } #ifdef GTASA + if (ImGui::BeginTabItem(TEXT("Animation.Tasks"))) + { + ImGui::Spacing(); + Widget::Checkbox(TEXT("Menu.ShowPedTasks"), &Overlay::m_bPedTasks); + ImGui::Spacing(); + CPlayerPed* player = FindPlayerPed(); + if (player) + { + ImGui::BeginChild("TasksList"); + ImGui::Text(TEXT("Animation.PrimaryTasks")); + ImGui::Separator(); + for (size_t i = 0; i != TASK_PRIMARY_MAX; ++i) + { + CTask *pTask = player->m_pIntelligence->m_TaskMgr.m_aPrimaryTasks[i]; + if (pTask) + { + const char *name = taskNames[pTask->GetId()]; + if (ImGui::MenuItem(name)) + { + ImGui::SetClipboardText(name); + Util::SetMessage(TEXT("Window.CopiedToClipboard")); + } + } + } + + ImGui::Dummy(ImVec2(0, 25)); + + ImGui::Text(TEXT("Animation.SecondaryTasks")); + ImGui::Separator(); + for (size_t i = 0; i != TASK_SECONDARY_MAX; ++i) + { + CTask *pTask = player->m_pIntelligence->m_TaskMgr.m_aSecondaryTasks[i]; + if (pTask) + { + const char *name = taskNames[pTask->GetId()]; + if (ImGui::MenuItem(name)) + { + ImGui::SetClipboardText(name); + Util::SetMessage(TEXT("Window.CopiedToClipboard")); + } + } + } + ImGui::EndChild(); + } + ImGui::EndTabItem(); + } if (ImGui::BeginTabItem(TEXT("Animation.CutsceneTab"))) { ImGui::Spacing(); @@ -464,7 +512,7 @@ void Animation::ShowPage() if (ImGui::Combo(TEXT("Animation.FightingStyle"), &fightStyle, fightStyles)) { Command(hPlayer, fightStyle + 4, 6); - SetHelpMessage(TEXT("Animation.FightingStyleSet")); + Util::SetMessage(TEXT("Animation.FightingStyleSet")); } if (Widget::ListBox(TEXT("Animation.WalkingStyle"), walkStyles, walkStyle)) { @@ -481,7 +529,7 @@ void Animation::ShowPage() Command(hPlayer, walkStyle.c_str()); Command(walkStyle.c_str()); } - SetHelpMessage(TEXT("Animation.WalkingStyleSet")); + Util::SetMessage(TEXT("Animation.WalkingStyleSet")); } ImGui::EndTabItem(); } diff --git a/src/animation.h b/src/animation.h index 4459f9b..bdf51ee 100644 --- a/src/animation.h +++ b/src/animation.h @@ -38,6 +38,10 @@ private: static void Play(std::string& rootKey, std::string& anim, std::string& ifp); static void Remove(std::string& rootKey, std::string& anim, std::string& ifp); +#ifdef GTASA + static void DrawPedTasks(); +#endif + public: Animation() = delete; Animation(const Animation&) = delete; diff --git a/src/cheatmenu.cpp b/src/cheatmenu.cpp index c2e30b8..a344718 100644 --- a/src/cheatmenu.cpp +++ b/src/cheatmenu.cpp @@ -15,6 +15,7 @@ #include "vehicle.h" #include "visual.h" #include "weapon.h" +#include "overlay.h" static bool DrawTitleBar() { @@ -76,43 +77,33 @@ void CheatMenu::DrawWindow() else { bRunning = true; - if (m_bShowMenu || BY_GAME(Menu::Commands::m_bShowMenu, true, true)) + if (m_bShowMenu) { - if (m_bShowMenu) + ImGui::SetNextWindowSize(m_fMenuSize); + + if (ImGui::Begin(MENU_TITLE, NULL, ImGuiWindowFlags_NoCollapse || ImGuiWindowFlags_NoTitleBar)) { - ImGui::SetNextWindowSize(m_fMenuSize); + m_bShowMenu = !DrawTitleBar(); + ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(250, 350)); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, + ImVec2(ImGui::GetWindowWidth() / 85, ImGui::GetWindowHeight() / 200)); - if (ImGui::Begin(MENU_TITLE, NULL, ImGuiWindowFlags_NoCollapse || ImGuiWindowFlags_NoTitleBar)) - { - m_bShowMenu = !DrawTitleBar(); - ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(250, 350)); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, - ImVec2(ImGui::GetWindowWidth() / 85, ImGui::GetWindowHeight() / 200)); + ProcessPages(); - ProcessPages(); + if (m_bSizeChangedExternal) + m_bSizeChangedExternal = false; + else + m_fMenuSize = ImGui::GetWindowSize(); - if (m_bSizeChangedExternal) - m_bSizeChangedExternal = false; - else - m_fMenuSize = ImGui::GetWindowSize(); + gConfig.Set("Window.SizeX", m_fMenuSize.x); + gConfig.Set("Window.SizeY", m_fMenuSize.y); - gConfig.Set("Window.SizeX", m_fMenuSize.x); - gConfig.Set("Window.SizeY", m_fMenuSize.y); - - ImGui::PopStyleVar(2); - ImGui::End(); - } + ImGui::PopStyleVar(2); + ImGui::End(); } -#ifdef GTASA - else - { - Menu::DrawCommandWindow(); - } -#endif } } - Menu::DrawOverlay(); - ShowModelInfo::Draw(); + Overlay::Draw(); } void CheatMenu::ProcessPages() @@ -271,6 +262,7 @@ void CheatMenu::Init() Vehicle::Init(); Visual::Init(); Weapon::Init(); + Overlay::Init(); Events::processScriptsEvent += []() { @@ -283,12 +275,7 @@ void CheatMenu::Init() if (commandWindow.Pressed()) { - if (Menu::Commands::m_bShowMenu) - { - Menu::ProcessCommands(); - strcpy(Menu::Commands::m_nInputBuffer, ""); - } - Menu::Commands::m_bShowMenu = !Menu::Commands::m_bShowMenu; + Overlay::m_bCmdBar = !Overlay::m_bCmdBar; } bool mouseState = D3dHook::GetMouseState(); diff --git a/src/cheatmenu.h b/src/cheatmenu.h index c2e727e..8d9b1c2 100644 --- a/src/cheatmenu.h +++ b/src/cheatmenu.h @@ -30,7 +30,7 @@ private: static void ApplyStyle(); // Draws the window ui each frame - // Also handles drawing overlay & command window + // Also handles drawing info, overlay, command window static void DrawWindow(); static void ShowAnniversaryPage(); diff --git a/src/game.cpp b/src/game.cpp index 28eb5a4..ea2ea87 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -79,7 +79,7 @@ void Freecam::Process() // disble them again cause they get enabled CHud::bScriptDontDisplayRadar = true; CHud::m_Wants_To_Draw_Hud = false; - SetHelpMessage(TEXT("Game.PlayerTeleported")); + Util::SetMessage(TEXT("Game.PlayerTeleported")); } if (KeyPressed(VK_MENU) && m_nMul > 1) @@ -150,7 +150,7 @@ void Freecam::Process() if (m_nMul < 10) { ++m_nMul; - SetHelpMessage(std::format("Speed: {}", m_nMul).c_str()); + Util::SetMessage(std::format("Speed: {}", m_nMul).c_str()); } } } @@ -172,8 +172,8 @@ void Freecam::Process() if (m_nMul > 1) { --m_nMul; - SetHelpMessage(std::to_string(m_nMul).c_str()); - SetHelpMessage(std::format("Speed: {}", m_nMul).c_str()); + Util::SetMessage(std::to_string(m_nMul).c_str()); + Util::SetMessage(std::format("Speed: {}", m_nMul).c_str()); } } } @@ -353,7 +353,7 @@ void Game::Init() if (quickSceenShot.Pressed()) { Command(); - SetHelpMessage(TEXT("Game.ScreenshotTaken")); + Util::SetMessage(TEXT("Game.ScreenshotTaken")); } } @@ -444,7 +444,7 @@ void SetPlayerMission(std::string& rootkey, std::string& name, std::string& id) } else { - SetHelpMessage(TEXT("Game.MissionStartFailed")); + Util::SetMessage(TEXT("Game.MissionStartFailed")); } } @@ -1037,7 +1037,7 @@ void Game::ShowPage() CStats::SetStatValue((unsigned short)i, 1000); } CHud::GetRidOfAllHudMessages(true); - SetHelpMessage(TEXT("Game.MaxWepSkillsText")); + Util::SetMessage(TEXT("Game.MaxWepSkillsText")); } ImGui::SameLine(); if (ImGui::Button(TEXT("Game.MaxVehSkills"), Widget::CalcSize(2))) @@ -1047,7 +1047,7 @@ void Game::ShowPage() CStats::SetStatValue(229, 1000); CStats::SetStatValue(230, 1000); CHud::GetRidOfAllHudMessages(true); - SetHelpMessage(TEXT("Game.MaxVehSkillsText")); + Util::SetMessage(TEXT("Game.MaxVehSkillsText")); } ImGui::Spacing(); diff --git a/src/menu.cpp b/src/menu.cpp index c471f29..f1f2a6d 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -5,333 +5,20 @@ #include "updater.h" #include "cheatmenu.h" #include "rpc.h" - -#ifdef GTASA -#include "teleport.h" -#include "weapon.h" -#include "vehicle.h" -#endif +#include "overlay.h" void Menu::Init() { - // TODO: use structs - // Load config data - Overlay::bCoord = gConfig.Get("Overlay.ShowCoordinates", false); - Overlay::bCpuUsage = gConfig.Get("Overlay.ShowCPUUsage", false); - Overlay::bFPS = gConfig.Get("Overlay.ShowFPS", false); - Overlay::bLocName = gConfig.Get("Overlay.ShowLocationName", false); - Overlay::bTransparent = gConfig.Get("Overlay.Transparent", false); - Overlay::bMemUsage = gConfig.Get("Overlay.ShowMemoryUsage", false); - Overlay::bVehHealth = gConfig.Get("Overlay.ShowVehicleHealth", false); - Overlay::bVehSpeed = gConfig.Get("Overlay.ShowVehicleSpeed", false); - Overlay::mSelectedPos = (DisplayPos)gConfig.Get("Overlay.SelectedPosition", (int)DisplayPos::BOTTOM_RIGHT); - Overlay::fPosX = gConfig.Get("Overlay.PosX", 0); - Overlay::fPosY = gConfig.Get("Overlay.PosY", 0); - Overlay::textColor[0] = gConfig.Get("Overlay.TextColor.Red", 1.0f); - Overlay::textColor[1] = gConfig.Get("Overlay.TextColor.Green", 1.0f); - Overlay::textColor[2] = gConfig.Get("Overlay.TextColor.Blue", 1.0f); - Overlay::textColor[3] = gConfig.Get("Overlay.TextColor.Alpha", 1.0f); m_bDiscordRPC = gConfig.Get("Menu.DiscordRPC", false); m_bAutoCheckUpdate = gConfig.Get("Menu.AutoCheckUpdate", true); m_bTextOnlyMode = gConfig.Get("Menu.TextOnlyMode", false); - Util::GetCPUUsageInit(); - MEMORYSTATUSEX memInfo; - memInfo.dwLength = sizeof(MEMORYSTATUSEX); - GlobalMemoryStatusEx(&memInfo); - - Overlay::mTotalRam = static_cast(memInfo.ullTotalPhys * 1e-6); // Bytes -> MegaBytes - if (m_bDiscordRPC) { RPC::Init(); } } -void Menu::DrawOverlay() -{ - CPlayerPed* pPlayer = FindPlayerPed(); - if (pPlayer) - { - bool m_bShowMenu = Overlay::bCoord || Overlay::bFPS || Overlay::bLocName || Overlay::bCpuUsage || Overlay::bMemUsage || - ((Overlay::bVehHealth || Overlay::bVehSpeed) && pPlayer && pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer); - - const float offset = 10.0f; - ImGuiIO& io = ImGui::GetIO(); - ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | - ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav; - - if (Overlay::mSelectedPos == DisplayPos::CUSTOM) - { - if (Overlay::fPosX != NULL && Overlay::fPosY != NULL) - { - gConfig.Set("Overlay.PosX", Overlay::fPosX); - gConfig.Set("Overlay.PosY", Overlay::fPosY); - ImGui::SetNextWindowPos(ImVec2(Overlay::fPosX, Overlay::fPosY), ImGuiCond_Once); - } - } - else - { - window_flags |= ImGuiWindowFlags_NoMove; - ImVec2 pos, pivot; - - if (Overlay::mSelectedPos == DisplayPos::TOP_LEFT) - { - pos = ImVec2(offset, offset); - pivot = ImVec2(0.0f, 0.0f); - } - - if (Overlay::mSelectedPos == DisplayPos::TOP_RIGHT) - { - pos = ImVec2(io.DisplaySize.x - offset, offset); - pivot = ImVec2(1.0f, 0.0f); - } - - if (Overlay::mSelectedPos == DisplayPos::BOTTOM_LEFT) - { - pos = ImVec2(offset, io.DisplaySize.y - offset); - pivot = ImVec2(0.0f, 1.0f); - } - - if (Overlay::mSelectedPos == DisplayPos::BOTTOM_RIGHT) - { - pos = ImVec2(io.DisplaySize.x - offset, io.DisplaySize.y - offset); - pivot = ImVec2(1.0f, 1.0f); - } - - ImGui::SetNextWindowPos(pos, ImGuiCond_Always, pivot); - } - - ImGui::SetNextWindowBgAlpha(Overlay::bTransparent ? 0.0f : 0.5f); - ImGui::PushStyleColor(ImGuiCol_Text, *(ImVec4*)&Overlay::textColor); - if (m_bShowMenu && ImGui::Begin("Overlay", nullptr, window_flags)) - { - CVector pos{0,0,0}; - pos = pPlayer->GetPosition(); - - size_t game_ms = CTimer::m_snTimeInMilliseconds; - static size_t interval = 0; - if (game_ms - interval > 1000) - { - Overlay::fCpuUsage = static_cast(Util::GetCurrentCPUUsage()); - - MEMORYSTATUSEX memInfo; - memInfo.dwLength = sizeof(MEMORYSTATUSEX); - GlobalMemoryStatusEx(&memInfo); - int mUsedRam = static_cast((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6); - Overlay::fMemUsage = 100.0f * (static_cast(mUsedRam) / static_cast(Overlay::mTotalRam)); - - Overlay::mFPS = static_cast(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate)); - interval = game_ms; - } - - if (Overlay::bCoord) - { - ImGui::Text(TEXT("Menu.Coords"), pos.x, pos.y, pos.z); - } - - if (Overlay::bCpuUsage) - { - ImGui::Text(TEXT("Menu.CPUUsage"), Overlay::fCpuUsage); - } - - if (Overlay::bFPS) - { - ImGui::Text(TEXT("Menu.Frames"), Overlay::mFPS); - } - - if (Overlay::bLocName) - { - ImGui::Text(TEXT("Menu.Location"), Util::GetLocationName(&pos).c_str()); - } - - if (Overlay::bMemUsage) - { - ImGui::Text(TEXT("Menu.RAMUsage"), Overlay::fMemUsage); - } - - if (pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer) - { - if (Overlay::bVehHealth) - { - ImGui::Text((TEXT_S("Menu.VehHealth") + ": %.f").c_str(), pPlayer->m_pVehicle->m_fHealth); - } - - if (Overlay::bVehSpeed) - { - int speed = pPlayer->m_pVehicle->m_vecMoveSpeed.Magnitude() * 50.0f; // 02E3 - GET_CAR_SPEED - ImGui::Text(TEXT("Menu.VehSpeed"), speed); - } - } - - ImVec2 windowPos = ImGui::GetWindowPos(); - Overlay::fPosX = windowPos.x; - Overlay::fPosY = windowPos.y; - - ImGui::End(); - } - ImGui::PopStyleColor(); - } -} - -void Menu::DrawCommandWindow() -{ - int resX = static_cast(screen::GetScreenWidth()); - int resY = static_cast(screen::GetScreenHeight()); - - ImGui::SetNextWindowPos(ImVec2(0, resY - 40), ImGuiCond_Always); - ImGui::SetNextWindowSize(ImVec2(resX, 40)); - - ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration + ImGuiWindowFlags_AlwaysAutoResize + - ImGuiWindowFlags_NoSavedSettings - + ImGuiWindowFlags_NoMove; - - if (ImGui::Begin("Shortcuts window", nullptr, flags)) - { - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, resY / 130)); - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(3, 3)); - - ImGui::SetNextItemWidth(ImGui::GetContentRegionMax().x); - - if (ImGui::InputTextWithHint("##TEXTFIELD", "Enter command", Commands::m_nInputBuffer, INPUT_BUFFER_SIZE, - ImGuiInputTextFlags_EnterReturnsTrue)) - { - ProcessCommands(); - Commands::m_bShowMenu = false; - strcpy(Commands::m_nInputBuffer, ""); - } - if (!ImGui::IsAnyItemActive()) - { - ImGui::SetKeyboardFocusHere(-1); - } - ImGui::PopStyleVar(2); - ImGui::End(); - } -} - -void Menu::ProcessCommands() -{ - std::stringstream ss(Commands::m_nInputBuffer); - - std::string command; - ss >> command; - - if (command == "armour") - { - try - { - std::string temp; - ss >> temp; - FindPlayerPed()->m_fArmour = std::stof(temp); - } - catch (...) - { - SetHelpMessage(TEXT("Menu.InvalidValue")); - } - } - - if (command == "hp") - { - try - { - std::string temp; - ss >> temp; - FindPlayerPed()->m_fHealth = std::stof(temp); - } - catch (...) - { - SetHelpMessage(TEXT("Menu.InvalidValue")); - } - } - - if (command == "time") - { - try - { - std::string temp; - ss >> temp; - CClock::ms_nGameClockHours = std::stoi(temp); - - ss >> temp; - CClock::ms_nGameClockMinutes = std::stoi(temp); - } - catch (...) - { - SetHelpMessage(TEXT("Menu.InvalidValue")); - } - } - -#ifdef GTASA - if (command == "tp") - { - try - { - CVector pos; - std::string temp; - - ss >> temp; - pos.x = std::stof(temp); - - ss >> temp; - pos.y = std::stof(temp); - - ss >> temp; - pos.z = std::stof(temp); - - Teleport::WarpPlayer(pos); - } - catch (...) - { - SetHelpMessage(TEXT("Menu.InvalidLocation")); - } - } - - if (command == "wep") - { - std::string wep_name; - ss >> wep_name; - - if (wep_name == "jetpack") - { - std::string weapon = "-1"; - Weapon::GiveWeaponToPlayer(weapon); - SetHelpMessage(TEXT("Menu.WeaponSpawned")); - } - else - { - eWeaponType weapon = CWeaponInfo::FindWeaponType((char*)wep_name.c_str()); - std::string weapon_name = std::to_string(weapon); - CWeaponInfo* pweaponinfo = CWeaponInfo::GetWeaponInfo(weapon, 1); - - if (wep_name != "" && pweaponinfo->m_nModelId1 != -1) - { - Weapon::GiveWeaponToPlayer(weapon_name); - SetHelpMessage(TEXT("Menu.WeaponSpawned")); - } - else - SetHelpMessage(TEXT("Menu.InvalidComamnd")); - } - - return; - } - if (command == "veh") - { - std::string veh_name; - ss >> veh_name; - - int model = Vehicle::GetModelFromName(veh_name.c_str()); - if (model != 0) - { - std::string smodel = std::to_string(model); - Vehicle::SpawnVehicle(smodel); - SetHelpMessage(TEXT("Menu.VehicleSpawned")); - } - else - SetHelpMessage(TEXT("Menu.InvalidComamnd")); - } -#endif -} - void Menu::ShowPage() { if (ImGui::BeginTabBar("Menu", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) @@ -359,7 +46,7 @@ void Menu::ShowPage() } else { - SetHelpMessage(TEXT("Menu.LanguageChangeFailed")); + Util::SetMessage(TEXT("Menu.LanguageChangeFailed")); } } } @@ -399,64 +86,74 @@ void Menu::ShowPage() ImGui::Spacing(); ImGui::Spacing(); ImGui::SameLine(); - if (Widget::ListBox(TEXT("Menu.Position"), Overlay::posNames, (int&)Overlay::mSelectedPos)) + if (ImGui::Combo(TEXT("Menu.Position"), (int*)&Overlay::m_nSelectedPos, "Custom\0Top left\0Top right\0Bottom left\0Bottom right\0")) { - gConfig.Set("Overlay.SelectedPosition", static_cast(Overlay::mSelectedPos)); + gConfig.Set("Overlay.SelectedPosition", static_cast(Overlay::m_nSelectedPos)); } ImGui::Spacing(); ImGui::SameLine(); - if (ImGui::ColorEdit4(TEXT("Menu.TextColor"), Overlay::textColor)) + if (ImGui::ColorEdit4(TEXT("Menu.TextColor"), Overlay::m_fTextCol)) { - gConfig.Set("Overlay.TextColor.Red", Overlay::textColor[0]); - gConfig.Set("Overlay.TextColor.Green", Overlay::textColor[1]); - gConfig.Set("Overlay.TextColor.Blue", Overlay::textColor[2]); - gConfig.Set("Overlay.TextColor.Alpha", Overlay::textColor[3]); + gConfig.Set("Overlay.TextColor.Red", Overlay::m_fTextCol[0]); + gConfig.Set("Overlay.TextColor.Green", Overlay::m_fTextCol[1]); + gConfig.Set("Overlay.TextColor.Blue", Overlay::m_fTextCol[2]); + gConfig.Set("Overlay.TextColor.Alpha", Overlay::m_fTextCol[3]); } ImGui::Spacing(); ImGui::Columns(2, nullptr, false); - if (ImGui::Checkbox(TEXT("Menu.NoBG"), &Overlay::bTransparent)) + if (ImGui::Checkbox(TEXT("Menu.NoBG"), &Overlay::m_bTransparent)) { - gConfig.Set("Overlay.Transparent", Overlay::bTransparent); + gConfig.Set("Overlay.Transparent", Overlay::m_bTransparent); } - if (ImGui::Checkbox(TEXT("Menu.ShowCoords"), &Overlay::bCoord)) + if (ImGui::Checkbox(TEXT("Menu.ShowCoords"), &Overlay::m_bCoord)) { - gConfig.Set("Overlay.ShowCoordinates", Overlay::bCoord); + gConfig.Set("Overlay.ShowCoordinates", Overlay::m_bCoord); } - if (ImGui::Checkbox(TEXT("Menu.ShowCPU"), &Overlay::bCpuUsage)) + if (ImGui::Checkbox(TEXT("Menu.ShowCPU"), &Overlay::m_bCpuUsage)) { - gConfig.Set("Overlay.ShowCPUUsage", Overlay::bCpuUsage); + gConfig.Set("Overlay.ShowCPUUsage", Overlay::m_bCpuUsage); } - if (ImGui::Checkbox(TEXT("Menu.ShowFPS"), &Overlay::bFPS)) + if (ImGui::Checkbox(TEXT("Menu.ShowFPS"), &Overlay::m_bFPS)) { - gConfig.Set("Overlay.ShowFPS", Overlay::bFPS); + gConfig.Set("Overlay.ShowFPS", Overlay::m_bFPS); + } + + if (ImGui::Checkbox(TEXT("Menu.ShowLocation"), &Overlay::m_bLocName)) + { + gConfig.Set("Overlay.ShowLocationName", Overlay::m_bLocName); + } + + if (ImGui::Checkbox(TEXT("Menu.ShowModelInfo"), &Overlay::m_bModelInfo)) + { + gConfig.Set("Overlay.ShowModelInfo", Overlay::m_bModelInfo); } ImGui::NextColumn(); - if (ImGui::Checkbox(TEXT("Menu.ShowLocation"), &Overlay::bLocName)) + if (ImGui::Checkbox(TEXT("Menu.ShowPedTasks"), &Overlay::m_bPedTasks)) { - gConfig.Set("Overlay.ShowLocationName", Overlay::bLocName); + gConfig.Set("Overlay.ShowPedTasks", Overlay::m_bPedTasks); } - if (ImGui::Checkbox(TEXT("Menu.ShowRAM"), &Overlay::bMemUsage)) + if (ImGui::Checkbox(TEXT("Menu.ShowRAM"), &Overlay::m_bMemUsage)) { - gConfig.Set("Overlay.ShowMemoryUsage", Overlay::bMemUsage); + gConfig.Set("Overlay.ShowMemoryUsage", Overlay::m_bMemUsage); } - if (ImGui::Checkbox(TEXT("Menu.ShowVehHealth"), &Overlay::bVehHealth)) + if (ImGui::Checkbox(TEXT("Menu.ShowVehHealth"), &Overlay::m_bVehHealth)) { - gConfig.Set("Overlay.ShowVehicleHealth", Overlay::bVehHealth); + gConfig.Set("Overlay.ShowVehicleHealth", Overlay::m_bVehHealth); } - if (ImGui::Checkbox(TEXT("Menu.ShowVehSpeed"), &Overlay::bVehSpeed)) + if (ImGui::Checkbox(TEXT("Menu.ShowVehSpeed"), &Overlay::m_bVehSpeed)) { - gConfig.Set("Overlay.ShowVehicleSpeed", Overlay::bVehSpeed); + gConfig.Set("Overlay.ShowVehicleSpeed", Overlay::m_bVehSpeed); } ImGui::Columns(1); diff --git a/src/menu.h b/src/menu.h index 9484683..e913067 100644 --- a/src/menu.h +++ b/src/menu.h @@ -3,47 +3,7 @@ class Menu { -private: - - enum DisplayPos - { - CUSTOM, - TOP_LEFT, - TOP_RIGHT, - BOTTOM_LEFT, - BOTTOM_RIGHT - }; - - struct Overlay - { - static inline bool bCoord; - static inline bool bFPS; - static inline int mFPS; - static inline bool bLocName; - static inline bool bTransparent; - static inline bool bVehHealth; - static inline bool bVehSpeed; - static inline bool bCpuUsage; - static inline float fCpuUsage; - static inline bool bMemUsage; - static inline float fMemUsage; - static inline std::vector posNames = - { - "Custom", "Top left", "Top right", "Bottom left", "Bottom right" - }; - static inline DisplayPos mSelectedPos = DisplayPos::BOTTOM_RIGHT; - static inline float fPosX; - static inline float fPosY; - static inline int mTotalRam = 0; - static inline float textColor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - }; - public: - struct Commands - { - static inline bool m_bShowMenu; - static inline char m_nInputBuffer[INPUT_BUFFER_SIZE] = ""; - }; static inline bool m_bAutoCheckUpdate; static inline bool m_bDiscordRPC; static inline bool m_bTextOnlyMode; @@ -53,7 +13,4 @@ public: static void Init(); static void ShowPage(); - static void DrawOverlay(); - static void DrawCommandWindow(); - static void ProcessCommands(); }; diff --git a/src/overlay.cpp b/src/overlay.cpp new file mode 100644 index 0000000..73d1d03 --- /dev/null +++ b/src/overlay.cpp @@ -0,0 +1,489 @@ +#include "pch.h" +#include "vehicle.h" +#include +#include "overlay.h" + +#ifdef GTASA +#include "teleport.h" +#include "weapon.h" +#include "vehicle.h" +#endif + +void Overlay::Init() +{ + // TODO: use structs + // Load config data + m_bCoord = gConfig.Get("Overlay.ShowCoordinates", false); + m_bCpuUsage = gConfig.Get("Overlay.ShowCPUUsage", false); + m_bFPS = gConfig.Get("Overlay.ShowFPS", false); + m_bLocName = gConfig.Get("Overlay.ShowLocationName", false); + m_bModelInfo = gConfig.Get("Overlay.ShowModelInfo", false); + m_bPedTasks = gConfig.Get("Overlay.ShowPedTasks", false); + m_bTransparent = gConfig.Get("Overlay.Transparent", false); + m_bMemUsage = gConfig.Get("Overlay.ShowMemoryUsage", false); + m_bVehHealth = gConfig.Get("Overlay.ShowVehicleHealth", false); + m_bVehSpeed = gConfig.Get("Overlay.ShowVehicleSpeed", false); + m_nSelectedPos = (DisplayPos)gConfig.Get("Overlay.SelectedPosition", (int)DisplayPos::BOTTOM_RIGHT); + m_fPos.x = gConfig.Get("Overlay.PosX", 0); + m_fPos.y = gConfig.Get("Overlay.PosY", 0); + m_fTextCol[0] = gConfig.Get("Overlay.TextColor.Red", 1.0f); + m_fTextCol[1] = gConfig.Get("Overlay.TextColor.Green", 1.0f); + m_fTextCol[2] = gConfig.Get("Overlay.TextColor.Blue", 1.0f); + m_fTextCol[3] = gConfig.Get("Overlay.TextColor.Alpha", 1.0f); + + Util::GetCPUUsageInit(); + MEMORYSTATUSEX memInfo; + memInfo.dwLength = sizeof(MEMORYSTATUSEX); + GlobalMemoryStatusEx(&memInfo); + + m_nTotalMem = static_cast(memInfo.ullTotalPhys * 1e-6); // Bytes -> MegaBytes + + ThiscallEvent, PRIORITY_BEFORE, ArgPickN, void(CEntity*)> preRenderEntityEvent; + +#ifndef GTASA + patch::Nop(BY_GAME(NULL, 0x488828, 0x474BBA), 4); +#endif + + // Directly drawing here seems to crash renderer? + preRenderEntityEvent += [](CEntity *pEnt) + { + CPlayerPed *player = FindPlayerPed(); + if (player != pEnt) + { + CVector coord = pEnt->GetPosition(); + CVector plaPos = player->GetPosition(); + + CColPoint outColPoint; + if (BY_GAME(pEnt->m_bIsVisible, pEnt->IsVisible(), pEnt->IsVisible())) + { + m_EntityList.push_back(pEnt); + } + #ifdef GTAVC + if (CModelInfo::GetModelInfo(pEnt->m_nModelIndex)->m_nNum2dEffects > 0) + { + pEnt->ProcessLightsForEntity(); + } + #elif GTA3 + // if (CModelInfo::ms_modelInfoPtrs[pEnt->m_nModelIndex]->m_nNum2dEffects > 0) + // { + // pEnt->ProcessLightsForEntity(); + // } + #endif + } + }; +} + +void Overlay::ProcessModelInfo() +{ + if (m_bModelInfo) + { + ImDrawList *pDrawList = ImGui::GetWindowDrawList(); + CPlayerPed *player = FindPlayerPed(); + for (CEntity *pEnt : m_EntityList) + { + if (pEnt == player) + { + continue; + } + + CVector coord = BY_GAME(,,*)pEnt->GetBoundCentre(); + float distance = DistanceBetweenPoints(coord, player->GetPosition()); + RwV3d screen; + CVector2D size; + if (distance < m_fMaxDistance && +#ifdef GTASA + CSprite::CalcScreenCoors(coord.ToRwV3d(), &screen, &size.x, &size.y, true, true) +#else + CSprite::CalcScreenCoors(coord.ToRwV3d(), &screen, &size.x, &size.y, true) +#endif +) + { + bool skip = false; + uint model = pEnt->m_nModelIndex; + std::string text = std::to_string(model); + ImU32 col = ImGui::ColorConvertFloat4ToU32(distance < m_fMaxDistance/2 ? ImVec4(1.0f, 1.0f, 1.0f, 1.00f) : ImVec4(0.35f, 0.33f, 0.3f, 1.00f)); +#ifdef GTASA + if (pEnt->m_nType == ENTITY_TYPE_VEHICLE) + { + text = std::format("{}\n{}", model, Vehicle::GetNameFromModel(model)); + } + else if (pEnt->m_nType == ENTITY_TYPE_PED) + { + CPed *ped = static_cast(pEnt); + if (BY_GAME(ped->m_nPedFlags.bInVehicle, ped->m_bInVehicle, ped->m_bInVehicle)) + { + skip = true; + } + } +#endif + + if (!skip) + { + pDrawList->AddText(ImVec2(screen.x, screen.y), col, text.c_str()); + } + } + } + } +} + +void Overlay::ProcessPedTasks() +{ + if (m_bPedTasks) + { + ImDrawList *pDrawList = ImGui::GetWindowDrawList(); + CPlayerPed *player = FindPlayerPed(); + for (CEntity *pEnt : m_EntityList) + { + if (pEnt == player || pEnt->m_nType != ENTITY_TYPE_PED) + { + continue; + } + CPed *pPed = static_cast(pEnt); + CVector coord = BY_GAME(,,*)pPed->GetBoundCentre(); + float distance = DistanceBetweenPoints(coord, player->GetPosition()); + RwV3d screen; + CVector2D size; + if (distance < m_fMaxDistance + && CSprite::CalcScreenCoors(coord.ToRwV3d(), &screen, &size.x, &size.y, true, true)) + { + ImU32 col = ImGui::ColorConvertFloat4ToU32(distance < m_fMaxDistance/2 ? ImVec4(1.0f, 1.0f, 1.0f, 1.00f) : ImVec4(0.35f, 0.33f, 0.3f, 1.00f)); + float height = ImGui::GetTextLineHeight(); + screen.y -= 2 * height; + + for (size_t i = 0; i != TASK_SECONDARY_MAX; ++i) + { + CTask *pTask = pPed->m_pIntelligence->m_TaskMgr.m_aSecondaryTasks[i]; + if (pTask) + { + const char *name = taskNames[pTask->GetId()]; + pDrawList->AddText(ImVec2(screen.x, screen.y), col, name); + screen.y -= height; + } + } + for (size_t i = 0; i != TASK_PRIMARY_MAX; ++i) + { + CTask *pTask = pPed->m_pIntelligence->m_TaskMgr.m_aPrimaryTasks[i]; + if (pTask) + { + const char *name = taskNames[pTask->GetId()]; + pDrawList->AddText(ImVec2(screen.x, screen.y), col, name); + screen.y -= height; + } + } + } + } + } +} + +void Overlay::Draw() +{ + if (FrontEndMenuManager.m_bMenuActive) + { + return; + } + + ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove + | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoNavFocus + | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing; + ImGui::SetNextWindowPos(ImVec2(0, 0)); + ImGui::SetNextWindowSize(ImVec2(screen::GetScreenWidth(), screen::GetScreenHeight())); + ImGui::SetNextWindowBgAlpha(0.0f); + if (ImGui::Begin("##Overlay", NULL, flags)) + { + ProcessModelInfo(); + ProcessPedTasks(); + ImGui::End(); + } + + ProcessInfoBox(); + ProcessCmdBar(); + + // clear the list here + m_EntityList.clear(); +} + +void Overlay::ProcessCmdBar() +{ + if (m_bCmdBar) + { + int resX = static_cast(screen::GetScreenWidth()); + int resY = static_cast(screen::GetScreenHeight()); + + ImGui::SetNextWindowPos(ImVec2(0, resY - 40), ImGuiCond_Always); + ImGui::SetNextWindowSize(ImVec2(resX, 40)); + + ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration + ImGuiWindowFlags_AlwaysAutoResize + + ImGuiWindowFlags_NoSavedSettings + + ImGuiWindowFlags_NoMove; + if (ImGui::Begin("CmdBar", nullptr, flags)) + { + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, resY / 130)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(3, 3)); + + ImGui::SetNextItemWidth(ImGui::GetContentRegionMax().x); + + static char buf[INPUT_BUFFER_SIZE] = ""; + if (ImGui::InputTextWithHint("##TEXTFIELD", "Enter command", buf, INPUT_BUFFER_SIZE, ImGuiInputTextFlags_EnterReturnsTrue)) + { + ProcessCommands(std::string(buf)); + m_bCmdBar = false; + strcpy(buf, ""); + } + if (!ImGui::IsAnyItemActive()) + { + ImGui::SetKeyboardFocusHere(-1); + } + ImGui::PopStyleVar(2); + ImGui::End(); + } + } +} + +void Overlay::ProcessCommands(std::string&& str) +{ + std::stringstream ss(str); + + std::string command; + ss >> command; + + if (command == "armour") + { + try + { + std::string temp; + ss >> temp; + FindPlayerPed()->m_fArmour = std::stof(temp); + } + catch (...) + { + Util::SetMessage(TEXT("Menu.InvalidValue")); + } + } + + if (command == "hp") + { + try + { + std::string temp; + ss >> temp; + FindPlayerPed()->m_fHealth = std::stof(temp); + } + catch (...) + { + Util::SetMessage(TEXT("Menu.InvalidValue")); + } + } + + if (command == "time") + { + try + { + std::string temp; + ss >> temp; + CClock::ms_nGameClockHours = std::stoi(temp); + + ss >> temp; + CClock::ms_nGameClockMinutes = std::stoi(temp); + } + catch (...) + { + Util::SetMessage(TEXT("Menu.InvalidValue")); + } + } + +#ifdef GTASA + if (command == "tp") + { + try + { + CVector pos; + std::string temp; + + ss >> temp; + pos.x = std::stof(temp); + + ss >> temp; + pos.y = std::stof(temp); + + ss >> temp; + pos.z = std::stof(temp); + + Teleport::WarpPlayer(pos); + } + catch (...) + { + Util::SetMessage(TEXT("Menu.InvalidLocation")); + } + } + + if (command == "wep") + { + std::string wep_name; + ss >> wep_name; + + if (wep_name == "jetpack") + { + std::string weapon = "-1"; + Weapon::GiveWeaponToPlayer(weapon); + Util::SetMessage(TEXT("Menu.WeaponSpawned")); + } + else + { + eWeaponType weapon = CWeaponInfo::FindWeaponType((char*)wep_name.c_str()); + std::string weapon_name = std::to_string(weapon); + CWeaponInfo* pweaponinfo = CWeaponInfo::GetWeaponInfo(weapon, 1); + + if (wep_name != "" && pweaponinfo->m_nModelId1 != -1) + { + Weapon::GiveWeaponToPlayer(weapon_name); + Util::SetMessage(TEXT("Menu.WeaponSpawned")); + } + else + Util::SetMessage(TEXT("Menu.InvalidComamnd")); + } + + return; + } + if (command == "veh") + { + std::string veh_name; + ss >> veh_name; + + int model = Vehicle::GetModelFromName(veh_name.c_str()); + if (model != 0) + { + std::string smodel = std::to_string(model); + Vehicle::SpawnVehicle(smodel); + Util::SetMessage(TEXT("Menu.VehicleSpawned")); + } + else + Util::SetMessage(TEXT("Menu.InvalidComamnd")); + } +#endif +} + +void Overlay::ProcessInfoBox() +{ + CPlayerPed* pPlayer = FindPlayerPed(); + if (pPlayer) + { + bool m_bShowMenu = m_bCoord || m_bFPS || m_bLocName || m_bCpuUsage || m_bMemUsage || + ((m_bVehHealth || m_bVehSpeed) && pPlayer && pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer); + + const float offset = 10.0f; + ImGuiIO& io = ImGui::GetIO(); + ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | + ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav; + + if (m_nSelectedPos == DisplayPos::CUSTOM) + { + if (m_fPos.x != NULL && m_fPos.y != NULL) + { + gConfig.Set("Overlay.PosX", m_fPos.x); + gConfig.Set("Overlay.PosY", m_fPos.y); + ImGui::SetNextWindowPos(m_fPos, ImGuiCond_Once); + } + } + else + { + window_flags |= ImGuiWindowFlags_NoMove; + ImVec2 pos, pivot; + + if (m_nSelectedPos == DisplayPos::TOP_LEFT) + { + pos = ImVec2(offset, offset); + pivot = ImVec2(0.0f, 0.0f); + } + + if (m_nSelectedPos == DisplayPos::TOP_RIGHT) + { + pos = ImVec2(io.DisplaySize.x - offset, offset); + pivot = ImVec2(1.0f, 0.0f); + } + + if (m_nSelectedPos == DisplayPos::BOTTOM_LEFT) + { + pos = ImVec2(offset, io.DisplaySize.y - offset); + pivot = ImVec2(0.0f, 1.0f); + } + + if (m_nSelectedPos == DisplayPos::BOTTOM_RIGHT) + { + pos = ImVec2(io.DisplaySize.x - offset, io.DisplaySize.y - offset); + pivot = ImVec2(1.0f, 1.0f); + } + + ImGui::SetNextWindowPos(pos, ImGuiCond_Always, pivot); + } + + ImGui::SetNextWindowBgAlpha(m_bTransparent ? 0.0f : 0.5f); + ImGui::PushStyleColor(ImGuiCol_Text, *(ImVec4*)&m_fTextCol); + if (m_bShowMenu && ImGui::Begin("Overlay", nullptr, window_flags)) + { + CVector pos{0,0,0}; + pos = pPlayer->GetPosition(); + + size_t game_ms = CTimer::m_snTimeInMilliseconds; + static size_t interval = 0; + static float cpuUsage = 0, memUsage = 0; + if (game_ms - interval > 1000) + { + cpuUsage = static_cast(Util::GetCurrentCPUUsage()); + + MEMORYSTATUSEX memInfo; + memInfo.dwLength = sizeof(MEMORYSTATUSEX); + GlobalMemoryStatusEx(&memInfo); + int mUsedRam = static_cast((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6); + memUsage = 100.0f * (static_cast(mUsedRam) / static_cast(m_nTotalMem)); + + m_nFPS = static_cast(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate)); + interval = game_ms; + } + + if (m_bCoord) + { + ImGui::Text(TEXT("Menu.Coords"), pos.x, pos.y, pos.z); + } + + if (m_bCpuUsage) + { + ImGui::Text(TEXT("Menu.CPUUsage"), cpuUsage); + } + + if (m_bFPS) + { + ImGui::Text(TEXT("Menu.Frames"), m_nFPS); + } + + if (m_bLocName) + { + ImGui::Text(TEXT("Menu.Location"), Util::GetLocationName(&pos).c_str()); + } + + if (m_bMemUsage) + { + ImGui::Text(TEXT("Menu.RAMUsage"), memUsage); + } + + if (pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer) + { + if (m_bVehHealth) + { + ImGui::Text((TEXT_S("Menu.VehHealth") + ": %.f").c_str(), pPlayer->m_pVehicle->m_fHealth); + } + + if (m_bVehSpeed) + { + int speed = pPlayer->m_pVehicle->m_vecMoveSpeed.Magnitude() * 50.0f; // 02E3 - GET_CAR_SPEED + ImGui::Text(TEXT("Menu.VehSpeed"), speed); + } + } + + ImVec2 windowPos = ImGui::GetWindowPos(); + m_fPos = windowPos; + + ImGui::End(); + } + ImGui::PopStyleColor(); + } +} \ No newline at end of file diff --git a/src/overlay.h b/src/overlay.h new file mode 100644 index 0000000..8e2148c --- /dev/null +++ b/src/overlay.h @@ -0,0 +1,64 @@ +#pragma once +#include +#include + +/* + CheatMenu Overlay Class + + Handles drawing overlay windows on the screen + This is seprate from the menu window +*/ +class Overlay +{ +private: + enum DisplayPos + { + CUSTOM, + TOP_LEFT, + TOP_RIGHT, + BOTTOM_LEFT, + BOTTOM_RIGHT + }; + static inline std::vector m_EntityList; + static inline const float m_fMaxDistance = 50.0f; + static inline ImVec2 m_fPos; + static inline int m_nTotalMem = 0; + + // Draws model & it's name on screen (peds, objects, vehicles) + static void ProcessModelInfo(); + + // Processes current ped tasks & draws them ons creen + static void ProcessPedTasks(); + + // Processes commad bar & commands + static void ProcessCmdBar(); + static void ProcessCommands(std::string&& str); + + // Displays fps, health, veh speed etc + static void ProcessInfoBox(); + +public: + static inline bool m_bCmdBar; + static inline bool m_bCoord; + static inline bool m_bCpuUsage; + static inline bool m_bFPS; + static inline int m_nFPS; + static inline bool m_bLocName; + static inline bool m_bMemUsage; + static inline bool m_bModelInfo; + static inline bool m_bPedTasks; + static inline bool m_bTransparent; + static inline bool m_bVehHealth; + static inline bool m_bVehSpeed; + static inline float m_fTextCol[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + static inline DisplayPos m_nSelectedPos = DisplayPos::BOTTOM_RIGHT; + + Overlay() = delete; + Overlay(Overlay&) = delete; + + // Injects necessary hooks into the game + static void Init(); + + // Draws the actual overlay on screen + static void Draw(); +}; diff --git a/src/pch.h b/src/pch.h index 0712447..9d46441 100644 --- a/src/pch.h +++ b/src/pch.h @@ -61,6 +61,7 @@ #include "resourcestore.h" #include "fontmgr.h" #include "locale.h" +#include "util.h" #define TEXT(x) Locale::GetText(x).c_str() #define TEXT_S(x) Locale::GetText(x) @@ -82,22 +83,9 @@ typedef void(*ArgCallback)(std::string&); typedef std::string(*ArgCallbackRtn)(std::string&); typedef bool(*ArgCallbackRtnBool)(std::string&); -// Fix function clashes -static void SetHelpMessage(const char *message, bool b1 = false, bool b2 = false, bool b3 = false) -{ -#if GTASA - CHud::SetHelpMessage(message, b1, b2, b3); -#elif GTAVC - CHud::SetHelpMessage(message, b1, b2); -#else - const size_t size = strlen(message)+1; - wchar_t* wc = new wchar_t[size]; - mbstowcs(wc, message, size); - CHud::SetHelpMessage(wc, b1); - delete wc; +#ifdef GTASA +extern const char* taskNames[1802]; #endif -} - extern Hotkey aimSkinChanger; extern Hotkey freeCam; extern Hotkey freeCamForward; diff --git a/src/ped.cpp b/src/ped.cpp index 5fb6169..f3c1e15 100644 --- a/src/ped.cpp +++ b/src/ped.cpp @@ -94,7 +94,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) { if (Spawner::m_List.size() == SPAWN_PED_LIMIT) { - SetHelpMessage(TEXT("Ped.MaxLimit")); + Util::SetMessage(TEXT("Ped.MaxLimit")); return; } @@ -138,7 +138,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) if (cat == "Special") // Special model { #ifdef GTA3 - SetHelpMessage(TEXT("Player.SpecialNotImplement")); + Util::SetMessage(TEXT("Player.SpecialNotImplement")); return; #else Command(currentSlot, model.c_str()); diff --git a/src/player.cpp b/src/player.cpp index dace574..bfa6f6d 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -255,7 +255,7 @@ void Player::Init() { if (m_bGodMode) { - SetHelpMessage(TEXT("Player.GodDisabled")); + Util::SetMessage(TEXT("Player.GodDisabled")); #ifdef GTASA patch::Set(0x96916D, m_bGodMode, false); player->m_nPhysicalFlags.bBulletProof = 0; @@ -280,7 +280,7 @@ void Player::Init() } else { - SetHelpMessage(TEXT("Player.GodEnabled")); + Util::SetMessage(TEXT("Player.GodEnabled")); m_bGodMode = true; } } @@ -381,7 +381,7 @@ void Player::ChangePlayerModel(std::string& cat, std::string& key, std::string& // CStreaming::LoadAllRequestedModels(true); // player->SetModelIndex(109); // CStreaming::SetMissionDoesntRequireSpecialChar(109); - SetHelpMessage(TEXT("Player.SpecialNotImplement")); + Util::SetMessage(TEXT("Player.SpecialNotImplement")); } else { @@ -411,7 +411,7 @@ void Player::ShowPage() std::string text = std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " + std::to_string(pos.z); ImGui::SetClipboardText(text.c_str()); - SetHelpMessage(TEXT("Player.CoordCopied")); + Util::SetMessage(TEXT("Player.CoordCopied")); } ImGui::SameLine(); if (ImGui::Button(TEXT("Player.Suicide"), ImVec2(Widget::CalcSize(2)))) diff --git a/src/tasknames.cpp b/src/tasknames.cpp new file mode 100644 index 0000000..f76e80c --- /dev/null +++ b/src/tasknames.cpp @@ -0,0 +1,1806 @@ +#include "pch.h" + +const char* taskNames[1802] = { + "Player on foot\0", + "Player in car\0", + "Unknown 2\0", + "Unknown 3\0", + "Unknown 4\0", + "Unknown 5\0", + "Unknown 6\0", + "Unknown 7\0", + "Unknown 8\0", + "Unknown 9\0", + "Unknown 10\0", + "Unknown 11\0", + "Unknown 12\0", + "Unknown 13\0", + "Unknown 14\0", + "Unknown 15\0", + "Unknown 16\0", + "Unknown 17\0", + "Unknown 18\0", + "Unknown 19\0", + "Unknown 20\0", + "Unknown 21\0", + "Unknown 22\0", + "Unknown 23\0", + "Unknown 24\0", + "Unknown 25\0", + "Unknown 26\0", + "Unknown 27\0", + "Unknown 28\0", + "Unknown 29\0", + "Unknown 30\0", + "Unknown 31\0", + "Unknown 32\0", + "Unknown 33\0", + "Unknown 34\0", + "Unknown 35\0", + "Unknown 36\0", + "Unknown 37\0", + "Unknown 38\0", + "Unknown 39\0", + "Unknown 40\0", + "Unknown 41\0", + "Unknown 42\0", + "Unknown 43\0", + "Unknown 44\0", + "Unknown 45\0", + "Unknown 46\0", + "Unknown 47\0", + "Unknown 48\0", + "Unknown 49\0", + "Unknown 50\0", + "Unknown 51\0", + "Unknown 52\0", + "Unknown 53\0", + "Unknown 54\0", + "Unknown 55\0", + "Unknown 56\0", + "Unknown 57\0", + "Unknown 58\0", + "Unknown 59\0", + "Unknown 60\0", + "Unknown 61\0", + "Unknown 62\0", + "Unknown 63\0", + "Unknown 64\0", + "Unknown 65\0", + "Unknown 66\0", + "Unknown 67\0", + "Unknown 68\0", + "Unknown 69\0", + "Unknown 70\0", + "Unknown 71\0", + "Unknown 72\0", + "Unknown 73\0", + "Unknown 74\0", + "Unknown 75\0", + "Unknown 76\0", + "Unknown 77\0", + "Unknown 78\0", + "Unknown 79\0", + "Unknown 80\0", + "Unknown 81\0", + "Unknown 82\0", + "Unknown 83\0", + "Unknown 84\0", + "Unknown 85\0", + "Unknown 86\0", + "Unknown 87\0", + "Unknown 88\0", + "Unknown 89\0", + "Unknown 90\0", + "Unknown 91\0", + "Unknown 92\0", + "Unknown 93\0", + "Unknown 94\0", + "Unknown 95\0", + "Unknown 96\0", + "Unknown 97\0", + "Unknown 98\0", + "Unknown 99\0", + "Medic treat injured ped\0", + "Treat accident\0", + "Give CPR\0", + "Cop arrest ped\0", + "Cop hassle ped\0", + "Hassled by cop\0", + "Present id to cop\0", + "Drive fire truck\0", + "Use swat rope\0", + "Use water cannon\0", + "Extinguish fire on foot\0", + "Unknown 111\0", + "Unknown 112\0", + "Unknown 113\0", + "Unknown 114\0", + "Unknown 115\0", + "Unknown 116\0", + "Unknown 117\0", + "Unknown 118\0", + "Unknown 119\0", + "Unknown 120\0", + "Unknown 121\0", + "Unknown 122\0", + "Unknown 123\0", + "Unknown 124\0", + "Unknown 125\0", + "Unknown 126\0", + "Unknown 127\0", + "Unknown 128\0", + "Unknown 129\0", + "Unknown 130\0", + "Unknown 131\0", + "Unknown 132\0", + "Unknown 133\0", + "Unknown 134\0", + "Unknown 135\0", + "Unknown 136\0", + "Unknown 137\0", + "Unknown 138\0", + "Unknown 139\0", + "Unknown 140\0", + "Unknown 141\0", + "Unknown 142\0", + "Unknown 143\0", + "Unknown 144\0", + "Unknown 145\0", + "Unknown 146\0", + "Unknown 147\0", + "Unknown 148\0", + "Unknown 149\0", + "Unknown 150\0", + "Unknown 151\0", + "Unknown 152\0", + "Unknown 153\0", + "Unknown 154\0", + "Unknown 155\0", + "Unknown 156\0", + "Unknown 157\0", + "Unknown 158\0", + "Unknown 159\0", + "Unknown 160\0", + "Unknown 161\0", + "Unknown 162\0", + "Unknown 163\0", + "Unknown 164\0", + "Unknown 165\0", + "Unknown 166\0", + "Unknown 167\0", + "Unknown 168\0", + "Unknown 169\0", + "Unknown 170\0", + "Unknown 171\0", + "Unknown 172\0", + "Unknown 173\0", + "Unknown 174\0", + "Unknown 175\0", + "Unknown 176\0", + "Unknown 177\0", + "Unknown 178\0", + "Unknown 179\0", + "Unknown 180\0", + "Unknown 181\0", + "Unknown 182\0", + "Unknown 183\0", + "Unknown 184\0", + "Unknown 185\0", + "Unknown 186\0", + "Unknown 187\0", + "Unknown 188\0", + "Unknown 189\0", + "Unknown 190\0", + "Unknown 191\0", + "Unknown 192\0", + "Unknown 193\0", + "Unknown 194\0", + "Unknown 195\0", + "Unknown 196\0", + "Unknown 197\0", + "Unknown 198\0", + "Unknown 199\0", + "None\0", + "Uninterruptable\0", + "Pause\0", + "Stand still\0", + "Set stay in same place\0", + "Get up\0", + "Get up and stand still\0", + "Fall\0", + "Fall and get up\0", + "Fall and stay down\0", + "Jump\0", + "Jump\0", + "Die\0", + "Drown\0", + "Die in car\0", + "Die in car\0", + "Drown in car\0", + "Die\0", + "Dead\0", + "Tired\0", + "Sit down\0", + "Sit idle\0", + "Stand up\0", + "Sit down then idle then stand up\0", + "Observe traffic lights\0", + "Observe traffic lights and achieve heading\0", + "Not used\0", + "Cross road look and achieve heading\0", + "Turn 180\0", + "Hail taxi\0", + "Hit response\0", + "Hit by gun response\0", + "Unused slot\0", + "Use effect\0", + "Wait at attractor\0", + "Use attractor\0", + "Wait for dry weather\0", + "Wait for bus\0", + "Wait for bus\0", + "Wait for pizza\0", + "In air and land\0", + "In air\0", + "Land\0", + "Be in group\0", + "Sequence\0", + "Call for backup\0", + "Use paired attractor\0", + "Use attractor partner\0", + "Attractor partner wait\0", + "Use scripted attractor\0", + "On fire\0", + "Be damaged\0", + "Trigger event\0", + "Ragdoll\0", + "Climb\0", + "Player on fire\0", + "Partner\0", + "Stare at ped\0", + "Use closest free scripted attractor\0", + "Use effect running\0", + "Use effect sprinting\0", + "Use closest free scripted attractor run\0", + "Use closest free scripted attractor sprint\0", + "Choking\0", + "Ik chain\0", + "Ik manager\0", + "Ik look at\0", + "Climb\0", + "In water\0", + "Trigger look at\0", + "Clear look at\0", + "Set char decision maker\0", + "Ik point r arm\0", + "Ik point l arm\0", + "Be still\0", + "Use sequence\0", + "Set kinda stay in same place\0", + "Fall to death\0", + "Wait for matching leader area codes\0", + "Unknown 279\0", + "Unknown 280\0", + "Unknown 281\0", + "Unknown 282\0", + "Unknown 283\0", + "Unknown 284\0", + "Unknown 285\0", + "Unknown 286\0", + "Unknown 287\0", + "Unknown 288\0", + "Unknown 289\0", + "Unknown 290\0", + "Unknown 291\0", + "Unknown 292\0", + "Unknown 293\0", + "Unknown 294\0", + "Unknown 295\0", + "Unknown 296\0", + "Unknown 297\0", + "Unknown 298\0", + "Unknown 299\0", + "Look at entity or coord\0", + "Say\0", + "Shake fist\0", + "Facial\0", + "Chained facial\0", + "Facial\0", + "Affect secondary behaviour\0", + "Hold entity\0", + "Pickup entity\0", + "Putdown entity\0", + "Go pickup entity\0", + "Duck while shots whizzing\0", + "Unknown 312\0", + "Unknown 313\0", + "Unknown 314\0", + "Unknown 315\0", + "Unknown 316\0", + "Unknown 317\0", + "Unknown 318\0", + "Unknown 319\0", + "Unknown 320\0", + "Unknown 321\0", + "Unknown 322\0", + "Unknown 323\0", + "Unknown 324\0", + "Unknown 325\0", + "Unknown 326\0", + "Unknown 327\0", + "Unknown 328\0", + "Unknown 329\0", + "Unknown 330\0", + "Unknown 331\0", + "Unknown 332\0", + "Unknown 333\0", + "Unknown 334\0", + "Unknown 335\0", + "Unknown 336\0", + "Unknown 337\0", + "Unknown 338\0", + "Unknown 339\0", + "Unknown 340\0", + "Unknown 341\0", + "Unknown 342\0", + "Unknown 343\0", + "Unknown 344\0", + "Unknown 345\0", + "Unknown 346\0", + "Unknown 347\0", + "Unknown 348\0", + "Unknown 349\0", + "Unknown 350\0", + "Unknown 351\0", + "Unknown 352\0", + "Unknown 353\0", + "Unknown 354\0", + "Unknown 355\0", + "Unknown 356\0", + "Unknown 357\0", + "Unknown 358\0", + "Unknown 359\0", + "Unknown 360\0", + "Unknown 361\0", + "Unknown 362\0", + "Unknown 363\0", + "Unknown 364\0", + "Unknown 365\0", + "Unknown 366\0", + "Unknown 367\0", + "Unknown 368\0", + "Unknown 369\0", + "Unknown 370\0", + "Unknown 371\0", + "Unknown 372\0", + "Unknown 373\0", + "Unknown 374\0", + "Unknown 375\0", + "Unknown 376\0", + "Unknown 377\0", + "Unknown 378\0", + "Unknown 379\0", + "Unknown 380\0", + "Unknown 381\0", + "Unknown 382\0", + "Unknown 383\0", + "Unknown 384\0", + "Unknown 385\0", + "Unknown 386\0", + "Unknown 387\0", + "Unknown 388\0", + "Unknown 389\0", + "Unknown 390\0", + "Unknown 391\0", + "Unknown 392\0", + "Unknown 393\0", + "Unknown 394\0", + "Unknown 395\0", + "Unknown 396\0", + "Unknown 397\0", + "Unknown 398\0", + "Unknown 399\0", + "Anim\0", + "Named anim\0", + "Timed anim\0", + "Hit back\0", + "Hit front\0", + "Hit left\0", + "Hit right\0", + "Hit by gun back\0", + "Hit by gun front\0", + "Hit by gun left\0", + "Hit by gun right\0", + "Hit wall\0", + "Cower\0", + "Hands up\0", + "Hit behind\0", + "Duck\0", + "Chat\0", + "Sunbathe\0", + "Sunbathe\0", + "Detonate\0", + "Use atm\0", + "Scratch head\0", + "Look about\0", + "Abseil\0", + "Anim looped middle\0", + "Handsignal anim\0", + "Handsignal anim\0", + "Duck forever\0", + "Start sunbathing\0", + "Idle sunbathing\0", + "Stop sunbathing\0", + "Unknown 431\0", + "Unknown 432\0", + "Unknown 433\0", + "Unknown 434\0", + "Unknown 435\0", + "Unknown 436\0", + "Unknown 437\0", + "Unknown 438\0", + "Unknown 439\0", + "Unknown 440\0", + "Unknown 441\0", + "Unknown 442\0", + "Unknown 443\0", + "Unknown 444\0", + "Unknown 445\0", + "Unknown 446\0", + "Unknown 447\0", + "Unknown 448\0", + "Unknown 449\0", + "Unknown 450\0", + "Unknown 451\0", + "Unknown 452\0", + "Unknown 453\0", + "Unknown 454\0", + "Unknown 455\0", + "Unknown 456\0", + "Unknown 457\0", + "Unknown 458\0", + "Unknown 459\0", + "Unknown 460\0", + "Unknown 461\0", + "Unknown 462\0", + "Unknown 463\0", + "Unknown 464\0", + "Unknown 465\0", + "Unknown 466\0", + "Unknown 467\0", + "Unknown 468\0", + "Unknown 469\0", + "Unknown 470\0", + "Unknown 471\0", + "Unknown 472\0", + "Unknown 473\0", + "Unknown 474\0", + "Unknown 475\0", + "Unknown 476\0", + "Unknown 477\0", + "Unknown 478\0", + "Unknown 479\0", + "Unknown 480\0", + "Unknown 481\0", + "Unknown 482\0", + "Unknown 483\0", + "Unknown 484\0", + "Unknown 485\0", + "Unknown 486\0", + "Unknown 487\0", + "Unknown 488\0", + "Unknown 489\0", + "Unknown 490\0", + "Unknown 491\0", + "Unknown 492\0", + "Unknown 493\0", + "Unknown 494\0", + "Unknown 495\0", + "Unknown 496\0", + "Unknown 497\0", + "Unknown 498\0", + "Unknown 499\0", + "Hit head\0", + "Evasive step\0", + "Evasive step\0", + "Evasive dive\0", + "Evasive dive and get up\0", + "Hit ped with car\0", + "Kill ped with car\0", + "Hurt ped with car\0", + "Walk round car\0", + "Walk round building attempt\0", + "Walk round object\0", + "Move back and jump\0", + "Evasive cower\0", + "Dive from attached entity and get up\0", + "Walk round fire\0", + "Stuck in air\0", + "Unknown 516\0", + "Unknown 517\0", + "Unknown 518\0", + "Unknown 519\0", + "Unknown 520\0", + "Unknown 521\0", + "Unknown 522\0", + "Unknown 523\0", + "Unknown 524\0", + "Unknown 525\0", + "Unknown 526\0", + "Unknown 527\0", + "Unknown 528\0", + "Unknown 529\0", + "Unknown 530\0", + "Unknown 531\0", + "Unknown 532\0", + "Unknown 533\0", + "Unknown 534\0", + "Unknown 535\0", + "Unknown 536\0", + "Unknown 537\0", + "Unknown 538\0", + "Unknown 539\0", + "Unknown 540\0", + "Unknown 541\0", + "Unknown 542\0", + "Unknown 543\0", + "Unknown 544\0", + "Unknown 545\0", + "Unknown 546\0", + "Unknown 547\0", + "Unknown 548\0", + "Unknown 549\0", + "Unknown 550\0", + "Unknown 551\0", + "Unknown 552\0", + "Unknown 553\0", + "Unknown 554\0", + "Unknown 555\0", + "Unknown 556\0", + "Unknown 557\0", + "Unknown 558\0", + "Unknown 559\0", + "Unknown 560\0", + "Unknown 561\0", + "Unknown 562\0", + "Unknown 563\0", + "Unknown 564\0", + "Unknown 565\0", + "Unknown 566\0", + "Unknown 567\0", + "Unknown 568\0", + "Unknown 569\0", + "Unknown 570\0", + "Unknown 571\0", + "Unknown 572\0", + "Unknown 573\0", + "Unknown 574\0", + "Unknown 575\0", + "Unknown 576\0", + "Unknown 577\0", + "Unknown 578\0", + "Unknown 579\0", + "Unknown 580\0", + "Unknown 581\0", + "Unknown 582\0", + "Unknown 583\0", + "Unknown 584\0", + "Unknown 585\0", + "Unknown 586\0", + "Unknown 587\0", + "Unknown 588\0", + "Unknown 589\0", + "Unknown 590\0", + "Unknown 591\0", + "Unknown 592\0", + "Unknown 593\0", + "Unknown 594\0", + "Unknown 595\0", + "Unknown 596\0", + "Unknown 597\0", + "Unknown 598\0", + "Unknown 599\0", + "Investigate dead ped\0", + "React to gun aimed at\0", + "Wait for backup\0", + "Get out of way of car\0", + "Extinguish fires\0", + "Unknown 605\0", + "Unknown 606\0", + "Unknown 607\0", + "Unknown 608\0", + "Unknown 609\0", + "Unknown 610\0", + "Unknown 611\0", + "Unknown 612\0", + "Unknown 613\0", + "Unknown 614\0", + "Unknown 615\0", + "Unknown 616\0", + "Unknown 617\0", + "Unknown 618\0", + "Unknown 619\0", + "Unknown 620\0", + "Unknown 621\0", + "Unknown 622\0", + "Unknown 623\0", + "Unknown 624\0", + "Unknown 625\0", + "Unknown 626\0", + "Unknown 627\0", + "Unknown 628\0", + "Unknown 629\0", + "Unknown 630\0", + "Unknown 631\0", + "Unknown 632\0", + "Unknown 633\0", + "Unknown 634\0", + "Unknown 635\0", + "Unknown 636\0", + "Unknown 637\0", + "Unknown 638\0", + "Unknown 639\0", + "Unknown 640\0", + "Unknown 641\0", + "Unknown 642\0", + "Unknown 643\0", + "Unknown 644\0", + "Unknown 645\0", + "Unknown 646\0", + "Unknown 647\0", + "Unknown 648\0", + "Unknown 649\0", + "Unknown 650\0", + "Unknown 651\0", + "Unknown 652\0", + "Unknown 653\0", + "Unknown 654\0", + "Unknown 655\0", + "Unknown 656\0", + "Unknown 657\0", + "Unknown 658\0", + "Unknown 659\0", + "Unknown 660\0", + "Unknown 661\0", + "Unknown 662\0", + "Unknown 663\0", + "Unknown 664\0", + "Unknown 665\0", + "Unknown 666\0", + "Unknown 667\0", + "Unknown 668\0", + "Unknown 669\0", + "Unknown 670\0", + "Unknown 671\0", + "Unknown 672\0", + "Unknown 673\0", + "Unknown 674\0", + "Unknown 675\0", + "Unknown 676\0", + "Unknown 677\0", + "Unknown 678\0", + "Unknown 679\0", + "Unknown 680\0", + "Unknown 681\0", + "Unknown 682\0", + "Unknown 683\0", + "Unknown 684\0", + "Unknown 685\0", + "Unknown 686\0", + "Unknown 687\0", + "Unknown 688\0", + "Unknown 689\0", + "Unknown 690\0", + "Unknown 691\0", + "Unknown 692\0", + "Unknown 693\0", + "Unknown 694\0", + "Unknown 695\0", + "Unknown 696\0", + "Unknown 697\0", + "Unknown 698\0", + "Unknown 699\0", + "Enter car as passenger\0", + "Enter car as driver\0", + "Steal car\0", + "Drag ped from car\0", + "Leave car\0", + "Leave car and die\0", + "Leave car and flee\0", + "Leave car and wander\0", + "Scream in car then leave\0", + "Car drive\0", + "Car drive to point\0", + "Car drive wander\0", + "Enter car as passenger timed\0", + "Enter car as driver timed\0", + "Leave any car\0", + "Enter boat as driver\0", + "Leave boat\0", + "Enter any car as driver\0", + "Enter car as passenger wait\0", + "Car drive timed\0", + "Shuffle seats\0", + "Car drive point route\0", + "Car open driver door\0", + "Car set temp action\0", + "Car drive mission\0", + "Car drive\0", + "Car drive mission flee scene\0", + "Enter leader car as passenger\0", + "Car open passenger door\0", + "Car drive mission kill ped\0", + "Leave car as passenger wait\0", + "Unknown 731\0", + "Unknown 732\0", + "Unknown 733\0", + "Unknown 734\0", + "Unknown 735\0", + "Unknown 736\0", + "Unknown 737\0", + "Unknown 738\0", + "Unknown 739\0", + "Unknown 740\0", + "Unknown 741\0", + "Unknown 742\0", + "Unknown 743\0", + "Unknown 744\0", + "Unknown 745\0", + "Unknown 746\0", + "Unknown 747\0", + "Unknown 748\0", + "Unknown 749\0", + "Unknown 750\0", + "Unknown 751\0", + "Unknown 752\0", + "Unknown 753\0", + "Unknown 754\0", + "Unknown 755\0", + "Unknown 756\0", + "Unknown 757\0", + "Unknown 758\0", + "Unknown 759\0", + "Unknown 760\0", + "Unknown 761\0", + "Unknown 762\0", + "Unknown 763\0", + "Unknown 764\0", + "Unknown 765\0", + "Unknown 766\0", + "Unknown 767\0", + "Unknown 768\0", + "Unknown 769\0", + "Unknown 770\0", + "Unknown 771\0", + "Unknown 772\0", + "Unknown 773\0", + "Unknown 774\0", + "Unknown 775\0", + "Unknown 776\0", + "Unknown 777\0", + "Unknown 778\0", + "Unknown 779\0", + "Unknown 780\0", + "Unknown 781\0", + "Unknown 782\0", + "Unknown 783\0", + "Unknown 784\0", + "Unknown 785\0", + "Unknown 786\0", + "Unknown 787\0", + "Unknown 788\0", + "Unknown 789\0", + "Unknown 790\0", + "Unknown 791\0", + "Unknown 792\0", + "Unknown 793\0", + "Unknown 794\0", + "Unknown 795\0", + "Unknown 796\0", + "Unknown 797\0", + "Unknown 798\0", + "Unknown 799\0", + "Go to car door and stand still\0", + "Car align\0", + "Car open door from outside\0", + "Car open locked door from outside\0", + "Bike pick up\0", + "Car close door from inside\0", + "Car close door from outside\0", + "Car get in\0", + "Car shuffle\0", + "Car wait to slow down\0", + "Car wait for door not to be in use\0", + "Car set ped in as passenger\0", + "Car set ped in as driver\0", + "Car get out\0", + "Car jump out\0", + "Car force ped out\0", + "Car set ped out\0", + "Car quick drag ped out\0", + "Car quick be dragged out\0", + "Car set ped quick dragged out\0", + "Car slow drag ped out\0", + "Car slow be dragged out\0", + "Car set ped slow dragged out\0", + "Car slow be dragged out\0", + "Car slow be dragged out and stand up\0", + "Car quick be dragged out\0", + "Bike jacked\0", + "Set ped as auto driver\0", + "Go to point near car door until door not in use\0", + "Wait until ped out car\0", + "Go to boat steering wheel\0", + "Get on boat seat\0", + "Create car and get in\0", + "Wait until ped in car\0", + "Car fall out\0", + "Unknown 835\0", + "Unknown 836\0", + "Unknown 837\0", + "Unknown 838\0", + "Unknown 839\0", + "Unknown 840\0", + "Unknown 841\0", + "Unknown 842\0", + "Unknown 843\0", + "Unknown 844\0", + "Unknown 845\0", + "Unknown 846\0", + "Unknown 847\0", + "Unknown 848\0", + "Unknown 849\0", + "Unknown 850\0", + "Unknown 851\0", + "Unknown 852\0", + "Unknown 853\0", + "Unknown 854\0", + "Unknown 855\0", + "Unknown 856\0", + "Unknown 857\0", + "Unknown 858\0", + "Unknown 859\0", + "Unknown 860\0", + "Unknown 861\0", + "Unknown 862\0", + "Unknown 863\0", + "Unknown 864\0", + "Unknown 865\0", + "Unknown 866\0", + "Unknown 867\0", + "Unknown 868\0", + "Unknown 869\0", + "Unknown 870\0", + "Unknown 871\0", + "Unknown 872\0", + "Unknown 873\0", + "Unknown 874\0", + "Unknown 875\0", + "Unknown 876\0", + "Unknown 877\0", + "Unknown 878\0", + "Unknown 879\0", + "Unknown 880\0", + "Unknown 881\0", + "Unknown 882\0", + "Unknown 883\0", + "Unknown 884\0", + "Unknown 885\0", + "Unknown 886\0", + "Unknown 887\0", + "Unknown 888\0", + "Unknown 889\0", + "Unknown 890\0", + "Unknown 891\0", + "Unknown 892\0", + "Unknown 893\0", + "Unknown 894\0", + "Unknown 895\0", + "Unknown 896\0", + "Unknown 897\0", + "Unknown 898\0", + "Unknown 899\0", + "Go to point\0", + "Go to point shooting\0", + "Achieve heading\0", + "Go to point and stand still\0", + "Go to point and stand still and achieve heading\0", + "Follow point route\0", + "Follow node route\0", + "Seek entity\0", + "Flee point\0", + "Flee entity\0", + "Smart flee point\0", + "Smart flee entity\0", + "Wander\0", + "Follow leader in formation\0", + "Follow sexy ped\0", + "Go to attractor\0", + "Leave attractor\0", + "Avoid other ped while wandering\0", + "Go to point any means\0", + "Walk round shop\0", + "Turn to face entity\0", + "Avoid building\0", + "Seek entity any means\0", + "Follow leader any means\0", + "Go to point aiming\0", + "Track entity\0", + "Go to point fine\0", + "Flee any means\0", + "Flee shooting\0", + "Seek entity shooting\0", + "Unused1\0", + "Follow patrol route\0", + "Goto door and open\0", + "Seek entity aiming\0", + "Slide to coord\0", + "Investigate disturbance\0", + "Follow ped footsteps\0", + "Follow node route shooting\0", + "Use entryexit\0", + "Avoid entity\0", + "Smart flee entity walking\0", + "Unknown 941\0", + "Unknown 942\0", + "Unknown 943\0", + "Unknown 944\0", + "Unknown 945\0", + "Unknown 946\0", + "Unknown 947\0", + "Unknown 948\0", + "Unknown 949\0", + "Unknown 950\0", + "Unknown 951\0", + "Unknown 952\0", + "Unknown 953\0", + "Unknown 954\0", + "Unknown 955\0", + "Unknown 956\0", + "Unknown 957\0", + "Unknown 958\0", + "Unknown 959\0", + "Unknown 960\0", + "Unknown 961\0", + "Unknown 962\0", + "Unknown 963\0", + "Unknown 964\0", + "Unknown 965\0", + "Unknown 966\0", + "Unknown 967\0", + "Unknown 968\0", + "Unknown 969\0", + "Unknown 970\0", + "Unknown 971\0", + "Unknown 972\0", + "Unknown 973\0", + "Unknown 974\0", + "Unknown 975\0", + "Unknown 976\0", + "Unknown 977\0", + "Unknown 978\0", + "Unknown 979\0", + "Unknown 980\0", + "Unknown 981\0", + "Unknown 982\0", + "Unknown 983\0", + "Unknown 984\0", + "Unknown 985\0", + "Unknown 986\0", + "Unknown 987\0", + "Unknown 988\0", + "Unknown 989\0", + "Unknown 990\0", + "Unknown 991\0", + "Unknown 992\0", + "Unknown 993\0", + "Unknown 994\0", + "Unknown 995\0", + "Unknown 996\0", + "Unknown 997\0", + "Unknown 998\0", + "Unknown 999\0", + "Kill ped on foot\0", + "Kill ped on foot melee\0", + "Kill ped on foot armed\0", + "Destroy car\0", + "Destroy car melee\0", + "Destroy car armed\0", + "React to attack\0", + "Be kicked on ground\0", + "Be hit\0", + "Be hit while moving\0", + "Side step and shoot\0", + "Driveby shoot\0", + "Driveby watch for target\0", + "Do driveby\0", + "Kill all threats\0", + "Kill ped group on foot\0", + "Fight\0", + "Use gun\0", + "Throw\0", + "Fight ctrl\0", + "Gun ctrl\0", + "Throw ctrl\0", + "Gang driveby\0", + "Kill ped on foot timed\0", + "Kill ped on foot stand still\0", + "Unused2\0", + "Kill ped on foot while ducking\0", + "Stealth kill\0", + "Kill ped on foot stealth\0", + "Kill ped on foot kinda stand still\0", + "Kill ped and reenter car\0", + "Road rage\0", + "Kill ped from boat\0", + "Set char ignore weapon range flag\0", + "Seek cover until target dead\0", + "Unknown 1035\0", + "Unknown 1036\0", + "Unknown 1037\0", + "Unknown 1038\0", + "Unknown 1039\0", + "Unknown 1040\0", + "Unknown 1041\0", + "Unknown 1042\0", + "Unknown 1043\0", + "Unknown 1044\0", + "Unknown 1045\0", + "Unknown 1046\0", + "Unknown 1047\0", + "Unknown 1048\0", + "Unknown 1049\0", + "Unknown 1050\0", + "Unknown 1051\0", + "Unknown 1052\0", + "Unknown 1053\0", + "Unknown 1054\0", + "Unknown 1055\0", + "Unknown 1056\0", + "Unknown 1057\0", + "Unknown 1058\0", + "Unknown 1059\0", + "Unknown 1060\0", + "Unknown 1061\0", + "Unknown 1062\0", + "Unknown 1063\0", + "Unknown 1064\0", + "Unknown 1065\0", + "Unknown 1066\0", + "Unknown 1067\0", + "Unknown 1068\0", + "Unknown 1069\0", + "Unknown 1070\0", + "Unknown 1071\0", + "Unknown 1072\0", + "Unknown 1073\0", + "Unknown 1074\0", + "Unknown 1075\0", + "Unknown 1076\0", + "Unknown 1077\0", + "Unknown 1078\0", + "Unknown 1079\0", + "Unknown 1080\0", + "Unknown 1081\0", + "Unknown 1082\0", + "Unknown 1083\0", + "Unknown 1084\0", + "Unknown 1085\0", + "Unknown 1086\0", + "Unknown 1087\0", + "Unknown 1088\0", + "Unknown 1089\0", + "Unknown 1090\0", + "Unknown 1091\0", + "Unknown 1092\0", + "Unknown 1093\0", + "Unknown 1094\0", + "Unknown 1095\0", + "Unknown 1096\0", + "Unknown 1097\0", + "Unknown 1098\0", + "Unknown 1099\0", + "Arrest ped\0", + "Arrest ped\0", + "Be arrested\0", + "Police pursuit\0", + "Be cop\0", + "Kill criminal\0", + "Cop in car\0", + "Unknown 1107\0", + "Unknown 1108\0", + "Unknown 1109\0", + "Unknown 1110\0", + "Unknown 1111\0", + "Unknown 1112\0", + "Unknown 1113\0", + "Unknown 1114\0", + "Unknown 1115\0", + "Unknown 1116\0", + "Unknown 1117\0", + "Unknown 1118\0", + "Unknown 1119\0", + "Unknown 1120\0", + "Unknown 1121\0", + "Unknown 1122\0", + "Unknown 1123\0", + "Unknown 1124\0", + "Unknown 1125\0", + "Unknown 1126\0", + "Unknown 1127\0", + "Unknown 1128\0", + "Unknown 1129\0", + "Unknown 1130\0", + "Unknown 1131\0", + "Unknown 1132\0", + "Unknown 1133\0", + "Unknown 1134\0", + "Unknown 1135\0", + "Unknown 1136\0", + "Unknown 1137\0", + "Unknown 1138\0", + "Unknown 1139\0", + "Unknown 1140\0", + "Unknown 1141\0", + "Unknown 1142\0", + "Unknown 1143\0", + "Unknown 1144\0", + "Unknown 1145\0", + "Unknown 1146\0", + "Unknown 1147\0", + "Unknown 1148\0", + "Unknown 1149\0", + "Unknown 1150\0", + "Unknown 1151\0", + "Unknown 1152\0", + "Unknown 1153\0", + "Unknown 1154\0", + "Unknown 1155\0", + "Unknown 1156\0", + "Unknown 1157\0", + "Unknown 1158\0", + "Unknown 1159\0", + "Unknown 1160\0", + "Unknown 1161\0", + "Unknown 1162\0", + "Unknown 1163\0", + "Unknown 1164\0", + "Unknown 1165\0", + "Unknown 1166\0", + "Unknown 1167\0", + "Unknown 1168\0", + "Unknown 1169\0", + "Unknown 1170\0", + "Unknown 1171\0", + "Unknown 1172\0", + "Unknown 1173\0", + "Unknown 1174\0", + "Unknown 1175\0", + "Unknown 1176\0", + "Unknown 1177\0", + "Unknown 1178\0", + "Unknown 1179\0", + "Unknown 1180\0", + "Unknown 1181\0", + "Unknown 1182\0", + "Unknown 1183\0", + "Unknown 1184\0", + "Unknown 1185\0", + "Unknown 1186\0", + "Unknown 1187\0", + "Unknown 1188\0", + "Unknown 1189\0", + "Unknown 1190\0", + "Unknown 1191\0", + "Unknown 1192\0", + "Unknown 1193\0", + "Unknown 1194\0", + "Unknown 1195\0", + "Unknown 1196\0", + "Unknown 1197\0", + "Unknown 1198\0", + "Unknown 1199\0", + "Inform group\0", + "Gang leader\0", + "Partner deal\0", + "Partner greet\0", + "Partner chat\0", + "Gang hassle vehicle\0", + "Walk with ped\0", + "Gang follower\0", + "Walk alongside ped\0", + "Partner shove\0", + "Signal at ped\0", + "Pass object\0", + "Gang hassle ped\0", + "Wait for ped\0", + "Do hand signal\0", + "Be in couple\0", + "Goto vehicle and lean\0", + "Lean on vehicle\0", + "Chat\0", + "Gang join respond\0", + "Unknown 1220\0", + "Unknown 1221\0", + "Unknown 1222\0", + "Unknown 1223\0", + "Unknown 1224\0", + "Unknown 1225\0", + "Unknown 1226\0", + "Unknown 1227\0", + "Unknown 1228\0", + "Unknown 1229\0", + "Unknown 1230\0", + "Unknown 1231\0", + "Unknown 1232\0", + "Unknown 1233\0", + "Unknown 1234\0", + "Unknown 1235\0", + "Unknown 1236\0", + "Unknown 1237\0", + "Unknown 1238\0", + "Unknown 1239\0", + "Unknown 1240\0", + "Unknown 1241\0", + "Unknown 1242\0", + "Unknown 1243\0", + "Unknown 1244\0", + "Unknown 1245\0", + "Unknown 1246\0", + "Unknown 1247\0", + "Unknown 1248\0", + "Unknown 1249\0", + "Unknown 1250\0", + "Unknown 1251\0", + "Unknown 1252\0", + "Unknown 1253\0", + "Unknown 1254\0", + "Unknown 1255\0", + "Unknown 1256\0", + "Unknown 1257\0", + "Unknown 1258\0", + "Unknown 1259\0", + "Unknown 1260\0", + "Unknown 1261\0", + "Unknown 1262\0", + "Unknown 1263\0", + "Unknown 1264\0", + "Unknown 1265\0", + "Unknown 1266\0", + "Unknown 1267\0", + "Unknown 1268\0", + "Unknown 1269\0", + "Unknown 1270\0", + "Unknown 1271\0", + "Unknown 1272\0", + "Unknown 1273\0", + "Unknown 1274\0", + "Unknown 1275\0", + "Unknown 1276\0", + "Unknown 1277\0", + "Unknown 1278\0", + "Unknown 1279\0", + "Unknown 1280\0", + "Unknown 1281\0", + "Unknown 1282\0", + "Unknown 1283\0", + "Unknown 1284\0", + "Unknown 1285\0", + "Unknown 1286\0", + "Unknown 1287\0", + "Unknown 1288\0", + "Unknown 1289\0", + "Unknown 1290\0", + "Unknown 1291\0", + "Unknown 1292\0", + "Unknown 1293\0", + "Unknown 1294\0", + "Unknown 1295\0", + "Unknown 1296\0", + "Unknown 1297\0", + "Unknown 1298\0", + "Unknown 1299\0", + "Zone response\0", + "Toggle ped threat scanner\0", + "Finished\0", + "Jetpack\0", + "Swim\0", + "Swim and climb out\0", + "Duck toggle\0", + "Wait for matching area codes\0", + "On escalator\0", + "Prostitute solicit\0", + "Unknown 1310\0", + "Unknown 1311\0", + "Unknown 1312\0", + "Unknown 1313\0", + "Unknown 1314\0", + "Unknown 1315\0", + "Unknown 1316\0", + "Unknown 1317\0", + "Unknown 1318\0", + "Unknown 1319\0", + "Unknown 1320\0", + "Unknown 1321\0", + "Unknown 1322\0", + "Unknown 1323\0", + "Unknown 1324\0", + "Unknown 1325\0", + "Unknown 1326\0", + "Unknown 1327\0", + "Unknown 1328\0", + "Unknown 1329\0", + "Unknown 1330\0", + "Unknown 1331\0", + "Unknown 1332\0", + "Unknown 1333\0", + "Unknown 1334\0", + "Unknown 1335\0", + "Unknown 1336\0", + "Unknown 1337\0", + "Unknown 1338\0", + "Unknown 1339\0", + "Unknown 1340\0", + "Unknown 1341\0", + "Unknown 1342\0", + "Unknown 1343\0", + "Unknown 1344\0", + "Unknown 1345\0", + "Unknown 1346\0", + "Unknown 1347\0", + "Unknown 1348\0", + "Unknown 1349\0", + "Unknown 1350\0", + "Unknown 1351\0", + "Unknown 1352\0", + "Unknown 1353\0", + "Unknown 1354\0", + "Unknown 1355\0", + "Unknown 1356\0", + "Unknown 1357\0", + "Unknown 1358\0", + "Unknown 1359\0", + "Unknown 1360\0", + "Unknown 1361\0", + "Unknown 1362\0", + "Unknown 1363\0", + "Unknown 1364\0", + "Unknown 1365\0", + "Unknown 1366\0", + "Unknown 1367\0", + "Unknown 1368\0", + "Unknown 1369\0", + "Unknown 1370\0", + "Unknown 1371\0", + "Unknown 1372\0", + "Unknown 1373\0", + "Unknown 1374\0", + "Unknown 1375\0", + "Unknown 1376\0", + "Unknown 1377\0", + "Unknown 1378\0", + "Unknown 1379\0", + "Unknown 1380\0", + "Unknown 1381\0", + "Unknown 1382\0", + "Unknown 1383\0", + "Unknown 1384\0", + "Unknown 1385\0", + "Unknown 1386\0", + "Unknown 1387\0", + "Unknown 1388\0", + "Unknown 1389\0", + "Unknown 1390\0", + "Unknown 1391\0", + "Unknown 1392\0", + "Unknown 1393\0", + "Unknown 1394\0", + "Unknown 1395\0", + "Unknown 1396\0", + "Unknown 1397\0", + "Unknown 1398\0", + "Unknown 1399\0", + "Interior use info\0", + "Interior goto info\0", + "Interior be in house\0", + "Interior be in office\0", + "Interior be in shop\0", + "Interior shopkeeper\0", + "Interior lie in bed\0", + "Interior sit on chair\0", + "Interior sit at desk\0", + "Interior leave\0", + "Interior sit in restaurant\0", + "Interior reserved2\0", + "Interior reserved3\0", + "Interior reserved4\0", + "Interior reserved5\0", + "Interior reserved6\0", + "Interior reserved7\0", + "Interior reserved8\0", + "Unknown 1418\0", + "Unknown 1419\0", + "Unknown 1420\0", + "Unknown 1421\0", + "Unknown 1422\0", + "Unknown 1423\0", + "Unknown 1424\0", + "Unknown 1425\0", + "Unknown 1426\0", + "Unknown 1427\0", + "Unknown 1428\0", + "Unknown 1429\0", + "Unknown 1430\0", + "Unknown 1431\0", + "Unknown 1432\0", + "Unknown 1433\0", + "Unknown 1434\0", + "Unknown 1435\0", + "Unknown 1436\0", + "Unknown 1437\0", + "Unknown 1438\0", + "Unknown 1439\0", + "Unknown 1440\0", + "Unknown 1441\0", + "Unknown 1442\0", + "Unknown 1443\0", + "Unknown 1444\0", + "Unknown 1445\0", + "Unknown 1446\0", + "Unknown 1447\0", + "Unknown 1448\0", + "Unknown 1449\0", + "Unknown 1450\0", + "Unknown 1451\0", + "Unknown 1452\0", + "Unknown 1453\0", + "Unknown 1454\0", + "Unknown 1455\0", + "Unknown 1456\0", + "Unknown 1457\0", + "Unknown 1458\0", + "Unknown 1459\0", + "Unknown 1460\0", + "Unknown 1461\0", + "Unknown 1462\0", + "Unknown 1463\0", + "Unknown 1464\0", + "Unknown 1465\0", + "Unknown 1466\0", + "Unknown 1467\0", + "Unknown 1468\0", + "Unknown 1469\0", + "Unknown 1470\0", + "Unknown 1471\0", + "Unknown 1472\0", + "Unknown 1473\0", + "Unknown 1474\0", + "Unknown 1475\0", + "Unknown 1476\0", + "Unknown 1477\0", + "Unknown 1478\0", + "Unknown 1479\0", + "Unknown 1480\0", + "Unknown 1481\0", + "Unknown 1482\0", + "Unknown 1483\0", + "Unknown 1484\0", + "Unknown 1485\0", + "Unknown 1486\0", + "Unknown 1487\0", + "Unknown 1488\0", + "Unknown 1489\0", + "Unknown 1490\0", + "Unknown 1491\0", + "Unknown 1492\0", + "Unknown 1493\0", + "Unknown 1494\0", + "Unknown 1495\0", + "Unknown 1496\0", + "Unknown 1497\0", + "Unknown 1498\0", + "Unknown 1499\0", + "Group follow leader any means\0", + "Group follow leader with limits\0", + "Group kill threats basic\0", + "Group kill player basic\0", + "Group stare at ped\0", + "Group flee threat\0", + "Group partner deal\0", + "Group partner greet\0", + "Group hassle sexy ped\0", + "Group hassle threat\0", + "Group use member decision\0", + "Group exit car\0", + "Group enter car\0", + "Group enter car and perform sequence\0", + "Group respond to leader command\0", + "Group hand signal\0", + "Group driveby\0", + "Group hassle threat passive\0", + "Unknown 1518\0", + "Unknown 1519\0", + "Unknown 1520\0", + "Unknown 1521\0", + "Unknown 1522\0", + "Unknown 1523\0", + "Unknown 1524\0", + "Unknown 1525\0", + "Unknown 1526\0", + "Unknown 1527\0", + "Unknown 1528\0", + "Unknown 1529\0", + "Unknown 1530\0", + "Unknown 1531\0", + "Unknown 1532\0", + "Unknown 1533\0", + "Unknown 1534\0", + "Unknown 1535\0", + "Unknown 1536\0", + "Unknown 1537\0", + "Unknown 1538\0", + "Unknown 1539\0", + "Unknown 1540\0", + "Unknown 1541\0", + "Unknown 1542\0", + "Unknown 1543\0", + "Unknown 1544\0", + "Unknown 1545\0", + "Unknown 1546\0", + "Unknown 1547\0", + "Unknown 1548\0", + "Unknown 1549\0", + "Unknown 1550\0", + "Unknown 1551\0", + "Unknown 1552\0", + "Unknown 1553\0", + "Unknown 1554\0", + "Unknown 1555\0", + "Unknown 1556\0", + "Unknown 1557\0", + "Unknown 1558\0", + "Unknown 1559\0", + "Unknown 1560\0", + "Unknown 1561\0", + "Unknown 1562\0", + "Unknown 1563\0", + "Unknown 1564\0", + "Unknown 1565\0", + "Unknown 1566\0", + "Unknown 1567\0", + "Unknown 1568\0", + "Unknown 1569\0", + "Unknown 1570\0", + "Unknown 1571\0", + "Unknown 1572\0", + "Unknown 1573\0", + "Unknown 1574\0", + "Unknown 1575\0", + "Unknown 1576\0", + "Unknown 1577\0", + "Unknown 1578\0", + "Unknown 1579\0", + "Unknown 1580\0", + "Unknown 1581\0", + "Unknown 1582\0", + "Unknown 1583\0", + "Unknown 1584\0", + "Unknown 1585\0", + "Unknown 1586\0", + "Unknown 1587\0", + "Unknown 1588\0", + "Unknown 1589\0", + "Unknown 1590\0", + "Unknown 1591\0", + "Unknown 1592\0", + "Unknown 1593\0", + "Unknown 1594\0", + "Unknown 1595\0", + "Unknown 1596\0", + "Unknown 1597\0", + "Unknown 1598\0", + "Unknown 1599\0", + "Use mobile phone\0", + "Phone talk\0", + "Phone in\0", + "Phone out\0", + "Use goggles\0", + "Goggles on\0", + "Goggles off\0", + "Unknown 1607\0", + "Unknown 1608\0", + "Unknown 1609\0", + "Unknown 1610\0", + "Unknown 1611\0", + "Unknown 1612\0", + "Unknown 1613\0", + "Unknown 1614\0", + "Unknown 1615\0", + "Unknown 1616\0", + "Unknown 1617\0", + "Unknown 1618\0", + "Unknown 1619\0", + "Unknown 1620\0", + "Unknown 1621\0", + "Unknown 1622\0", + "Unknown 1623\0", + "Unknown 1624\0", + "Unknown 1625\0", + "Unknown 1626\0", + "Unknown 1627\0", + "Unknown 1628\0", + "Unknown 1629\0", + "Unknown 1630\0", + "Unknown 1631\0", + "Unknown 1632\0", + "Unknown 1633\0", + "Unknown 1634\0", + "Unknown 1635\0", + "Unknown 1636\0", + "Unknown 1637\0", + "Unknown 1638\0", + "Unknown 1639\0", + "Unknown 1640\0", + "Unknown 1641\0", + "Unknown 1642\0", + "Unknown 1643\0", + "Unknown 1644\0", + "Unknown 1645\0", + "Unknown 1646\0", + "Unknown 1647\0", + "Unknown 1648\0", + "Unknown 1649\0", + "Unknown 1650\0", + "Unknown 1651\0", + "Unknown 1652\0", + "Unknown 1653\0", + "Unknown 1654\0", + "Unknown 1655\0", + "Unknown 1656\0", + "Unknown 1657\0", + "Unknown 1658\0", + "Unknown 1659\0", + "Unknown 1660\0", + "Unknown 1661\0", + "Unknown 1662\0", + "Unknown 1663\0", + "Unknown 1664\0", + "Unknown 1665\0", + "Unknown 1666\0", + "Unknown 1667\0", + "Unknown 1668\0", + "Unknown 1669\0", + "Unknown 1670\0", + "Unknown 1671\0", + "Unknown 1672\0", + "Unknown 1673\0", + "Unknown 1674\0", + "Unknown 1675\0", + "Unknown 1676\0", + "Unknown 1677\0", + "Unknown 1678\0", + "Unknown 1679\0", + "Unknown 1680\0", + "Unknown 1681\0", + "Unknown 1682\0", + "Unknown 1683\0", + "Unknown 1684\0", + "Unknown 1685\0", + "Unknown 1686\0", + "Unknown 1687\0", + "Unknown 1688\0", + "Unknown 1689\0", + "Unknown 1690\0", + "Unknown 1691\0", + "Unknown 1692\0", + "Unknown 1693\0", + "Unknown 1694\0", + "Unknown 1695\0", + "Unknown 1696\0", + "Unknown 1697\0", + "Unknown 1698\0", + "Unknown 1699\0", + "Inform respected friends\0", + "Unknown 1701\0", + "Unknown 1702\0", + "Unknown 1703\0", + "Unknown 1704\0", + "Unknown 1705\0", + "Unknown 1706\0", + "Unknown 1707\0", + "Unknown 1708\0", + "Unknown 1709\0", + "Unknown 1710\0", + "Unknown 1711\0", + "Unknown 1712\0", + "Unknown 1713\0", + "Unknown 1714\0", + "Unknown 1715\0", + "Unknown 1716\0", + "Unknown 1717\0", + "Unknown 1718\0", + "Unknown 1719\0", + "Unknown 1720\0", + "Unknown 1721\0", + "Unknown 1722\0", + "Unknown 1723\0", + "Unknown 1724\0", + "Unknown 1725\0", + "Unknown 1726\0", + "Unknown 1727\0", + "Unknown 1728\0", + "Unknown 1729\0", + "Unknown 1730\0", + "Unknown 1731\0", + "Unknown 1732\0", + "Unknown 1733\0", + "Unknown 1734\0", + "Unknown 1735\0", + "Unknown 1736\0", + "Unknown 1737\0", + "Unknown 1738\0", + "Unknown 1739\0", + "Unknown 1740\0", + "Unknown 1741\0", + "Unknown 1742\0", + "Unknown 1743\0", + "Unknown 1744\0", + "Unknown 1745\0", + "Unknown 1746\0", + "Unknown 1747\0", + "Unknown 1748\0", + "Unknown 1749\0", + "Unknown 1750\0", + "Unknown 1751\0", + "Unknown 1752\0", + "Unknown 1753\0", + "Unknown 1754\0", + "Unknown 1755\0", + "Unknown 1756\0", + "Unknown 1757\0", + "Unknown 1758\0", + "Unknown 1759\0", + "Unknown 1760\0", + "Unknown 1761\0", + "Unknown 1762\0", + "Unknown 1763\0", + "Unknown 1764\0", + "Unknown 1765\0", + "Unknown 1766\0", + "Unknown 1767\0", + "Unknown 1768\0", + "Unknown 1769\0", + "Unknown 1770\0", + "Unknown 1771\0", + "Unknown 1772\0", + "Unknown 1773\0", + "Unknown 1774\0", + "Unknown 1775\0", + "Unknown 1776\0", + "Unknown 1777\0", + "Unknown 1778\0", + "Unknown 1779\0", + "Unknown 1780\0", + "Unknown 1781\0", + "Unknown 1782\0", + "Unknown 1783\0", + "Unknown 1784\0", + "Unknown 1785\0", + "Unknown 1786\0", + "Unknown 1787\0", + "Unknown 1788\0", + "Unknown 1789\0", + "Unknown 1790\0", + "Unknown 1791\0", + "Unknown 1792\0", + "Unknown 1793\0", + "Unknown 1794\0", + "Unknown 1795\0", + "Unknown 1796\0", + "Unknown 1797\0", + "Unknown 1798\0", + "Unknown 1799\0", + "Use scripted brain\0", + "Finish brain\0" +}; \ No newline at end of file diff --git a/src/teleport.cpp b/src/teleport.cpp index bdffb6c..1a73a84 100644 --- a/src/teleport.cpp +++ b/src/teleport.cpp @@ -138,7 +138,7 @@ void Teleport::WarpPlayer(CVector pos, int interiorID) tRadarTrace targetBlip = CRadar::ms_RadarTrace[LOWORD(FrontEndMenuManager.m_nTargetBlipIndex)]; if (targetBlip.m_nRadarSprite != RADAR_SPRITE_WAYPOINT) { - SetHelpMessage(TEXT("Teleport.TargetBlipText")); + Util::SetMessage(TEXT("Teleport.TargetBlipText")); return; } pos = targetBlip.m_vecPos; @@ -209,7 +209,7 @@ void Teleport::WarpPlayer(CVector pos, int interiorID) if (pVeh && pPlayer->m_pVehicle) { #ifdef GTAVC - pPlayer->m_nAreaCode = interior_id; + pPlayer->m_nAreaCode = interiorID; #endif pVeh->Teleport(pos); } @@ -236,7 +236,7 @@ void Teleport::TeleportToLocation(std::string& rootkey, std::string& bLocName, s } catch (...) { - SetHelpMessage(TEXT("Teleport.InvalidLocation")); + Util::SetMessage(TEXT("Teleport.InvalidLocation")); } } @@ -245,12 +245,12 @@ void Teleport::RemoveTeleportEntry(std::string& category, std::string& key, std: if (category == "Custom") { m_locData.m_pData->RemoveKey("Custom", key.c_str()); - SetHelpMessage(TEXT("Teleport.LocationRemoved")); + Util::SetMessage(TEXT("Teleport.LocationRemoved")); m_locData.m_pData->Save(); } else { - SetHelpMessage(TEXT("Teleport.CustomLocationRemoveOnly")); + Util::SetMessage(TEXT("Teleport.CustomLocationRemoveOnly")); } } @@ -311,7 +311,7 @@ void Teleport::ShowPage() } catch (...) { - SetHelpMessage(TEXT("Teleport.InvalidCoord")); + Util::SetMessage(TEXT("Teleport.InvalidCoord")); } } ImGui::SameLine(); @@ -323,7 +323,7 @@ void Teleport::ShowPage() #else if (ImGui::Button(TEXT("Teleport.TeleportCenter"), Widget::CalcSize(2))) { - TeleportPlayer(CVector(0, 0, 23), eTeleportType::Coordinate); + WarpPlayer(CVector(0, 0, 23)); } #endif ImGui::EndChild(); diff --git a/src/updater.cpp b/src/updater.cpp index 366f1ac..ba7af7a 100644 --- a/src/updater.cpp +++ b/src/updater.cpp @@ -37,7 +37,7 @@ void Updater::Process() if (res == E_OUTOFMEMORY || res == INET_E_DOWNLOAD_FAILURE) { - SetHelpMessage(TEXT("Updater.Failed")); + Util::SetMessage(TEXT("Updater.Failed")); return; } @@ -64,12 +64,12 @@ void Updater::Process() if (latestVer > MENU_VERSION_NUMBER) { - SetHelpMessage(TEXT("Updater.Found")); + Util::SetMessage(TEXT("Updater.Found")); curState = States::FOUND; } else { - SetHelpMessage(TEXT("Updater.NotFound")); + Util::SetMessage(TEXT("Updater.NotFound")); Updater::curState = States::IDLE; } } diff --git a/src/util.cpp b/src/util.cpp index 2fe4553..dd43913 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3,6 +3,21 @@ #include "psapi.h" #include +void Util::SetMessage(const char *message, bool b1, bool b2, bool b3) +{ +#if GTASA + CHud::SetHelpMessage(message, b1, b2, b3); +#elif GTAVC + CHud::SetHelpMessage(message, b1, b2); +#else + const size_t size = strlen(message)+1; + wchar_t* wc = new wchar_t[size]; + mbstowcs(wc, message, size); + CHud::SetHelpMessage(wc, b1); + delete wc; +#endif +} + float Util::RoundFloat(float val) { return roundf(val * 100) / 100; diff --git a/src/util.h b/src/util.h index 73fd877..7cb6e63 100644 --- a/src/util.h +++ b/src/util.h @@ -23,7 +23,6 @@ public: static void ClearCharTasksVehCheck(CPed* ped); static bool IsOnMission(); #endif - static void UnFlipVehicle(CVehicle *pVeh); static void FixVehicle(CVehicle *pVeh); static CPed* GetClosestPed(); @@ -35,5 +34,6 @@ public: static bool IsInVehicle(CPed *pPed = FindPlayerPed()); static void RainbowValues(int& r, int& g, int& b, float speed); static void SetCarForwardSpeed(CVehicle *pVeh, float speed); + static void SetMessage(const char *message, bool b1 = false, bool b2 = false, bool b3 = false); static float RoundFloat(float val); }; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 016d3e6..f8aa03a 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -51,7 +51,7 @@ void Vehicle::Init() if (fixVeh.Pressed()) { Util::FixVehicle(pVeh); - SetHelpMessage("Vehicle fixed"); + Util::SetMessage("Vehicle fixed"); } if (vehEngine.Pressed()) @@ -60,11 +60,11 @@ void Vehicle::Init() if (state) { - SetHelpMessage("Vehicle engine off"); + Util::SetMessage("Vehicle engine off"); } else { - SetHelpMessage("Vehicle engine on"); + Util::SetMessage("Vehicle engine on"); } #ifdef GTASA pVeh->m_nVehicleFlags.bEngineBroken = state; @@ -215,7 +215,7 @@ void Vehicle::AddComponent(const std::string& component, const bool display_mess if (display_message) { - SetHelpMessage("Component added"); + Util::SetMessage("Component added"); } } catch (...) @@ -237,7 +237,7 @@ void Vehicle::RemoveComponent(const std::string& component, const bool display_m if (display_message) { - SetHelpMessage("Component removed"); + Util::SetMessage("Component removed"); } } catch (...) @@ -272,7 +272,7 @@ int Vehicle::GetRandomTrainIdForModel(int model) _end = 10; break; default: - SetHelpMessage("Invalid train model"); + Util::SetMessage("Invalid train model"); return -1; } int id = Random(_start, _end); @@ -515,7 +515,7 @@ static void StartAutoDrive(CVehicle *pVeh, const char *buf = nullptr) pos = targetBlip.m_vecPos; if (targetBlip.m_nRadarSprite != RADAR_SPRITE_WAYPOINT) { - SetHelpMessage(TEXT("Teleport.TargetBlipText")); + Util::SetMessage(TEXT("Teleport.TargetBlipText")); return; } #else @@ -1128,12 +1128,12 @@ void Vehicle::ShowPage() } else { - SetHelpMessage(TEXT("Vehicle.InvalidID")); + Util::SetMessage(TEXT("Vehicle.InvalidID")); } } catch(...) { - SetHelpMessage(TEXT("Vehicle.InvalidID")); + Util::SetMessage(TEXT("Vehicle.InvalidID")); } } #ifdef GTASA @@ -1210,7 +1210,7 @@ void Vehicle::ShowPage() if (ImGui::Button(TEXT("Vehicle.ResetColor"), ImVec2(Widget::CalcSize()))) { Paint::ResetNodeColor(veh, PaintData::m_Selected); - SetHelpMessage(TEXT("Vehicle.ResetColorMSG")); + Util::SetMessage(TEXT("Vehicle.ResetColorMSG")); } ImGui::Spacing(); @@ -1281,7 +1281,7 @@ void Vehicle::ShowPage() if (ImGui::Button(TEXT("Vehicle.RemoveNeon"), ImVec2(Widget::CalcSize()))) { Neon::Remove(veh); - SetHelpMessage(TEXT("Vehicle.RemoveNeonMSG")); + Util::SetMessage(TEXT("Vehicle.RemoveNeonMSG")); } ImGui::Spacing(); @@ -1350,7 +1350,7 @@ void Vehicle::ShowPage() if (ImGui::Button(TEXT("Vehicle.ResetTexture"), ImVec2(Widget::CalcSize()))) { Paint::ResetNodeTexture(veh, PaintData::m_Selected); - SetHelpMessage(TEXT("Vehicle.ResetTextureMSG")); + Util::SetMessage(TEXT("Vehicle.ResetTextureMSG")); } ImGui::Spacing(); @@ -1442,7 +1442,7 @@ void Vehicle::ShowPage() if (ImGui::Button(TEXT("Vehicle.ResetHandling"), ImVec2(Widget::CalcSize(3)))) { gHandlingDataMgr.LoadHandlingData(); - SetHelpMessage(TEXT("Vehicle.ResetHandlingMSG")); + Util::SetMessage(TEXT("Vehicle.ResetHandlingMSG")); } ImGui::SameLine(); @@ -1450,7 +1450,7 @@ void Vehicle::ShowPage() if (ImGui::Button(TEXT("Vehicle.SaveFile"), ImVec2(Widget::CalcSize(3)))) { FileHandler::GenerateHandlingFile(pHandlingData, m_VehicleIDE); - SetHelpMessage(TEXT("Vehicle.SaveFileMSG")); + Util::SetMessage(TEXT("Vehicle.SaveFileMSG")); } ImGui::SameLine(); diff --git a/src/visual.cpp b/src/visual.cpp index 7096313..a61f9c0 100644 --- a/src/visual.cpp +++ b/src/visual.cpp @@ -4,8 +4,6 @@ #include "util.h" #include "game.h" #include "timecycle.h" -#include "CSprite.h" -#include "CFont.h" #include "CWorld.h" #include "vehicle.h" @@ -158,7 +156,6 @@ void Visual::Init() m_nBacWeatherType = CWeather::OldWeatherType; } }; - ShowModelInfo::Init(); } template @@ -525,103 +522,6 @@ static void ColorPickerAddr(const char* label, int addr, ImVec4&& default_color) } } -void ShowModelInfo::Init() -{ - ThiscallEvent, PRIORITY_BEFORE, ArgPickN, void(CEntity*)> preRenderEntityEvent; - -#ifndef GTASA - patch::Nop(BY_GAME(NULL, 0x488828, 0x474BBA), 4); -#endif - - // Directly drawing here seems to crash renderer? - preRenderEntityEvent += [](CEntity *pEnt) - { - CPlayerPed *player = FindPlayerPed(); - if (m_bEnable) - { - CVector coord = pEnt->GetPosition(); - CVector plaPos = player->GetPosition(); - - CColPoint outColPoint; - if (BY_GAME(pEnt->m_bIsVisible, pEnt->IsVisible(), pEnt->IsVisible())) - { - ShowModelInfo::m_EntityList.push_back(pEnt); - } - } - -#ifdef GTAVC - if (CModelInfo::GetModelInfo(pEnt->m_nModelIndex)->m_nNum2dEffects > 0) - { - pEnt->ProcessLightsForEntity(); - } -#elif GTA3 - // if (CModelInfo::ms_modelInfoPtrs[pEnt->m_nModelIndex]->m_nNum2dEffects > 0) - // { - // pEnt->ProcessLightsForEntity(); - // } -#endif - }; -} - -void ShowModelInfo::Draw() -{ - if (m_bEnable) - { - ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove - | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoNavFocus - | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing; - ImGui::SetNextWindowPos(ImVec2(0, 0)); - ImGui::SetNextWindowSize(ImVec2(screen::GetScreenWidth(), screen::GetScreenHeight())); - ImGui::SetNextWindowBgAlpha(0.0f); - if (ImGui::Begin("##Overlay", NULL, flags)) - { - ImDrawList *pDrawList = ImGui::GetWindowDrawList(); - for (CEntity *pEnt : m_EntityList) - { - CVector coord = BY_GAME(,,*)pEnt->GetBoundCentre(); - float distance = DistanceBetweenPoints(coord, FindPlayerPed()->GetPosition()); - RwV3d screen; - CVector2D size; - if (distance < m_nDistance && -#ifdef GTASA - CSprite::CalcScreenCoors(coord.ToRwV3d(), &screen, &size.x, &size.y, true, true) -#else - CSprite::CalcScreenCoors(coord.ToRwV3d(), &screen, &size.x, &size.y, true) -#endif -) - { - bool skip = false; - uint model = pEnt->m_nModelIndex; - std::string text = std::to_string(model); - ImU32 col = ImGui::ColorConvertFloat4ToU32(distance < m_nDistance/2 ? ImVec4(1.0f, 1.0f, 1.0f, 1.00f) : ImVec4(0.35f, 0.33f, 0.3f, 1.00f)); -#ifdef GTASA - if (pEnt->m_nType == ENTITY_TYPE_VEHICLE) - { - text = std::format("{}\n{}", model, Vehicle::GetNameFromModel(model)); - } - else if (pEnt->m_nType == ENTITY_TYPE_PED) - { - CPed *ped = static_cast(pEnt); - if (BY_GAME(ped->m_nPedFlags.bInVehicle, ped->m_bInVehicle, ped->m_bInVehicle)) - { - skip = true; - } - } -#endif - - if (!skip) - { - pDrawList->AddText(ImVec2(screen.x, screen.y), col, text.c_str()); - } - } - } - m_EntityList.clear(); - ImGui::End(); - } - - } -} - void Visual::ShowPage() { if (ImGui::BeginTabBar("Visual", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) @@ -803,7 +703,6 @@ void Visual::ShowPage() plugin::patch::SetRaw(0x6E8580, (char*)"\x51\xD9\x44", 3); } } - bool radar_state = (patch::Get(0xBA676C) != 2); if (Widget::Checkbox(TEXT("Visual.ShowRadar"), &radar_state)) { @@ -958,22 +857,6 @@ void Visual::ShowPage() #endif if (ImGui::BeginChild("VisualsChild")) { - if(ImGui::CollapsingHeader(TEXT("Visual.ShowModelInfo"))) - { - Widget::Checkbox(TEXT("Window.Enabled"), &ShowModelInfo::m_bEnable); - - ImGui::Spacing(); - - if (ImGui::InputInt(TEXT("Visual.Distance"), &ShowModelInfo::m_nDistance)) - { - if (ShowModelInfo::m_nDistance < 0.0f) - { - ShowModelInfo::m_nDistance = 0.0f; - } - } - ImGui::Spacing(); - ImGui::Separator(); - } #ifdef GTASA ColorPickerAddr(TEXT("Visual.ArmourbarColor"), *(int*)0x5890FC, ImVec4(225, 225, 225, 255)); Widget::EditAddr(TEXT("Visual.ArmourbarPosX"), 0x866B78, -999, 94, 999); @@ -1041,13 +924,13 @@ void Visual::ShowPage() if (ImGui::Button(TEXT("Visual.GenerateFile"), Widget::CalcSize(2))) { GenerateTimecycFile(); - SetHelpMessage(TEXT("Visual.FileGenerated")); + Util::SetMessage(TEXT("Visual.FileGenerated")); } ImGui::SameLine(); if (ImGui::Button(TEXT("Visual.ResetTimecyc"), Widget::CalcSize(2))) { CTimeCycle::Initialise(); - SetHelpMessage(TEXT("Visual.TimecycReset")); + Util::SetMessage(TEXT("Visual.TimecycReset")); } ImGui::Spacing(); diff --git a/src/visual.h b/src/visual.h index b0609e5..60ea2b4 100644 --- a/src/visual.h +++ b/src/visual.h @@ -1,24 +1,10 @@ #pragma once #include "pch.h" -struct ShowModelInfo -{ -private: - static inline std::vector m_EntityList; - -public: - static inline bool m_bEnable; - static inline int m_nDistance = 50.0f; - - static void Init(); - static void Draw(); -}; - class Visual { private: static inline bool m_bLockWeather; - static inline bool m_bModelInfo; #ifdef GTASA static inline bool m_bInvisibleWater; @@ -39,7 +25,7 @@ private: static bool TimeCycColorEdit4(const char* label, T* r, T* g, T* b, T* a, ImGuiColorEditFlags flags = 0); template static void TimecycSlider(const char* label, T* data, int min, int max); - + public: Visual() = delete; Visual(const Visual&) = delete; diff --git a/src/widget.cpp b/src/widget.cpp index f536ffe..3a7c917 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -137,7 +137,7 @@ void Widget::DataList(ResourceStore& data, ArgCallback3 clickFunc, ArgCallback3 { data.m_pData->Set(std::format("Favourites.{}", contextMenu.key).c_str(), contextMenu.val); data.m_pData->Save(); - SetHelpMessage(TEXT("Menu.FavouritesText")); + Util::SetMessage(TEXT("Menu.FavouritesText")); } if (contextMenu.func && ImGui::MenuItem(TEXT("Menu.Remove"))) { @@ -194,7 +194,7 @@ void Widget::DataList(ResourceStore& data, ArgCallback3 clickFunc, ArgCallback3 { data.m_pData->RemoveKey("Favourites", contextMenu.key.c_str()); data.m_pData->Save(); - SetHelpMessage(TEXT("Menu.FavouritesRemoveText")); + Util::SetMessage(TEXT("Menu.FavouritesRemoveText")); } if (ImGui::MenuItem(TEXT("Menu.Close"))) { @@ -364,7 +364,7 @@ void Widget::ImageList(ResourceStore &store, ArgCallback clickFunc, ArgCallbackR { store.m_pData->Set(std::format("Favourites.{}", contextMenu.val).c_str(), contextMenu.key); store.m_pData->Save(); - SetHelpMessage(TEXT("Menu.FavouritesText")); + Util::SetMessage(TEXT("Menu.FavouritesText")); } if (ImGui::MenuItem(TEXT("Menu.Close"))) { @@ -450,7 +450,7 @@ void Widget::ImageList(ResourceStore &store, ArgCallback clickFunc, ArgCallbackR { store.m_pData->RemoveKey("Favourites", contextMenu.val.c_str()); store.m_pData->Save(); - SetHelpMessage(TEXT("Menu.FavouritesRemoveText")); + Util::SetMessage(TEXT("Menu.FavouritesRemoveText")); } if (ImGui::MenuItem(TEXT("Menu.Close"))) {