CheatMenuSA/src/menu.cpp

637 lines
21 KiB
C++
Raw Normal View History

2021-10-24 18:08:00 -04:00
#include "pch.h"
2021-10-25 10:03:27 -04:00
#include "menu.h"
2021-09-20 08:41:40 -04:00
#include "ui.h"
2021-10-24 18:08:00 -04:00
#include "util.h"
2021-10-25 10:03:27 -04:00
#include "updater.h"
2021-12-16 15:17:49 -05:00
#include "cheatmenu.h"
2022-03-09 17:23:08 -05:00
#include "rpc.h"
2020-12-02 16:19:16 -05:00
2021-08-01 21:41:48 -04:00
#ifdef GTASA
2021-09-20 08:41:40 -04:00
#include "teleport.h"
2021-10-24 18:08:00 -04:00
#include "weapon.h"
2021-10-25 10:03:27 -04:00
#include "vehicle.h"
2021-08-01 21:41:48 -04:00
#endif
void Menu::Init()
2020-12-02 16:19:16 -05:00
{
2022-01-07 03:18:00 -05:00
// TODO: use structs
// Load config data
2022-06-26 08:08:55 -04:00
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.ShowVehicleName", 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);
2022-06-18 04:01:31 -04:00
m_bTextOnlyMode = gConfig.Get("Menu.TextOnlyMode", false);
2020-12-02 16:19:16 -05:00
2022-01-07 03:18:00 -05:00
Util::GetCPUUsageInit();
MEMORYSTATUSEX memInfo;
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&memInfo);
2022-06-26 08:08:55 -04:00
Overlay::mTotalRam = static_cast<int>(memInfo.ullTotalPhys * 1e-6); // Bytes -> MegaBytes
2022-03-09 17:23:08 -05:00
if (m_bDiscordRPC)
{
RPC::Init();
}
2020-12-02 16:19:16 -05:00
}
2021-02-25 17:45:41 -05:00
void Menu::DrawOverlay()
2020-12-02 16:19:16 -05:00
{
2022-01-07 03:18:00 -05:00
CPlayerPed* pPlayer = FindPlayerPed();
if (pPlayer)
{
2022-06-26 08:08:55 -04:00
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);
2022-01-07 03:18:00 -05:00
const float offset = 10.0f;
ImGuiIO& io = ImGui::GetIO();
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
2022-06-26 08:08:55 -04:00
if (Overlay::mSelectedPos == DisplayPos::CUSTOM)
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
if (Overlay::fPosX != NULL && Overlay::fPosY != NULL)
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.PosX", Overlay::fPosX);
gConfig.Set("Overlay.PosY", Overlay::fPosY);
ImGui::SetNextWindowPos(ImVec2(Overlay::fPosX, Overlay::fPosY), ImGuiCond_Once);
2022-01-07 03:18:00 -05:00
}
}
else
{
window_flags |= ImGuiWindowFlags_NoMove;
ImVec2 pos, pivot;
2022-06-26 08:08:55 -04:00
if (Overlay::mSelectedPos == DisplayPos::TOP_LEFT)
2022-01-07 03:18:00 -05:00
{
pos = ImVec2(offset, offset);
pivot = ImVec2(0.0f, 0.0f);
}
2022-06-26 08:08:55 -04:00
if (Overlay::mSelectedPos == DisplayPos::TOP_RIGHT)
2022-01-07 03:18:00 -05:00
{
pos = ImVec2(io.DisplaySize.x - offset, offset);
pivot = ImVec2(1.0f, 0.0f);
}
2022-06-26 08:08:55 -04:00
if (Overlay::mSelectedPos == DisplayPos::BOTTOM_LEFT)
2022-01-07 03:18:00 -05:00
{
pos = ImVec2(offset, io.DisplaySize.y - offset);
pivot = ImVec2(0.0f, 1.0f);
}
2022-06-26 08:08:55 -04:00
if (Overlay::mSelectedPos == DisplayPos::BOTTOM_RIGHT)
2022-01-07 03:18:00 -05:00
{
pos = ImVec2(io.DisplaySize.x - offset, io.DisplaySize.y - offset);
pivot = ImVec2(1.0f, 1.0f);
}
ImGui::SetNextWindowPos(pos, ImGuiCond_Always, pivot);
}
2022-06-26 08:08:55 -04:00
ImGui::SetNextWindowBgAlpha(Overlay::bTransparent ? 0.0f : 0.5f);
ImGui::PushStyleColor(ImGuiCol_Text, *(ImVec4*)&Overlay::textColor);
2022-01-07 03:18:00 -05:00
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)
{
2022-06-26 08:08:55 -04:00
Overlay::fCpuUsage = static_cast<float>(Util::GetCurrentCPUUsage());
2022-01-07 03:18:00 -05:00
MEMORYSTATUSEX memInfo;
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&memInfo);
int mUsedRam = static_cast<int>((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6);
2022-06-26 08:08:55 -04:00
Overlay::fMemUsage = 100.0f * (static_cast<float>(mUsedRam) / static_cast<float>(Overlay::mTotalRam));
2022-01-07 03:18:00 -05:00
2022-06-26 08:08:55 -04:00
Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate));
2022-01-07 03:18:00 -05:00
interval = game_ms;
}
2022-06-26 08:08:55 -04:00
if (Overlay::bCoord)
2022-01-07 03:18:00 -05:00
{
2022-04-17 07:46:28 -04:00
ImGui::Text(TEXT("Menu.Coords"), pos.x, pos.y, pos.z);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (Overlay::bCpuUsage)
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
ImGui::Text(TEXT("Menu.CPUUsage"), Overlay::fCpuUsage);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (Overlay::bFPS)
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
ImGui::Text(TEXT("Menu.Frames"), Overlay::mFPS);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (Overlay::bLocName)
2022-01-07 03:18:00 -05:00
{
2022-04-17 07:46:28 -04:00
ImGui::Text(TEXT("Menu.Location"), Util::GetLocationName(&pos).c_str());
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (Overlay::bMemUsage)
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
ImGui::Text(TEXT("Menu.RAMUsage"), Overlay::fMemUsage);
2022-01-07 03:18:00 -05:00
}
if (pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer)
{
2022-06-26 08:08:55 -04:00
if (Overlay::bVehHealth)
2022-01-07 03:18:00 -05:00
{
2022-04-17 07:46:28 -04:00
ImGui::Text(TEXT("Menu.VehHealth"), pPlayer->m_pVehicle->m_fHealth);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (Overlay::bVehSpeed)
2022-01-07 03:18:00 -05:00
{
int speed = pPlayer->m_pVehicle->m_vecMoveSpeed.Magnitude() * 50.0f; // 02E3 - GET_CAR_SPEED
2022-04-17 07:46:28 -04:00
ImGui::Text(TEXT("Menu.VehSpeed"), speed);
2022-01-07 03:18:00 -05:00
}
}
ImVec2 windowPos = ImGui::GetWindowPos();
2022-06-26 08:08:55 -04:00
Overlay::fPosX = windowPos.x;
Overlay::fPosY = windowPos.y;
2022-01-07 03:18:00 -05:00
ImGui::End();
}
ImGui::PopStyleColor();
}
2020-12-02 16:19:16 -05:00
}
2021-02-24 16:54:45 -05:00
void Menu::DrawShortcutsWindow()
2020-12-02 16:19:16 -05:00
{
2022-01-07 03:18:00 -05:00
int resX = static_cast<int>(screen::GetScreenWidth());
int resY = static_cast<int>(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);
2022-06-26 08:08:55 -04:00
if (ImGui::InputTextWithHint("##TEXTFIELD", "Enter command", Commands::m_nInputBuffer, INPUT_BUFFER_SIZE,
2022-01-07 03:18:00 -05:00
ImGuiInputTextFlags_EnterReturnsTrue))
{
ProcessCommands();
2022-06-26 08:08:55 -04:00
Commands::m_bShowMenu = false;
strcpy(Commands::m_nInputBuffer, "");
2022-01-07 03:18:00 -05:00
}
if (!ImGui::IsAnyItemActive())
{
ImGui::SetKeyboardFocusHere(-1);
}
ImGui::PopStyleVar(2);
ImGui::End();
}
2020-12-02 16:19:16 -05:00
}
void Menu::ProcessCommands()
{
2022-06-26 08:08:55 -04:00
std::stringstream ss(Commands::m_nInputBuffer);
2022-01-07 03:18:00 -05:00
std::string command;
ss >> command;
if (command == "hp")
{
try
{
std::string temp;
ss >> temp;
FindPlayerPed()->m_fHealth = std::stof(temp);
}
catch (...)
{
2022-03-18 03:23:43 -04:00
SetHelpMessage(TEXT("Menu.InvalidValue"));
2022-01-07 03:18:00 -05:00
}
}
if (command == "time")
{
try
{
std::string temp;
ss >> temp;
CClock::ms_nGameClockHours = std::stoi(temp);
ss >> temp;
CClock::ms_nGameClockMinutes = std::stoi(temp);
}
catch (...)
{
2022-03-18 03:23:43 -04:00
SetHelpMessage(TEXT("Menu.InvalidValue"));
2022-01-07 03:18:00 -05:00
}
}
#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::TeleportPlayer(false, pos, 0);
}
catch (...)
{
2022-04-17 07:46:28 -04:00
SetHelpMessage(TEXT("Menu.InvalidLocation"));
2022-01-07 03:18:00 -05:00
}
}
if (command == "wep")
{
std::string wep_name;
ss >> wep_name;
if (wep_name == "jetpack")
{
std::string weapon = "-1";
Weapon::GiveWeaponToPlayer(weapon);
2022-04-17 07:46:28 -04:00
SetHelpMessage(TEXT("Menu.WeaponSpawned"));
2022-01-07 03:18:00 -05:00
}
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);
2022-04-17 07:46:28 -04:00
SetHelpMessage(TEXT("Menu.WeaponSpawned"));
2022-01-07 03:18:00 -05:00
}
else
2022-04-17 07:46:28 -04:00
SetHelpMessage(TEXT("Menu.InvalidComamnd"));
2022-01-07 03:18:00 -05:00
}
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);
2022-04-17 07:46:28 -04:00
SetHelpMessage(TEXT("Menu.VehicleSpawned"));
2022-01-07 03:18:00 -05:00
}
else
2022-04-17 07:46:28 -04:00
SetHelpMessage(TEXT("Menu.InvalidComamnd"));
2022-01-07 03:18:00 -05:00
}
#endif
2020-12-02 16:19:16 -05:00
}
2022-01-20 02:04:45 -05:00
void Menu::ShowPage()
2020-12-02 16:19:16 -05:00
{
2022-01-07 03:18:00 -05:00
if (ImGui::BeginTabBar("Menu", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
{
2022-02-11 16:35:08 -05:00
if (ImGui::BeginTabItem(TEXT("Menu.Config")))
2022-02-11 01:38:14 -05:00
{
ImGui::Spacing();
if (ImGui::Button(TEXT("Menu.ResetSize"), ImVec2(Ui::GetSize(1))))
2022-02-11 01:38:14 -05:00
{
CheatMenu::ResetMenuSize();
}
2022-06-19 18:36:20 -04:00
2022-02-11 01:38:14 -05:00
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
static int selected = Locale::GetCurrentLocaleIndex();
static std::vector<std::string>& vec = Locale::GetLocaleList();
if (vec.size() > 0)
2022-02-11 01:38:14 -05:00
{
if (Ui::ListBox(TEXT("Menu.Language"), vec, selected))
2022-02-11 01:38:14 -05:00
{
2022-02-22 02:44:33 -05:00
if (Locale::SetLocale(selected) == Locale::eReturnCodes::SUCCESS)
{
CheatMenu::GenHeaderList();
}
else
{
SetHelpMessage(TEXT("Menu.LanguageChangeFailed"));
}
2022-02-11 01:38:14 -05:00
}
}
2022-03-09 17:23:08 -05:00
ImGui::Spacing();
2022-03-14 02:04:58 -04:00
ImGui::Columns(2, NULL, false);
2022-03-09 17:23:08 -05:00
if (ImGui::Checkbox(TEXT("Menu.DiscordRPC"), &m_bDiscordRPC))
{
if (m_bDiscordRPC)
{
RPC::Init();
}
else
{
RPC::Shutdown();
}
gConfig.Set("Menu.DiscordRPC", m_bDiscordRPC);
2022-03-09 17:23:08 -05:00
}
ImGui::NextColumn();
2022-06-18 04:01:31 -04:00
if (gRenderer == Render_DirectX9
&& Ui::CheckboxWithHint(TEXT("Menu.TextOnlyMode"), &m_bTextOnlyMode, TEXT("Menu.TextOnlyModeHint")))
{
gConfig.Set("Menu.TextOnlyMode", m_bTextOnlyMode);
}
2022-03-09 17:23:08 -05:00
ImGui::Columns(1);
2022-02-11 01:38:14 -05:00
ImGui::EndTabItem();
}
2022-02-11 16:35:08 -05:00
if (ImGui::BeginTabItem(TEXT("Menu.Overlay")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
ImGui::Spacing();
ImGui::SameLine();
2022-06-26 08:08:55 -04:00
if (Ui::ListBox(TEXT("Menu.Position"), Overlay::posNames, (int&)Overlay::mSelectedPos))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set<int>("Overlay.SelectedPosition", static_cast<int>(Overlay::mSelectedPos));
2022-01-07 03:18:00 -05:00
}
ImGui::Spacing();
ImGui::SameLine();
2022-06-26 08:08:55 -04:00
if (ImGui::ColorEdit4(TEXT("Menu.TextColor"), Overlay::textColor))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
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]);
2022-01-07 03:18:00 -05:00
}
ImGui::Spacing();
ImGui::Columns(2, nullptr, false);
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.NoBG"), &Overlay::bTransparent))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.Transparent", Overlay::bTransparent);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowCoords"), &Overlay::bCoord))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowCoordinates", Overlay::bCoord);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowCPU"), &Overlay::bCpuUsage))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowCPUUsage", Overlay::bCpuUsage);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowFPS"), &Overlay::bFPS))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowFPS", Overlay::bFPS);
2022-01-07 03:18:00 -05:00
}
ImGui::NextColumn();
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowLocation"), &Overlay::bLocName))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowLocationName", Overlay::bLocName);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowRAM"), &Overlay::bMemUsage))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowMemoryUsage", Overlay::bMemUsage);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowVehHealth"), &Overlay::bVehHealth))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowVehicleHealth", Overlay::bVehHealth);
2022-01-07 03:18:00 -05:00
}
2022-06-26 08:08:55 -04:00
if (ImGui::Checkbox(TEXT("Menu.ShowVehSpeed"), &Overlay::bVehSpeed))
2022-01-07 03:18:00 -05:00
{
2022-06-26 08:08:55 -04:00
gConfig.Set("Overlay.ShowVehicleSpeed", Overlay::bVehSpeed);
2022-01-07 03:18:00 -05:00
}
ImGui::Columns(1);
ImGui::EndTabItem();
}
2022-02-11 16:35:08 -05:00
if (ImGui::BeginTabItem(TEXT("Menu.Hotkeys")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
ImGui::Text(TEXT("Menu.Usage"));
Ui::ShowTooltip(TEXT("Menu.UsageText"));
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
ImGui::BeginChild("Hotkeys");
2022-06-07 17:25:49 -04:00
menuOpen.DrawUI(TEXT("Menu.OpenMenuKey"));
commandWindow.DrawUI(TEXT("Menu.OpenCMDKey"));
2022-01-07 03:18:00 -05:00
ImGui::Dummy(ImVec2(0, 10));
2022-06-07 17:25:49 -04:00
aimSkinChanger.DrawUI(TEXT("Menu.SkinChangerKey"));
quickSceenShot.DrawUI(TEXT("Menu.QuickSSKey"));
freeCam.DrawUI(TEXT("Menu.FreecamKey"));
freeCamForward.DrawUI(TEXT("Menu.FreecamForwardKey"));
freeCamBackward.DrawUI(TEXT("Menu.FreecamBackwardKey"));
freeCamLeft.DrawUI(TEXT("Menu.FreecamLeftKey"));
freeCamRight.DrawUI(TEXT("Menu.FreecamRightKey"));
quickTeleport.DrawUI(TEXT("Menu.QuickTPKey"));
2022-01-07 03:18:00 -05:00
ImGui::Dummy(ImVec2(0, 10));
2022-06-07 17:25:49 -04:00
fixVeh.DrawUI(TEXT("Menu.FixVehKey"));
flipVeh.DrawUI(TEXT("Menu.FlipVehKey"));
godMode.DrawUI(TEXT("Menu.GodModeKey"));
vehEngine.DrawUI(TEXT("Menu.VehEngineKey"));
vehInstantStart.DrawUI(TEXT("Menu.VehStartKey"));
vehInstantStop.DrawUI(TEXT("Menu.VehStopKey"));
2022-01-07 03:18:00 -05:00
ImGui::Dummy(ImVec2(0, 10));
ImGui::EndChild();
ImGui::EndTabItem();
}
2022-02-11 16:35:08 -05:00
if (ImGui::BeginTabItem(TEXT("Menu.Commands")))
2022-01-07 03:18:00 -05:00
{
if (ImGui::BeginChild("CommandsChild"))
{
2022-02-11 16:35:08 -05:00
ImGui::TextWrapped(TEXT("Menu.OpenCMDUsing"), commandWindow.GetNameString().c_str());
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
if (ImGui::CollapsingHeader(TEXT("Menu.SetHealthCMD")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
ImGui::TextWrapped(TEXT("Menu.SetHealthCMDText"));
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
ImGui::Separator();
}
2022-02-11 16:35:08 -05:00
if (ImGui::CollapsingHeader(TEXT("Menu.SetTimeCMD")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
ImGui::TextWrapped(TEXT("Menu.SetTimeCMDText"));
ImGui::TextWrapped(TEXT("Menu.SetTimeCMDText2"));
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
ImGui::Separator();
}
2022-02-11 16:35:08 -05:00
if (ImGui::CollapsingHeader(TEXT("Menu.TeleportCMD")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
ImGui::TextWrapped(TEXT("Menu.TeleportCMDText"));
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
ImGui::Separator();
}
2022-02-11 16:35:08 -05:00
if (ImGui::CollapsingHeader(TEXT("Menu.QuickVehSpawnerCMD")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
ImGui::TextWrapped(TEXT("Menu.QuickVehSpawnerCMDText"));
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
ImGui::Separator();
}
2022-02-11 16:35:08 -05:00
if (ImGui::CollapsingHeader(TEXT("Menu.QuickWepSpawnerCMD")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-04-20 01:57:49 -04:00
ImGui::TextWrapped(TEXT("Menu.QuickWepSpawnerCMDText"));
2022-01-07 03:18:00 -05:00
ImGui::Spacing();
ImGui::Separator();
}
ImGui::EndChild();
}
ImGui::EndTabItem();
}
2022-02-11 16:35:08 -05:00
if (ImGui::BeginTabItem(TEXT("Menu.About")))
2022-01-07 03:18:00 -05:00
{
ImGui::Spacing();
2022-02-11 16:35:08 -05:00
if (ImGui::Button(TEXT("Menu.CheckUpdate"), ImVec2(Ui::GetSize(3))))
2022-01-07 03:18:00 -05:00
{
Updater::CheckUpdate();
}
ImGui::SameLine();
2022-02-11 16:35:08 -05:00
if (ImGui::Button(TEXT("Menu.DiscordServer"), ImVec2(Ui::GetSize(3))))
2022-01-07 03:18:00 -05:00
{
ShellExecute(nullptr, "open", DISCORD_INVITE, nullptr, nullptr, SW_SHOWNORMAL);
}
ImGui::SameLine();
2022-02-11 16:35:08 -05:00
if (ImGui::Button(TEXT("Menu.GitHubRepo"), ImVec2(Ui::GetSize(3))))
2022-01-07 03:18:00 -05:00
{
ShellExecute(nullptr, "open", GITHUB_LINK, nullptr, nullptr, SW_SHOWNORMAL);
}
ImGui::Spacing();
if (ImGui::BeginChild("AboutChild"))
{
ImGui::Columns(2, nullptr, false);
2022-02-11 16:35:08 -05:00
ImGui::Text("%s: Grinch_", TEXT("Menu.Author"));
2022-01-07 03:18:00 -05:00
2022-02-11 16:35:08 -05:00
ImGui::Text("%s: %s", TEXT("Menu.Version"), MENU_VERSION);
2022-01-07 03:18:00 -05:00
ImGui::NextColumn();
ImGui::Text("ImGui: %s", ImGui::GetVersion());
2022-02-11 16:35:08 -05:00
ImGui::Text("%s: %s",TEXT("Menu.Build"), BUILD_NUMBER);
2022-01-07 03:18:00 -05:00
ImGui::Columns(1);
ImGui::Dummy(ImVec2(0, 10));
2022-02-11 16:35:08 -05:00
ImGui::TextWrapped(TEXT("Menu.BugDisclaimer"));
2022-01-07 03:18:00 -05:00
ImGui::Dummy(ImVec2(0, 10));
2022-02-11 16:35:08 -05:00
Ui::CenterdText(TEXT("Menu.CopyrightDisclaimer"));
2022-01-07 03:18:00 -05:00
ImGui::Dummy(ImVec2(0, 30));
if (ImGui::BeginTable("Hall of Fame", 2, ImGuiTableFlags_ScrollY))
{
2022-02-11 16:35:08 -05:00
ImGui::TableSetupColumn(TEXT("Menu.Name"), ImGuiTableColumnFlags_WidthFixed, 100);
ImGui::TableSetupColumn(TEXT("Menu.Credits"));
ImGui::TableHeadersRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Codenulls");
ImGui::TableNextColumn();
ImGui::Text("III & VC animation code");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("DKPac22");
ImGui::TableNextColumn();
ImGui::Text("Plugin SDK, vehicle texture code");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Junior-Djjr");
ImGui::TableNextColumn();
ImGui::Text("Code & suggestions");
2022-06-16 16:42:57 -04:00
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Marzer");
ImGui::TableNextColumn();
ImGui::Text("TOML parser");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Ocornut");
ImGui::TableNextColumn();
ImGui::Text("ImGui");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Rebzzel");
ImGui::TableNextColumn();
ImGui::Text("Keiro");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("TsudaKageyu");
ImGui::TableNextColumn();
ImGui::Text("MinHook");
2022-03-04 01:08:06 -05:00
ImGui::TableNextRow();
ImGui::TableNextColumn();
2022-03-04 16:48:45 -05:00
ImGui::Text(TEXT("Main.TranslatorName"));
2022-03-04 01:08:06 -05:00
ImGui::TableNextColumn();
2022-03-04 16:48:45 -05:00
ImGui::Text(TEXT("Main.Translator"));
ImGui::EndTable();
}
2022-01-07 03:18:00 -05:00
ImGui::EndChild();
}
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
2021-06-18 12:49:11 -04:00
}