Code refactor

This commit is contained in:
Grinch_ 2022-06-26 18:08:55 +06:00
parent 97205369b5
commit 58d395df02
25 changed files with 337 additions and 312 deletions

View File

@ -82,6 +82,8 @@ You can either open a issue here or directly contact me on discord (Recommended)
The translations are loaded from `CheatMenuXX/locale/*.toml` files. Make a copy of the `English.toml` file and translate the texts there to your language. Rename the file to `your_language.toml` and make a pull request.
If you're language isn't supported ( Appears `???` in the menu. Check [here](https://github.com/user-grinch/Cheat-Menu/tree/rewrite/tools/subset/in.txt) for supported languages), open a [issue](https://github.com/user-grinch/Cheat-Menu/issues) asking for support.
## Required to build
1. [Build Tools 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022)

Binary file not shown.

Binary file not shown.

View File

@ -30,9 +30,9 @@ void Animation::PlayCutscene(std::string& rootKey, std::string& cutsceneId, std:
CPlayerPed* pPlayer = FindPlayerPed();
if (pPlayer)
{
m_Cutscene::m_SceneName = cutsceneId;
Cutscene::m_SceneName = cutsceneId;
Command<Commands::LOAD_CUTSCENE>(cutsceneId.c_str());
m_Cutscene::m_nInterior = pPlayer->m_nAreaCode;
Cutscene::m_nInterior = pPlayer->m_nAreaCode;
pPlayer->m_nAreaCode = std::stoi(interior);
Command<Commands::SET_AREA_VISIBLE>(pPlayer->m_nAreaCode);
}
@ -47,7 +47,7 @@ void Animation::PlayParticle(std::string& rootKey, std::string& particle, std::s
int handle;
Command<Commands::CREATE_FX_SYSTEM>(particle.c_str(), pos.x, pos.y, pos.z, 1, &handle);
Command<Commands::PLAY_FX_SYSTEM>(handle);
m_Particle::m_nParticleList.push_back(handle);
Particle::m_nParticleList.push_back(handle);
}
}
@ -56,8 +56,8 @@ void Animation::RemoveParticle(std::string& ifp, std::string& particle, std::str
{
if (ifp == "Custom")
{
m_Particle::m_Data.m_pData->RemoveKey("Custom", particle.c_str());
m_Particle::m_Data.m_pData->Save();
Particle::m_Data.m_pData->RemoveKey("Custom", particle.c_str());
Particle::m_Data.m_pData->Save();
SetHelpMessage(TEXT("Animation.ParticleRemoved"));
}
else
@ -223,7 +223,7 @@ void Animation::Init()
Events::processScriptsEvent += []
{
CPlayerPed* pPlayer = FindPlayerPed();
if (m_Cutscene::m_bRunning)
if (Cutscene::m_bRunning)
{
if (Command<Commands::HAS_CUTSCENE_FINISHED>())
{
@ -232,18 +232,18 @@ void Animation::Init()
return;
}
pPlayer->m_nAreaCode = m_Cutscene::m_nInterior;
pPlayer->m_nAreaCode = Cutscene::m_nInterior;
Command<Commands::SET_AREA_VISIBLE>(pPlayer->m_nAreaCode);
m_Cutscene::m_nInterior = 0;
Cutscene::m_nInterior = 0;
TheCamera.Fade(0, 1);
}
}
else
{
if (m_Cutscene::m_SceneName != "" && Command<Commands::HAS_CUTSCENE_LOADED>())
if (Cutscene::m_SceneName != "" && Command<Commands::HAS_CUTSCENE_LOADED>())
{
Command<Commands::START_CUTSCENE>();
m_Cutscene::m_bRunning = true;
Cutscene::m_bRunning = true;
}
}
@ -330,7 +330,7 @@ void Animation::ShowPage()
if (ImGui::BeginChild("Anims Child"))
{
ImGui::Spacing();
Ui::DrawJSON(m_AnimData, PlayAnimation, RemoveAnimation);
Ui::DrawList(m_AnimData, PlayAnimation, RemoveAnimation);
ImGui::EndChild();
}
}
@ -342,15 +342,15 @@ void Animation::ShowPage()
ImGui::Spacing();
if (ImGui::Button(TEXT("Animation.StopCutscene"), Ui::GetSize()))
{
if (m_Cutscene::m_bRunning)
if (Cutscene::m_bRunning)
{
Command<Commands::CLEAR_CUTSCENE>();
m_Cutscene::m_bRunning = false;
m_Cutscene::m_SceneName = "";
Cutscene::m_bRunning = false;
Cutscene::m_SceneName = "";
CPlayerPed* player = FindPlayerPed();
player->m_nAreaCode = m_Cutscene::m_nInterior;
player->m_nAreaCode = Cutscene::m_nInterior;
Command<Commands::SET_AREA_VISIBLE>(player->m_nAreaCode);
m_Cutscene::m_nInterior = 0;
Cutscene::m_nInterior = 0;
TheCamera.Fade(0, 1);
}
}
@ -359,7 +359,7 @@ void Animation::ShowPage()
if (ImGui::BeginChild("Cutscene Child"))
{
ImGui::Spacing();
Ui::DrawJSON(m_Cutscene::m_Data, PlayCutscene, nullptr);
Ui::DrawList(Cutscene::m_Data, PlayCutscene, nullptr);
ImGui::EndChild();
}
ImGui::EndTabItem();
@ -369,17 +369,17 @@ void Animation::ShowPage()
ImGui::Spacing();
if (ImGui::Button(TEXT("Animation.RemoveAll"), Ui::GetSize(2)))
{
for (int& p : m_Particle::m_nParticleList)
for (int& p : Particle::m_nParticleList)
{
Command<Commands::KILL_FX_SYSTEM>(p);
}
m_Particle::m_nParticleList.clear();
Particle::m_nParticleList.clear();
}
ImGui::SameLine();
if (ImGui::Button(TEXT("Animation.RemoveLatest"), Ui::GetSize(2)))
{
Command<Commands::KILL_FX_SYSTEM>(m_Particle::m_nParticleList.back()); // stop if anything is running
m_Particle::m_nParticleList.pop_back();
Command<Commands::KILL_FX_SYSTEM>(Particle::m_nParticleList.back()); // stop if anything is running
Particle::m_nParticleList.pop_back();
}
ImGui::Spacing();
if (Ui::CheckboxBitFlag(TEXT("Animation.InvisiblePlayer"), pPlayer->m_nPedFlags.bDontRender))
@ -389,20 +389,20 @@ void Animation::ShowPage()
ImGui::Spacing();
if (ImGui::CollapsingHeader(TEXT("Window.AddNew")))
{
ImGui::InputTextWithHint(TEXT("Animation.ParticleName"), "kkjj_on_fire", m_Particle::m_NameBuffer, INPUT_BUFFER_SIZE);
ImGui::InputTextWithHint(TEXT("Animation.ParticleName"), "kkjj_on_fire", Particle::m_NameBuffer, INPUT_BUFFER_SIZE);
ImGui::Spacing();
if (ImGui::Button(TEXT("Animation.AddParticle"), Ui::GetSize()))
{
std::string key = std::string("Custom.") + m_Particle::m_NameBuffer;
std::string key = std::string("Custom.") + Particle::m_NameBuffer;
m_AnimData.m_pData->Set(key.c_str(), std::string("Dummy"));
m_Particle::m_Data.m_pData->Save();
Particle::m_Data.m_pData->Save();
}
}
ImGui::Spacing();
if (ImGui::BeginChild("Anims Child"))
{
ImGui::Spacing();
Ui::DrawJSON(m_Particle::m_Data, PlayParticle, RemoveParticle);
Ui::DrawList(Particle::m_Data, PlayParticle, RemoveParticle);
ImGui::EndChild();
}
ImGui::EndTabItem();

View File

@ -15,7 +15,7 @@ private:
#ifdef GTASA
// Cutscene player
struct m_Cutscene
struct Cutscene
{
static inline ResourceStore m_Data{ "cutscenes", eResourceType::TYPE_TEXT };
static inline std::string m_SceneName;
@ -35,7 +35,7 @@ private:
};
// Particle player
struct m_Particle
struct Particle
{
static inline ResourceStore m_Data{ "particles", eResourceType::TYPE_TEXT };
static inline char m_NameBuffer[INPUT_BUFFER_SIZE];

View File

@ -33,7 +33,7 @@ void CheatMenu::DrawWindow()
else
{
bRunning = true;
if (m_bShowMenu || BY_GAME(Menu::m_Commands::m_bShowMenu, true, true))
if (m_bShowMenu || BY_GAME(Menu::Commands::m_bShowMenu, true, true))
{
if (m_bShowMenu)
{
@ -239,12 +239,12 @@ void CheatMenu::Init()
if (commandWindow.Pressed())
{
if (Menu::m_Commands::m_bShowMenu)
if (Menu::Commands::m_bShowMenu)
{
Menu::ProcessCommands();
strcpy(Menu::m_Commands::m_nInputBuffer, "");
strcpy(Menu::Commands::m_nInputBuffer, "");
}
Menu::m_Commands::m_bShowMenu = !Menu::m_Commands::m_bShowMenu;
Menu::Commands::m_bShowMenu = !Menu::Commands::m_bShowMenu;
}
bool mouseState = D3dHook::GetMouseState();

View File

@ -139,7 +139,7 @@ void D3dHook::ProcessFrame(void* ptr)
ImGui_ImplWin32_EnableDpiAwareness();
// Loading fonts
io.FontDefault = FontMgr::Load("text", "C:/Windows/Fonts/ARIALUNI.TTF", 1.15f);
io.FontDefault = FontMgr::Load("text", PLUGIN_PATH((char*)FILE_NAME "/fonts/text.ttf"), 1.15f);
FontMgr::Load("title", PLUGIN_PATH((char*)FILE_NAME "/fonts/title.ttf"), 2.0f);
io.IniFilename = nullptr;

View File

@ -19,21 +19,20 @@ const ImWchar* FontMgr::GetGlyphRanges()
static const ImWchar ranges[] =
{
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x0980, 0x09FF, // Bengali
0x2000, 0x206F, // General Punctuation
// Chinease
0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana
0x31F0, 0x31FF, // Katakana Phonetic Extensions
0xFF00, 0xFFEF, // Half-width characters
0xFFFD, 0xFFFD, // Invalid
0x4e00, 0x9FAF, // CJK Ideograms
// 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana
// 0x31F0, 0x31FF, // Katakana Phonetic Extensions
// 0xFF00, 0xFFEF, // Half-width characters
// 0xFFFD, 0xFFFD, // Invalid
// 0x4E00, 0x9FAF, // CJK Ideograms
// Russian
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x0400, 0x052F, // Cyrillic + Cyrillic Supplement
0x2DE0, 0x2DFF, // Cyrillic Extended-A
0xA640, 0xA69F, // Cyrillic Extended-B
0x2212, 0x2212, // Minus Sign
0,
};
return &ranges[0];

View File

@ -38,7 +38,7 @@ void Game::Init()
{
#ifdef GTASA
// Generate enabled cheats vector
for (auto [k, v] : m_RandomCheats::m_pData.Items())
for (auto [k, v] : RandomCheats::m_pData.Items())
{
/*
[
@ -46,8 +46,8 @@ void Game::Init()
]
*/
std::string key { k.str() };
m_RandomCheats::m_EnabledCheats[std::stoi(key)][0] = v.value_or<std::string>("Unknown");
m_RandomCheats::m_EnabledCheats[std::stoi(key)][1] = "true";
RandomCheats::m_EnabledCheats[std::stoi(key)][0] = v.value_or<std::string>("Unknown");
RandomCheats::m_EnabledCheats[std::stoi(key)][1] = "true";
}
Events::drawMenuBackgroundEvent += []()
@ -61,14 +61,14 @@ void Game::Init()
Events::drawingEvent += []()
{
if (m_RandomCheats::m_bEnabled && m_RandomCheats::m_bProgressBar)
if (RandomCheats::m_bEnabled && RandomCheats::m_bProgressBar)
{
// Next cheat timer bar
uint screenWidth = screen::GetScreenWidth();
uint screenHeight = screen::GetScreenHeight();
uint timer = CTimer::m_snTimeInMilliseconds;
uint totalTime = m_RandomCheats::m_nInterval;
float progress = (totalTime - (timer - m_RandomCheats::m_nTimer) / 1000.0f) / totalTime;
uint totalTime = RandomCheats::m_nInterval;
float progress = (totalTime - (timer - RandomCheats::m_nTimer) / 1000.0f) / totalTime;
CRect sizeBox = CRect(0,0, screenWidth, screenHeight/50);
CRect sizeProgress = CRect(0,0, screenWidth*progress, screenHeight/50);
@ -87,7 +87,7 @@ void Game::Init()
CPlayerPed* pPlayer = FindPlayerPed();
int hplayer = CPools::GetPedRef(pPlayer);
if (m_HardMode::m_bEnabled)
if (HardMode::m_bEnabled)
{
if (pPlayer->m_fHealth > 50.0f)
pPlayer->m_fHealth = 50.0f;
@ -148,18 +148,18 @@ void Game::Init()
if (freeCam.Pressed())
{
if (m_Freecam::m_bEnabled)
if (Freecam::m_bEnabled)
{
m_Freecam::m_bEnabled = false;
Freecam::m_bEnabled = false;
ClearFreecamStuff();
}
else
{
m_Freecam::m_bEnabled = true;
Freecam::m_bEnabled = true;
}
}
if (m_Freecam::m_bEnabled)
if (Freecam::m_bEnabled)
{
FreeCam();
}
@ -178,9 +178,9 @@ void Game::Init()
}
#ifdef GTASA
if (m_RandomCheats::m_bEnabled)
if (RandomCheats::m_bEnabled)
{
if ((timer - m_RandomCheats::m_nTimer) > (static_cast<uint>(m_RandomCheats::m_nInterval) * 1000))
if ((timer - RandomCheats::m_nTimer) > (static_cast<uint>(RandomCheats::m_nInterval) * 1000))
{
int id = Random(0, 91);
@ -188,11 +188,11 @@ void Game::Init()
{
if (i == id)
{
if (m_RandomCheats::m_EnabledCheats[i][1] == "true")
if (RandomCheats::m_EnabledCheats[i][1] == "true")
{
Call<0x00438370>(id); // cheatEnableLegimate(int CheatID)
CMessages::AddMessage((char*)m_RandomCheats::m_EnabledCheats[i][0].c_str(), 2000, 0, false);
m_RandomCheats::m_nTimer = timer;
CMessages::AddMessage((char*)RandomCheats::m_EnabledCheats[i][0].c_str(), 2000, 0, false);
RandomCheats::m_nTimer = timer;
}
break;
}
@ -228,36 +228,36 @@ void Game::FreeCam()
{
int delta = (CTimer::m_snTimeInMilliseconds - CTimer::m_snPreviousTimeInMilliseconds);
int ratio = 1 / (1 + (delta * m_Freecam::m_nMul));
int speed = m_Freecam::m_nMul + m_Freecam::m_nMul * ratio * delta;
int ratio = 1 / (1 + (delta * Freecam::m_nMul));
int speed = Freecam::m_nMul + Freecam::m_nMul * ratio * delta;
if (!m_Freecam::m_bInitDone)
if (!Freecam::m_bInitDone)
{
CPlayerPed* player = FindPlayerPed();
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, true);
m_Freecam::m_bHudState = patch::Get<BYTE>(BY_GAME(0xBA6769, 0x86963A, NULL)); // hud
Freecam::m_bHudState = patch::Get<BYTE>(BY_GAME(0xBA6769, 0x86963A, NULL)); // hud
patch::Set<BYTE>(BY_GAME(0xBA6769, 0x86963A, NULL), 0); // hud
m_Freecam::m_bRadarState = patch::Get<BYTE>(BY_GAME(0xBA676C, 0xA10AB6, NULL)); // radar
Freecam::m_bRadarState = patch::Get<BYTE>(BY_GAME(0xBA676C, 0xA10AB6, NULL)); // radar
CVector playerPos = player->GetPosition();
CPad::GetPad(0)->DisablePlayerControls = true;
Command<Commands::CREATE_RANDOM_CHAR>(playerPos.x, playerPos.y, playerPos.z, &m_Freecam::m_nPed);
m_Freecam::m_pPed = CPools::GetPed(m_Freecam::m_nPed);
Command<Commands::CREATE_RANDOM_CHAR>(playerPos.x, playerPos.y, playerPos.z, &Freecam::m_nPed);
Freecam::m_pPed = CPools::GetPed(Freecam::m_nPed);
m_Freecam::m_fTotalMouse.x = player->GetHeading() + 89.6f;
m_Freecam::m_fTotalMouse.y = 0;
Freecam::m_fTotalMouse.x = player->GetHeading() + 89.6f;
Freecam::m_fTotalMouse.y = 0;
playerPos.z -= 20;
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(m_Freecam::m_nPed, true);
Command<Commands::SET_LOAD_COLLISION_FOR_CHAR_FLAG>(m_Freecam::m_nPed, false);
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(Freecam::m_nPed, true);
Command<Commands::SET_LOAD_COLLISION_FOR_CHAR_FLAG>(Freecam::m_nPed, false);
#ifdef GTASA
m_Freecam::m_pPed->m_bIsVisible = false;
Command<Commands::SET_CHAR_COLLISION>(m_Freecam::m_nPed, false);
m_Freecam::m_pPed->SetPosn(playerPos);
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 1000, true);
Freecam::m_pPed->m_bIsVisible = false;
Command<Commands::SET_CHAR_COLLISION>(Freecam::m_nPed, false);
Freecam::m_pPed->SetPosn(playerPos);
TheCamera.LerpFOV(TheCamera.FindCamFOV(), Freecam::m_fFOV, 1000, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
patch::Set<BYTE>(0xBA676C, 2); // disable radar
#elif GTAVC
@ -271,30 +271,30 @@ void Game::FreeCam()
m_Freecam::m_pPed->SetPosition(playerPos.x, playerPos.y, playerPos.z);
#endif
m_Freecam::m_bInitDone = true;
Freecam::m_bInitDone = true;
}
CVector pos = m_Freecam::m_pPed->GetPosition();
CVector pos = Freecam::m_pPed->GetPosition();
m_Freecam::m_fMouse.x = CPad::NewMouseControllerState.x;
m_Freecam::m_fMouse.y = CPad::NewMouseControllerState.y;
m_Freecam::m_fTotalMouse.x = m_Freecam::m_fTotalMouse.x - m_Freecam::m_fMouse.x / 250;
m_Freecam::m_fTotalMouse.y = m_Freecam::m_fTotalMouse.y + m_Freecam::m_fMouse.y / 3;
Freecam::m_fMouse.x = CPad::NewMouseControllerState.x;
Freecam::m_fMouse.y = CPad::NewMouseControllerState.y;
Freecam::m_fTotalMouse.x = Freecam::m_fTotalMouse.x - Freecam::m_fMouse.x / 250;
Freecam::m_fTotalMouse.y = Freecam::m_fTotalMouse.y + Freecam::m_fMouse.y / 3;
if (m_Freecam::m_fTotalMouse.x > 150)
if (Freecam::m_fTotalMouse.x > 150)
{
m_Freecam::m_fTotalMouse.y = 150;
Freecam::m_fTotalMouse.y = 150;
}
if (m_Freecam::m_fTotalMouse.y < -150)
if (Freecam::m_fTotalMouse.y < -150)
{
m_Freecam::m_fTotalMouse.y = -150;
Freecam::m_fTotalMouse.y = -150;
}
if (freeCamTeleport.Pressed())
{
CPlayerPed* player = FindPlayerPed();
CVector pos = m_Freecam::m_pPed->GetPosition();
CVector pos = Freecam::m_pPed->GetPosition();
#ifdef GTASA
CEntity* playerEntity = FindPlayerEntity(-1);
@ -330,10 +330,10 @@ void Game::FreeCam()
}
float angle;
Command<Commands::GET_CHAR_HEADING>(m_Freecam::m_nPed, &angle);
Command<Commands::GET_CHAR_HEADING>(Freecam::m_nPed, &angle);
pos.x += speed * cos(angle * 3.14159f / 180.0f);
pos.y += speed * sin(angle * 3.14159f / 180.0f);
pos.z += speed * 2 * sin(m_Freecam::m_fTotalMouse.y / 3 * 3.14159f / 180.0f);
pos.z += speed * 2 * sin(Freecam::m_fTotalMouse.y / 3 * 3.14159f / 180.0f);
}
if (freeCamLeft.PressedBasic() || freeCamRight.PressedBasic())
@ -344,7 +344,7 @@ void Game::FreeCam()
}
float angle;
Command<Commands::GET_CHAR_HEADING>(m_Freecam::m_nPed, &angle);
Command<Commands::GET_CHAR_HEADING>(Freecam::m_nPed, &angle);
angle -= 90;
pos.x += speed * cos(angle * 3.14159f / 180.0f);
@ -354,29 +354,29 @@ void Game::FreeCam()
#ifdef GTASA
if (CPad::NewMouseControllerState.wheelUp)
{
if (m_Freecam::m_fFOV > 10.0f)
if (Freecam::m_fFOV > 10.0f)
{
m_Freecam::m_fFOV -= 2.0f * speed;
Freecam::m_fFOV -= 2.0f * speed;
}
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 250, true);
TheCamera.LerpFOV(TheCamera.FindCamFOV(), Freecam::m_fFOV, 250, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
}
if (CPad::NewMouseControllerState.wheelDown)
{
if (m_Freecam::m_fFOV < 115.0f)
if (Freecam::m_fFOV < 115.0f)
{
m_Freecam::m_fFOV += 2.0f * speed;
Freecam::m_fFOV += 2.0f * speed;
}
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 250, true);
TheCamera.LerpFOV(TheCamera.FindCamFOV(), Freecam::m_fFOV, 250, true);
Command<Commands::CAMERA_PERSIST_FOV>(true);
}
m_Freecam::m_pPed->SetHeading(m_Freecam::m_fTotalMouse.x);
Command<Commands::ATTACH_CAMERA_TO_CHAR>(m_Freecam::m_nPed, 0.0, 0.0, 20.0, 90.0, 180, m_Freecam::m_fTotalMouse.y, 0.0, 2);
m_Freecam::m_pPed->SetPosn(pos);
Freecam::m_pPed->SetHeading(Freecam::m_fTotalMouse.x);
Command<Commands::ATTACH_CAMERA_TO_CHAR>(Freecam::m_nPed, 0.0, 0.0, 20.0, 90.0, 180, Freecam::m_fTotalMouse.y, 0.0, 2);
Freecam::m_pPed->SetPosn(pos);
CIplStore::AddIplsNeededAtPosn(pos);
#elif GTAVC
m_Freecam::m_pPed->m_placement.SetHeading(m_Freecam::m_fTotalMouse.x);
@ -389,15 +389,15 @@ void Game::FreeCam()
void Game::ClearFreecamStuff()
{
m_Freecam::m_bInitDone = false;
Freecam::m_bInitDone = false;
Command<Commands::SET_EVERYONE_IGNORE_PLAYER>(0, false);
patch::Set<BYTE>(BY_GAME(0xBA6769, 0x86963A, NULL), m_Freecam::m_bHudState); // hud
patch::Set<BYTE>(BY_GAME(0xBA676C, 0xA10AB6, NULL), m_Freecam::m_bRadarState); // radar
patch::Set<BYTE>(BY_GAME(0xBA6769, 0x86963A, NULL), Freecam::m_bHudState); // hud
patch::Set<BYTE>(BY_GAME(0xBA676C, 0xA10AB6, NULL), Freecam::m_bRadarState); // radar
CPad::GetPad(0)->DisablePlayerControls = false;
Command<Commands::DELETE_CHAR>(m_Freecam::m_nPed);
m_Freecam::m_pPed = nullptr;
Command<Commands::DELETE_CHAR>(Freecam::m_nPed);
Freecam::m_pPed = nullptr;
#ifdef GTASA
Command<Commands::CAMERA_PERSIST_FOV>(false);
@ -503,18 +503,18 @@ void Game::ShowPage()
{
Command<Commands::FREEZE_ONSCREEN_TIMER>(m_bMissionTimer);
}
if (Ui::CheckboxWithHint(TEXT("Game.HardMode"), &m_HardMode::m_bEnabled, TEXT("Game.HardModeText")))
if (Ui::CheckboxWithHint(TEXT("Game.HardMode"), &HardMode::m_bEnabled, TEXT("Game.HardModeText")))
{
CPlayerPed* player = FindPlayerPed();
if (m_HardMode::m_bEnabled)
if (HardMode::m_bEnabled)
{
m_HardMode::m_fBacArmour = player->m_fArmour;
m_HardMode::m_fBacHealth = player->m_fHealth;
HardMode::m_fBacArmour = player->m_fArmour;
HardMode::m_fBacHealth = player->m_fHealth;
#ifdef GTASA
m_HardMode::m_fBacMaxHealth = CStats::GetStatValue(STAT_MAX_HEALTH);
m_HardMode::m_fBacStamina = CStats::GetStatValue(STAT_STAMINA);
HardMode::m_fBacMaxHealth = CStats::GetStatValue(STAT_MAX_HEALTH);
HardMode::m_fBacStamina = CStats::GetStatValue(STAT_STAMINA);
#else
m_HardMode::m_fBacMaxHealth = 100.0f;
#endif
@ -522,13 +522,13 @@ void Game::ShowPage()
}
else
{
player->m_fArmour = m_HardMode::m_fBacArmour;
player->m_fArmour = HardMode::m_fBacArmour;
#ifdef GTASA
CStats::SetStatValue(STAT_STAMINA, m_HardMode::m_fBacStamina);
CStats::SetStatValue(STAT_MAX_HEALTH, m_HardMode::m_fBacMaxHealth);
CStats::SetStatValue(STAT_STAMINA, HardMode::m_fBacStamina);
CStats::SetStatValue(STAT_MAX_HEALTH, HardMode::m_fBacMaxHealth);
#endif
player->m_fHealth = m_HardMode::m_fBacHealth;
player->m_fHealth = HardMode::m_fBacHealth;
}
}
#ifdef GTASA
@ -588,17 +588,17 @@ void Game::ShowPage()
#ifdef GTASA
if (ImGui::CollapsingHeader(TEXT("Game.Freecam")))
{
if (Ui::CheckboxWithHint(TEXT("Game.Enable"), &m_Freecam::m_bEnabled, TEXT("Game.EnableText")))
if (Ui::CheckboxWithHint(TEXT("Game.Enable"), &Freecam::m_bEnabled, TEXT("Game.EnableText")))
{
if (!m_Freecam::m_bEnabled)
if (!Freecam::m_bEnabled)
{
ClearFreecamStuff();
}
}
ImGui::Spacing();
ImGui::SliderFloat(TEXT("Game.FieldOfView"), &m_Freecam::m_fFOV, 5.0f, 120.0f);
ImGui::SliderInt(TEXT("Game.Movement Speed"), &m_Freecam::m_nMul, 1, 10);
ImGui::SliderFloat(TEXT("Game.FieldOfView"), &Freecam::m_fFOV, 5.0f, 120.0f);
ImGui::SliderInt(TEXT("Game.Movement Speed"), &Freecam::m_nMul, 1, 10);
ImGui::Spacing();
ImGui::TextWrapped(TEXT("Game.FreecamTip"));
ImGui::Spacing();
@ -774,7 +774,7 @@ void Game::ShowPage()
ImGui::Spacing();
Ui::DrawJSON(m_MissionData, SetPlayerMission, nullptr);
Ui::DrawList(m_MissionData, SetPlayerMission, nullptr);
}
ImGui::EndTabItem();
}
@ -834,15 +834,15 @@ void Game::ShowPage()
{
ImGui::Spacing();
ImGui::Columns(2, NULL, false);
ImGui::Checkbox(TEXT("Game.Enable"), &m_RandomCheats::m_bEnabled);
ImGui::Checkbox(TEXT("Game.Enable"), &RandomCheats::m_bEnabled);
ImGui::NextColumn();
ImGui::Checkbox(TEXT("Game.ProgressBar"), &m_RandomCheats::m_bProgressBar);
ImGui::Checkbox(TEXT("Game.ProgressBar"), &RandomCheats::m_bProgressBar);
ImGui::Columns(1);
ImGui::Spacing();
ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() / 2);
ImGui::SliderInt(TEXT("Game.ActivateTimer"), &m_RandomCheats::m_nInterval, 5, 60);
ImGui::SliderInt(TEXT("Game.ActivateTimer"), &RandomCheats::m_nInterval, 5, 60);
Ui::ShowTooltip(TEXT("Game.ActivateTimerText"));
ImGui::PopItemWidth();
@ -851,7 +851,7 @@ void Game::ShowPage()
ImGui::Separator();
if (ImGui::BeginChild("Cheats list"))
{
for (std::string* element : m_RandomCheats::m_EnabledCheats)
for (std::string* element : RandomCheats::m_EnabledCheats)
{
bool selected = (element[1] == "true") ? true : false;

View File

@ -9,7 +9,7 @@ private:
static inline bool m_bDisableReplay;
static inline bool m_bMissionTimer;
struct m_Freecam
struct Freecam
{
static inline bool m_bEnabled;
static inline int m_nMul = 1;
@ -22,7 +22,7 @@ private:
static inline BYTE m_bHudState;
static inline BYTE m_bRadarState;
};
struct m_HardMode
struct HardMode
{
static inline bool m_bEnabled;
static inline float m_fBacHealth = 0.0f;
@ -44,7 +44,7 @@ private:
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
struct m_RandomCheats
struct RandomCheats
{
static inline bool m_bEnabled;
static inline bool m_bProgressBar = true;

View File

@ -16,21 +16,21 @@ void Menu::Init()
{
// TODO: use structs
// Load config data
m_Overlay::bCoord = gConfig.Get("Overlay.ShowCoordinates", false);
m_Overlay::bCpuUsage = gConfig.Get("Overlay.ShowCPUUsage", false);
m_Overlay::bFPS = gConfig.Get("Overlay.ShowFPS", false);
m_Overlay::bLocName = gConfig.Get("Overlay.ShowLocationName", false);
m_Overlay::bTransparent = gConfig.Get("Overlay.Transparent", false);
m_Overlay::bMemUsage = gConfig.Get("Overlay.ShowMemoryUsage", false);
m_Overlay::bVehHealth = gConfig.Get("Overlay.ShowVehicleName", false);
m_Overlay::bVehSpeed = gConfig.Get("Overlay.ShowVehicleSpeed", false);
m_Overlay::mSelectedPos = (DisplayPos)gConfig.Get("Overlay.SelectedPosition", (int)DisplayPos::BOTTOM_RIGHT);
m_Overlay::fPosX = gConfig.Get("Overlay.PosX", 0);
m_Overlay::fPosY = gConfig.Get("Overlay.PosY", 0);
m_Overlay::textColor[0] = gConfig.Get("Overlay.TextColor.Red", 1.0f);
m_Overlay::textColor[1] = gConfig.Get("Overlay.TextColor.Green", 1.0f);
m_Overlay::textColor[2] = gConfig.Get("Overlay.TextColor.Blue", 1.0f);
m_Overlay::textColor[3] = gConfig.Get("Overlay.TextColor.Alpha", 1.0f);
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);
m_bTextOnlyMode = gConfig.Get("Menu.TextOnlyMode", false);
@ -39,7 +39,7 @@ void Menu::Init()
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&memInfo);
m_Overlay::mTotalRam = static_cast<int>(memInfo.ullTotalPhys * 1e-6); // Bytes -> MegaBytes
Overlay::mTotalRam = static_cast<int>(memInfo.ullTotalPhys * 1e-6); // Bytes -> MegaBytes
if (m_bDiscordRPC)
{
@ -52,21 +52,21 @@ void Menu::DrawOverlay()
CPlayerPed* pPlayer = FindPlayerPed();
if (pPlayer)
{
bool m_bShowMenu = m_Overlay::bCoord || m_Overlay::bFPS || m_Overlay::bLocName || m_Overlay::bCpuUsage || m_Overlay::bMemUsage ||
((m_Overlay::bVehHealth || m_Overlay::bVehSpeed) && pPlayer && pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == 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 (m_Overlay::mSelectedPos == DisplayPos::CUSTOM)
if (Overlay::mSelectedPos == DisplayPos::CUSTOM)
{
if (m_Overlay::fPosX != NULL && m_Overlay::fPosY != NULL)
if (Overlay::fPosX != NULL && Overlay::fPosY != NULL)
{
gConfig.Set("Overlay.PosX", m_Overlay::fPosX);
gConfig.Set("Overlay.PosY", m_Overlay::fPosY);
ImGui::SetNextWindowPos(ImVec2(m_Overlay::fPosX, m_Overlay::fPosY), ImGuiCond_Once);
gConfig.Set("Overlay.PosX", Overlay::fPosX);
gConfig.Set("Overlay.PosY", Overlay::fPosY);
ImGui::SetNextWindowPos(ImVec2(Overlay::fPosX, Overlay::fPosY), ImGuiCond_Once);
}
}
else
@ -74,25 +74,25 @@ void Menu::DrawOverlay()
window_flags |= ImGuiWindowFlags_NoMove;
ImVec2 pos, pivot;
if (m_Overlay::mSelectedPos == DisplayPos::TOP_LEFT)
if (Overlay::mSelectedPos == DisplayPos::TOP_LEFT)
{
pos = ImVec2(offset, offset);
pivot = ImVec2(0.0f, 0.0f);
}
if (m_Overlay::mSelectedPos == DisplayPos::TOP_RIGHT)
if (Overlay::mSelectedPos == DisplayPos::TOP_RIGHT)
{
pos = ImVec2(io.DisplaySize.x - offset, offset);
pivot = ImVec2(1.0f, 0.0f);
}
if (m_Overlay::mSelectedPos == DisplayPos::BOTTOM_LEFT)
if (Overlay::mSelectedPos == DisplayPos::BOTTOM_LEFT)
{
pos = ImVec2(offset, io.DisplaySize.y - offset);
pivot = ImVec2(0.0f, 1.0f);
}
if (m_Overlay::mSelectedPos == DisplayPos::BOTTOM_RIGHT)
if (Overlay::mSelectedPos == DisplayPos::BOTTOM_RIGHT)
{
pos = ImVec2(io.DisplaySize.x - offset, io.DisplaySize.y - offset);
pivot = ImVec2(1.0f, 1.0f);
@ -101,8 +101,8 @@ void Menu::DrawOverlay()
ImGui::SetNextWindowPos(pos, ImGuiCond_Always, pivot);
}
ImGui::SetNextWindowBgAlpha(m_Overlay::bTransparent ? 0.0f : 0.5f);
ImGui::PushStyleColor(ImGuiCol_Text, *(ImVec4*)&m_Overlay::textColor);
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};
@ -112,51 +112,51 @@ void Menu::DrawOverlay()
static size_t interval = 0;
if (game_ms - interval > 1000)
{
m_Overlay::fCpuUsage = static_cast<float>(Util::GetCurrentCPUUsage());
Overlay::fCpuUsage = static_cast<float>(Util::GetCurrentCPUUsage());
MEMORYSTATUSEX memInfo;
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&memInfo);
int mUsedRam = static_cast<int>((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6);
m_Overlay::fMemUsage = 100.0f * (static_cast<float>(mUsedRam) / static_cast<float>(m_Overlay::mTotalRam));
Overlay::fMemUsage = 100.0f * (static_cast<float>(mUsedRam) / static_cast<float>(Overlay::mTotalRam));
m_Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate));
Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate));
interval = game_ms;
}
if (m_Overlay::bCoord)
if (Overlay::bCoord)
{
ImGui::Text(TEXT("Menu.Coords"), pos.x, pos.y, pos.z);
}
if (m_Overlay::bCpuUsage)
if (Overlay::bCpuUsage)
{
ImGui::Text(TEXT("Menu.CPUUsage"), m_Overlay::fCpuUsage);
ImGui::Text(TEXT("Menu.CPUUsage"), Overlay::fCpuUsage);
}
if (m_Overlay::bFPS)
if (Overlay::bFPS)
{
ImGui::Text(TEXT("Menu.Frames"), m_Overlay::mFPS);
ImGui::Text(TEXT("Menu.Frames"), Overlay::mFPS);
}
if (m_Overlay::bLocName)
if (Overlay::bLocName)
{
ImGui::Text(TEXT("Menu.Location"), Util::GetLocationName(&pos).c_str());
}
if (m_Overlay::bMemUsage)
if (Overlay::bMemUsage)
{
ImGui::Text(TEXT("Menu.RAMUsage"), m_Overlay::fMemUsage);
ImGui::Text(TEXT("Menu.RAMUsage"), Overlay::fMemUsage);
}
if (pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer)
{
if (m_Overlay::bVehHealth)
if (Overlay::bVehHealth)
{
ImGui::Text(TEXT("Menu.VehHealth"), pPlayer->m_pVehicle->m_fHealth);
}
if (m_Overlay::bVehSpeed)
if (Overlay::bVehSpeed)
{
int speed = pPlayer->m_pVehicle->m_vecMoveSpeed.Magnitude() * 50.0f; // 02E3 - GET_CAR_SPEED
ImGui::Text(TEXT("Menu.VehSpeed"), speed);
@ -164,8 +164,8 @@ void Menu::DrawOverlay()
}
ImVec2 windowPos = ImGui::GetWindowPos();
m_Overlay::fPosX = windowPos.x;
m_Overlay::fPosY = windowPos.y;
Overlay::fPosX = windowPos.x;
Overlay::fPosY = windowPos.y;
ImGui::End();
}
@ -192,12 +192,12 @@ void Menu::DrawShortcutsWindow()
ImGui::SetNextItemWidth(ImGui::GetContentRegionMax().x);
if (ImGui::InputTextWithHint("##TEXTFIELD", "Enter command", m_Commands::m_nInputBuffer, INPUT_BUFFER_SIZE,
if (ImGui::InputTextWithHint("##TEXTFIELD", "Enter command", Commands::m_nInputBuffer, INPUT_BUFFER_SIZE,
ImGuiInputTextFlags_EnterReturnsTrue))
{
ProcessCommands();
m_Commands::m_bShowMenu = false;
strcpy(m_Commands::m_nInputBuffer, "");
Commands::m_bShowMenu = false;
strcpy(Commands::m_nInputBuffer, "");
}
if (!ImGui::IsAnyItemActive())
{
@ -210,7 +210,7 @@ void Menu::DrawShortcutsWindow()
void Menu::ProcessCommands()
{
std::stringstream ss(m_Commands::m_nInputBuffer);
std::stringstream ss(Commands::m_nInputBuffer);
std::string command;
ss >> command;
@ -380,64 +380,64 @@ void Menu::ShowPage()
ImGui::Spacing();
ImGui::Spacing();
ImGui::SameLine();
if (Ui::ListBox(TEXT("Menu.Position"), m_Overlay::posNames, (int&)m_Overlay::mSelectedPos))
if (Ui::ListBox(TEXT("Menu.Position"), Overlay::posNames, (int&)Overlay::mSelectedPos))
{
gConfig.Set<int>("Overlay.SelectedPosition", static_cast<int>(m_Overlay::mSelectedPos));
gConfig.Set<int>("Overlay.SelectedPosition", static_cast<int>(Overlay::mSelectedPos));
}
ImGui::Spacing();
ImGui::SameLine();
if (ImGui::ColorEdit4(TEXT("Menu.TextColor"), m_Overlay::textColor))
if (ImGui::ColorEdit4(TEXT("Menu.TextColor"), Overlay::textColor))
{
gConfig.Set("Overlay.TextColor.Red", m_Overlay::textColor[0]);
gConfig.Set("Overlay.TextColor.Green", m_Overlay::textColor[1]);
gConfig.Set("Overlay.TextColor.Blue", m_Overlay::textColor[2]);
gConfig.Set("Overlay.TextColor.Alpha", m_Overlay::textColor[3]);
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]);
}
ImGui::Spacing();
ImGui::Columns(2, nullptr, false);
if (ImGui::Checkbox(TEXT("Menu.NoBG"), &m_Overlay::bTransparent))
if (ImGui::Checkbox(TEXT("Menu.NoBG"), &Overlay::bTransparent))
{
gConfig.Set("Overlay.Transparent", m_Overlay::bTransparent);
gConfig.Set("Overlay.Transparent", Overlay::bTransparent);
}
if (ImGui::Checkbox(TEXT("Menu.ShowCoords"), &m_Overlay::bCoord))
if (ImGui::Checkbox(TEXT("Menu.ShowCoords"), &Overlay::bCoord))
{
gConfig.Set("Overlay.ShowCoordinates", m_Overlay::bCoord);
gConfig.Set("Overlay.ShowCoordinates", Overlay::bCoord);
}
if (ImGui::Checkbox(TEXT("Menu.ShowCPU"), &m_Overlay::bCpuUsage))
if (ImGui::Checkbox(TEXT("Menu.ShowCPU"), &Overlay::bCpuUsage))
{
gConfig.Set("Overlay.ShowCPUUsage", m_Overlay::bCpuUsage);
gConfig.Set("Overlay.ShowCPUUsage", Overlay::bCpuUsage);
}
if (ImGui::Checkbox(TEXT("Menu.ShowFPS"), &m_Overlay::bFPS))
if (ImGui::Checkbox(TEXT("Menu.ShowFPS"), &Overlay::bFPS))
{
gConfig.Set("Overlay.ShowFPS", m_Overlay::bFPS);
gConfig.Set("Overlay.ShowFPS", Overlay::bFPS);
}
ImGui::NextColumn();
if (ImGui::Checkbox(TEXT("Menu.ShowLocation"), &m_Overlay::bLocName))
if (ImGui::Checkbox(TEXT("Menu.ShowLocation"), &Overlay::bLocName))
{
gConfig.Set("Overlay.ShowLocationName", m_Overlay::bLocName);
gConfig.Set("Overlay.ShowLocationName", Overlay::bLocName);
}
if (ImGui::Checkbox(TEXT("Menu.ShowRAM"), &m_Overlay::bMemUsage))
if (ImGui::Checkbox(TEXT("Menu.ShowRAM"), &Overlay::bMemUsage))
{
gConfig.Set("Overlay.ShowMemoryUsage", m_Overlay::bMemUsage);
gConfig.Set("Overlay.ShowMemoryUsage", Overlay::bMemUsage);
}
if (ImGui::Checkbox(TEXT("Menu.ShowVehHealth"), &m_Overlay::bVehHealth))
if (ImGui::Checkbox(TEXT("Menu.ShowVehHealth"), &Overlay::bVehHealth))
{
gConfig.Set("Overlay.ShowVehicleHealth", m_Overlay::bVehHealth);
gConfig.Set("Overlay.ShowVehicleHealth", Overlay::bVehHealth);
}
if (ImGui::Checkbox(TEXT("Menu.ShowVehSpeed"), &m_Overlay::bVehSpeed))
if (ImGui::Checkbox(TEXT("Menu.ShowVehSpeed"), &Overlay::bVehSpeed))
{
gConfig.Set("Overlay.ShowVehicleSpeed", m_Overlay::bVehSpeed);
gConfig.Set("Overlay.ShowVehicleSpeed", Overlay::bVehSpeed);
}
ImGui::Columns(1);

View File

@ -14,7 +14,7 @@ private:
BOTTOM_RIGHT
};
struct m_Overlay
struct Overlay
{
static inline bool bCoord;
static inline bool bFPS;
@ -39,7 +39,7 @@ private:
};
public:
struct m_Commands
struct Commands
{
static inline bool m_bShowMenu;
static inline char m_nInputBuffer[INPUT_BUFFER_SIZE] = "";

View File

@ -85,7 +85,7 @@ void Ped::SpawnPed(std::string& model)
void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
#endif
{
if (m_SpawnPed::m_List.size() == SPAWN_PED_LIMIT)
if (SpawnPed::m_List.size() == SPAWN_PED_LIMIT)
{
SetHelpMessage(TEXT("Ped.MaxLimit"));
return;
@ -117,7 +117,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
CStreaming::RequestSpecialChar(currentSlot, name.c_str(), PRIORITY_REQUEST);
CStreaming::LoadAllRequestedModels(true);
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 290 + currentSlot, pos.x, pos.y, pos.z + 1, &hplayer);
Command<Commands::CREATE_CHAR>(SpawnPed::m_nSelectedPedType + 4, 290 + currentSlot, pos.x, pos.y, pos.z + 1, &hplayer);
CStreaming::SetSpecialCharIsDeletable(290 + currentSlot);
// SA has 10 slots
@ -154,31 +154,31 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
CStreaming::RequestModel(iModel, eStreamingFlags::PRIORITY_REQUEST);
CStreaming::LoadAllRequestedModels(false);
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, iModel, pos.x, pos.y, pos.z + 1, &hplayer);
Command<Commands::CREATE_CHAR>(SpawnPed::m_nSelectedPedType + 4, iModel, pos.x, pos.y, pos.z + 1, &hplayer);
CStreaming::SetModelIsDeletable(iModel);
}
ped = CPools::GetPed(hplayer);
if (m_SpawnPed::m_bPedMove)
if (SpawnPed::m_bPedMove)
{
m_SpawnPed::m_List.push_back(ped);
SpawnPed::m_List.push_back(ped);
}
else
{
Command<Commands::MARK_CHAR_AS_NO_LONGER_NEEDED>(hplayer);
}
ped->m_nPedFlags.bPedIsBleeding = m_SpawnPed::m_bPedBleed;
ped->m_nWeaponAccuracy = m_SpawnPed::m_nAccuracy;
ped->m_fHealth = m_SpawnPed::m_nPedHealth;
ped->m_nPedFlags.bPedIsBleeding = SpawnPed::m_bPedBleed;
ped->m_nWeaponAccuracy = SpawnPed::m_nAccuracy;
ped->m_fHealth = SpawnPed::m_nPedHealth;
#ifdef GTASA
if (m_SpawnPed::m_nWeaponId != 0)
if (SpawnPed::m_nWeaponId != 0)
{
int model = 0;
Command<Commands::GET_WEAPONTYPE_MODEL>(m_SpawnPed::m_nWeaponId, &model);
Command<Commands::GET_WEAPONTYPE_MODEL>(SpawnPed::m_nWeaponId, &model);
CStreaming::RequestModel(model, PRIORITY_REQUEST);
CStreaming::LoadAllRequestedModels(false);
Command<Commands::GIVE_WEAPON_TO_CHAR>(hplayer, m_SpawnPed::m_nWeaponId, 999);
Command<Commands::GIVE_WEAPON_TO_CHAR>(hplayer, SpawnPed::m_nWeaponId, 999);
}
#endif
}
@ -343,12 +343,12 @@ void Ped::ShowPage()
ImGui::Spacing();
if (ImGui::Button(TEXT("Ped.RemoveFrozen"), Ui::GetSize(1)))
{
for (CPed* ped : m_SpawnPed::m_List)
for (CPed* ped : SpawnPed::m_List)
{
CWorld::Remove(ped);
ped->Remove();
}
m_SpawnPed::m_List.clear();
SpawnPed::m_List.clear();
}
ImGui::Spacing();
if (ImGui::BeginTabBar("SpawnPedBar"))
@ -374,41 +374,41 @@ void Ped::ShowPage()
ImGui::Spacing();
ImGui::BeginChild("PedCOnfig");
ImGui::Columns(2, 0, false);
Ui::CheckboxWithHint(TEXT("Ped.NoMove"), &m_SpawnPed::m_bPedMove);
Ui::CheckboxWithHint(TEXT("Ped.NoMove"), &SpawnPed::m_bPedMove);
ImGui::NextColumn();
Ui::CheckboxWithHint(TEXT("Ped.PedBleed"), &m_SpawnPed::m_bPedBleed);
Ui::CheckboxWithHint(TEXT("Ped.PedBleed"), &SpawnPed::m_bPedBleed);
ImGui::Columns(1);
ImGui::Spacing();
ImGui::SliderInt(TEXT("Ped.Accuracy"), &m_SpawnPed::m_nAccuracy, 0.0, 100.0);
if (ImGui::InputInt(TEXT("Ped.Health"), &m_SpawnPed::m_nPedHealth))
ImGui::SliderInt(TEXT("Ped.Accuracy"), &SpawnPed::m_nAccuracy, 0.0, 100.0);
if (ImGui::InputInt(TEXT("Ped.Health"), &SpawnPed::m_nPedHealth))
{
if (m_SpawnPed::m_nPedHealth > 1000)
if (SpawnPed::m_nPedHealth > 1000)
{
m_SpawnPed::m_nPedHealth = 1000;
SpawnPed::m_nPedHealth = 1000;
}
if (m_SpawnPed::m_nPedHealth < 0)
if (SpawnPed::m_nPedHealth < 0)
{
m_SpawnPed::m_nPedHealth = 0;
SpawnPed::m_nPedHealth = 0;
}
}
Ui::ListBox(TEXT("Ped.PedType"), m_SpawnPed::m_PedTypeList, m_SpawnPed::m_nSelectedPedType);
Ui::ListBox(TEXT("Ped.PedType"), SpawnPed::m_PedTypeList, SpawnPed::m_nSelectedPedType);
ImGui::Spacing();
ImGui::Text(TEXT("Ped.SelectedWeapon"), m_SpawnPed::m_nWeaponName.c_str());
ImGui::Text(TEXT("Ped.SelectedWeapon"), SpawnPed::m_nWeaponName.c_str());
ImGui::Spacing();
#ifdef GTASA
Ui::DrawImages(Weapon::m_WeaponData,
[](std::string str)
{
m_SpawnPed::m_nWeaponId = std::stoi(str);
SpawnPed::m_nWeaponId = std::stoi(str);
},
nullptr,
[](std::string str)
{
m_SpawnPed::m_nWeaponName = Weapon::m_WeaponData.m_pData->Get(str.c_str(), "Unknown");
return m_SpawnPed::m_nWeaponName;
SpawnPed::m_nWeaponName = Weapon::m_WeaponData.m_pData->Get(str.c_str(), "Unknown");
return SpawnPed::m_nWeaponName;
},
[](std::string str)
{

View File

@ -15,7 +15,7 @@ private:
};
#endif
struct m_SpawnPed
struct SpawnPed
{
static inline std::vector<CPed*> m_List;
static inline int m_nAccuracy = 50;

View File

@ -25,7 +25,7 @@ void Player::TopDownCameraView()
{
CPlayerPed *player = FindPlayerPed ();
CVector pos = player->GetPosition ();
float curOffset = m_TopDownCamera::m_fOffset;
float curOffset = TopDownCamera::m_fOffset;
// drunk effect causes issues
Command<eScriptCommands::COMMAND_SET_PLAYER_DRUNKENNESS> (0, 0);
@ -107,7 +107,7 @@ void Player::Init()
if (file_name.size() < 9)
{
m_CustomSkins::m_List.push_back(file_name);
CustomSkins::m_List.push_back(file_name);
}
else
{
@ -155,22 +155,22 @@ void Player::Init()
}
}
if (m_KeepPosition::m_bEnabled)
if (KeepPosition::m_bEnabled)
{
if (Command<Commands::IS_CHAR_DEAD>(hplayer))
{
m_KeepPosition::m_fPos = player->GetPosition();
KeepPosition::m_fPos = player->GetPosition();
}
else
{
CVector cur_pos = player->GetPosition();
if (m_KeepPosition::m_fPos.x != 0 && m_KeepPosition::m_fPos.x != cur_pos.x
&& m_KeepPosition::m_fPos.y != 0 && m_KeepPosition::m_fPos.y != cur_pos.y)
if (KeepPosition::m_fPos.x != 0 && KeepPosition::m_fPos.x != cur_pos.x
&& KeepPosition::m_fPos.y != 0 && KeepPosition::m_fPos.y != cur_pos.y)
{
BY_GAME(player->Teleport(m_KeepPosition::m_fPos, false)
, player->Teleport(m_KeepPosition::m_fPos), player->Teleport(m_KeepPosition::m_fPos));
m_KeepPosition::m_fPos = CVector(0, 0, 0);
BY_GAME(player->Teleport(KeepPosition::m_fPos, false)
, player->Teleport(KeepPosition::m_fPos), player->Teleport(KeepPosition::m_fPos));
KeepPosition::m_fPos = CVector(0, 0, 0);
}
}
}
@ -200,12 +200,12 @@ void Player::Init()
}
#ifdef GTASA
if (m_bDrunkEffect && !m_TopDownCamera::m_bEnabled)
if (m_bDrunkEffect && !TopDownCamera::m_bEnabled)
{
Command<eScriptCommands::COMMAND_SET_PLAYER_DRUNKENNESS> (0, 100);
}
if (m_TopDownCamera::m_bEnabled)
if (TopDownCamera::m_bEnabled)
{
TopDownCameraView();
}
@ -303,8 +303,8 @@ void Player::ChangePlayerCloth(std::string& name)
#ifdef GTASA
void Player::ChangePlayerModel(std::string& model)
{
bool custom_skin = std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) !=
m_CustomSkins::m_List.end();
bool custom_skin = std::find(CustomSkins::m_List.begin(), CustomSkins::m_List.end(), model) !=
CustomSkins::m_List.end();
if (Ped::m_PedData.m_pData->Contains(model.c_str()) || custom_skin)
{
@ -409,7 +409,7 @@ void Player::ShowPage()
#ifdef GTASA
Ui::CheckboxAddress(TEXT("Player.BountyYourself"), 0x96913F);
ImGui::BeginDisabled(m_TopDownCamera::m_bEnabled);
ImGui::BeginDisabled(TopDownCamera::m_bEnabled);
if (Ui::CheckboxWithHint(TEXT("Player.DrunkEffect"), &m_bDrunkEffect))
{
if (!m_bDrunkEffect)
@ -532,7 +532,7 @@ void Player::ShowPage()
}
#endif
Ui::CheckboxAddress(TEXT("Player.NoFee"), (int)&pInfo->m_bGetOutOfJailFree);
Ui::CheckboxWithHint(TEXT("Player.RespawnDieLoc"), &m_KeepPosition::m_bEnabled, TEXT("Player.RespawnDieLocTip"));
Ui::CheckboxWithHint(TEXT("Player.RespawnDieLoc"), &KeepPosition::m_bEnabled, TEXT("Player.RespawnDieLocTip"));
#ifdef GTASA
static bool sprintInt = false;
@ -672,12 +672,12 @@ void Player::ShowPage()
Ui::EditStat(TEXT("Player.Stamina"), STAT_STAMINA);
if (ImGui::CollapsingHeader(TEXT("Player.TopDownCamera")))
{
if (ImGui::Checkbox(TEXT("Window.Enabled"), &m_TopDownCamera::m_bEnabled))
if (ImGui::Checkbox(TEXT("Window.Enabled"), &TopDownCamera::m_bEnabled))
{
Command<Commands::RESTORE_CAMERA_JUMPCUT>();
}
ImGui::Spacing();
ImGui::SliderFloat(TEXT("Player.CameraZoom"), &m_TopDownCamera::m_fOffset, 20.0f, 60.0f);
ImGui::SliderFloat(TEXT("Player.CameraZoom"), &TopDownCamera::m_fOffset, 20.0f, 60.0f);
ImGui::Spacing();
ImGui::Separator();
}
@ -850,15 +850,15 @@ void Player::ShowPage()
if (m_bModloaderInstalled)
{
Ui::FilterWithHint(TEXT("Window.Search"), m_ClothData.m_Filter,
std::string(TEXT("Player.TotalSkins") + std::to_string(m_CustomSkins::m_List.size()))
std::string(TEXT("Player.TotalSkins") + std::to_string(CustomSkins::m_List.size()))
.c_str());
Ui::ShowTooltip(TEXT("Player.CustomSkinsDirTip"));
ImGui::Spacing();
ImGui::TextWrapped(TEXT("Player.CustomSkinsTip"));
ImGui::Spacing();
for (std::string name : m_CustomSkins::m_List)
for (std::string name : CustomSkins::m_List)
{
if (m_CustomSkins::m_Filter.PassFilter(name.c_str()))
if (CustomSkins::m_Filter.PassFilter(name.c_str()))
{
if (ImGui::MenuItem(name.c_str()))
{

View File

@ -7,7 +7,7 @@ private:
static inline bool m_bHealthRegen;
static inline bool m_bGodMode;
static inline bool m_bModloaderInstalled;
struct m_KeepPosition
struct KeepPosition
{
static inline bool m_bEnabled = false;
static inline CVector m_fPos;
@ -20,13 +20,13 @@ private:
static inline bool m_bFastSprint;
static inline int m_nUiBodyState;
static inline ResourceStore m_ClothData { "clothes", eResourceType::TYPE_IMAGE, ImVec2(70, 100)};
struct m_CustomSkins
struct CustomSkins
{
static inline ImGuiTextFilter m_Filter;
static inline std::vector<std::string> m_List;
};
struct m_TopDownCamera
struct TopDownCamera
{
static inline bool m_bEnabled = false;
static inline float m_fOffset = 40.0f;

View File

@ -40,14 +40,14 @@ void Teleport::Init()
Events::processScriptsEvent += []
{
if ((m_Teleport::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - m_Teleport::m_nTimer) > 500))
if ((QuicKTP::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - QuicKTP::m_nTimer) > 500))
{
CPlayerPed* player = FindPlayerPed();
#ifdef GTASA
CEntity* player_entity = FindPlayerEntity(-1);
m_Teleport::m_fPos.z = CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y,
m_Teleport::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f;
QuicKTP::m_fPos.z = CWorld::FindGroundZFor3DCoord(QuicKTP::m_fPos.x, QuicKTP::m_fPos.y,
QuicKTP::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f;
#else
m_Teleport::m_fPos.z = CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y,
m_Teleport::m_fPos.z + 100.0f, nullptr) + 1.0f;
@ -56,14 +56,14 @@ void Teleport::Init()
if (pVeh && BY_GAME(player->m_nPedFlags.bInVehicle, player->m_pVehicle, player->m_pVehicle))
{
BY_GAME(pVeh->Teleport(m_Teleport::m_fPos, false), pVeh->Teleport(m_Teleport::m_fPos), player->Teleport(m_Teleport::m_fPos));
BY_GAME(pVeh->Teleport(QuicKTP::m_fPos, false), pVeh->Teleport(QuicKTP::m_fPos), player->Teleport(QuicKTP::m_fPos));
}
else
{
BY_GAME(player->Teleport(m_Teleport::m_fPos, false), player->Teleport(m_Teleport::m_fPos), player->Teleport(m_Teleport::m_fPos));
BY_GAME(player->Teleport(QuicKTP::m_fPos, false), player->Teleport(QuicKTP::m_fPos), player->Teleport(QuicKTP::m_fPos));
}
m_Teleport::m_bEnabled = false;
QuicKTP::m_bEnabled = false;
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(CPools::GetPedRef(player), false);
Command<Commands::RESTORE_CAMERA_JUMPCUT>();
TheCamera.Fade(0, 1);
@ -100,9 +100,9 @@ void Teleport::TeleportPlayer(bool get_marker, CVector pos, int interior_id)
pos = targetBlip.m_vecPos;
pos.z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, 1000, nullptr, &pPlayerEntity) + 500.f;
m_Teleport::m_fPos = pos;
m_Teleport::m_nTimer = CTimer::m_snTimeInMilliseconds;
m_Teleport::m_bEnabled = true;
QuicKTP::m_fPos = pos;
QuicKTP::m_nTimer = CTimer::m_snTimeInMilliseconds;
QuicKTP::m_bEnabled = true;
TheCamera.Fade(0, 0);
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(CPools::GetPedRef(pPlayer), true);
}
@ -298,7 +298,7 @@ void Teleport::ShowPage()
}
ImGui::Spacing();
Ui::DrawJSON(m_tpData, TeleportToLocation, RemoveTeleportEntry);
Ui::DrawList(m_tpData, TeleportToLocation, RemoveTeleportEntry);
ImGui::EndTabItem();
}
ImGui::EndTabBar();

View File

@ -15,7 +15,7 @@ private:
static inline DataStore m_SpriteData {"sprites"};
#endif
struct m_Teleport
struct QuicKTP
{
static inline bool m_bEnabled;
static inline CVector m_fPos = { -1, -1, -1 };

View File

@ -370,7 +370,7 @@ bool Ui::CheckboxBitFlag(const char* label, uint flag, const char* hint)
return rtn;
}
void Ui::DrawJSON(ResourceStore& data,
void Ui::DrawList(ResourceStore& data,
std::function<void(std::string&, std::string&, std::string&)> func_left_click,
std::function<void(std::string&, std::string&, std::string&)> func_right_click)
{

View File

@ -49,7 +49,7 @@ public:
static bool CheckboxBitFlag(const char* label, uint flag, const char* hint = nullptr);
static bool CheckboxWithHint(const char* label, bool* state, const char* hint = nullptr, bool is_disabled = false);
static void DrawJSON(ResourceStore& data,
static void DrawList(ResourceStore& data,
std::function<void(std::string&, std::string&, std::string&)> func_left_click,
std::function<void(std::string&, std::string&, std::string&)> func_right_click);
static void DrawImages(ResourceStore &store, std::function<void(std::string&)> on_left_click,

View File

@ -25,8 +25,8 @@ void Vehicle::Init()
FileHandler::FetchColorData(m_CarcolsColorData);
// Get config data
m_Spawner::m_bSpawnInAir = gConfig.Get("Features.SpawnAircraftInAir", true);
m_Spawner::m_bSpawnInside = gConfig.Get("Features.SpawnInsideVehicle", true);
Spawner::m_bSpawnInAir = gConfig.Get("Features.SpawnAircraftInAir", true);
Spawner::m_bSpawnInside = gConfig.Get("Features.SpawnInsideVehicle", true);
Events::processScriptsEvent += []
{
@ -111,43 +111,43 @@ void Vehicle::Init()
}
#ifdef GTASA
if (m_UnlimitedNitro::m_bEnabled && pVeh->m_nVehicleSubClass == VEHICLE_AUTOMOBILE)
if (UnlimitedNitro::m_bEnabled && pVeh->m_nVehicleSubClass == VEHICLE_AUTOMOBILE)
{
patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro
patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro
if (KeyPressed(VK_LBUTTON))
{
if (!m_UnlimitedNitro::m_bCompAdded)
if (!UnlimitedNitro::m_bCompAdded)
{
AddComponent("1010", false);
m_UnlimitedNitro::m_bCompAdded = true;
UnlimitedNitro::m_bCompAdded = true;
}
}
else
{
if (m_UnlimitedNitro::m_bCompAdded)
if (UnlimitedNitro::m_bCompAdded)
{
RemoveComponent("1010", false);
m_UnlimitedNitro::m_bCompAdded = false;
UnlimitedNitro::m_bCompAdded = false;
}
}
}
if (m_Neon::m_bRainbowEffect && timer - m_Neon::m_nRainbowTimer > 50)
if (NeonData::m_bRainbowEffect && timer - NeonData::m_nRainbowTimer > 50)
{
int red, green, blue;
Util::RainbowValues(red, green, blue, 0.25);
Neon::Install(pVeh, red, green, blue);
m_Neon::m_nRainbowTimer = timer;
NeonData::m_nRainbowTimer = timer;
}
#endif
}
#ifdef GTASA
// Traffic neons
if (m_Neon::m_bApplyOnTraffic && timer - m_Neon::m_bTrafficTimer > 1000)
if (NeonData::m_bApplyOnTraffic && timer - NeonData::m_bTrafficTimer > 1000)
{
for (CVehicle* veh : CPools::ms_pVehiclePool)
{
@ -173,7 +173,7 @@ void Vehicle::Init()
Neon::Install(veh, Random(0, 255), Random(0, 255), Random(0, 255));
}
}
m_Neon::m_bTrafficTimer = timer;
NeonData::m_bTrafficTimer = timer;
}
if (m_bBikeFly && pVeh && pVeh->IsDriver(pPlayer))
@ -327,7 +327,7 @@ void Vehicle::SpawnVehicle(const std::string& rootkey, const std::string& vehNam
float speed = 0;
bool bInVehicle = Command<Commands::IS_CHAR_IN_ANY_CAR>(hplayer);
if (bInVehicle && m_Spawner::m_bSpawnInside)
if (bInVehicle && Spawner::m_bSpawnInside)
{
CVehicle* pveh = player->m_pVehicle;
int hveh = CPools::GetVehicleRef(pveh);
@ -353,7 +353,7 @@ void Vehicle::SpawnVehicle(const std::string& rootkey, const std::string& vehNam
if (interior == 0)
{
if (m_Spawner::m_bSpawnInAir && (CModelInfo::IsHeliModel(imodel) || CModelInfo::IsPlaneModel(imodel)))
if (Spawner::m_bSpawnInAir && (CModelInfo::IsHeliModel(imodel) || CModelInfo::IsPlaneModel(imodel)))
{
pos.z = 400;
}
@ -395,7 +395,7 @@ void Vehicle::SpawnVehicle(const std::string& rootkey, const std::string& vehNam
if (veh->m_pDriver)
Command<Commands::DELETE_CHAR>(CPools::GetPedRef(veh->m_pDriver));
if (m_Spawner::m_bSpawnInside)
if (Spawner::m_bSpawnInside)
{
Command<Commands::WARP_CHAR_INTO_CAR>(hplayer, hveh);
Util::SetCarForwardSpeed(veh, speed);
@ -415,13 +415,13 @@ void Vehicle::SpawnVehicle(const std::string& rootkey, const std::string& vehNam
CStreaming::RequestModel(imodel, PRIORITY_REQUEST);
CStreaming::LoadAllRequestedModels(false);
#ifdef GTASA
if (m_Spawner::m_nLicenseText[0] != '\0')
if (Spawner::m_nLicenseText[0] != '\0')
{
Command<Commands::CUSTOM_PLATE_FOR_NEXT_CAR>(imodel, m_Spawner::m_nLicenseText);
Command<Commands::CUSTOM_PLATE_FOR_NEXT_CAR>(imodel, Spawner::m_nLicenseText);
}
#endif
int hveh = 0;
if (m_Spawner::m_bSpawnInside)
if (Spawner::m_bSpawnInside)
{
Command<Commands::CREATE_CAR>(imodel, pos.x, pos.y, pos.z + 4.0f, &hveh);
veh = CPools::GetVehicle(hveh);
@ -659,7 +659,7 @@ void Vehicle::ShowPage()
Ui::CheckboxAddress(TEXT("Vehicle.PerfectHandling"), 0x96914C);
Ui::CheckboxAddress(TEXT("Vehicle.TankMode"), 0x969164);
Ui::CheckboxWithHint(TEXT("Vehicle.InfNitro"), &m_UnlimitedNitro::m_bEnabled, TEXT("Vehicle.InfNitroTip"));
Ui::CheckboxWithHint(TEXT("Vehicle.InfNitro"), &UnlimitedNitro::m_bEnabled, TEXT("Vehicle.InfNitroTip"));
if (Ui::CheckboxWithHint(TEXT("Vehicle.FlipNoBurn"), &m_bVehFlipNoBurn, TEXT("Vehicle.FlipNoBurnTip")))
{
// MixSets (Link2012)
@ -1018,14 +1018,14 @@ void Vehicle::ShowPage()
{
ImGui::Spacing();
ImGui::Columns(2, 0, false);
if (Ui::CheckboxWithHint(TEXT("Vehicle.SpawnInside"), &m_Spawner::m_bSpawnInside))
if (Ui::CheckboxWithHint(TEXT("Vehicle.SpawnInside"), &Spawner::m_bSpawnInside))
{
gConfig.Set("Features.SpawnInsideVehicle", m_Spawner::m_bSpawnInside);
gConfig.Set("Features.SpawnInsideVehicle", Spawner::m_bSpawnInside);
}
ImGui::NextColumn();
if( Ui::CheckboxWithHint(TEXT("Vehicle.SpawnInAir"), &m_Spawner::m_bSpawnInAir))
if( Ui::CheckboxWithHint(TEXT("Vehicle.SpawnInAir"), &Spawner::m_bSpawnInAir))
{
gConfig.Set("Features.SpawnAircraftInAir", m_Spawner::m_bSpawnInAir);
gConfig.Set("Features.SpawnAircraftInAir", Spawner::m_bSpawnInAir);
}
ImGui::Columns(1);
@ -1065,9 +1065,9 @@ void Vehicle::ShowPage()
#ifdef GTASA
ImGui::SameLine();
ImGui::SetNextItemWidth(width);
ImGui::InputTextWithHint("##LicenseText", TEXT("Vehicle.PlateText"), m_Spawner::m_nLicenseText, 9);
ImGui::InputTextWithHint("##LicenseText", TEXT("Vehicle.PlateText"), Spawner::m_nLicenseText, 9);
Ui::DrawImages(m_Spawner::m_VehData, SpawnVehicle, nullptr,
Ui::DrawImages(Spawner::m_VehData, SpawnVehicle, nullptr,
[](std::string str)
{
return GetNameFromModel(std::stoi(str));
@ -1085,24 +1085,24 @@ void Vehicle::ShowPage()
if (ImGui::BeginTabItem(TEXT("Vehicle.Color")))
{
#ifdef GTASA
Paint::GenerateNodeList(veh, m_Paint::m_vecNames, m_Paint::m_Selected);
Paint::GenerateNodeList(veh, PaintData::m_vecNames, PaintData::m_Selected);
ImGui::Spacing();
if (ImGui::Button(TEXT("Vehicle.ResetColor"), ImVec2(Ui::GetSize())))
{
Paint::ResetNodeColor(veh, m_Paint::m_Selected);
Paint::ResetNodeColor(veh, PaintData::m_Selected);
SetHelpMessage(TEXT("Vehicle.ResetColorMSG"));
}
ImGui::Spacing();
Ui::ListBoxStr(TEXT("Vehicle.Component"), m_Paint::m_vecNames, m_Paint::m_Selected);
Ui::ListBoxStr(TEXT("Vehicle.Component"), PaintData::m_vecNames, PaintData::m_Selected);
if (ImGui::ColorEdit3(TEXT("Vehicle.ColorPicker"), m_Paint::m_fColorPicker))
if (ImGui::ColorEdit3(TEXT("Vehicle.ColorPicker"), PaintData::m_fColorPicker))
{
uchar r = m_Paint::m_fColorPicker[0] * 255;
uchar g = m_Paint::m_fColorPicker[1] * 255;
uchar b = m_Paint::m_fColorPicker[2] * 255;
Paint::SetNodeColor(veh, m_Paint::m_Selected, { r, g, b, 255 }, m_Paint::m_bMatFilter);
uchar r = PaintData::m_fColorPicker[0] * 255;
uchar g = PaintData::m_fColorPicker[1] * 255;
uchar b = PaintData::m_fColorPicker[2] * 255;
Paint::SetNodeColor(veh, PaintData::m_Selected, { r, g, b, 255 }, PaintData::m_bMatFilter);
}
#endif
@ -1110,17 +1110,17 @@ void Vehicle::ShowPage()
ImGui::Columns(2, NULL, false);
#ifdef GTASA
ImGui::Checkbox(TEXT("Vehicle.MatFilter"), &m_Paint::m_bMatFilter);
ImGui::RadioButton(TEXT("Vehicle.Primary"), &m_Paint::m_nRadioButton, 1);
ImGui::RadioButton(TEXT("Vehicle.Secondary"), &m_Paint::m_nRadioButton, 2);
ImGui::Checkbox(TEXT("Vehicle.MatFilter"), &PaintData::m_bMatFilter);
ImGui::RadioButton(TEXT("Vehicle.Primary"), &PaintData::m_nRadioButton, 1);
ImGui::RadioButton(TEXT("Vehicle.Secondary"), &PaintData::m_nRadioButton, 2);
ImGui::NextColumn();
ImGui::NewLine();
ImGui::RadioButton(TEXT("Vehicle.Tertiary"), &m_Paint::m_nRadioButton, 3);
ImGui::RadioButton(TEXT("Vehicle.Quaternary"), &m_Paint::m_nRadioButton, 4);
ImGui::RadioButton(TEXT("Vehicle.Tertiary"), &PaintData::m_nRadioButton, 3);
ImGui::RadioButton(TEXT("Vehicle.Quaternary"), &PaintData::m_nRadioButton, 4);
#else
ImGui::RadioButton(TEXT("Vehicle.Primary"), &m_Paint::m_nRadioButton, 1);
ImGui::RadioButton(TEXT("Vehicle.Primary"), &m_PaintData::m_nRadioButton, 1);
ImGui::NextColumn();
ImGui::RadioButton(TEXT("Vehicle.Secondary"), &m_Paint::m_nRadioButton, 2);
ImGui::RadioButton(TEXT("Vehicle.Secondary"), &m_PaintData::m_nRadioButton, 2);
#endif
ImGui::Spacing();
ImGui::Columns(1);
@ -1140,7 +1140,7 @@ void Vehicle::ShowPage()
{
if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId], ImVec2(btnSize, btnSize)))
{
*(uint8_replacement*)(int(veh) + BY_GAME(0x433, 0x19F, 0x19B) + m_Paint::m_nRadioButton) = colorId;
*(uint8_replacement*)(int(veh) + BY_GAME(0x433, 0x19F, 0x19B) + PaintData::m_nRadioButton) = colorId;
}
if ((colorId + 1) % btnsInRow != 0)
@ -1174,18 +1174,18 @@ void Vehicle::ShowPage()
Neon::SetPulsing(veh, pulsing);
}
Ui::CheckboxWithHint(TEXT("Vehicle.RainbowNeon"), &m_Neon::m_bRainbowEffect, TEXT("Vehicle.RainbowNeonMSG"));
Ui::CheckboxWithHint(TEXT("Vehicle.RainbowNeon"), &NeonData::m_bRainbowEffect, TEXT("Vehicle.RainbowNeonMSG"));
ImGui::NextColumn();
Ui::CheckboxWithHint(TEXT("Vehicle.TrafficNeon"), &m_Neon::m_bApplyOnTraffic, TEXT("Vehicle.TrafficNeonMSG"));
Ui::CheckboxWithHint(TEXT("Vehicle.TrafficNeon"), &NeonData::m_bApplyOnTraffic, TEXT("Vehicle.TrafficNeonMSG"));
ImGui::Columns(1);
ImGui::Spacing();
if (ImGui::ColorEdit3(TEXT("Vehicle.ColorPicker"), m_Neon::m_fColorPicker))
if (ImGui::ColorEdit3(TEXT("Vehicle.ColorPicker"), NeonData::m_fColorPicker))
{
int r = static_cast<int>(m_Neon::m_fColorPicker[0] * 255);
int g = static_cast<int>(m_Neon::m_fColorPicker[1] * 255);
int b = static_cast<int>(m_Neon::m_fColorPicker[2] * 255);
int r = static_cast<int>(NeonData::m_fColorPicker[0] * 255);
int g = static_cast<int>(NeonData::m_fColorPicker[1] * 255);
int b = static_cast<int>(NeonData::m_fColorPicker[2] * 255);
Neon::Install(veh, r, g, b);
}
@ -1225,21 +1225,21 @@ void Vehicle::ShowPage()
}
if (ImGui::BeginTabItem(TEXT("Vehicle.TextureTab")))
{
Paint::GenerateNodeList(veh, m_Paint::m_vecNames, m_Paint::m_Selected);
Paint::GenerateNodeList(veh, PaintData::m_vecNames, PaintData::m_Selected);
ImGui::Spacing();
if (ImGui::Button(TEXT("Vehicle.ResetTexture"), ImVec2(Ui::GetSize())))
{
Paint::ResetNodeTexture(veh, m_Paint::m_Selected);
Paint::ResetNodeTexture(veh, PaintData::m_Selected);
SetHelpMessage(TEXT("Vehicle.ResetTextureMSG"));
}
ImGui::Spacing();
Ui::ListBoxStr(TEXT("Vehicle.Component"), m_Paint::m_vecNames, m_Paint::m_Selected);
Ui::ListBoxStr(TEXT("Vehicle.Component"), PaintData::m_vecNames, PaintData::m_Selected);
ImGui::Spacing();
ImGui::Columns(2, NULL, false);
ImGui::Checkbox(TEXT("Vehicle.MatFilter"), &m_Paint::m_bMatFilter);
ImGui::Checkbox(TEXT("Vehicle.MatFilter"), &PaintData::m_bMatFilter);
ImGui::NextColumn();
int maxpjob, curpjob;
Command<Commands::GET_NUM_AVAILABLE_PAINTJOBS>(hveh, &maxpjob);
@ -1277,8 +1277,8 @@ void Vehicle::ShowPage()
Ui::DrawImages(Paint::m_TextureData,
[](std::string& str)
{
Paint::SetNodeTexture(FindPlayerPed()->m_pVehicle, m_Paint::m_Selected, str,
m_Paint::m_bMatFilter);
Paint::SetNodeTexture(FindPlayerPed()->m_pVehicle, PaintData::m_Selected, str,
PaintData::m_bMatFilter);
},
nullptr,
[](std::string& str)

View File

@ -16,7 +16,7 @@ private:
static inline bool m_bLockSpeed;
static inline float m_fLockSpeed;
static inline std::vector<std::vector<float>> m_CarcolsColorData;
struct m_Paint
struct PaintData
{
static inline bool m_bMatFilter = true;
static inline int m_nRadioButton = 1;
@ -31,7 +31,7 @@ private:
static inline bool m_bMoreTrainCams;
static inline bool m_bNoDerail;
static inline std::map<int, std::string> m_VehicleIDE;
struct m_Neon
struct NeonData
{
static inline float m_fColorPicker[3] { 0, 0, 0 };
static inline bool m_bRainbowEffect;
@ -42,7 +42,7 @@ private:
static inline ResourceStore m_TuneData { "components", eResourceType::TYPE_IMAGE, ImVec2(100, 80) };
#endif
struct m_Spawner
struct Spawner
{
#ifdef GTASA
static inline ResourceStore m_VehData { "vehicles", eResourceType::TYPE_IMAGE, ImVec2(100, 75)};
@ -53,7 +53,7 @@ private:
static inline bool m_bSpawnInAir = true;
static inline char m_nLicenseText[9];
};
struct m_UnlimitedNitro
struct UnlimitedNitro
{
static inline bool m_bEnabled;
static inline bool m_bCompAdded;

23
tools/subset/in.txt Normal file
View File

@ -0,0 +1,23 @@
# CheatMenu supported unicode ranges
# Lines starting with # are comments
# Basic latin
0020-00FF,
# Punctuation
2000-206F,
# Bengali
0980-09FF,
# Chinease
#3000-30FF,
#31F0-31FF,
#FF00-FFEF,
#FFFD-FFFD,
#4E00-9FAF,
# Russian
0400-052F, # Cyrillic + Cyrillic Supplement
2DE0-2DFF, # Cyrillic Extended-A
A640-A69F, # Cyrillic Extended-B

BIN
tools/subset/src.ttf Normal file

Binary file not shown.

1
tools/subset/subset.bat Normal file
View File

@ -0,0 +1 @@
pyftsubset src.ttf --unicodes-file="in.txt" --output-file="text.ttf"