clang format code
This commit is contained in:
parent
4676894169
commit
26a671c4e5
11
.clang-format
Normal file
11
.clang-format
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
# We'll use defaults from the LLVM style, but with 4 columns indentation.
|
||||||
|
BasedOnStyle: Microsoft
|
||||||
|
IndentWidth: 4
|
||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
|
# Force pointers to the type for C++.
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
PointerAlignment: Right
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
---
|
@ -1,13 +1,14 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "animation.h"
|
#include "animation.h"
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
Animation::Animation()
|
Animation::Animation()
|
||||||
{
|
{
|
||||||
Events::processScriptsEvent += [this]
|
Events::processScriptsEvent += [this] {
|
||||||
{
|
|
||||||
if (m_Cutscene::m_bRunning)
|
if (m_Cutscene::m_bRunning)
|
||||||
{
|
{
|
||||||
if (Command<Commands::HAS_CUTSCENE_FINISHED>())
|
if (Command<Commands::HAS_CUTSCENE_FINISHED>())
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
class Animation
|
class Animation
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Animation player
|
// Animation player
|
||||||
static inline ResourceStore m_AnimData{"animation", eResourceType::TYPE_TEXT};
|
static inline ResourceStore m_AnimData{"animation", eResourceType::TYPE_TEXT};
|
||||||
static inline char m_nAnimBuffer[INPUT_BUFFER_SIZE];
|
static inline char m_nAnimBuffer[INPUT_BUFFER_SIZE];
|
||||||
@ -24,14 +23,12 @@ private:
|
|||||||
|
|
||||||
static inline int m_nFightingStyle;
|
static inline int m_nFightingStyle;
|
||||||
static inline std::string m_nWalkingStyle = "default";
|
static inline std::string m_nWalkingStyle = "default";
|
||||||
static inline std::vector<std::string> m_FightingStyleList =
|
static inline std::vector<std::string> m_FightingStyleList = {"Default", "Boxing", "Kung fu", "Kick Boxing",
|
||||||
{ "Default", "Boxing", "Kung fu", "Kick Boxing", "Punch Kick" };
|
"Punch Kick"};
|
||||||
static inline std::vector<std::string> m_WalkingStyleList =
|
static inline std::vector<std::string> m_WalkingStyleList = {
|
||||||
{
|
"default", "man", "shuffle", "oldman", "gang1", "gang2", "oldfatman", "fatman",
|
||||||
"default", "man", "shuffle", "oldman", "gang1", "gang2", "oldfatman",
|
"jogger", "drunkman", "blindman", "swat", "woman", "shopping", "busywoman", "sexywoman",
|
||||||
"fatman", "jogger", "drunkman", "blindman", "swat", "woman", "shopping", "busywoman",
|
"pro", "oldwoman", "fatwoman", "jogwoman", "oldfatwoman", "skate"};
|
||||||
"sexywoman", "pro", "oldwoman", "fatwoman", "jogwoman", "oldfatwoman", "skate"
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Animation();
|
Animation();
|
||||||
@ -45,5 +42,7 @@ public:
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
// Dummy Class for VC & III
|
// Dummy Class for VC & III
|
||||||
class Animation{};
|
class Animation
|
||||||
|
{
|
||||||
|
};
|
||||||
#endif
|
#endif
|
@ -1,6 +1,6 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "cheatMenu.h"
|
#include "cheatMenu.h"
|
||||||
#include "menuinfo.h"
|
#include "menuinfo.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "updater.h"
|
#include "updater.h"
|
||||||
|
|
||||||
@ -9,7 +9,8 @@ void CheatMenu::DrawWindow()
|
|||||||
ImGuiIO &io = ImGui::GetIO();
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
static bool bRunning = true;
|
static bool bRunning = true;
|
||||||
|
|
||||||
if (BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible, FrontEndMenuManager.m_bMenuActive))
|
if (BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible,
|
||||||
|
FrontEndMenuManager.m_bMenuActive))
|
||||||
{
|
{
|
||||||
if (bRunning)
|
if (bRunning)
|
||||||
{
|
{
|
||||||
@ -76,9 +77,9 @@ CheatMenu::CheatMenu()
|
|||||||
m_fMenuSize.y = gConfig.GetValue("window.sizeY", screen::GetScreenHeight() / 1.2f);
|
m_fMenuSize.y = gConfig.GetValue("window.sizeY", screen::GetScreenHeight() / 1.2f);
|
||||||
srand(CTimer::m_snTimeInMilliseconds);
|
srand(CTimer::m_snTimeInMilliseconds);
|
||||||
|
|
||||||
Events::processScriptsEvent += []()
|
Events::processScriptsEvent += []() {
|
||||||
{
|
if (!BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible,
|
||||||
if (!BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible, FrontEndMenuManager.m_bMenuActive))
|
FrontEndMenuManager.m_bMenuActive))
|
||||||
{
|
{
|
||||||
if (menuOpen.Pressed())
|
if (menuOpen.Pressed())
|
||||||
{
|
{
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "animation.h"
|
#include "animation.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
#include "hook.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "ped.h"
|
#include "ped.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "teleport.h"
|
#include "teleport.h"
|
||||||
#include "menu.h"
|
|
||||||
#include "hook.h"
|
|
||||||
#include "weapon.h"
|
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
|
#include "weapon.h"
|
||||||
|
|
||||||
#ifndef GTA3
|
#ifndef GTA3
|
||||||
class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon
|
class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon
|
||||||
@ -33,24 +33,20 @@ private:
|
|||||||
static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2);
|
static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2);
|
||||||
|
|
||||||
#ifdef GTA3
|
#ifdef GTA3
|
||||||
static inline CallbackTable header
|
static inline CallbackTable header{
|
||||||
{
|
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw}, {"Dummy", nullptr},
|
||||||
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw},
|
{"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, {"Game", &Game::Draw}, {"Menu", &Menu::Draw},
|
||||||
{"Dummy", nullptr}, {"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw},
|
|
||||||
{"Game", &Game::Draw}, {"Menu", &Menu::Draw},
|
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
static inline CallbackTable header
|
static inline CallbackTable header{
|
||||||
{
|
|
||||||
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw},
|
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw},
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
{"Animation", &Animation::Draw},
|
{"Animation", &Animation::Draw},
|
||||||
#else
|
#else
|
||||||
{"Dummy", nullptr},
|
{"Dummy", nullptr},
|
||||||
#endif
|
#endif
|
||||||
{"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw},
|
{"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, {"Game", &Game::Draw},
|
||||||
{"Game", &Game::Draw}, {"Visual", &Visual::Draw}, {"Menu", &Menu::Draw}
|
{"Visual", &Visual::Draw}, {"Menu", &Menu::Draw}};
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void ApplyStyle();
|
static void ApplyStyle();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "hook.h"
|
|
||||||
#include "cheatmenu.h"
|
#include "cheatmenu.h"
|
||||||
#include "updater.h"
|
#include "hook.h"
|
||||||
#include "menuinfo.h"
|
#include "menuinfo.h"
|
||||||
|
#include "pch.h"
|
||||||
|
#include "updater.h"
|
||||||
|
|
||||||
void MenuThread(void *param)
|
void MenuThread(void *param)
|
||||||
{
|
{
|
||||||
@ -14,7 +14,9 @@ void MenuThread(void* param)
|
|||||||
*/
|
*/
|
||||||
if (!std::filesystem::is_directory(PLUGIN_PATH((char *)"CheatMenu")))
|
if (!std::filesystem::is_directory(PLUGIN_PATH((char *)"CheatMenu")))
|
||||||
{
|
{
|
||||||
gLog << "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory" << std::endl;
|
gLog << "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same "
|
||||||
|
"directory"
|
||||||
|
<< std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,10 +27,7 @@ void MenuThread(void* param)
|
|||||||
static bool bGameInit = false;
|
static bool bGameInit = false;
|
||||||
|
|
||||||
// Wait till game init
|
// Wait till game init
|
||||||
Events::initRwEvent += []
|
Events::initRwEvent += [] { bGameInit = true; };
|
||||||
{
|
|
||||||
bGameInit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
while (!bGameInit)
|
while (!bGameInit)
|
||||||
{
|
{
|
||||||
@ -48,11 +47,11 @@ void MenuThread(void* param)
|
|||||||
CFastman92limitAdjuster::Init();
|
CFastman92limitAdjuster::Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gLog << "Starting...\nVersion: " MENU_TITLE "\nAuthor: Grinch_\nDiscord: " DISCORD_INVITE "\nMore Info: "
|
gLog << "Starting...\nVersion: " MENU_TITLE "\nAuthor: Grinch_\nDiscord: " DISCORD_INVITE
|
||||||
GITHUB_LINK "\n" << std::endl;
|
"\nMore Info: " GITHUB_LINK "\n"
|
||||||
|
<< std::endl;
|
||||||
CheatMenu menu;
|
CheatMenu menu;
|
||||||
|
|
||||||
|
|
||||||
// Checking for updates once a day
|
// Checking for updates once a day
|
||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
struct tm tstruct = *localtime(&now);
|
struct tm tstruct = *localtime(&now);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "filehandler.h"
|
#include "filehandler.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "visual.h"
|
#include "visual.h"
|
||||||
|
|
||||||
// TODO: Clean up this mess, use structures instead?
|
// TODO: Clean up this mess, use structures instead?
|
||||||
@ -46,17 +46,16 @@ void FileHandler::GenerateHandlingFile(int pHandling, std::map<int, std::string>
|
|||||||
float fSeatOffsetDistance = patch::Get<float>(pHandling + 0xD4);
|
float fSeatOffsetDistance = patch::Get<float>(pHandling + 0xD4);
|
||||||
|
|
||||||
// TODO: make this more readable
|
// TODO: make this more readable
|
||||||
fprintf(
|
fprintf(fp,
|
||||||
fp,
|
"\n%s\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%d\t%d\t%.5g\t%.5g\t%c\t%c\t%.5g\t%.5g\t%"
|
||||||
"\n%s\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%d\t%d\t%.5g\t%.5g\t%c\t%c\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%d\t%d\t%d\t%d\t%d",
|
"d\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%d\t%d\t%d\t%d\t%d",
|
||||||
handlingId.c_str(), fMass, fTurnMass, fDragMult, CentreOfMassX, CentreOfMassY, CentreOfMassZ, nPercentSubmerged,
|
handlingId.c_str(), fMass, fTurnMass, fDragMult, CentreOfMassX, CentreOfMassY, CentreOfMassZ,
|
||||||
fTractionMultiplier, fTractionLoss, TractionBias, nNumberOfGears,
|
nPercentSubmerged, fTractionMultiplier, fTractionLoss, TractionBias, nNumberOfGears, MaxVelocity,
|
||||||
MaxVelocity, fEngineAcceleration, fEngineInertia, nDriveType, nEngineType, BrakeDeceleration, BrakeBias, ABS,
|
fEngineAcceleration, fEngineInertia, nDriveType, nEngineType, BrakeDeceleration, BrakeBias, ABS,
|
||||||
SteeringLock, SuspensionForceLevel, SuspensionDampingLevel,
|
SteeringLock, SuspensionForceLevel, SuspensionDampingLevel, SuspensionHighSpdComDamp,
|
||||||
SuspensionHighSpdComDamp, Suspension_upper_limit, Suspension_lower_limit, Suspension_bias,
|
Suspension_upper_limit, Suspension_lower_limit, Suspension_bias, Suspension_anti_dive_multiplier,
|
||||||
Suspension_anti_dive_multiplier, fSeatOffsetDistance,
|
fSeatOffsetDistance, fCollisionDamageMultiplier, nMonetaryValue, modelFlags, handlingFlags, front_lights,
|
||||||
fCollisionDamageMultiplier, nMonetaryValue, modelFlags, handlingFlags, front_lights, rear_lights,
|
rear_lights, vehicle_anim_group);
|
||||||
vehicle_anim_group);
|
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class FileHandler
|
class FileHandler
|
||||||
{
|
{
|
||||||
@ -21,4 +21,3 @@ public:
|
|||||||
static void FetchHandlingID(std::map<int, std::string> &storeMap);
|
static void FetchHandlingID(std::map<int, std::string> &storeMap);
|
||||||
static void GenerateHandlingFile(int pHandling, std::map<int, std::string> &storeMap);
|
static void GenerateHandlingFile(int pHandling, std::map<int, std::string> &storeMap);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
49
src/game.cpp
49
src/game.cpp
@ -1,8 +1,9 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "menu.h"
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
#include "menu.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
#include <CIplStore.h>
|
#include <CIplStore.h>
|
||||||
#include <CMessages.h>
|
#include <CMessages.h>
|
||||||
@ -50,8 +51,7 @@ Game::Game()
|
|||||||
m_RandomCheats::m_EnabledCheats[std::stoi(element.key())][1] = "true";
|
m_RandomCheats::m_EnabledCheats[std::stoi(element.key())][1] = "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
Events::drawMenuBackgroundEvent += []()
|
Events::drawMenuBackgroundEvent += []() {
|
||||||
{
|
|
||||||
if (bSaveGameFlag)
|
if (bSaveGameFlag)
|
||||||
{
|
{
|
||||||
FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE;
|
FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE;
|
||||||
@ -59,8 +59,7 @@ Game::Game()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Events::drawingEvent += []()
|
Events::drawingEvent += []() {
|
||||||
{
|
|
||||||
if (m_RandomCheats::m_bEnabled && m_RandomCheats::m_bProgressBar)
|
if (m_RandomCheats::m_bEnabled && m_RandomCheats::m_bProgressBar)
|
||||||
{
|
{
|
||||||
// Next cheat timer bar
|
// Next cheat timer bar
|
||||||
@ -81,8 +80,7 @@ Game::Game()
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Events::processScriptsEvent += []
|
Events::processScriptsEvent += [] {
|
||||||
{
|
|
||||||
uint timer = CTimer::m_snTimeInMilliseconds;
|
uint timer = CTimer::m_snTimeInMilliseconds;
|
||||||
CPlayerPed *pPlayer = FindPlayerPed();
|
CPlayerPed *pPlayer = FindPlayerPed();
|
||||||
int hplayer = CPools::GetPedRef(pPlayer);
|
int hplayer = CPools::GetPedRef(pPlayer);
|
||||||
@ -187,7 +185,8 @@ Game::Game()
|
|||||||
if (m_RandomCheats::m_EnabledCheats[i][1] == "true")
|
if (m_RandomCheats::m_EnabledCheats[i][1] == "true")
|
||||||
{
|
{
|
||||||
Call<0x00438370>(id); // cheatEnableLegimate(int CheatID)
|
Call<0x00438370>(id); // cheatEnableLegimate(int CheatID)
|
||||||
CMessages::AddMessage((char*)m_RandomCheats::m_EnabledCheats[i][0].c_str(), 2000, 0, false);
|
CMessages::AddMessage((char *)m_RandomCheats::m_EnabledCheats[i][0].c_str(), 2000, 0,
|
||||||
|
false);
|
||||||
m_RandomCheats::m_nTimer = timer;
|
m_RandomCheats::m_nTimer = timer;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -223,8 +222,7 @@ void SetPlayerMission(std::string& rootkey, std::string& name, std::string& id)
|
|||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
void Game::FreeCam()
|
void Game::FreeCam()
|
||||||
{
|
{
|
||||||
int delta = (CTimer::m_snTimeInMillisecondsNonClipped -
|
int delta = (CTimer::m_snTimeInMillisecondsNonClipped - CTimer::m_snPreviousTimeInMillisecondsNonClipped);
|
||||||
CTimer::m_snPreviousTimeInMillisecondsNonClipped);
|
|
||||||
|
|
||||||
int ratio = 1 / (1 + (delta * m_Freecam::m_nMul));
|
int ratio = 1 / (1 + (delta * m_Freecam::m_nMul));
|
||||||
int speed = m_Freecam::m_nMul + m_Freecam::m_nMul * ratio * delta;
|
int speed = m_Freecam::m_nMul + m_Freecam::m_nMul * ratio * delta;
|
||||||
@ -353,7 +351,8 @@ void Game::FreeCam()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_Freecam::m_pPed->SetHeading(m_Freecam::m_fTotalMouse.x);
|
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);
|
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);
|
m_Freecam::m_pPed->SetPosn(pos);
|
||||||
CIplStore::AddIplsNeededAtPosn(pos);
|
CIplStore::AddIplsNeededAtPosn(pos);
|
||||||
}
|
}
|
||||||
@ -468,7 +467,8 @@ of LS without completing missions"))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
patch::SetRaw(BY_GAME(0x52CF10, 0x487010, 0x473460), (char*)BY_GAME("\x56\x8B", "\x6A\x01", "\x6A\x01"), 2);
|
patch::SetRaw(BY_GAME(0x52CF10, 0x487010, 0x473460),
|
||||||
|
(char *)BY_GAME("\x56\x8B", "\x6A\x01", "\x6A\x01"), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,7 +480,8 @@ of LS without completing missions"))
|
|||||||
Command<Commands::FREEZE_ONSCREEN_TIMER>(m_bMissionTimer);
|
Command<Commands::FREEZE_ONSCREEN_TIMER>(m_bMissionTimer);
|
||||||
}
|
}
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
if (Ui::CheckboxWithHint("Hard mode", &m_HardMode::m_bEnabled, "Makes the game more challanging to play. \n\
|
if (Ui::CheckboxWithHint("Hard mode", &m_HardMode::m_bEnabled,
|
||||||
|
"Makes the game more challanging to play. \n\
|
||||||
Lowers armour, health, stamina etc."))
|
Lowers armour, health, stamina etc."))
|
||||||
{
|
{
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
@ -508,8 +509,9 @@ Lowers armour, health, stamina etc."))
|
|||||||
Command<Commands::SWITCH_DEATH_PENALTIES>(m_bKeepStuff);
|
Command<Commands::SWITCH_DEATH_PENALTIES>(m_bKeepStuff);
|
||||||
}
|
}
|
||||||
Ui::CheckboxWithHint("Screenshot shortcut", &m_bScreenShot,
|
Ui::CheckboxWithHint("Screenshot shortcut", &m_bScreenShot,
|
||||||
(("Take screenshot using ") + quickSceenShot.GetNameString()
|
(("Take screenshot using ") + quickSceenShot.GetNameString() +
|
||||||
+ "\nSaved inside 'GTA San Andreas User Files\\Gallery'").c_str());
|
"\nSaved inside 'GTA San Andreas User Files\\Gallery'")
|
||||||
|
.c_str());
|
||||||
Ui::CheckboxWithHint("Solid water", &m_bSolidWater,
|
Ui::CheckboxWithHint("Solid water", &m_bSolidWater,
|
||||||
"Player can walk on water\nTurn this off if you want to swim.");
|
"Player can walk on water\nTurn this off if you want to swim.");
|
||||||
#endif
|
#endif
|
||||||
@ -576,15 +578,19 @@ Lowers armour, health, stamina etc."))
|
|||||||
|
|
||||||
if (ImGui::InputInt("Hour", &hour))
|
if (ImGui::InputInt("Hour", &hour))
|
||||||
{
|
{
|
||||||
if (hour < 0) hour = 23;
|
if (hour < 0)
|
||||||
if (hour > 23) hour = 0;
|
hour = 23;
|
||||||
|
if (hour > 23)
|
||||||
|
hour = 0;
|
||||||
CClock::ms_nGameClockHours = hour;
|
CClock::ms_nGameClockHours = hour;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::InputInt("Minute", &minute))
|
if (ImGui::InputInt("Minute", &minute))
|
||||||
{
|
{
|
||||||
if (minute < 0) minute = 59;
|
if (minute < 0)
|
||||||
if (minute > 59) minute = 0;
|
minute = 59;
|
||||||
|
if (minute > 59)
|
||||||
|
minute = 0;
|
||||||
CClock::ms_nGameClockMinutes = minute;
|
CClock::ms_nGameClockMinutes = minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,8 +599,7 @@ Lowers armour, health, stamina etc."))
|
|||||||
}
|
}
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static std::vector<Ui::NamedMemory> themes{
|
static std::vector<Ui::NamedMemory> themes{
|
||||||
{"Beach", 0x969159}, {"Country", 0x96917D}, {"Fun house", 0x969176}, {"Ninja", 0x96915C}
|
{"Beach", 0x969159}, {"Country", 0x96917D}, {"Fun house", 0x969176}, {"Ninja", 0x96915C}};
|
||||||
};
|
|
||||||
Ui::EditRadioButtonAddress("Themes", themes);
|
Ui::EditRadioButtonAddress("Themes", themes);
|
||||||
#endif
|
#endif
|
||||||
if (ImGui::CollapsingHeader("Weather"))
|
if (ImGui::CollapsingHeader("Weather"))
|
||||||
|
@ -17,10 +17,8 @@ public:
|
|||||||
static inline bool m_bKeepStuff;
|
static inline bool m_bKeepStuff;
|
||||||
static inline ResourceStore m_StatData{"stat", eResourceType::TYPE_TEXT};
|
static inline ResourceStore m_StatData{"stat", eResourceType::TYPE_TEXT};
|
||||||
|
|
||||||
static inline std::vector<std::string> m_DayNames =
|
static inline std::vector<std::string> m_DayNames = {"Sunday", "Monday", "Tuesday", "Wednesday",
|
||||||
{
|
"Thursday", "Friday", "Saturday"};
|
||||||
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
|
||||||
};
|
|
||||||
|
|
||||||
struct m_RandomCheats
|
struct m_RandomCheats
|
||||||
{
|
{
|
||||||
|
12
src/hook.cpp
12
src/hook.cpp
@ -1,10 +1,10 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
|
#include "../depend/imgui/imgui_impl_dx11.h"
|
||||||
|
#include "../depend/imgui/imgui_impl_dx9.h"
|
||||||
|
#include "../depend/imgui/imgui_impl_win32.h"
|
||||||
#include "../depend/kiero/kiero.h"
|
#include "../depend/kiero/kiero.h"
|
||||||
#include "../depend/kiero/minhook/MinHook.h"
|
#include "../depend/kiero/minhook/MinHook.h"
|
||||||
#include "../depend/imgui/imgui_impl_dx9.h"
|
#include "pch.h"
|
||||||
#include "../depend/imgui/imgui_impl_dx11.h"
|
|
||||||
#include "../depend/imgui/imgui_impl_win32.h"
|
|
||||||
#include <dinput.h>
|
#include <dinput.h>
|
||||||
|
|
||||||
#define DIMOUSE ((LPDIRECTINPUTDEVICE8)(RsGlobal.ps->diMouse))
|
#define DIMOUSE ((LPDIRECTINPUTDEVICE8)(RsGlobal.ps->diMouse))
|
||||||
@ -168,7 +168,6 @@ void Hook::ShowMouse(bool state)
|
|||||||
isController = patch::Get<BYTE>(0xBA6818);
|
isController = patch::Get<BYTE>(0xBA6818);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (isController && (m_bShowMouse || bMouseDisabled))
|
if (isController && (m_bShowMouse || bMouseDisabled))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -318,7 +317,8 @@ static int _cdecl _GetMouseState(Mouse* pMouse)
|
|||||||
{
|
{
|
||||||
if (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED)
|
if (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED)
|
||||||
{
|
{
|
||||||
while (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED);
|
while (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
Hotkey aimSkinChanger;
|
Hotkey aimSkinChanger;
|
||||||
Hotkey freeCam;
|
Hotkey freeCam;
|
||||||
|
@ -11,9 +11,9 @@ public:
|
|||||||
int m_key1;
|
int m_key1;
|
||||||
int m_key2;
|
int m_key2;
|
||||||
|
|
||||||
Hotkey(int key1 = -1, int key2 = -1)
|
Hotkey(int key1 = -1, int key2 = -1) : m_key1(key1), m_key2(key2)
|
||||||
: m_key1(key1), m_key2(key2)
|
{
|
||||||
{}
|
}
|
||||||
|
|
||||||
// Draws ui to change the hotkeys from frontend
|
// Draws ui to change the hotkeys from frontend
|
||||||
bool DrawUI(const char *label);
|
bool DrawUI(const char *label);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "json.h"
|
#include "json.h"
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
CJson::CJson(const char *name)
|
CJson::CJson(const char *name)
|
||||||
{
|
{
|
||||||
|
13
src/json.h
13
src/json.h
@ -19,8 +19,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
// specialize since typeid(std::string) doesn't work
|
// specialize since typeid(std::string) doesn't work
|
||||||
|
|
||||||
template <typename T>
|
template <typename T> T GetValue(std::string &&key, T &&defaultVal)
|
||||||
T GetValue(std::string&& key, T&& defaultVal)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -47,8 +46,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <> std::string GetValue(std::string &&key, std::string &&defaultVal)
|
||||||
std::string GetValue(std::string&& key, std::string&& defaultVal)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -74,8 +72,7 @@ public:
|
|||||||
Allows to save values in json hierarchy using '.'
|
Allows to save values in json hierarchy using '.'
|
||||||
Example: "Menu.Window.X"
|
Example: "Menu.Window.X"
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T> void SetValue(std::string &&key, T &val)
|
||||||
void SetValue(std::string&& key, T& val)
|
|
||||||
{
|
{
|
||||||
std::stringstream ss(key);
|
std::stringstream ss(key);
|
||||||
std::string line;
|
std::string line;
|
||||||
@ -85,7 +82,6 @@ public:
|
|||||||
while (getline(ss, line, '.'))
|
while (getline(ss, line, '.'))
|
||||||
{
|
{
|
||||||
json = &((*json)[line]);
|
json = &((*json)[line]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// json library bugs with bool, using int instead
|
// json library bugs with bool, using int instead
|
||||||
@ -99,8 +95,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <> void SetValue(std::string &&key, std::string &val)
|
||||||
void SetValue(std::string&& key, std::string& val)
|
|
||||||
{
|
{
|
||||||
std::stringstream ss(key);
|
std::stringstream ss(key);
|
||||||
std::string line;
|
std::string line;
|
||||||
|
24
src/menu.cpp
24
src/menu.cpp
@ -1,14 +1,15 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "menuinfo.h"
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "menuinfo.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
|
||||||
#include "updater.h"
|
#include "updater.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
#include "teleport.h"
|
#include "teleport.h"
|
||||||
#include "weapon.h"
|
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
|
#include "weapon.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Menu::Menu()
|
Menu::Menu()
|
||||||
@ -77,13 +78,16 @@ void Menu::DrawOverlay()
|
|||||||
CPlayerPed *pPlayer = FindPlayerPed();
|
CPlayerPed *pPlayer = FindPlayerPed();
|
||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
{
|
{
|
||||||
bool m_bShowMenu = m_Overlay::bCoord || m_Overlay::bFPS || m_Overlay::bLocName || m_Overlay::bCpuUsage || m_Overlay::bMemUsage ||
|
bool m_bShowMenu = m_Overlay::bCoord || m_Overlay::bFPS || m_Overlay::bLocName || m_Overlay::bCpuUsage ||
|
||||||
((m_Overlay::bVehHealth || m_Overlay::bVehSpeed) && pPlayer && pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer);
|
m_Overlay::bMemUsage ||
|
||||||
|
((m_Overlay::bVehHealth || m_Overlay::bVehSpeed) && pPlayer && pPlayer->m_pVehicle &&
|
||||||
|
pPlayer->m_pVehicle->m_pDriver == pPlayer);
|
||||||
|
|
||||||
const float offset = 10.0f;
|
const float offset = 10.0f;
|
||||||
ImGuiIO &io = ImGui::GetIO();
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
|
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
|
||||||
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
|
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing |
|
||||||
|
ImGuiWindowFlags_NoNav;
|
||||||
|
|
||||||
if (m_Overlay::mSelectedPos == DISPLAY_POS::CUSTOM)
|
if (m_Overlay::mSelectedPos == DISPLAY_POS::CUSTOM)
|
||||||
{
|
{
|
||||||
@ -143,7 +147,8 @@ void Menu::DrawOverlay()
|
|||||||
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
||||||
GlobalMemoryStatusEx(&memInfo);
|
GlobalMemoryStatusEx(&memInfo);
|
||||||
int mUsedRam = static_cast<int>((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6);
|
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));
|
m_Overlay::fMemUsage =
|
||||||
|
100.0f * (static_cast<float>(mUsedRam) / static_cast<float>(m_Overlay::mTotalRam));
|
||||||
|
|
||||||
m_Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate));
|
m_Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate));
|
||||||
m_Overlay::mLastInterval = game_ms;
|
m_Overlay::mLastInterval = game_ms;
|
||||||
@ -206,8 +211,7 @@ void Menu::DrawShortcutsWindow()
|
|||||||
ImGui::SetNextWindowSize(ImVec2(resX, 40));
|
ImGui::SetNextWindowSize(ImVec2(resX, 40));
|
||||||
|
|
||||||
ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration + ImGuiWindowFlags_AlwaysAutoResize +
|
ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration + ImGuiWindowFlags_AlwaysAutoResize +
|
||||||
ImGuiWindowFlags_NoSavedSettings
|
ImGuiWindowFlags_NoSavedSettings + ImGuiWindowFlags_NoMove;
|
||||||
+ ImGuiWindowFlags_NoMove;
|
|
||||||
|
|
||||||
if (ImGui::Begin("Shortcuts window", nullptr, flags))
|
if (ImGui::Begin("Shortcuts window", nullptr, flags))
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
class Menu
|
class Menu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
enum DISPLAY_POS
|
enum DISPLAY_POS
|
||||||
{
|
{
|
||||||
CUSTOM,
|
CUSTOM,
|
||||||
@ -26,9 +25,8 @@ private:
|
|||||||
static inline float fCpuUsage = 0.0f;
|
static inline float fCpuUsage = 0.0f;
|
||||||
static inline bool bMemUsage = false;
|
static inline bool bMemUsage = false;
|
||||||
static inline float fMemUsage = 0.0f;
|
static inline float fMemUsage = 0.0f;
|
||||||
static inline std::vector<std::string> posNames = {
|
static inline std::vector<std::string> posNames = {"Custom", "Top left", "Top right", "Bottom left",
|
||||||
"Custom", "Top left", "Top right", "Bottom left", "Bottom right"
|
"Bottom right"};
|
||||||
};
|
|
||||||
static inline DISPLAY_POS mSelectedPos = DISPLAY_POS::BOTTOM_RIGHT;
|
static inline DISPLAY_POS mSelectedPos = DISPLAY_POS::BOTTOM_RIGHT;
|
||||||
static inline float fPosX = 0.0f;
|
static inline float fPosX = 0.0f;
|
||||||
static inline float fPosY = 0.0f;
|
static inline float fPosY = 0.0f;
|
||||||
|
262
src/neon.cpp
262
src/neon.cpp
@ -1,178 +1,109 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "neon.h"
|
#include "neon.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
// Neon sprite
|
// Neon sprite
|
||||||
const unsigned char neon_mask[1689] =
|
const unsigned char neon_mask[1689] = {
|
||||||
{
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00,
|
||||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00,
|
0x40, 0x00, 0x00, 0x00, 0x80, 0x08, 0x06, 0x00, 0x00, 0x00, 0xbb, 0x81, 0x6f, 0x6a, 0x00, 0x00, 0x00, 0x09, 0x70,
|
||||||
0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
|
0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x80, 0x08, 0x06, 0x00, 0x00, 0x00, 0xbb, 0x81, 0x6f, 0x6a,
|
0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25, 0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b,
|
0x80, 0xe9, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, 0x3a, 0x98, 0x00, 0x00, 0x17, 0x6f, 0x92,
|
||||||
0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00,
|
0x5f, 0xc5, 0x46, 0x00, 0x00, 0x06, 0x1f, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xec, 0x5d, 0xdb, 0x8e, 0xe4, 0x2a,
|
||||||
0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25,
|
0x0c, 0x64, 0xa3, 0xf3, 0x10, 0x45, 0x49, 0x2b, 0xe2, 0xff, 0xbf, 0x11, 0x45, 0x09, 0x42, 0x79, 0x9b, 0xf3, 0x34,
|
||||||
0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0x80,
|
0xda, 0xde, 0x08, 0x70, 0xd9, 0x18, 0x42, 0x66, 0x1a, 0x69, 0xb4, 0xdb, 0x37, 0x3a, 0x55, 0x2e, 0x97, 0x0d, 0xdd,
|
||||||
0xe9, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00,
|
0x6a, 0xfe, 0x7c, 0x7d, 0x7d, 0x99, 0x86, 0x63, 0x01, 0x9f, 0x77, 0xb4, 0xba, 0xa0, 0x3f, 0x95, 0x09, 0x58, 0x14,
|
||||||
0x3a, 0x98, 0x00, 0x00, 0x17, 0x6f, 0x92, 0x5f, 0xc5, 0x46, 0x00,
|
0xe6, 0x38, 0x9e, 0x46, 0x00, 0x02, 0xda, 0x26, 0xee, 0x77, 0xad, 0xc9, 0xd0, 0x24, 0x60, 0x11, 0x82, 0x36, 0x02,
|
||||||
0x00, 0x06, 0x1f, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xec, 0x5d,
|
0x32, 0x8e, 0xde, 0x08, 0x58, 0x98, 0xa0, 0x2d, 0x03, 0xb0, 0xab, 0x49, 0x82, 0x06, 0x01, 0x4b, 0x21, 0x70, 0x14,
|
||||||
0xdb, 0x8e, 0xe4, 0x2a, 0x0c, 0x64, 0xa3, 0xf3, 0x10, 0x45, 0x49,
|
0x74, 0x15, 0x22, 0x4a, 0x09, 0x40, 0xc1, 0x53, 0xf7, 0xa1, 0xd1, 0x77, 0xbd, 0x10, 0x80, 0x4a, 0xde, 0x0a, 0x14,
|
||||||
0x2b, 0xe2, 0xff, 0xbf, 0x11, 0x45, 0x09, 0x42, 0x79, 0x9b, 0xf3,
|
0xe0, 0x84, 0x6a, 0x38, 0x5a, 0x11, 0xa0, 0x01, 0x7e, 0x8d, 0xbc, 0x7e, 0x63, 0x12, 0xa1, 0x42, 0x82, 0x16, 0x01,
|
||||||
0x34, 0xda, 0xde, 0x08, 0x70, 0xd9, 0x18, 0x42, 0x66, 0x1a, 0x69,
|
0x96, 0x41, 0xc4, 0x9a, 0x99, 0xbb, 0x39, 0x09, 0x5c, 0x02, 0x16, 0x66, 0xe4, 0x53, 0x51, 0x7f, 0x45, 0xe6, 0xd9,
|
||||||
0xb4, 0xdb, 0x37, 0x3a, 0x55, 0x2e, 0x97, 0x0d, 0xdd, 0x6a, 0xfe,
|
0x41, 0x22, 0x9c, 0xa6, 0x31, 0x72, 0x08, 0xa8, 0x01, 0x7e, 0x36, 0xc6, 0x78, 0x90, 0x08, 0x0e, 0x09, 0x4d, 0x08,
|
||||||
0x7c, 0x7d, 0x7d, 0x99, 0x86, 0x63, 0x01, 0x9f, 0x77, 0xb4, 0xba,
|
0x48, 0x81, 0x4f, 0x49, 0xfe, 0x0a, 0x3c, 0x36, 0x7c, 0x6b, 0x12, 0x50, 0x02, 0x16, 0x41, 0xe4, 0x63, 0x51, 0x9f,
|
||||||
0xa0, 0x3f, 0x95, 0x09, 0x58, 0x14, 0xe6, 0x38, 0x9e, 0x46, 0x00,
|
0x13, 0x24, 0x78, 0x06, 0x11, 0xaa, 0x24, 0x0c, 0xca, 0x2d, 0xae, 0x04, 0xfc, 0xf7, 0xed, 0xd8, 0xe3, 0xaf, 0x88,
|
||||||
0x02, 0xda, 0x26, 0xee, 0x77, 0xad, 0xc9, 0xd0, 0x24, 0x60, 0x11,
|
0x92, 0x2c, 0x68, 0xbe, 0xd0, 0x18, 0x04, 0xaf, 0xb1, 0x05, 0xe0, 0xdf, 0x81, 0x4e, 0x97, 0xbf, 0xeb, 0xe3, 0x73,
|
||||||
0x82, 0x36, 0x02, 0x32, 0x8e, 0xde, 0x08, 0x58, 0x98, 0xa0, 0x2d,
|
0xc6, 0x30, 0x45, 0x60, 0xb5, 0x08, 0x40, 0xc0, 0xbf, 0x12, 0xe0, 0xcd, 0x05, 0xf0, 0xf4, 0x36, 0xc7, 0x14, 0x51,
|
||||||
0x03, 0xb0, 0xab, 0x49, 0x82, 0x06, 0x01, 0x4b, 0x21, 0x70, 0x14,
|
0xc0, 0x95, 0x84, 0x95, 0x59, 0x82, 0x97, 0x52, 0x02, 0x16, 0x01, 0xf3, 0xaf, 0x4b, 0x34, 0xaf, 0x51, 0xbf, 0x02,
|
||||||
0x74, 0x15, 0x22, 0x4a, 0x09, 0x40, 0xc1, 0x53, 0xf7, 0xa1, 0xd1,
|
0x9e, 0x12, 0xff, 0xa7, 0x48, 0xb0, 0x77, 0x2a, 0x80, 0x92, 0x7e, 0xcc, 0xe5, 0x63, 0x20, 0x4d, 0x42, 0x01, 0x14,
|
||||||
0x77, 0xbd, 0x10, 0x80, 0x4a, 0xde, 0x0a, 0x14, 0xe0, 0x84, 0x6a,
|
0x09, 0xb9, 0xca, 0xc3, 0x52, 0xc1, 0x50, 0x18, 0x7d, 0x4b, 0x94, 0xba, 0x58, 0xbe, 0x5f, 0x41, 0x4f, 0x89, 0xdb,
|
||||||
0x38, 0x5a, 0x11, 0xa0, 0x01, 0x7e, 0x8d, 0xbc, 0x7e, 0x63, 0x12,
|
0x29, 0x12, 0x90, 0x54, 0x68, 0xe2, 0x01, 0xa9, 0x31, 0x67, 0x22, 0x9b, 0x03, 0x9e, 0x52, 0xcb, 0x75, 0x4e, 0x24,
|
||||||
0xa1, 0x42, 0x82, 0x16, 0x01, 0x96, 0x41, 0xc4, 0x9a, 0x99, 0xbb,
|
0x15, 0xac, 0x36, 0x01, 0x36, 0x23, 0xbb, 0xf7, 0xe8, 0xc7, 0x0c, 0xcf, 0x10, 0x60, 0x29, 0x52, 0x26, 0xa2, 0x3c,
|
||||||
0x39, 0x09, 0x5c, 0x02, 0x16, 0x66, 0xe4, 0x53, 0x51, 0x7f, 0x45,
|
0x16, 0xed, 0x56, 0x0d, 0xc2, 0xda, 0x9f, 0x32, 0x3e, 0x29, 0x78, 0x8e, 0xb2, 0xe6, 0x4c, 0x6f, 0xc0, 0xee, 0x0b,
|
||||||
0xe6, 0xd9, 0x41, 0x22, 0x9c, 0xa6, 0x31, 0x72, 0x08, 0xa8, 0x01,
|
0xb8, 0x29, 0x60, 0x41, 0xe3, 0x2b, 0x01, 0x3f, 0x31, 0x53, 0xa1, 0x48, 0x05, 0x03, 0x53, 0xfe, 0x68, 0xf4, 0x0d,
|
||||||
0x7e, 0x36, 0xc6, 0x78, 0x90, 0x08, 0x0e, 0x09, 0x4d, 0x08, 0x48,
|
0xe0, 0x03, 0xc6, 0x18, 0x33, 0x0a, 0x48, 0xa0, 0x54, 0x50, 0x6c, 0x82, 0x4b, 0x85, 0xe8, 0xe7, 0xc0, 0x8f, 0x09,
|
||||||
0x81, 0x4f, 0x49, 0xfe, 0x0a, 0x3c, 0x36, 0x7c, 0x6b, 0x12, 0x50,
|
0x22, 0x26, 0x66, 0xea, 0x89, 0xda, 0xe3, 0xd2, 0x2a, 0x50, 0x12, 0x7d, 0x54, 0x0d, 0x57, 0x52, 0x67, 0xe2, 0xfd,
|
||||||
0x02, 0x16, 0x41, 0xe4, 0x63, 0x51, 0x9f, 0x13, 0x24, 0x78, 0x06,
|
0x6e, 0x2f, 0x83, 0x14, 0xe8, 0x31, 0x03, 0x76, 0x14, 0x92, 0xb7, 0x12, 0x4b, 0x72, 0x31, 0x01, 0x16, 0x94, 0xff,
|
||||||
0x11, 0xaa, 0x24, 0x0c, 0xca, 0x2d, 0xae, 0x04, 0xfc, 0xf7, 0xed,
|
0x4c, 0xd4, 0x73, 0x24, 0xca, 0x1c, 0x52, 0xa5, 0x66, 0xb8, 0x68, 0x2a, 0xe0, 0x55, 0x49, 0x3d, 0x94, 0x0a, 0x28,
|
||||||
0xd8, 0xe3, 0xaf, 0x88, 0x92, 0x2c, 0x68, 0xbe, 0xd0, 0x18, 0x04,
|
0x33, 0x64, 0x99, 0xf8, 0x50, 0x58, 0xff, 0x73, 0xdd, 0x9b, 0x66, 0xf4, 0x29, 0xf0, 0xc8, 0xce, 0x14, 0x3b, 0x05,
|
||||||
0xaf, 0xb1, 0x05, 0xe0, 0xdf, 0x81, 0x4e, 0x97, 0xbf, 0xeb, 0xe3,
|
0x90, 0x09, 0x38, 0x46, 0x74, 0x2a, 0x7a, 0xca, 0xa4, 0xa5, 0x46, 0x4e, 0x1f, 0x60, 0x13, 0x52, 0x9b, 0x19, 0xe6,
|
||||||
0x73, 0xc6, 0x30, 0x45, 0x60, 0xb5, 0x08, 0x40, 0xc0, 0xbf, 0x12,
|
0x27, 0x4d, 0x83, 0x6a, 0x63, 0xa8, 0x94, 0xff, 0x1a, 0xf2, 0x47, 0x5f, 0xc3, 0xf5, 0x81, 0x25, 0x45, 0x00, 0x37,
|
||||||
0xe0, 0xcd, 0x05, 0xf0, 0xf4, 0x36, 0xc7, 0x14, 0x51, 0xc0, 0x95,
|
0xff, 0x6b, 0x44, 0x9e, 0xe3, 0x31, 0x2a, 0x3e, 0xc0, 0x55, 0xc0, 0x5a, 0xe0, 0x01, 0xb5, 0x87, 0xa8, 0x1c, 0x0e,
|
||||||
0x84, 0x95, 0x59, 0x82, 0x97, 0x52, 0x02, 0x16, 0x01, 0xf3, 0xaf,
|
0xcc, 0xfa, 0x2f, 0x6d, 0x7e, 0x6a, 0x37, 0x5b, 0x73, 0x4b, 0x0f, 0x78, 0x11, 0xf2, 0xd7, 0x24, 0x62, 0x14, 0x80,
|
||||||
0x4b, 0x34, 0xaf, 0x51, 0xbf, 0x02, 0x9e, 0x12, 0xff, 0xa7, 0x48,
|
0x5f, 0x6b, 0x11, 0xb0, 0x0a, 0xa2, 0x3f, 0x56, 0x8c, 0x3a, 0x55, 0x0e, 0x21, 0x15, 0x0f, 0x40, 0xfd, 0xb7, 0x8c,
|
||||||
0xb0, 0x77, 0x2a, 0x80, 0x92, 0x7e, 0xcc, 0xe5, 0x63, 0x20, 0x4d,
|
0x1e, 0x60, 0x32, 0x0f, 0x1b, 0x43, 0xa6, 0x02, 0x58, 0x81, 0xfc, 0x6b, 0x44, 0x7f, 0x04, 0xab, 0xc1, 0x2c, 0x49,
|
||||||
0x42, 0x01, 0x14, 0x09, 0xb9, 0xca, 0xc3, 0x52, 0xc1, 0x50, 0x18,
|
0x83, 0x5a, 0xab, 0xc1, 0xb1, 0x93, 0xf9, 0x48, 0x35, 0x7f, 0x13, 0x70, 0x30, 0xf3, 0x5f, 0xb2, 0x01, 0xd2, 0xaa,
|
||||||
0x7d, 0x4b, 0x94, 0xba, 0x58, 0xbe, 0x5f, 0x41, 0x4f, 0x89, 0xdb,
|
0x1a, 0xb0, 0x3e, 0x4a, 0x1b, 0x88, 0x26, 0xc8, 0x66, 0xea, 0xac, 0xd4, 0xf8, 0x90, 0xcf, 0x07, 0xa8, 0x79, 0xd5,
|
||||||
0x29, 0x12, 0x90, 0x54, 0x68, 0xe2, 0x01, 0xa9, 0x31, 0x67, 0x22,
|
0x48, 0xff, 0x8f, 0xb9, 0x10, 0x2a, 0xdd, 0xf5, 0xa9, 0x65, 0x98, 0xdf, 0x73, 0xf9, 0x8b, 0x6a, 0x37, 0x29, 0x01,
|
||||||
0x9b, 0x03, 0x9e, 0x52, 0xcb, 0x75, 0x4e, 0x24, 0x15, 0xac, 0x36,
|
0x5c, 0xf9, 0x6b, 0x01, 0xbd, 0x3e, 0x37, 0x44, 0x54, 0x70, 0xbe, 0x3d, 0x37, 0x64, 0x7a, 0x95, 0x5d, 0x62, 0x82,
|
||||||
0x01, 0x36, 0x23, 0xbb, 0xf7, 0xe8, 0xc7, 0x0c, 0xcf, 0x10, 0x60,
|
0xb6, 0x30, 0x7a, 0x31, 0xf9, 0x87, 0x4a, 0xb9, 0x1f, 0x12, 0xd7, 0x32, 0x97, 0x6c, 0x88, 0xe4, 0xf2, 0x7f, 0x06,
|
||||||
0x29, 0x52, 0x26, 0xa2, 0x3c, 0x16, 0xed, 0x56, 0x0d, 0xc2, 0xda,
|
0xca, 0x91, 0xb6, 0xd4, 0xa7, 0x0c, 0xc9, 0x31, 0x1f, 0x61, 0x77, 0x85, 0xdc, 0x32, 0x38, 0xdf, 0x98, 0xe7, 0xa5,
|
||||||
0x9f, 0x32, 0x3e, 0x29, 0x78, 0x8e, 0xb2, 0xe6, 0x4c, 0x6f, 0xc0,
|
0xf3, 0x5b, 0x0d, 0x02, 0x24, 0x0d, 0x4b, 0x0d, 0x90, 0xd4, 0x7b, 0xcd, 0xc0, 0xea, 0x70, 0x41, 0x5a, 0xe1, 0x95,
|
||||||
0xee, 0x0b, 0xb8, 0x29, 0x60, 0x41, 0xe3, 0x2b, 0x01, 0x3f, 0x31,
|
0xb8, 0xa0, 0x1e, 0x5b, 0xdf, 0x99, 0xc0, 0x64, 0xb9, 0x0a, 0x78, 0x01, 0x51, 0x19, 0xcd, 0x43, 0xc7, 0x60, 0xb0,
|
||||||
0x53, 0xa1, 0x48, 0x05, 0x03, 0x53, 0xfe, 0x68, 0xf4, 0x0d, 0xe0,
|
0x9d, 0xa0, 0xbb, 0x73, 0x1f, 0x35, 0xc3, 0x89, 0xb9, 0x8a, 0x25, 0x37, 0x44, 0x7a, 0x5a, 0xed, 0x55, 0xa9, 0x36,
|
||||||
0x03, 0xc6, 0x18, 0x33, 0x0a, 0x48, 0xa0, 0x54, 0x50, 0x6c, 0x82,
|
0x43, 0x06, 0xf4, 0x4a, 0xa8, 0x60, 0xea, 0x90, 0x24, 0xae, 0x11, 0x8a, 0xaa, 0x40, 0x4f, 0xf9, 0x3f, 0x82, 0xcd,
|
||||||
0x4b, 0x85, 0xe8, 0xe7, 0xc0, 0x8f, 0x09, 0x22, 0x26, 0x66, 0xea,
|
0x50, 0x76, 0x35, 0x78, 0x30, 0x0d, 0xb0, 0xf7, 0x31, 0x49, 0x53, 0x40, 0xcb, 0x00, 0xbb, 0x01, 0xa7, 0xd9, 0x08,
|
||||||
0x89, 0xda, 0xe3, 0xd2, 0x2a, 0x50, 0x12, 0x7d, 0x54, 0x0d, 0x57,
|
0x3d, 0x25, 0xff, 0xd9, 0xef, 0xcf, 0x59, 0x0c, 0x21, 0x1d, 0x59, 0xaf, 0x2a, 0x58, 0x35, 0x4c, 0x30, 0x74, 0x92,
|
||||||
0x52, 0x67, 0xe2, 0xfd, 0x6e, 0x2f, 0x83, 0x14, 0xe8, 0x31, 0x03,
|
0x06, 0xaa, 0xd7, 0x31, 0x34, 0xca, 0xbf, 0x3b, 0x15, 0xf0, 0xd2, 0x2e, 0x83, 0x3f, 0x6a, 0xfc, 0x74, 0x02, 0xe6,
|
||||||
0x76, 0x14, 0x92, 0xb7, 0x12, 0x4b, 0x72, 0x31, 0x01, 0x16, 0x94,
|
0xdf, 0x4e, 0xc0, 0xaf, 0x57, 0x80, 0xff, 0x28, 0x40, 0x91, 0x80, 0xa7, 0x96, 0xc1, 0xfd, 0xb7, 0x97, 0x41, 0x96,
|
||||||
0xff, 0x4c, 0xd4, 0x73, 0x24, 0xca, 0x1c, 0x52, 0xa5, 0x66, 0xb8,
|
0x02, 0x1c, 0x93, 0xf9, 0xf3, 0x01, 0x0a, 0x30, 0x26, 0xf3, 0x01, 0x09, 0xaa, 0x00, 0x0f, 0x5e, 0x44, 0x78, 0x58,
|
||||||
0x68, 0x2a, 0xe0, 0x55, 0x49, 0x3d, 0x94, 0x0a, 0x28, 0x33, 0x64,
|
0x7a, 0x40, 0x04, 0x78, 0xd3, 0xcf, 0x28, 0x21, 0xd8, 0xa5, 0x08, 0x58, 0xa4, 0x06, 0xd2, 0xe9, 0x08, 0xda, 0x0a,
|
||||||
0x99, 0xf8, 0x50, 0x58, 0xff, 0x73, 0xdd, 0x9b, 0x66, 0xf4, 0x29,
|
0xa0, 0xde, 0xe0, 0xbc, 0x11, 0xec, 0x99, 0xb8, 0x26, 0x8f, 0xaa, 0x60, 0xc8, 0x3c, 0xb8, 0x3d, 0xd4, 0x07, 0xde,
|
||||||
0xf0, 0xc8, 0xce, 0x14, 0x3b, 0x05, 0x90, 0x09, 0x38, 0x46, 0x74,
|
0xaf, 0x77, 0x97, 0x2a, 0xc0, 0x75, 0x08, 0x2e, 0xd4, 0xf0, 0x07, 0x6a, 0x4f, 0x50, 0x6a, 0x84, 0xa1, 0x01, 0xf8,
|
||||||
0x2a, 0x7a, 0xca, 0xa4, 0xa5, 0x46, 0x4e, 0x1f, 0x60, 0x13, 0x52,
|
0x98, 0xfc, 0x03, 0xa7, 0x04, 0xa2, 0x1e, 0xb0, 0x77, 0xee, 0x03, 0xea, 0xad, 0xb0, 0x23, 0xd8, 0x0b, 0x1d, 0xe6,
|
||||||
0x9b, 0x19, 0xe6, 0x27, 0x4d, 0x83, 0x6a, 0x63, 0xa8, 0x94, 0xff,
|
0x3b, 0xa5, 0xd6, 0xe4, 0x0f, 0x2d, 0x68, 0x2e, 0x86, 0xce, 0x4a, 0x69, 0x10, 0x04, 0xef, 0x85, 0x18, 0xe0, 0x21,
|
||||||
0x1a, 0xf2, 0x47, 0x5f, 0xc3, 0xf5, 0x81, 0x25, 0x45, 0x00, 0x37,
|
0x21, 0xe0, 0x6e, 0x2f, 0x28, 0x99, 0xdf, 0x71, 0x3d, 0xc0, 0x5d, 0x7c, 0x20, 0x55, 0x06, 0x43, 0x45, 0x12, 0x50,
|
||||||
0xff, 0x6b, 0x44, 0x9e, 0xe3, 0x31, 0x2a, 0x3e, 0xc0, 0x55, 0xc0,
|
0xf3, 0xfb, 0xbe, 0xed, 0x39, 0x06, 0xc8, 0x5d, 0x0c, 0x21, 0xa0, 0xce, 0x86, 0xab, 0xc8, 0x09, 0x6c, 0x82, 0xb2,
|
||||||
0x5a, 0xe0, 0x01, 0xb5, 0x87, 0xa8, 0x1c, 0x0e, 0xcc, 0xfa, 0x2f,
|
0x98, 0x90, 0x6f, 0x89, 0x6d, 0xe6, 0xdf, 0x7d, 0x75, 0x6f, 0xfe, 0xee, 0xb5, 0x05, 0x00, 0x60, 0x60, 0x10, 0x12,
|
||||||
0x6d, 0x7e, 0x6a, 0x37, 0x5b, 0x73, 0x4b, 0x0f, 0x78, 0x11, 0xf2,
|
0x18, 0x3e, 0x13, 0x34, 0x5a, 0x78, 0x6e, 0x23, 0xe4, 0x15, 0x65, 0x1e, 0xde, 0xfe, 0x34, 0xbc, 0x80, 0x2d, 0xff,
|
||||||
0xd7, 0x24, 0x62, 0x14, 0x80, 0x5f, 0x6b, 0x11, 0xb0, 0x0a, 0xa2,
|
0x77, 0x02, 0x0e, 0xd0, 0x07, 0xa4, 0x69, 0x10, 0x03, 0x4e, 0xdd, 0x87, 0x44, 0xbf, 0x98, 0x3c, 0xea, 0xab, 0xb2,
|
||||||
0x3f, 0x56, 0x8c, 0x3a, 0x55, 0x0e, 0x21, 0x15, 0x0f, 0x40, 0xfd,
|
0xc8, 0xba, 0x40, 0xed, 0x62, 0x14, 0x8c, 0x32, 0x55, 0xfe, 0x9c, 0xe6, 0x6a, 0x50, 0xd2, 0x13, 0xdc, 0x35, 0x1f,
|
||||||
0xb7, 0x8c, 0x1e, 0x60, 0x32, 0x0f, 0x1b, 0x43, 0xa6, 0x02, 0x58,
|
0xf9, 0xeb, 0x73, 0xb9, 0x14, 0x70, 0x09, 0x73, 0xf1, 0x60, 0xee, 0x9f, 0x95, 0xc0, 0x87, 0x44, 0xe4, 0x3d, 0x37,
|
||||||
0x81, 0xfc, 0x6b, 0x44, 0x7f, 0x04, 0xab, 0xc1, 0x2c, 0x49, 0x83,
|
0xff, 0x91, 0x56, 0x98, 0x6b, 0x88, 0x3d, 0xb6, 0xc6, 0x6a, 0x1b, 0x22, 0x9b, 0x52, 0x5f, 0xa0, 0xd9, 0xf9, 0x85,
|
||||||
0x5a, 0xab, 0xc1, 0xb1, 0x93, 0xf9, 0x48, 0x35, 0x7f, 0x13, 0x70,
|
0x4c, 0xf9, 0x73, 0x89, 0x7f, 0x8b, 0x3d, 0x80, 0x4a, 0x83, 0xd0, 0x20, 0xf7, 0x43, 0x46, 0x89, 0x9b, 0x86, 0x02,
|
||||||
0x30, 0xf3, 0x5f, 0xb2, 0x01, 0xd2, 0xaa, 0x1a, 0xb0, 0x3e, 0x4a,
|
0x20, 0xf6, 0x6e, 0x96, 0x7f, 0x28, 0x58, 0xa3, 0x88, 0x15, 0xb0, 0x15, 0x2e, 0x8e, 0x6a, 0x0e, 0xce, 0x06, 0xee,
|
||||||
0x1b, 0x88, 0x26, 0xc8, 0x66, 0xea, 0xac, 0xd4, 0xf8, 0x90, 0xcf,
|
0x11, 0x23, 0x80, 0xfb, 0x8b, 0xac, 0xad, 0xab, 0x41, 0x60, 0x44, 0x1e, 0x56, 0xee, 0x50, 0x89, 0x6d, 0x8d, 0x1d,
|
||||||
0x07, 0xa8, 0x79, 0xd5, 0x48, 0xff, 0x8f, 0xb9, 0x10, 0x2a, 0xdd,
|
0xa3, 0x53, 0x10, 0x88, 0x0d, 0xe8, 0x07, 0x0e, 0x2e, 0x01, 0x57, 0x36, 0xb7, 0x06, 0x4a, 0x68, 0xb6, 0xc5, 0x86,
|
||||||
0xf5, 0xa9, 0x65, 0x98, 0xdf, 0x73, 0xf9, 0x8b, 0x6a, 0x37, 0x29,
|
0xee, 0x07, 0x68, 0x6c, 0x90, 0x8c, 0x0a, 0xf2, 0x47, 0xca, 0x5f, 0x11, 0x01, 0x87, 0x62, 0x8e, 0xd6, 0xd8, 0x38,
|
||||||
0x01, 0x5c, 0xf9, 0x6b, 0x01, 0xbd, 0x3e, 0x37, 0x44, 0x54, 0x70,
|
0x55, 0xcd, 0xff, 0xd2, 0xb5, 0x40, 0xad, 0x8f, 0xcd, 0x4e, 0x46, 0xf4, 0xb9, 0xf9, 0xcf, 0x26, 0xc0, 0x01, 0x3e,
|
||||||
0xbe, 0x3d, 0x37, 0x64, 0x7a, 0x95, 0x5d, 0x62, 0x82, 0xb6, 0x30,
|
0xf0, 0xde, 0x87, 0x53, 0x52, 0x3d, 0x2b, 0x44, 0x5f, 0x54, 0xfe, 0x6a, 0xaf, 0x06, 0x29, 0x33, 0x3c, 0x85, 0xd1,
|
||||||
0x7a, 0x31, 0xf9, 0x87, 0x4a, 0xb9, 0x1f, 0x12, 0xd7, 0x32, 0x97,
|
0xa7, 0xfa, 0x13, 0x96, 0xfc, 0x35, 0x08, 0xd8, 0x81, 0x9c, 0x0c, 0x42, 0xe9, 0xa7, 0xfc, 0xc5, 0x6b, 0x36, 0x61,
|
||||||
0x6c, 0x88, 0xe4, 0xf2, 0x7f, 0x06, 0xca, 0x91, 0xb6, 0xd4, 0xa7,
|
0x03, 0x22, 0x13, 0x30, 0x0d, 0xb8, 0x1b, 0x24, 0x27, 0xa1, 0x88, 0x20, 0xf4, 0x21, 0x87, 0xe6, 0x3f, 0xb7, 0x0f,
|
||||||
0x0c, 0xc9, 0x31, 0x1f, 0x61, 0x77, 0x85, 0xdc, 0x32, 0x38, 0xdf,
|
0xa8, 0xa1, 0x02, 0x64, 0xb1, 0x43, 0x75, 0x80, 0x1b, 0x57, 0xf6, 0x25, 0x29, 0x50, 0xa2, 0x82, 0x20, 0xf0, 0x8f,
|
||||||
0x98, 0xe7, 0xa5, 0xf3, 0x5b, 0x0d, 0x02, 0x24, 0x0d, 0x4b, 0x0d,
|
0xeb, 0x3c, 0x52, 0xf3, 0x4b, 0x2a, 0x7b, 0xe0, 0x3c, 0x99, 0xa9, 0x82, 0x12, 0x12, 0x72, 0x4d, 0x97, 0x07, 0xcd,
|
||||||
0x90, 0xd4, 0x7b, 0xcd, 0xc0, 0xea, 0x70, 0x41, 0x5a, 0xe1, 0x95,
|
0x4f, 0xb5, 0x0f, 0x70, 0x80, 0x0a, 0xf6, 0xc8, 0x45, 0x72, 0x48, 0x08, 0x0c, 0xe9, 0xab, 0x44, 0xbf, 0x56, 0x19,
|
||||||
0xb8, 0xa0, 0x1e, 0x5b, 0xdf, 0x99, 0xc0, 0x64, 0xb9, 0x0a, 0x78,
|
0x44, 0xbe, 0x49, 0x12, 0x08, 0x52, 0x10, 0xe9, 0xe7, 0x72, 0x5f, 0xa5, 0x0c, 0x1e, 0xc0, 0xa4, 0x31, 0x15, 0xa4,
|
||||||
0x01, 0x51, 0x19, 0xcd, 0x43, 0xc7, 0x60, 0xb0, 0x9d, 0xa0, 0xbb,
|
0x1a, 0x24, 0xe4, 0xf3, 0x80, 0x90, 0x01, 0x4f, 0x75, 0x7d, 0x4d, 0x4c, 0x30, 0x97, 0x12, 0x1b, 0x51, 0x0d, 0x42,
|
||||||
0x73, 0x1f, 0x35, 0xc3, 0x89, 0xb9, 0x8a, 0x25, 0x37, 0x44, 0x7a,
|
0x02, 0x74, 0xce, 0xfc, 0x3c, 0x21, 0x7d, 0x24, 0xf7, 0x8f, 0x12, 0x02, 0x0e, 0x01, 0xcb, 0xfb, 0x45, 0x01, 0xa9,
|
||||||
0x5a, 0xed, 0x55, 0xa9, 0x36, 0x43, 0x06, 0xf4, 0x4a, 0xa8, 0x60,
|
0x56, 0x39, 0x24, 0xa2, 0x4e, 0x81, 0x2f, 0x2a, 0x7b, 0x9a, 0x1e, 0xe0, 0x88, 0x54, 0xd8, 0x13, 0x40, 0x02, 0x60,
|
||||||
0xea, 0x90, 0x24, 0xae, 0x11, 0x8a, 0xaa, 0x40, 0x4f, 0xf9, 0x3f,
|
0x8e, 0x14, 0x78, 0xb4, 0xf1, 0x39, 0x6a, 0x10, 0xe0, 0x18, 0xa9, 0x10, 0x23, 0x21, 0xe6, 0x0b, 0x21, 0xf2, 0xb8,
|
||||||
0x82, 0xcd, 0x50, 0x76, 0x35, 0x78, 0x30, 0x0d, 0xb0, 0xf7, 0x31,
|
0x07, 0xbb, 0xbd, 0xea, 0x0a, 0x38, 0x0a, 0xfd, 0x60, 0x8f, 0xf8, 0x42, 0xec, 0x50, 0x15, 0x4f, 0x94, 0xbb, 0x0d,
|
||||||
0x49, 0x53, 0x40, 0xcb, 0x00, 0xbb, 0x01, 0xa7, 0xd9, 0x08, 0x3d,
|
0x0c, 0x00, 0x6b, 0x7c, 0x8e, 0xd9, 0xf9, 0x1c, 0xb4, 0xf4, 0x39, 0x6a, 0xeb, 0x73, 0xd8, 0x9a, 0x06, 0x01, 0x08,
|
||||||
0x25, 0xff, 0xd9, 0xef, 0xcf, 0x59, 0x0c, 0x21, 0x1d, 0x59, 0xaf,
|
0xf0, 0x1f, 0x73, 0xdc, 0x9e, 0x16, 0x09, 0xe8, 0xfe, 0x43, 0x77, 0x07, 0x2e, 0x72, 0x3d, 0x01, 0xb9, 0xef, 0x71,
|
||||||
0x2a, 0x58, 0x35, 0x4c, 0x30, 0x74, 0x92, 0x06, 0xaa, 0xd7, 0x31,
|
0x47, 0x6e, 0x4a, 0x48, 0x40, 0x15, 0xc0, 0x5d, 0xe1, 0xdd, 0x4e, 0x00, 0x27, 0x25, 0x72, 0xf7, 0x3f, 0xf6, 0xd8,
|
||||||
0x34, 0xca, 0xbf, 0x3b, 0x15, 0xf0, 0xd2, 0x2e, 0x83, 0x3f, 0x6a,
|
0x5d, 0x8a, 0x04, 0x6e, 0xf4, 0x91, 0xce, 0xae, 0xbb, 0x83, 0x97, 0x39, 0x44, 0xe4, 0xc8, 0x78, 0xf4, 0xd1, 0xdb,
|
||||||
0xfc, 0x74, 0x02, 0xe6, 0xdf, 0x4e, 0xc0, 0xaf, 0x57, 0x80, 0xff,
|
0x52, 0x32, 0x4c, 0x6b, 0xd0, 0x2d, 0x09, 0x90, 0x12, 0x72, 0xb4, 0xba, 0xa0, 0xff, 0x07, 0x00, 0x48, 0x04, 0x71,
|
||||||
0x28, 0x40, 0x91, 0x80, 0xa7, 0x96, 0xc1, 0xfd, 0xb7, 0x97, 0x41,
|
0x83, 0x9e, 0xcc, 0x51, 0xce, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82};
|
||||||
0x96, 0x02, 0x1c, 0x93, 0xf9, 0xf3, 0x01, 0x0a, 0x30, 0x26, 0xf3,
|
|
||||||
0x01, 0x09, 0xaa, 0x00, 0x0f, 0x5e, 0x44, 0x78, 0x58, 0x7a, 0x40,
|
|
||||||
0x04, 0x78, 0xd3, 0xcf, 0x28, 0x21, 0xd8, 0xa5, 0x08, 0x58, 0xa4,
|
|
||||||
0x06, 0xd2, 0xe9, 0x08, 0xda, 0x0a, 0xa0, 0xde, 0xe0, 0xbc, 0x11,
|
|
||||||
0xec, 0x99, 0xb8, 0x26, 0x8f, 0xaa, 0x60, 0xc8, 0x3c, 0xb8, 0x3d,
|
|
||||||
0xd4, 0x07, 0xde, 0xaf, 0x77, 0x97, 0x2a, 0xc0, 0x75, 0x08, 0x2e,
|
|
||||||
0xd4, 0xf0, 0x07, 0x6a, 0x4f, 0x50, 0x6a, 0x84, 0xa1, 0x01, 0xf8,
|
|
||||||
0x98, 0xfc, 0x03, 0xa7, 0x04, 0xa2, 0x1e, 0xb0, 0x77, 0xee, 0x03,
|
|
||||||
0xea, 0xad, 0xb0, 0x23, 0xd8, 0x0b, 0x1d, 0xe6, 0x3b, 0xa5, 0xd6,
|
|
||||||
0xe4, 0x0f, 0x2d, 0x68, 0x2e, 0x86, 0xce, 0x4a, 0x69, 0x10, 0x04,
|
|
||||||
0xef, 0x85, 0x18, 0xe0, 0x21, 0x21, 0xe0, 0x6e, 0x2f, 0x28, 0x99,
|
|
||||||
0xdf, 0x71, 0x3d, 0xc0, 0x5d, 0x7c, 0x20, 0x55, 0x06, 0x43, 0x45,
|
|
||||||
0x12, 0x50, 0xf3, 0xfb, 0xbe, 0xed, 0x39, 0x06, 0xc8, 0x5d, 0x0c,
|
|
||||||
0x21, 0xa0, 0xce, 0x86, 0xab, 0xc8, 0x09, 0x6c, 0x82, 0xb2, 0x98,
|
|
||||||
0x90, 0x6f, 0x89, 0x6d, 0xe6, 0xdf, 0x7d, 0x75, 0x6f, 0xfe, 0xee,
|
|
||||||
0xb5, 0x05, 0x00, 0x60, 0x60, 0x10, 0x12, 0x18, 0x3e, 0x13, 0x34,
|
|
||||||
0x5a, 0x78, 0x6e, 0x23, 0xe4, 0x15, 0x65, 0x1e, 0xde, 0xfe, 0x34,
|
|
||||||
0xbc, 0x80, 0x2d, 0xff, 0x77, 0x02, 0x0e, 0xd0, 0x07, 0xa4, 0x69,
|
|
||||||
0x10, 0x03, 0x4e, 0xdd, 0x87, 0x44, 0xbf, 0x98, 0x3c, 0xea, 0xab,
|
|
||||||
0xb2, 0xc8, 0xba, 0x40, 0xed, 0x62, 0x14, 0x8c, 0x32, 0x55, 0xfe,
|
|
||||||
0x9c, 0xe6, 0x6a, 0x50, 0xd2, 0x13, 0xdc, 0x35, 0x1f, 0xf9, 0xeb,
|
|
||||||
0x73, 0xb9, 0x14, 0x70, 0x09, 0x73, 0xf1, 0x60, 0xee, 0x9f, 0x95,
|
|
||||||
0xc0, 0x87, 0x44, 0xe4, 0x3d, 0x37, 0xff, 0x91, 0x56, 0x98, 0x6b,
|
|
||||||
0x88, 0x3d, 0xb6, 0xc6, 0x6a, 0x1b, 0x22, 0x9b, 0x52, 0x5f, 0xa0,
|
|
||||||
0xd9, 0xf9, 0x85, 0x4c, 0xf9, 0x73, 0x89, 0x7f, 0x8b, 0x3d, 0x80,
|
|
||||||
0x4a, 0x83, 0xd0, 0x20, 0xf7, 0x43, 0x46, 0x89, 0x9b, 0x86, 0x02,
|
|
||||||
0x20, 0xf6, 0x6e, 0x96, 0x7f, 0x28, 0x58, 0xa3, 0x88, 0x15, 0xb0,
|
|
||||||
0x15, 0x2e, 0x8e, 0x6a, 0x0e, 0xce, 0x06, 0xee, 0x11, 0x23, 0x80,
|
|
||||||
0xfb, 0x8b, 0xac, 0xad, 0xab, 0x41, 0x60, 0x44, 0x1e, 0x56, 0xee,
|
|
||||||
0x50, 0x89, 0x6d, 0x8d, 0x1d, 0xa3, 0x53, 0x10, 0x88, 0x0d, 0xe8,
|
|
||||||
0x07, 0x0e, 0x2e, 0x01, 0x57, 0x36, 0xb7, 0x06, 0x4a, 0x68, 0xb6,
|
|
||||||
0xc5, 0x86, 0xee, 0x07, 0x68, 0x6c, 0x90, 0x8c, 0x0a, 0xf2, 0x47,
|
|
||||||
0xca, 0x5f, 0x11, 0x01, 0x87, 0x62, 0x8e, 0xd6, 0xd8, 0x38, 0x55,
|
|
||||||
0xcd, 0xff, 0xd2, 0xb5, 0x40, 0xad, 0x8f, 0xcd, 0x4e, 0x46, 0xf4,
|
|
||||||
0xb9, 0xf9, 0xcf, 0x26, 0xc0, 0x01, 0x3e, 0xf0, 0xde, 0x87, 0x53,
|
|
||||||
0x52, 0x3d, 0x2b, 0x44, 0x5f, 0x54, 0xfe, 0x6a, 0xaf, 0x06, 0x29,
|
|
||||||
0x33, 0x3c, 0x85, 0xd1, 0xa7, 0xfa, 0x13, 0x96, 0xfc, 0x35, 0x08,
|
|
||||||
0xd8, 0x81, 0x9c, 0x0c, 0x42, 0xe9, 0xa7, 0xfc, 0xc5, 0x6b, 0x36,
|
|
||||||
0x61, 0x03, 0x22, 0x13, 0x30, 0x0d, 0xb8, 0x1b, 0x24, 0x27, 0xa1,
|
|
||||||
0x88, 0x20, 0xf4, 0x21, 0x87, 0xe6, 0x3f, 0xb7, 0x0f, 0xa8, 0xa1,
|
|
||||||
0x02, 0x64, 0xb1, 0x43, 0x75, 0x80, 0x1b, 0x57, 0xf6, 0x25, 0x29,
|
|
||||||
0x50, 0xa2, 0x82, 0x20, 0xf0, 0x8f, 0xeb, 0x3c, 0x52, 0xf3, 0x4b,
|
|
||||||
0x2a, 0x7b, 0xe0, 0x3c, 0x99, 0xa9, 0x82, 0x12, 0x12, 0x72, 0x4d,
|
|
||||||
0x97, 0x07, 0xcd, 0x4f, 0xb5, 0x0f, 0x70, 0x80, 0x0a, 0xf6, 0xc8,
|
|
||||||
0x45, 0x72, 0x48, 0x08, 0x0c, 0xe9, 0xab, 0x44, 0xbf, 0x56, 0x19,
|
|
||||||
0x44, 0xbe, 0x49, 0x12, 0x08, 0x52, 0x10, 0xe9, 0xe7, 0x72, 0x5f,
|
|
||||||
0xa5, 0x0c, 0x1e, 0xc0, 0xa4, 0x31, 0x15, 0xa4, 0x1a, 0x24, 0xe4,
|
|
||||||
0xf3, 0x80, 0x90, 0x01, 0x4f, 0x75, 0x7d, 0x4d, 0x4c, 0x30, 0x97,
|
|
||||||
0x12, 0x1b, 0x51, 0x0d, 0x42, 0x02, 0x74, 0xce, 0xfc, 0x3c, 0x21,
|
|
||||||
0x7d, 0x24, 0xf7, 0x8f, 0x12, 0x02, 0x0e, 0x01, 0xcb, 0xfb, 0x45,
|
|
||||||
0x01, 0xa9, 0x56, 0x39, 0x24, 0xa2, 0x4e, 0x81, 0x2f, 0x2a, 0x7b,
|
|
||||||
0x9a, 0x1e, 0xe0, 0x88, 0x54, 0xd8, 0x13, 0x40, 0x02, 0x60, 0x8e,
|
|
||||||
0x14, 0x78, 0xb4, 0xf1, 0x39, 0x6a, 0x10, 0xe0, 0x18, 0xa9, 0x10,
|
|
||||||
0x23, 0x21, 0xe6, 0x0b, 0x21, 0xf2, 0xb8, 0x07, 0xbb, 0xbd, 0xea,
|
|
||||||
0x0a, 0x38, 0x0a, 0xfd, 0x60, 0x8f, 0xf8, 0x42, 0xec, 0x50, 0x15,
|
|
||||||
0x4f, 0x94, 0xbb, 0x0d, 0x0c, 0x00, 0x6b, 0x7c, 0x8e, 0xd9, 0xf9,
|
|
||||||
0x1c, 0xb4, 0xf4, 0x39, 0x6a, 0xeb, 0x73, 0xd8, 0x9a, 0x06, 0x01,
|
|
||||||
0x08, 0xf0, 0x1f, 0x73, 0xdc, 0x9e, 0x16, 0x09, 0xe8, 0xfe, 0x43,
|
|
||||||
0x77, 0x07, 0x2e, 0x72, 0x3d, 0x01, 0xb9, 0xef, 0x71, 0x47, 0x6e,
|
|
||||||
0x4a, 0x48, 0x40, 0x15, 0xc0, 0x5d, 0xe1, 0xdd, 0x4e, 0x00, 0x27,
|
|
||||||
0x25, 0x72, 0xf7, 0x3f, 0xf6, 0xd8, 0x5d, 0x8a, 0x04, 0x6e, 0xf4,
|
|
||||||
0x91, 0xce, 0xae, 0xbb, 0x83, 0x97, 0x39, 0x44, 0xe4, 0xc8, 0x78,
|
|
||||||
0xf4, 0xd1, 0xdb, 0x52, 0x32, 0x4c, 0x6b, 0xd0, 0x2d, 0x09, 0x90,
|
|
||||||
0x12, 0x72, 0xb4, 0xba, 0xa0, 0xff, 0x07, 0x00, 0x48, 0x04, 0x71,
|
|
||||||
0x83, 0x9e, 0xcc, 0x51, 0xce, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
|
|
||||||
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
|
|
||||||
};
|
|
||||||
|
|
||||||
Neon::Neon()
|
Neon::Neon()
|
||||||
{
|
{
|
||||||
Events::processScriptsEvent += [this]
|
Events::processScriptsEvent += [this] {
|
||||||
{
|
|
||||||
if (!m_pNeonTexture)
|
if (!m_pNeonTexture)
|
||||||
{
|
{
|
||||||
m_pNeonTexture = Util::LoadTextureFromMemory((char *)neon_mask, sizeof(neon_mask));
|
m_pNeonTexture = Util::LoadTextureFromMemory((char *)neon_mask, sizeof(neon_mask));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Events::vehicleRenderEvent += [](CVehicle* pVeh)
|
Events::vehicleRenderEvent += [](CVehicle *pVeh) {
|
||||||
{
|
|
||||||
NeonData *data = &m_VehNeon.Get(pVeh);
|
NeonData *data = &m_VehNeon.Get(pVeh);
|
||||||
if (data->m_bNeonInstalled && !pVeh->IsUpsideDown())
|
if (data->m_bNeonInstalled && !pVeh->IsUpsideDown())
|
||||||
{
|
{
|
||||||
@ -180,8 +111,9 @@ Neon::Neon()
|
|||||||
CVector center = pVeh->TransformFromObjectSpace(CVector(0.0f, 0.0f, 0.0f));
|
CVector center = pVeh->TransformFromObjectSpace(CVector(0.0f, 0.0f, 0.0f));
|
||||||
CVector up = pVeh->TransformFromObjectSpace(CVector(0.0f, -Pos.y - data->m_fVal, 0.0f)) - center;
|
CVector up = pVeh->TransformFromObjectSpace(CVector(0.0f, -Pos.y - data->m_fVal, 0.0f)) - center;
|
||||||
CVector right = pVeh->TransformFromObjectSpace(CVector(Pos.x + data->m_fVal, 0.0f, 0.0f)) - center;
|
CVector right = pVeh->TransformFromObjectSpace(CVector(Pos.x + data->m_fVal, 0.0f, 0.0f)) - center;
|
||||||
CShadows::StoreShadowToBeRendered(5, m_pNeonTexture, ¢er, up.x, up.y, right.x, right.y, 180, data->m_Color.r,
|
CShadows::StoreShadowToBeRendered(5, m_pNeonTexture, ¢er, up.x, up.y, right.x, right.y, 180,
|
||||||
data->m_Color.g, data->m_Color.b, 2.0f, false, 1.0f, 0, true);
|
data->m_Color.r, data->m_Color.g, data->m_Color.b, 2.0f, false, 1.0f, 0,
|
||||||
|
true);
|
||||||
|
|
||||||
if (data->m_bPulsing)
|
if (data->m_bPulsing)
|
||||||
{
|
{
|
||||||
@ -250,5 +182,3 @@ void Neon::RemoveNeon(CVehicle* pVeh)
|
|||||||
{
|
{
|
||||||
m_VehNeon.Get(pVeh).m_bNeonInstalled = false;
|
m_VehNeon.Get(pVeh).m_bNeonInstalled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,20 +22,18 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
#include "paint.h"
|
#include "paint.h"
|
||||||
#include "NodeName.h"
|
#include "NodeName.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
Paint::Paint()
|
Paint::Paint()
|
||||||
{
|
{
|
||||||
Events::vehicleRenderEvent.before += [](CVehicle* pVeh)
|
Events::vehicleRenderEvent.before += [](CVehicle *pVeh) {
|
||||||
{
|
|
||||||
VehData &data = m_VehData.Get(pVeh);
|
VehData &data = m_VehData.Get(pVeh);
|
||||||
|
|
||||||
// reset custom color if color id changed
|
// reset custom color if color id changed
|
||||||
if (pVeh->m_nPrimaryColor != data.primary_color
|
if (pVeh->m_nPrimaryColor != data.primary_color || pVeh->m_nSecondaryColor != data.secondary_color)
|
||||||
|| pVeh->m_nSecondaryColor != data.secondary_color)
|
|
||||||
{
|
{
|
||||||
for (auto &it : data.materialProperties)
|
for (auto &it : data.materialProperties)
|
||||||
data.resetMaterialColor(it.first);
|
data.resetMaterialColor(it.first);
|
||||||
@ -69,9 +67,9 @@ Paint::Paint()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ThiscallEvent<AddressList<0x55332A, H_CALL>, PRIORITY_BEFORE, ArgPickN<CVehicle*, 0>, void(CVehicle*)> vehicleResetAfterRender;
|
ThiscallEvent<AddressList<0x55332A, H_CALL>, PRIORITY_BEFORE, ArgPickN<CVehicle *, 0>, void(CVehicle *)>
|
||||||
vehicleResetAfterRender += [](CVehicle* pVeh)
|
vehicleResetAfterRender;
|
||||||
{
|
vehicleResetAfterRender += [](CVehicle *pVeh) {
|
||||||
for (auto &it : m_VehData.Get(pVeh).materialProperties)
|
for (auto &it : m_VehData.Get(pVeh).materialProperties)
|
||||||
{
|
{
|
||||||
if (it.second._recolor)
|
if (it.second._recolor)
|
||||||
@ -91,9 +89,8 @@ void Paint::VehData::setMaterialColor(RpMaterial* material, RpGeometry* geometry
|
|||||||
{
|
{
|
||||||
auto &matProps = materialProperties[material];
|
auto &matProps = materialProperties[material];
|
||||||
|
|
||||||
if (!filter_mat
|
if (!filter_mat || (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00) ||
|
||||||
|| (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00)
|
(material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF))
|
||||||
|| (material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF))
|
|
||||||
{
|
{
|
||||||
matProps._recolor = true;
|
matProps._recolor = true;
|
||||||
matProps._color = color;
|
matProps._color = color;
|
||||||
@ -105,9 +102,8 @@ void Paint::VehData::setMaterialTexture(RpMaterial* material, RwTexture* texture
|
|||||||
{
|
{
|
||||||
auto &matProps = materialProperties[material];
|
auto &matProps = materialProperties[material];
|
||||||
|
|
||||||
if (!filter_mat
|
if (!filter_mat || (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00) ||
|
||||||
|| (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00)
|
(material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF))
|
||||||
|| (material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF))
|
|
||||||
{
|
{
|
||||||
matProps._retexture = true;
|
matProps._retexture = true;
|
||||||
matProps._texture = texture;
|
matProps._texture = texture;
|
||||||
@ -146,8 +142,7 @@ void Paint::UpdateNodeListRecursive(CVehicle* pVeh)
|
|||||||
{
|
{
|
||||||
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
||||||
|
|
||||||
NodeWrapperRecursive(frame, pVeh, [](RwFrame* frame)
|
NodeWrapperRecursive(frame, pVeh, [](RwFrame *frame) {
|
||||||
{
|
|
||||||
const std::string name = GetFrameNodeName(frame);
|
const std::string name = GetFrameNodeName(frame);
|
||||||
|
|
||||||
if (!(std::find(veh_nodes::names_vec.begin(), veh_nodes::names_vec.end(), name) != veh_nodes::names_vec.end()))
|
if (!(std::find(veh_nodes::names_vec.begin(), veh_nodes::names_vec.end(), name) != veh_nodes::names_vec.end()))
|
||||||
@ -159,8 +154,7 @@ void Paint::SetNodeColor(CVehicle* pVeh, std::string node_name, CRGBA color, boo
|
|||||||
{
|
{
|
||||||
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
||||||
|
|
||||||
NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
|
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) {
|
||||||
{
|
|
||||||
const std::string name = GetFrameNodeName(frame);
|
const std::string name = GetFrameNodeName(frame);
|
||||||
|
|
||||||
struct ST
|
struct ST
|
||||||
@ -174,8 +168,9 @@ void Paint::SetNodeColor(CVehicle* pVeh, std::string node_name, CRGBA color, boo
|
|||||||
|
|
||||||
if (node_name == "Default" || node_name == name)
|
if (node_name == "Default" || node_name == name)
|
||||||
{
|
{
|
||||||
RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
|
RwFrameForAllObjects(
|
||||||
{
|
frame,
|
||||||
|
[](RwObject *object, void *data) -> RwObject * {
|
||||||
if (object->type == rpATOMIC)
|
if (object->type == rpATOMIC)
|
||||||
{
|
{
|
||||||
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
||||||
@ -191,7 +186,8 @@ void Paint::SetNodeColor(CVehicle* pVeh, std::string node_name, CRGBA color, boo
|
|||||||
{color->r, color->g, color->b, 255}, filter_mat);
|
{color->r, color->g, color->b, 255}, filter_mat);
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}, &st);
|
},
|
||||||
|
&st);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -210,8 +206,7 @@ void Paint::SetNodeTexture(CVehicle* pVeh, std::string node_name, std::string te
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
|
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) {
|
||||||
{
|
|
||||||
const std::string name = GetFrameNodeName(frame);
|
const std::string name = GetFrameNodeName(frame);
|
||||||
|
|
||||||
struct ST
|
struct ST
|
||||||
@ -225,8 +220,9 @@ void Paint::SetNodeTexture(CVehicle* pVeh, std::string node_name, std::string te
|
|||||||
|
|
||||||
if (node_name == "Default" || node_name == name)
|
if (node_name == "Default" || node_name == name)
|
||||||
{
|
{
|
||||||
RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
|
RwFrameForAllObjects(
|
||||||
{
|
frame,
|
||||||
|
[](RwObject *object, void *data) -> RwObject * {
|
||||||
if (object->type == rpATOMIC)
|
if (object->type == rpATOMIC)
|
||||||
{
|
{
|
||||||
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
||||||
@ -236,12 +232,12 @@ void Paint::SetNodeTexture(CVehicle* pVeh, std::string node_name, std::string te
|
|||||||
|
|
||||||
for (int i = 0; i < atomic->geometry->matList.numMaterials; ++i)
|
for (int i = 0; i < atomic->geometry->matList.numMaterials; ++i)
|
||||||
{
|
{
|
||||||
data.setMaterialTexture(atomic->geometry->matList.materials[i], st->_tex,
|
data.setMaterialTexture(atomic->geometry->matList.materials[i], st->_tex, st->_filter);
|
||||||
st->_filter);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}, &st);
|
},
|
||||||
|
&st);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -250,14 +246,14 @@ void Paint::ResetNodeColor(CVehicle* pVeh, std::string node_name)
|
|||||||
{
|
{
|
||||||
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
||||||
|
|
||||||
NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
|
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) {
|
||||||
{
|
|
||||||
const std::string name = GetFrameNodeName(frame);
|
const std::string name = GetFrameNodeName(frame);
|
||||||
|
|
||||||
if (node_name == "Default" || node_name == name)
|
if (node_name == "Default" || node_name == name)
|
||||||
{
|
{
|
||||||
RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
|
RwFrameForAllObjects(
|
||||||
{
|
frame,
|
||||||
|
[](RwObject *object, void *data) -> RwObject * {
|
||||||
if (object->type == rpATOMIC)
|
if (object->type == rpATOMIC)
|
||||||
{
|
{
|
||||||
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
||||||
@ -267,7 +263,8 @@ void Paint::ResetNodeColor(CVehicle* pVeh, std::string node_name)
|
|||||||
data.resetMaterialColor(atomic->geometry->matList.materials[i]);
|
data.resetMaterialColor(atomic->geometry->matList.materials[i]);
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}, nullptr);
|
},
|
||||||
|
nullptr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -276,14 +273,14 @@ void Paint::ResetNodeTexture(CVehicle* pVeh, std::string node_name)
|
|||||||
{
|
{
|
||||||
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
RwFrame *frame = (RwFrame *)pVeh->m_pRwClump->object.parent;
|
||||||
|
|
||||||
NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
|
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) {
|
||||||
{
|
|
||||||
const std::string name = GetFrameNodeName(frame);
|
const std::string name = GetFrameNodeName(frame);
|
||||||
|
|
||||||
if (node_name == "Default" || node_name == name)
|
if (node_name == "Default" || node_name == name)
|
||||||
{
|
{
|
||||||
RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
|
RwFrameForAllObjects(
|
||||||
{
|
frame,
|
||||||
|
[](RwObject *object, void *data) -> RwObject * {
|
||||||
if (object->type == rpATOMIC)
|
if (object->type == rpATOMIC)
|
||||||
{
|
{
|
||||||
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
RpAtomic *atomic = reinterpret_cast<RpAtomic *>(object);
|
||||||
@ -294,7 +291,8 @@ void Paint::ResetNodeTexture(CVehicle* pVeh, std::string node_name)
|
|||||||
data.resetMaterialTexture(atomic->geometry->matList.materials[i]);
|
data.resetMaterialTexture(atomic->geometry->matList.materials[i]);
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}, nullptr);
|
},
|
||||||
|
nullptr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
11
src/paint.h
11
src/paint.h
@ -32,14 +32,9 @@ private:
|
|||||||
{
|
{
|
||||||
struct MaterialProperties
|
struct MaterialProperties
|
||||||
{
|
{
|
||||||
MaterialProperties() :
|
MaterialProperties()
|
||||||
_color{0, 0, 0, 0},
|
: _color{0, 0, 0, 0}, _recolor(false), _retexture(false),
|
||||||
_recolor(false),
|
_geometry(nullptr), _originalColor{0, 0, 0, 0}, _originalTexture(nullptr), _originalGeometryFlags(0)
|
||||||
_retexture(false),
|
|
||||||
_geometry(nullptr),
|
|
||||||
_originalColor{0, 0, 0, 0},
|
|
||||||
_originalTexture(nullptr),
|
|
||||||
_originalGeometryFlags(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
src/pch.h
26
src/pch.h
@ -14,63 +14,65 @@
|
|||||||
#define BY_GAME(sa, vc, iii) iii
|
#define BY_GAME(sa, vc, iii) iii
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <d3d9.h>
|
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <d3d11Shader.h>
|
#include <d3d11Shader.h>
|
||||||
|
#include <d3d9.h>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <plugin.h>
|
|
||||||
#include <CCamera.h>
|
#include <CCamera.h>
|
||||||
#include <CClock.h>
|
|
||||||
#include <CCivilianPed.h>
|
#include <CCivilianPed.h>
|
||||||
|
#include <CClock.h>
|
||||||
#include <CGangs.h>
|
#include <CGangs.h>
|
||||||
#include <CHud.h>
|
#include <CHud.h>
|
||||||
#include <CMenuManager.h>
|
#include <CMenuManager.h>
|
||||||
#include <CModelInfo.h>
|
#include <CModelInfo.h>
|
||||||
#include <RenderWare.h>
|
|
||||||
#include <CStats.h>
|
#include <CStats.h>
|
||||||
#include <CStreaming.h>
|
#include <CStreaming.h>
|
||||||
#include <CTheScripts.h>
|
#include <CTheScripts.h>
|
||||||
#include <CTimer.h>
|
|
||||||
#include <CTimeCycle.h>
|
#include <CTimeCycle.h>
|
||||||
|
#include <CTimer.h>
|
||||||
#include <CTrain.h>
|
#include <CTrain.h>
|
||||||
#include <CWeather.h>
|
#include <CWeather.h>
|
||||||
#include <CWorld.h>
|
#include <CWorld.h>
|
||||||
#include <extensions/ScriptCommands.h>
|
#include <RenderWare.h>
|
||||||
#include <extensions/Screen.h>
|
|
||||||
#include <extensions/Paths.h>
|
#include <extensions/Paths.h>
|
||||||
|
#include <extensions/Screen.h>
|
||||||
|
#include <extensions/ScriptCommands.h>
|
||||||
|
#include <plugin.h>
|
||||||
|
|
||||||
#ifndef GTA3
|
#ifndef GTA3
|
||||||
#include <CBike.h>
|
#include <CBike.h>
|
||||||
#include <cHandlingDataMgr.h>
|
|
||||||
#include <CTheZones.h>
|
#include <CTheZones.h>
|
||||||
#include <CZoneInfo.h>
|
#include <CZoneInfo.h>
|
||||||
|
#include <cHandlingDataMgr.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
#include <CCheat.h>
|
#include <CCheat.h>
|
||||||
#include <CClothes.h>
|
#include <CClothes.h>
|
||||||
#include <CCutsceneMgr.h>
|
#include <CCutsceneMgr.h>
|
||||||
|
#include <CGangWars.h>
|
||||||
#include <CRadar.h>
|
#include <CRadar.h>
|
||||||
#include <CShadows.h>
|
#include <CShadows.h>
|
||||||
#include <eVehicleClass.h>
|
#include <eVehicleClass.h>
|
||||||
#include <CGangWars.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../depend/fla/IDaccess.h"
|
#include "../depend/fla/IDaccess.h"
|
||||||
#include "../depend/imgui/imgui.h"
|
#include "../depend/imgui/imgui.h"
|
||||||
|
|
||||||
#include "json.h"
|
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
#include "vKeys.h"
|
#include "json.h"
|
||||||
#include "resourcestore.h"
|
#include "resourcestore.h"
|
||||||
|
#include "vKeys.h"
|
||||||
|
|
||||||
using CallbackTable = std::vector<std::pair<std::string, void (*)()>>;
|
using CallbackTable = std::vector<std::pair<std::string, void (*)()>>;
|
||||||
using namespace plugin;
|
using namespace plugin;
|
||||||
|
40
src/ped.cpp
40
src/ped.cpp
@ -1,5 +1,5 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "ped.h"
|
#include "ped.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "weapon.h"
|
#include "weapon.h"
|
||||||
@ -23,9 +23,7 @@ Ped::Ped()
|
|||||||
|
|
||||||
TODO: Implement in VC too
|
TODO: Implement in VC too
|
||||||
*/
|
*/
|
||||||
Events::pedRenderEvent += [](CPed *ped)
|
Events::pedRenderEvent += [](CPed *ped) {
|
||||||
{
|
|
||||||
|
|
||||||
if (m_bBigHead || m_bThinBody)
|
if (m_bBigHead || m_bThinBody)
|
||||||
{
|
{
|
||||||
auto animHier = GetAnimHierarchyFromSkinClump(ped->m_pRwClump);
|
auto animHier = GetAnimHierarchyFromSkinClump(ped->m_pRwClump);
|
||||||
@ -95,7 +93,8 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
|
|||||||
CStreaming::RequestSpecialChar(currentSlot, name.c_str(), PRIORITY_REQUEST);
|
CStreaming::RequestSpecialChar(currentSlot, name.c_str(), PRIORITY_REQUEST);
|
||||||
CStreaming::LoadAllRequestedModels(true);
|
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>(m_SpawnPed::m_nSelectedPedType + 4, 290 + currentSlot, pos.x, pos.y,
|
||||||
|
pos.z + 1, &hplayer);
|
||||||
CStreaming::SetSpecialCharIsDeletable(290 + currentSlot);
|
CStreaming::SetSpecialCharIsDeletable(290 + currentSlot);
|
||||||
|
|
||||||
// SA has 10 slots
|
// SA has 10 slots
|
||||||
@ -115,7 +114,8 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
|
|||||||
Command<Commands::LOAD_SPECIAL_CHARACTER>(currentSlot, model.c_str());
|
Command<Commands::LOAD_SPECIAL_CHARACTER>(currentSlot, model.c_str());
|
||||||
Command<Commands::LOAD_ALL_MODELS_NOW>();
|
Command<Commands::LOAD_ALL_MODELS_NOW>();
|
||||||
|
|
||||||
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 108+currentSlot, pos.x, pos.y, pos.z + 1, &hplayer);
|
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 108 + currentSlot, pos.x, pos.y,
|
||||||
|
pos.z + 1, &hplayer);
|
||||||
Command<Commands::UNLOAD_SPECIAL_CHARACTER>(currentSlot);
|
Command<Commands::UNLOAD_SPECIAL_CHARACTER>(currentSlot);
|
||||||
|
|
||||||
++currentSlot;
|
++currentSlot;
|
||||||
@ -132,7 +132,8 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
|
|||||||
CStreaming::RequestModel(iModel, eStreamingFlags::PRIORITY_REQUEST);
|
CStreaming::RequestModel(iModel, eStreamingFlags::PRIORITY_REQUEST);
|
||||||
CStreaming::LoadAllRequestedModels(false);
|
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>(m_SpawnPed::m_nSelectedPedType + 4, iModel, pos.x, pos.y, pos.z + 1,
|
||||||
|
&hplayer);
|
||||||
CStreaming::SetModelIsDeletable(iModel);
|
CStreaming::SetModelIsDeletable(iModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,8 +287,7 @@ void Ped::Draw()
|
|||||||
if (ImGui::CollapsingHeader("Recruit anyone"))
|
if (ImGui::CollapsingHeader("Recruit anyone"))
|
||||||
{
|
{
|
||||||
static std::vector<Ui::NamedMemory> selectWeapon{
|
static std::vector<Ui::NamedMemory> selectWeapon{
|
||||||
{"9mm", 0x96917C}, {"AK47", 0x96917D}, {"Rockets", 0x96917E}
|
{"9mm", 0x96917C}, {"AK47", 0x96917D}, {"Rockets", 0x96917E}};
|
||||||
};
|
|
||||||
Ui::RadioButtonAddress("Select weapon", selectWeapon);
|
Ui::RadioButtonAddress("Select weapon", selectWeapon);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@ -303,8 +303,8 @@ void Ped::Draw()
|
|||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
for (CPed *ped : CPools::ms_pPedPool)
|
for (CPed *ped : CPools::ms_pPedPool)
|
||||||
{
|
{
|
||||||
if (DistanceBetweenPoints(ped->GetPosition(), player->GetPosition()) < m_nPedRemoveRadius
|
if (DistanceBetweenPoints(ped->GetPosition(), player->GetPosition()) < m_nPedRemoveRadius &&
|
||||||
&& ped->m_pVehicle == nullptr && ped != player)
|
ped->m_pVehicle == nullptr && ped != player)
|
||||||
{
|
{
|
||||||
Command<Commands::DELETE_CHAR>(CPools::GetPedRef(ped));
|
Command<Commands::DELETE_CHAR>(CPools::GetPedRef(ped));
|
||||||
}
|
}
|
||||||
@ -374,20 +374,20 @@ void Ped::Draw()
|
|||||||
ImGui::Text("Selected weapon: %s", m_SpawnPed::m_nWeaponName.c_str());
|
ImGui::Text("Selected weapon: %s", m_SpawnPed::m_nWeaponName.c_str());
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Ui::DrawImages(Weapon::m_WeaponData,
|
Ui::DrawImages(
|
||||||
[](std::string str) { m_SpawnPed::m_nWeaponId = std::stoi(str); },
|
Weapon::m_WeaponData, [](std::string str) { m_SpawnPed::m_nWeaponId = std::stoi(str); },
|
||||||
nullptr,
|
nullptr,
|
||||||
[](std::string str)
|
[](std::string str) {
|
||||||
{
|
|
||||||
m_SpawnPed::m_nWeaponName = Weapon::m_WeaponData.m_pJson->m_Data[str].get<std::string>();
|
m_SpawnPed::m_nWeaponName = Weapon::m_WeaponData.m_pJson->m_Data[str].get<std::string>();
|
||||||
return m_SpawnPed::m_nWeaponName;
|
return m_SpawnPed::m_nWeaponName;
|
||||||
},
|
},
|
||||||
[](std::string str) { return str != "-1"; /*Jetpack*/ }
|
[](std::string str) {
|
||||||
);
|
return str != "-1"; /*Jetpack*/
|
||||||
|
});
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
Ui::DrawJSON(Weapon::m_WeaponData,
|
Ui::DrawJSON(
|
||||||
[](std::string& root, std::string& key, std::string& id)
|
Weapon::m_WeaponData,
|
||||||
{
|
[](std::string &root, std::string &key, std::string &id) {
|
||||||
m_SpawnPed::m_nWeaponId = std::stoi(id);
|
m_SpawnPed::m_nWeaponId = std::stoi(id);
|
||||||
m_SpawnPed::m_nWeaponName = key;
|
m_SpawnPed::m_nWeaponName = key;
|
||||||
},
|
},
|
||||||
|
40
src/ped.h
40
src/ped.h
@ -14,11 +14,9 @@ private:
|
|||||||
static inline CJson m_SpecialPedJson = CJson("ped special");
|
static inline CJson m_SpecialPedJson = CJson("ped special");
|
||||||
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)};
|
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)};
|
||||||
|
|
||||||
static inline std::vector<std::string> m_GangNames =
|
static inline std::vector<std::string> m_GangNames = {
|
||||||
{
|
"Ballas", "Grove street families", "Los santos vagos", "San fierro rifa", "Da nang boys",
|
||||||
"Ballas", "Grove street families", "Los santos vagos", "San fierro rifa",
|
"Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"};
|
||||||
"Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"
|
|
||||||
};
|
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_TEXT};
|
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_TEXT};
|
||||||
#endif
|
#endif
|
||||||
@ -35,19 +33,33 @@ private:
|
|||||||
static inline int m_nSelectedPedType;
|
static inline int m_nSelectedPedType;
|
||||||
static inline int m_nWeaponId;
|
static inline int m_nWeaponId;
|
||||||
static inline std::string m_nWeaponName = "None";
|
static inline std::string m_nWeaponName = "None";
|
||||||
static inline std::vector<std::string> m_PedTypeList =
|
static inline std::vector<std::string> m_PedTypeList = {
|
||||||
{
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
"Civ Male", "Civ Female", "Cop", "Ballas", "Grove Street Families", "Los Santos Vagos",
|
"Civ Male",
|
||||||
"San Fierro Rifa", "Da Nang Boys", "Mafia", "Mountain Cloud Triads", "Varrio Los Aztecas",
|
"Civ Female",
|
||||||
"Gang 9", "Medic", "Dealer", "Criminal", "Fireman", "Prostitute"
|
"Cop",
|
||||||
|
"Ballas",
|
||||||
|
"Grove Street Families",
|
||||||
|
"Los Santos Vagos",
|
||||||
|
"San Fierro Rifa",
|
||||||
|
"Da Nang Boys",
|
||||||
|
"Mafia",
|
||||||
|
"Mountain Cloud Triads",
|
||||||
|
"Varrio Los Aztecas",
|
||||||
|
"Gang 9",
|
||||||
|
"Medic",
|
||||||
|
"Dealer",
|
||||||
|
"Criminal",
|
||||||
|
"Fireman",
|
||||||
|
"Prostitute"
|
||||||
#elif GTAVC
|
#elif GTAVC
|
||||||
"Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang",
|
"Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang",
|
||||||
"Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency",
|
"Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency", "Fireman",
|
||||||
"Fireman", "Criminal", "Unused", "Prostitute", "Special"
|
"Criminal", "Unused", "Prostitute", "Special"
|
||||||
#else // GTA3
|
#else // GTA3
|
||||||
"Civ Male", "Civ Female", "Cop", "Leones", "Triads", "Diablos", "Yakuza", "Yardies", "Colombians",
|
"Civ Male", "Civ Female", "Cop", "Leones", "Triads", "Diablos", "Yakuza",
|
||||||
"Hoods", "unused", "unused", "Emergency", "Fireman", "Criminal", "unused", "Prostitute", "Special"
|
"Yardies", "Colombians", "Hoods", "unused", "unused", "Emergency", "Fireman",
|
||||||
|
"Criminal", "unused", "Prostitute", "Special"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
#include "ped.h"
|
#include "ped.h"
|
||||||
|
|
||||||
// hardcoded cloth category names
|
// hardcoded cloth category names
|
||||||
const char* cloth_category[18] =
|
const char *cloth_category[18] = {"Shirts",
|
||||||
{
|
|
||||||
"Shirts",
|
|
||||||
"Heads",
|
"Heads",
|
||||||
"Trousers",
|
"Trousers",
|
||||||
"Shoes",
|
"Shoes",
|
||||||
@ -26,8 +25,7 @@ const char* cloth_category[18] =
|
|||||||
"Watches",
|
"Watches",
|
||||||
"Glasses",
|
"Glasses",
|
||||||
"Hats",
|
"Hats",
|
||||||
"Extras"
|
"Extras"};
|
||||||
};
|
|
||||||
|
|
||||||
static inline void PlayerModelBrokenFix()
|
static inline void PlayerModelBrokenFix()
|
||||||
{
|
{
|
||||||
@ -37,7 +35,6 @@ static inline void PlayerModelBrokenFix()
|
|||||||
Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false);
|
Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Taken from gta chaos mod by Lordmau5
|
Taken from gta chaos mod by Lordmau5
|
||||||
https://github.com/gta-chaos-mod/Trilogy-ASI-Script
|
https://github.com/gta-chaos-mod/Trilogy-ASI-Script
|
||||||
@ -74,30 +71,26 @@ void Player::TopDownCameraView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
CVector playerOffset = CVector(pos.x, pos.y, pos.z + 2.0f);
|
CVector playerOffset = CVector(pos.x, pos.y, pos.z + 2.0f);
|
||||||
CVector cameraPos
|
CVector cameraPos = CVector(playerOffset.x, playerOffset.y, playerOffset.z + curOffset);
|
||||||
= CVector (playerOffset.x, playerOffset.y, playerOffset.z + curOffset);
|
|
||||||
|
|
||||||
CColPoint outColPoint;
|
CColPoint outColPoint;
|
||||||
CEntity *outEntity;
|
CEntity *outEntity;
|
||||||
|
|
||||||
// TODO: Which variable? X, Y or Z for the look direction?
|
// TODO: Which variable? X, Y or Z for the look direction?
|
||||||
|
|
||||||
if (CWorld::ProcessLineOfSight (playerOffset, cameraPos, outColPoint,
|
if (CWorld::ProcessLineOfSight(playerOffset, cameraPos, outColPoint, outEntity, true, true, true, true, true, true,
|
||||||
outEntity, true, true, true, true, true,
|
true, true))
|
||||||
true, true, true))
|
|
||||||
{
|
{
|
||||||
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION> (
|
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION>(outColPoint.m_vecPoint.x, outColPoint.m_vecPoint.y,
|
||||||
outColPoint.m_vecPoint.x, outColPoint.m_vecPoint.y,
|
|
||||||
outColPoint.m_vecPoint.z, 0.0f, 0.0f, 0.0f);
|
outColPoint.m_vecPoint.z, 0.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION> (
|
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION>(cameraPos.x, cameraPos.y, cameraPos.z, 0.0f, 0.0f,
|
||||||
cameraPos.x, cameraPos.y, cameraPos.z, 0.0f, 0.0f, 0.0f);
|
0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Command<eScriptCommands::COMMAND_POINT_CAMERA_AT_POINT> (pos.x, pos.y,
|
Command<eScriptCommands::COMMAND_POINT_CAMERA_AT_POINT>(pos.x, pos.y, pos.z, 2);
|
||||||
pos.z, 2);
|
|
||||||
|
|
||||||
TheCamera.m_fGenerationDistMultiplier = 10.0f;
|
TheCamera.m_fGenerationDistMultiplier = 10.0f;
|
||||||
TheCamera.m_fLODDistMultiplier = 10.0f;
|
TheCamera.m_fLODDistMultiplier = 10.0f;
|
||||||
@ -140,8 +133,7 @@ Player::Player()
|
|||||||
m_bModloaderInstalled = true;
|
m_bModloaderInstalled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Events::processScriptsEvent += []
|
Events::processScriptsEvent += [] {
|
||||||
{
|
|
||||||
uint timer = CTimer::m_snTimeInMilliseconds;
|
uint timer = CTimer::m_snTimeInMilliseconds;
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
int hplayer = CPools::GetPedRef(player);
|
int hplayer = CPools::GetPedRef(player);
|
||||||
@ -156,11 +148,10 @@ Player::Player()
|
|||||||
{
|
{
|
||||||
CVector cur_pos = player->GetPosition();
|
CVector cur_pos = player->GetPosition();
|
||||||
|
|
||||||
if (m_KeepPosition::m_fPos.x != 0 && m_KeepPosition::m_fPos.x != cur_pos.x
|
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)
|
m_KeepPosition::m_fPos.y != 0 && m_KeepPosition::m_fPos.y != cur_pos.y)
|
||||||
{
|
{
|
||||||
BY_GAME(player->Teleport(m_KeepPosition::m_fPos, false)
|
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);
|
m_KeepPosition::m_fPos = CVector(0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -294,8 +285,8 @@ void Player::ChangePlayerCloth(std::string& name)
|
|||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
void Player::ChangePlayerModel(std::string &model)
|
void Player::ChangePlayerModel(std::string &model)
|
||||||
{
|
{
|
||||||
bool custom_skin = std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) !=
|
bool custom_skin =
|
||||||
m_CustomSkins::m_List.end();
|
std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) != m_CustomSkins::m_List.end();
|
||||||
|
|
||||||
if (Ped::m_PedData.m_pJson->m_Data.contains(model) || custom_skin)
|
if (Ped::m_PedData.m_pJson->m_Data.contains(model) || custom_skin)
|
||||||
{
|
{
|
||||||
@ -416,8 +407,9 @@ void Player::Draw()
|
|||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
#endif
|
#endif
|
||||||
Ui::CheckboxAddress("Free healthcare", BY_GAME((int)&pInfo->m_bFreeHealthCare,
|
Ui::CheckboxAddress("Free healthcare",
|
||||||
(int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bGetOutOfHospitalFree));
|
BY_GAME((int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bFreeHealthCare,
|
||||||
|
(int)&pInfo->m_bGetOutOfHospitalFree));
|
||||||
|
|
||||||
if (Ui::CheckboxWithHint("God mode", &m_bGodMode))
|
if (Ui::CheckboxWithHint("God mode", &m_bGodMode))
|
||||||
{
|
{
|
||||||
@ -451,7 +443,8 @@ void Player::Draw()
|
|||||||
}
|
}
|
||||||
Ui::CheckboxAddress("Infinite sprint", 0xB7CEE4);
|
Ui::CheckboxAddress("Infinite sprint", 0xB7CEE4);
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
Ui::CheckboxAddress("Infinite sprint", BY_GAME(NULL, (int)&pInfo->m_bNeverGetsTired, (int)&pInfo->m_bInfiniteSprint));
|
Ui::CheckboxAddress("Infinite sprint",
|
||||||
|
BY_GAME(NULL, (int)&pInfo->m_bNeverGetsTired, (int)&pInfo->m_bInfiniteSprint));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
@ -483,7 +476,8 @@ void Player::Draw()
|
|||||||
pPlayer->m_pWanted->CheatWantedLevel(0);
|
pPlayer->m_pWanted->CheatWantedLevel(0);
|
||||||
#endif
|
#endif
|
||||||
pPlayer->m_pWanted->Update();
|
pPlayer->m_pWanted->Update();
|
||||||
patch::SetRaw(BY_GAME(NULL, 0x4D2110, 0x4AD900), (char*)"\xC3\x90\x90\x90\x90\x90", 6); // CWanted::UpdateWantedLevel()
|
patch::SetRaw(BY_GAME(NULL, 0x4D2110, 0x4AD900), (char *)"\xC3\x90\x90\x90\x90\x90",
|
||||||
|
6); // CWanted::UpdateWantedLevel()
|
||||||
patch::Nop(BY_GAME(NULL, 0x5373D0, 0x4EFE73), 5); // CWanted::Update();
|
patch::Nop(BY_GAME(NULL, 0x5373D0, 0x4EFE73), 5); // CWanted::Update();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -502,7 +496,8 @@ void Player::Draw()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree);
|
Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree);
|
||||||
Ui::CheckboxWithHint("Respawn die location", &m_KeepPosition::m_bEnabled, "Respawn to the location you died from");
|
Ui::CheckboxWithHint("Respawn die location", &m_KeepPosition::m_bEnabled,
|
||||||
|
"Respawn to the location you died from");
|
||||||
|
|
||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
|
|
||||||
@ -601,7 +596,8 @@ void Player::Draw()
|
|||||||
Ui::EditStat("Energy", STAT_ENERGY);
|
Ui::EditStat("Energy", STAT_ENERGY);
|
||||||
Ui::EditStat("Fat", STAT_FAT);
|
Ui::EditStat("Fat", STAT_FAT);
|
||||||
#endif
|
#endif
|
||||||
Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100, BY_GAME(static_cast<int>(pPlayer->m_fMaxHealth), 100, 100));
|
Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100,
|
||||||
|
BY_GAME(static_cast<int>(pPlayer->m_fMaxHealth), 100, 100));
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Ui::EditStat("Lung capacity", STAT_LUNG_CAPACITY);
|
Ui::EditStat("Lung capacity", STAT_LUNG_CAPACITY);
|
||||||
Ui::EditStat("Max health", STAT_MAX_HEALTH, 0, 569, 1450);
|
Ui::EditStat("Max health", STAT_MAX_HEALTH, 0, 569, 1450);
|
||||||
@ -613,7 +609,6 @@ void Player::Draw()
|
|||||||
pInfo->m_nDisplayMoney = money;
|
pInfo->m_nDisplayMoney = money;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Ui::EditStat("Muscle", STAT_MUSCLE);
|
Ui::EditStat("Muscle", STAT_MUSCLE);
|
||||||
Ui::EditStat("Respect", STAT_RESPECT);
|
Ui::EditStat("Respect", STAT_RESPECT);
|
||||||
@ -713,8 +708,9 @@ void Player::Draw()
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
if (Ui::CheckboxWithHint("Aim skin changer", &m_bAimSkinChanger,
|
if (Ui::CheckboxWithHint("Aim skin changer", &m_bAimSkinChanger,
|
||||||
(("Changes to the ped, player is targeting with a weapon.\nTo use aim a ped with a weapon and press ")
|
(("Changes to the ped, player is targeting with a weapon.\nTo use aim a ped with "
|
||||||
+ aimSkinChanger.Pressed())))
|
"a weapon and press ") +
|
||||||
|
aimSkinChanger.Pressed())))
|
||||||
gConfig.SetValue("aim_skin_changer", m_bAimSkinChanger);
|
gConfig.SetValue("aim_skin_changer", m_bAimSkinChanger);
|
||||||
if (ImGui::BeginTabBar("AppearanceTabBar"))
|
if (ImGui::BeginTabBar("AppearanceTabBar"))
|
||||||
{
|
{
|
||||||
@ -730,9 +726,9 @@ void Player::Draw()
|
|||||||
{
|
{
|
||||||
if (bClothOption == 0)
|
if (bClothOption == 0)
|
||||||
{
|
{
|
||||||
Ui::DrawImages(m_ClothData, ChangePlayerCloth, nullptr,
|
Ui::DrawImages(
|
||||||
[](std::string str)
|
m_ClothData, ChangePlayerCloth, nullptr,
|
||||||
{
|
[](std::string str) {
|
||||||
std::stringstream ss(str);
|
std::stringstream ss(str);
|
||||||
std::string temp;
|
std::string temp;
|
||||||
|
|
||||||
@ -740,7 +736,8 @@ void Player::Draw()
|
|||||||
getline(ss, temp, '$');
|
getline(ss, temp, '$');
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}, nullptr, cloth_category, sizeof(cloth_category) / sizeof(const char*));
|
},
|
||||||
|
nullptr, cloth_category, sizeof(cloth_category) / sizeof(const char *));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -773,7 +770,8 @@ void Player::Draw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::TextWrapped("If CJ is wearing a full suit, click 'Extras/ Remove all' to remove it.");
|
ImGui::TextWrapped(
|
||||||
|
"If CJ is wearing a full suit, click 'Extras/ Remove all' to remove it.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -791,8 +789,9 @@ void Player::Draw()
|
|||||||
}
|
}
|
||||||
if (ImGui::BeginTabItem("Ped skins"))
|
if (ImGui::BeginTabItem("Ped skins"))
|
||||||
{
|
{
|
||||||
Ui::DrawImages(Ped::m_PedData, ChangePlayerModel, nullptr,
|
Ui::DrawImages(Ped::m_PedData, ChangePlayerModel, nullptr, [](std::string str) {
|
||||||
[](std::string str) { return Ped::m_PedData.m_pJson->m_Data[str].get<std::string>(); });
|
return Ped::m_PedData.m_pJson->m_Data[str].get<std::string>();
|
||||||
|
});
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginTabItem("Custom skins"))
|
if (ImGui::BeginTabItem("Custom skins"))
|
||||||
@ -801,13 +800,13 @@ void Player::Draw()
|
|||||||
|
|
||||||
if (m_bModloaderInstalled)
|
if (m_bModloaderInstalled)
|
||||||
{
|
{
|
||||||
Ui::FilterWithHint("Search", m_ClothData.m_Filter,
|
Ui::FilterWithHint(
|
||||||
std::string("Total skins: " + std::to_string(m_CustomSkins::m_List.size()))
|
"Search", m_ClothData.m_Filter,
|
||||||
.c_str());
|
std::string("Total skins: " + std::to_string(m_CustomSkins::m_List.size())).c_str());
|
||||||
Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'");
|
Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'");
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::TextWrapped(
|
ImGui::TextWrapped("Note: Your txd & dff names can't exceed 8 characters. Don't change names "
|
||||||
"Note: Your txd & dff names can't exceed 8 characters. Don't change names while the game is running.");
|
"while the game is running.");
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
for (std::string name : m_CustomSkins::m_List)
|
for (std::string name : m_CustomSkins::m_List)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,8 @@ private:
|
|||||||
static inline ResourceStore m_ClothData{"clothes", eResourceType::TYPE_IMAGE, ImVec2(70, 100)};
|
static inline ResourceStore m_ClothData{"clothes", eResourceType::TYPE_IMAGE, ImVec2(70, 100)};
|
||||||
struct m_CustomSkins
|
struct m_CustomSkins
|
||||||
{
|
{
|
||||||
static inline std::string m_Path = paths::GetGameDirPathA() + std::string("\\modloader\\Custom Skins\\");;
|
static inline std::string m_Path = paths::GetGameDirPathA() + std::string("\\modloader\\Custom Skins\\");
|
||||||
|
;
|
||||||
static inline ImGuiTextFilter m_Filter;
|
static inline ImGuiTextFilter m_Filter;
|
||||||
static inline std::vector<std::string> m_List;
|
static inline std::vector<std::string> m_List;
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "CFileLoader.h"
|
#include "CFileLoader.h"
|
||||||
#include "extensions/Paths.h"
|
#include "extensions/Paths.h"
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
ResourceStore::ResourceStore(const char* text, eResourceType type, ImVec2 imageSize)
|
ResourceStore::ResourceStore(const char *text, eResourceType type, ImVec2 imageSize) : m_ImageSize(imageSize)
|
||||||
: m_ImageSize(imageSize)
|
|
||||||
{
|
{
|
||||||
if (type == eResourceType::TYPE_TEXT
|
if (type == eResourceType::TYPE_TEXT || type == eResourceType::TYPE_BOTH)
|
||||||
|| type == eResourceType::TYPE_BOTH)
|
|
||||||
{
|
{
|
||||||
m_pJson = std::make_unique<CJson>(text);
|
m_pJson = std::make_unique<CJson>(text);
|
||||||
|
|
||||||
@ -20,15 +18,13 @@ ResourceStore::ResourceStore(const char* text, eResourceType type, ImVec2 imageS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == eResourceType::TYPE_IMAGE
|
if (type == eResourceType::TYPE_IMAGE || type == eResourceType::TYPE_BOTH)
|
||||||
|| type == eResourceType::TYPE_BOTH)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Textures need to be loaded from main thread
|
Textures need to be loaded from main thread
|
||||||
Loading it directly here doesn't work
|
Loading it directly here doesn't work
|
||||||
*/
|
*/
|
||||||
Events::processScriptsEvent += [text, this]()
|
Events::processScriptsEvent += [text, this]() {
|
||||||
{
|
|
||||||
if (!m_bTexturesLoaded)
|
if (!m_bTexturesLoaded)
|
||||||
{
|
{
|
||||||
LoadTextureResource(text);
|
LoadTextureResource(text);
|
||||||
@ -89,7 +85,6 @@ void ResourceStore::LoadTextureResource(std::string&& name)
|
|||||||
m_Categories.push_back(m_ImagesList.back().get()->m_CategoryName);
|
m_Categories.push_back(m_ImagesList.back().get()->m_CategoryName);
|
||||||
}
|
}
|
||||||
pRLL = (RwLinkList *)pEndDic;
|
pRLL = (RwLinkList *)pEndDic;
|
||||||
}
|
} while (pEndDic != (RwTexDictionary *)&pRwTexDictionary->texturesInDict);
|
||||||
while ( pEndDic != (RwTexDictionary*)&pRwTexDictionary->texturesInDict );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,13 +1,12 @@
|
|||||||
#include <string>
|
|
||||||
#include <rw/rwcore.h>
|
|
||||||
#include "json.h"
|
|
||||||
#include "../depend/imgui/imgui.h"
|
#include "../depend/imgui/imgui.h"
|
||||||
#include "d3d9.h"
|
#include "d3d9.h"
|
||||||
|
#include "json.h"
|
||||||
|
#include <rw/rwcore.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
struct RwD3D9Raster
|
struct RwD3D9Raster
|
||||||
{
|
{
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
IDirect3DTexture9 *texture;
|
IDirect3DTexture9 *texture;
|
||||||
IDirect3DSurface9 *surface;
|
IDirect3DSurface9 *surface;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "teleport.h"
|
#include "teleport.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -29,8 +29,8 @@ void Teleport::FetchRadarSpriteData()
|
|||||||
auto sprite_name = m_SpriteJson.m_Data[std::to_string(sprite)].get<std::string>();
|
auto sprite_name = m_SpriteJson.m_Data[std::to_string(sprite)].get<std::string>();
|
||||||
std::string key_name = sprite_name + ", " + Util::GetLocationName(&pos);
|
std::string key_name = sprite_name + ", " + Util::GetLocationName(&pos);
|
||||||
|
|
||||||
m_tpData.m_pJson->m_Data["Radar"][key_name] = "0, " + std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " +
|
m_tpData.m_pJson->m_Data["Radar"][key_name] =
|
||||||
std::to_string(pos.z);
|
"0, " + std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " + std::to_string(pos.z);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
"Radar" : {
|
"Radar" : {
|
||||||
@ -45,19 +45,21 @@ Teleport::Teleport()
|
|||||||
{
|
{
|
||||||
m_bQuickTeleport = gConfig.GetValue("quick_teleport", false);
|
m_bQuickTeleport = gConfig.GetValue("quick_teleport", false);
|
||||||
|
|
||||||
Events::processScriptsEvent += []
|
Events::processScriptsEvent += [] {
|
||||||
{
|
|
||||||
if ((m_Teleport::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - m_Teleport::m_nTimer) > 500))
|
if ((m_Teleport::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - m_Teleport::m_nTimer) > 500))
|
||||||
{
|
{
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
CEntity *player_entity = FindPlayerEntity(-1);
|
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 =
|
||||||
m_Teleport::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f;
|
CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y, m_Teleport::m_fPos.z + 100.0f,
|
||||||
|
nullptr, &player_entity) +
|
||||||
|
1.0f;
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
m_Teleport::m_fPos.z = CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y,
|
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;
|
m_Teleport::m_fPos.z + 100.0f, nullptr) +
|
||||||
|
1.0f;
|
||||||
#endif
|
#endif
|
||||||
CVehicle *pVeh = player->m_pVehicle;
|
CVehicle *pVeh = player->m_pVehicle;
|
||||||
|
|
||||||
@ -78,8 +80,7 @@ Teleport::Teleport()
|
|||||||
|
|
||||||
if (m_bQuickTeleport)
|
if (m_bQuickTeleport)
|
||||||
{
|
{
|
||||||
if (quickTeleport.Pressed()
|
if (quickTeleport.Pressed() && ((CTimer::m_snTimeInMilliseconds - m_nQuickTeleportTimer) > 500))
|
||||||
&& ((CTimer::m_snTimeInMilliseconds - m_nQuickTeleportTimer) > 500))
|
|
||||||
{
|
{
|
||||||
m_nQuickTeleportTimer = CTimer::m_snTimeInMilliseconds;
|
m_nQuickTeleportTimer = CTimer::m_snTimeInMilliseconds;
|
||||||
TeleportPlayer(true);
|
TeleportPlayer(true);
|
||||||
@ -202,9 +203,11 @@ void Teleport::Draw()
|
|||||||
ImGui::Checkbox("Insert coordinates", &m_bInsertCoord);
|
ImGui::Checkbox("Insert coordinates", &m_bInsertCoord);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
if (Ui::CheckboxWithHint("Quick teleport", &m_bQuickTeleport,
|
if (Ui::CheckboxWithHint(
|
||||||
std::string(std::string("Teleport to the location of your radar\ntarget blip using ")
|
"Quick teleport", &m_bQuickTeleport,
|
||||||
+ quickTeleport.GetNameString()).c_str()))
|
std::string(std::string("Teleport to the location of your radar\ntarget blip using ") +
|
||||||
|
quickTeleport.GetNameString())
|
||||||
|
.c_str()))
|
||||||
{
|
{
|
||||||
gConfig.SetValue("quick_teleport", m_bQuickTeleport);
|
gConfig.SetValue("quick_teleport", m_bQuickTeleport);
|
||||||
}
|
}
|
||||||
@ -218,7 +221,8 @@ void Teleport::Draw()
|
|||||||
|
|
||||||
strcpy(m_nInputBuffer,
|
strcpy(m_nInputBuffer,
|
||||||
(std::to_string(static_cast<int>(pos.x)) + ", " + std::to_string(static_cast<int>(pos.y)) +
|
(std::to_string(static_cast<int>(pos.x)) + ", " + std::to_string(static_cast<int>(pos.y)) +
|
||||||
", " + std::to_string(static_cast<int>(pos.z))).c_str());
|
", " + std::to_string(static_cast<int>(pos.z)))
|
||||||
|
.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::InputTextWithHint("Coordinates", "x, y, z", m_nInputBuffer, IM_ARRAYSIZE(m_nInputBuffer));
|
ImGui::InputTextWithHint("Coordinates", "x, y, z", m_nInputBuffer, IM_ARRAYSIZE(m_nInputBuffer));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class Teleport
|
class Teleport
|
||||||
{
|
{
|
||||||
@ -23,7 +23,6 @@ private:
|
|||||||
static inline uint m_nTimer;
|
static inline uint m_nTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
/*
|
/*
|
||||||
Generates radar sprite coordinates on the fly.
|
Generates radar sprite coordinates on the fly.
|
||||||
@ -34,6 +33,7 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Teleport();
|
Teleport();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void Draw();
|
static void Draw();
|
||||||
static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0);
|
static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0);
|
||||||
|
31
src/ui.cpp
31
src/ui.cpp
@ -1,6 +1,6 @@
|
|||||||
|
#include "ui.h"
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ui.h"
|
|
||||||
|
|
||||||
bool Ui::ListBox(const char *label, std::vector<std::string> &all_items, int &selected)
|
bool Ui::ListBox(const char *label, std::vector<std::string> &all_items, int &selected)
|
||||||
{
|
{
|
||||||
@ -42,7 +42,8 @@ bool Ui::ListBoxStr(const char* label, std::vector<std::string>& all_items, std:
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Ui::ListBoxCustomNames(const char* label, std::vector<std::string>& all_items, std::string& selected, const char* customNames[], size_t length)
|
bool Ui::ListBoxCustomNames(const char *label, std::vector<std::string> &all_items, std::string &selected,
|
||||||
|
const char *customNames[], size_t length)
|
||||||
{
|
{
|
||||||
bool rtn = false;
|
bool rtn = false;
|
||||||
std::string display_selected = (selected == "All") ? selected : customNames[std::stoi(selected)];
|
std::string display_selected = (selected == "All") ? selected : customNames[std::stoi(selected)];
|
||||||
@ -114,7 +115,6 @@ void Ui::DrawHeaders(CallbackTable& data)
|
|||||||
func = it->second;
|
func = it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ImGui::Button(btn_text, GetSize(3, false)))
|
if (ImGui::Button(btn_text, GetSize(3, false)))
|
||||||
{
|
{
|
||||||
m_HeaderId = btn_text;
|
m_HeaderId = btn_text;
|
||||||
@ -345,8 +345,7 @@ bool Ui::CheckboxBitFlag(const char* label, uint flag, const char* hint)
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ui::DrawJSON(ResourceStore& data,
|
void Ui::DrawJSON(ResourceStore &data, std::function<void(std::string &, std::string &, std::string &)> func_left_click,
|
||||||
std::function<void(std::string&, std::string&, std::string&)> func_left_click,
|
|
||||||
std::function<void(std::string &, std::string &, std::string &)> func_right_click)
|
std::function<void(std::string &, std::string &, std::string &)> func_right_click)
|
||||||
{
|
{
|
||||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5);
|
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5);
|
||||||
@ -374,7 +373,6 @@ void Ui::DrawJSON(ResourceStore& data,
|
|||||||
jsonPopup.function = nullptr;
|
jsonPopup.function = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImGui::BeginChild(1);
|
ImGui::BeginChild(1);
|
||||||
for (auto root : data.m_pJson->m_Data.items())
|
for (auto root : data.m_pJson->m_Data.items())
|
||||||
{
|
{
|
||||||
@ -415,7 +413,6 @@ void Ui::DrawJSON(ResourceStore& data,
|
|||||||
if (ImGui::MenuItem("Remove"))
|
if (ImGui::MenuItem("Remove"))
|
||||||
jsonPopup.function(jsonPopup.rootKey, jsonPopup.key, jsonPopup.value);
|
jsonPopup.function(jsonPopup.rootKey, jsonPopup.key, jsonPopup.value);
|
||||||
|
|
||||||
|
|
||||||
if (ImGui::MenuItem("Close"))
|
if (ImGui::MenuItem("Close"))
|
||||||
jsonPopup.function = nullptr;
|
jsonPopup.function = nullptr;
|
||||||
|
|
||||||
@ -482,9 +479,9 @@ void Ui::FilterWithHint(const char* label, ImGuiTextFilter& filter, const char*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLeftClick, std::function<void(std::string&)> onRightClick,
|
void Ui::DrawImages(ResourceStore &store, std::function<void(std::string &)> onLeftClick,
|
||||||
std::function<std::string(std::string&)> getName, std::function<bool(std::string&)> verifyFunc,
|
std::function<void(std::string &)> onRightClick, std::function<std::string(std::string &)> getName,
|
||||||
const char** customNames, size_t length)
|
std::function<bool(std::string &)> verifyFunc, const char **customNames, size_t length)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Trying to scale images based on resolutions
|
Trying to scale images based on resolutions
|
||||||
@ -496,7 +493,8 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
|
|||||||
|
|
||||||
int imageCount = 1;
|
int imageCount = 1;
|
||||||
int imagesInRow = static_cast<int>(ImGui::GetWindowContentRegionWidth() / m_ImageSize.x);
|
int imagesInRow = static_cast<int>(ImGui::GetWindowContentRegionWidth() / m_ImageSize.x);
|
||||||
m_ImageSize.x = ImGui::GetWindowContentRegionWidth() / imagesInRow - static_cast<int>(ImGuiStyleVar_ItemSpacing) * 0.65f;
|
m_ImageSize.x =
|
||||||
|
ImGui::GetWindowContentRegionWidth() / imagesInRow - static_cast<int>(ImGuiStyleVar_ItemSpacing) * 0.65f;
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
@ -527,10 +525,9 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
|
|||||||
std::string text = store.m_ImagesList[i]->m_FileName;
|
std::string text = store.m_ImagesList[i]->m_FileName;
|
||||||
std::string modelName = getName(text);
|
std::string modelName = getName(text);
|
||||||
|
|
||||||
if (store.m_Filter.PassFilter(modelName.c_str())
|
if (store.m_Filter.PassFilter(modelName.c_str()) &&
|
||||||
&& (store.m_ImagesList[i]->m_CategoryName == store.m_Selected || store.m_Selected == "All")
|
(store.m_ImagesList[i]->m_CategoryName == store.m_Selected || store.m_Selected == "All") &&
|
||||||
&& (verifyFunc == nullptr || verifyFunc(text))
|
(verifyFunc == nullptr || verifyFunc(text)))
|
||||||
)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Couldn't figure out how to laod images for Dx11
|
Couldn't figure out how to laod images for Dx11
|
||||||
@ -545,7 +542,8 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ImGui::ImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, ImVec2(0, 0), ImVec2(1, 1), 1, ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
|
if (ImGui::ImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, ImVec2(0, 0), ImVec2(1, 1), 1,
|
||||||
|
ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
|
||||||
{
|
{
|
||||||
onLeftClick(text);
|
onLeftClick(text);
|
||||||
}
|
}
|
||||||
@ -824,7 +822,6 @@ void Ui::EditFloat(const char* label, const int address, const float min, const
|
|||||||
ImGui::SameLine(0.0, 4.0);
|
ImGui::SameLine(0.0, 4.0);
|
||||||
ImGui::Text("Set");
|
ImGui::Text("Set");
|
||||||
|
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
if (ImGui::Button(("Minimum##" + std::string(label)).c_str(), GetSize(items)))
|
if (ImGui::Button(("Minimum##" + std::string(label)).c_str(), GetSize(items)))
|
||||||
|
10
src/ui.h
10
src/ui.h
@ -33,7 +33,6 @@ public:
|
|||||||
static inline JsonPopUpData jsonPopup;
|
static inline JsonPopUpData jsonPopup;
|
||||||
static inline ImgPopUpData imgPopup;
|
static inline ImgPopUpData imgPopup;
|
||||||
|
|
||||||
|
|
||||||
Ui() = delete;
|
Ui() = delete;
|
||||||
Ui(Ui &) = delete;
|
Ui(Ui &) = delete;
|
||||||
|
|
||||||
@ -61,7 +60,8 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static void EditAddress(const char *label, int address, int min = 0, int def = 0, int max = 100);
|
static void EditAddress(const char *label, int address, int min = 0, int def = 0, int max = 100);
|
||||||
static void EditBits(const char *label, int address, const std::vector<std::string> &names);
|
static void EditBits(const char *label, int address, const std::vector<std::string> &names);
|
||||||
static void EditFloat(const char* label, int address, float min, float def, float max, float mul = 1, float change = 1.0f);
|
static void EditFloat(const char *label, int address, float min, float def, float max, float mul = 1,
|
||||||
|
float change = 1.0f);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static void EditReference(const char *label, T &address, int min = 0, int def = 0, int max = 100);
|
static void EditReference(const char *label, T &address, int min = 0, int def = 0, int max = 100);
|
||||||
static void EditRadioButtonAddress(const char *label, std::vector<NamedMemory> &named_mem);
|
static void EditRadioButtonAddress(const char *label, std::vector<NamedMemory> &named_mem);
|
||||||
@ -77,7 +77,8 @@ public:
|
|||||||
|
|
||||||
static bool ListBox(const char *label, std::vector<std::string> &all_items, int &selected);
|
static bool ListBox(const char *label, std::vector<std::string> &all_items, int &selected);
|
||||||
static bool ListBoxStr(const char *label, std::vector<std::string> &all_items, std::string &selected);
|
static bool ListBoxStr(const char *label, std::vector<std::string> &all_items, std::string &selected);
|
||||||
static bool ListBoxCustomNames(const char* label, std::vector<std::string>& all_items, std::string& selected, const char* custom_names[] = nullptr, size_t length = 0);
|
static bool ListBoxCustomNames(const char *label, std::vector<std::string> &all_items, std::string &selected,
|
||||||
|
const char *custom_names[] = nullptr, size_t length = 0);
|
||||||
|
|
||||||
static void RadioButtonAddress(const char *label, std::vector<NamedMemory> &named_mem);
|
static void RadioButtonAddress(const char *label, std::vector<NamedMemory> &named_mem);
|
||||||
static void RadioButtonAddressEx(const char *label, int addr, std::vector<NamedValue> &named_val);
|
static void RadioButtonAddressEx(const char *label, int addr, std::vector<NamedValue> &named_val);
|
||||||
@ -145,8 +146,7 @@ void Ui::EditAddress(const char* label, const int address, const int min, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T> void Ui::EditReference(const char *label, T &address, const int min, const int def, const int max)
|
||||||
void Ui::EditReference(const char* label, T& address, const int min, const int def, const int max)
|
|
||||||
{
|
{
|
||||||
if (ImGui::CollapsingHeader(label))
|
if (ImGui::CollapsingHeader(label))
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "updater.h"
|
#include "updater.h"
|
||||||
#include "ui.h"
|
|
||||||
#include "menuinfo.h"
|
#include "menuinfo.h"
|
||||||
|
#include "pch.h"
|
||||||
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
void Updater::CheckForUpdate()
|
void Updater::CheckForUpdate()
|
||||||
@ -63,8 +63,10 @@ void Updater::ShowUpdateScreen()
|
|||||||
|
|
||||||
if (ImGui::Button("Download page", Ui::GetSize(3)))
|
if (ImGui::Button("Download page", Ui::GetSize(3)))
|
||||||
{
|
{
|
||||||
ShellExecute(NULL, "open", std::string("https://github.com/user-grinch/Cheat-Menu/releases/tag/" +
|
ShellExecute(
|
||||||
Updater::m_LatestVersion).c_str(), NULL, NULL, SW_SHOWNORMAL);
|
NULL, "open",
|
||||||
|
std::string("https://github.com/user-grinch/Cheat-Menu/releases/tag/" + Updater::m_LatestVersion).c_str(),
|
||||||
|
NULL, NULL, SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "psapi.h"
|
#include "psapi.h"
|
||||||
|
|
||||||
std::string Util::GetLocationName(CVector *pos)
|
std::string Util::GetLocationName(CVector *pos)
|
||||||
@ -95,8 +95,8 @@ void Util::ClearCharTasksVehCheck(CPed* ped)
|
|||||||
|
|
||||||
bool Util::IsOnMission()
|
bool Util::IsOnMission()
|
||||||
{
|
{
|
||||||
return FindPlayerPed()->CanPlayerStartMission() && !*(patch::Get<char*>(0x5D5380, false) +
|
return FindPlayerPed()->CanPlayerStartMission() &&
|
||||||
CTheScripts::OnAMissionFlag);
|
!*(patch::Get<char *>(0x5D5380, false) + CTheScripts::OnAMissionFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Util::GetLargestGangInZone()
|
int Util::GetLargestGangInZone()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "tchar.h"
|
|
||||||
#include "pdh.h"
|
#include "pdh.h"
|
||||||
|
#include "tchar.h"
|
||||||
|
|
||||||
static PDH_HQUERY cpuQuery;
|
static PDH_HQUERY cpuQuery;
|
||||||
static PDH_HCOUNTER cpuTotal;
|
static PDH_HCOUNTER cpuTotal;
|
||||||
@ -11,7 +11,6 @@ static HANDLE self;
|
|||||||
class Util
|
class Util
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static void ClearCharTasksVehCheck(CPed *ped);
|
static void ClearCharTasksVehCheck(CPed *ped);
|
||||||
static int GetLargestGangInZone();
|
static int GetLargestGangInZone();
|
||||||
|
151
src/vehicle.cpp
151
src/vehicle.cpp
@ -1,11 +1,11 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
|
#include "filehandler.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "pch.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "filehandler.h"
|
|
||||||
#include <CPopulation.h>
|
|
||||||
#include <CDamageManager.h>
|
#include <CDamageManager.h>
|
||||||
|
#include <CPopulation.h>
|
||||||
|
|
||||||
void Vehicle::FixVehicle(CVehicle *pVeh)
|
void Vehicle::FixVehicle(CVehicle *pVeh)
|
||||||
{
|
{
|
||||||
@ -14,14 +14,12 @@ void Vehicle::FixVehicle(CVehicle *pVeh)
|
|||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
switch (pVeh->m_nVehicleClass)
|
switch (pVeh->m_nVehicleClass)
|
||||||
{
|
{
|
||||||
case VEHICLE_AUTOMOBILE:
|
case VEHICLE_AUTOMOBILE: {
|
||||||
{
|
|
||||||
reinterpret_cast<CAutomobile *>(pVeh)->Fix();
|
reinterpret_cast<CAutomobile *>(pVeh)->Fix();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef GTAVC
|
#ifdef GTAVC
|
||||||
case VEHICLE_BIKE:
|
case VEHICLE_BIKE: {
|
||||||
{
|
|
||||||
reinterpret_cast<CBike *>(pVeh)->Fix();
|
reinterpret_cast<CBike *>(pVeh)->Fix();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -38,8 +36,7 @@ Vehicle::Vehicle()
|
|||||||
#endif
|
#endif
|
||||||
FileHandler::FetchColorData(m_CarcolsColorData);
|
FileHandler::FetchColorData(m_CarcolsColorData);
|
||||||
|
|
||||||
Events::processScriptsEvent += [this]
|
Events::processScriptsEvent += [this] {
|
||||||
{
|
|
||||||
uint timer = CTimer::m_snTimeInMilliseconds;
|
uint timer = CTimer::m_snTimeInMilliseconds;
|
||||||
CPlayerPed *pPlayer = FindPlayerPed();
|
CPlayerPed *pPlayer = FindPlayerPed();
|
||||||
CVehicle *pVeh = BY_GAME(FindPlayerVehicle(-1, false), FindPlayerVehicle(), FindPlayerVehicle());
|
CVehicle *pVeh = BY_GAME(FindPlayerVehicle(-1, false), FindPlayerVehicle(), FindPlayerVehicle());
|
||||||
@ -67,7 +64,8 @@ Vehicle::Vehicle()
|
|||||||
|
|
||||||
if (vehEngine.Pressed())
|
if (vehEngine.Pressed())
|
||||||
{
|
{
|
||||||
bool state = BY_GAME(!pVeh->m_nVehicleFlags.bEngineBroken, true, true) || pVeh->m_nVehicleFlags.bEngineOn;
|
bool state =
|
||||||
|
BY_GAME(!pVeh->m_nVehicleFlags.bEngineBroken, true, true) || pVeh->m_nVehicleFlags.bEngineOn;
|
||||||
|
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
@ -124,8 +122,8 @@ Vehicle::Vehicle()
|
|||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
pPlayer->m_nPedFlags.CantBeKnockedOffBike = m_bDontFallBike ? 1 : 2;
|
pPlayer->m_nPedFlags.CantBeKnockedOffBike = m_bDontFallBike ? 1 : 2;
|
||||||
|
|
||||||
if (m_UnlimitedNitro::m_bEnabled
|
if (m_UnlimitedNitro::m_bEnabled &&
|
||||||
&& BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass) == VEHICLE_AUTOMOBILE)
|
BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass) == VEHICLE_AUTOMOBILE)
|
||||||
{
|
{
|
||||||
patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro
|
patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro
|
||||||
patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro
|
patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro
|
||||||
@ -194,11 +192,10 @@ Vehicle::Vehicle()
|
|||||||
{
|
{
|
||||||
if (pVeh->m_nVehicleSubClass == VEHICLE_BIKE || pVeh->m_nVehicleSubClass == VEHICLE_BMX)
|
if (pVeh->m_nVehicleSubClass == VEHICLE_BIKE || pVeh->m_nVehicleSubClass == VEHICLE_BMX)
|
||||||
{
|
{
|
||||||
if (sqrt(pVeh->m_vecMoveSpeed.x * pVeh->m_vecMoveSpeed.x
|
if (sqrt(pVeh->m_vecMoveSpeed.x * pVeh->m_vecMoveSpeed.x +
|
||||||
+ pVeh->m_vecMoveSpeed.y * pVeh->m_vecMoveSpeed.y
|
pVeh->m_vecMoveSpeed.y * pVeh->m_vecMoveSpeed.y +
|
||||||
+ pVeh->m_vecMoveSpeed.z * pVeh->m_vecMoveSpeed.z
|
pVeh->m_vecMoveSpeed.z * pVeh->m_vecMoveSpeed.z) > 0.0 &&
|
||||||
) > 0.0
|
CTimer::ms_fTimeStep > 0.0)
|
||||||
&& CTimer::ms_fTimeStep > 0.0)
|
|
||||||
{
|
{
|
||||||
pVeh->FlyingControl(3, -9999.9902f, -9999.9902f, -9999.9902f, -9999.9902f);
|
pVeh->FlyingControl(3, -9999.9902f, -9999.9902f, -9999.9902f, -9999.9902f);
|
||||||
}
|
}
|
||||||
@ -231,7 +228,6 @@ void Vehicle::AddComponent(const std::string& component, const bool display_mess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Vehicle::RemoveComponent(const std::string &component, const bool display_message)
|
void Vehicle::RemoveComponent(const std::string &component, const bool display_message)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -399,8 +395,8 @@ void Vehicle::SpawnVehicle(std::string& rootkey, std::string& vehName, std::stri
|
|||||||
CTrain *carraige = nullptr;
|
CTrain *carraige = nullptr;
|
||||||
int track = Random(0, 1);
|
int track = Random(0, 1);
|
||||||
int node = CTrain::FindClosestTrackNode(pos, &track);
|
int node = CTrain::FindClosestTrackNode(pos, &track);
|
||||||
CTrain::CreateMissionTrain(pos, (Random(0, 1)) == 1 ? true : false, train_id, &train, &carraige, node,
|
CTrain::CreateMissionTrain(pos, (Random(0, 1)) == 1 ? true : false, train_id, &train, &carraige, node, track,
|
||||||
track, false);
|
false);
|
||||||
|
|
||||||
veh = (CVehicle *)train;
|
veh = (CVehicle *)train;
|
||||||
hveh = CPools::GetVehicleRef(veh);
|
hveh = CPools::GetVehicleRef(veh);
|
||||||
@ -582,7 +578,8 @@ void Vehicle::Draw()
|
|||||||
Ui::CheckboxAddress("Cars fly", BY_GAME(0x969160, 0xA10B28, NULL));
|
Ui::CheckboxAddress("Cars fly", BY_GAME(0x969160, 0xA10B28, NULL));
|
||||||
Ui::CheckboxWithHint("Cars heavy", &m_bVehHeavy);
|
Ui::CheckboxWithHint("Cars heavy", &m_bVehHeavy);
|
||||||
#endif
|
#endif
|
||||||
if (Ui::CheckboxWithHint("Damage proof", &m_bNoDamage,
|
if (Ui::CheckboxWithHint(
|
||||||
|
"Damage proof", &m_bNoDamage,
|
||||||
"Every vehicle entered will be damage proof\nBullet, Collision, Explosion, Fire, Meele etc"))
|
"Every vehicle entered will be damage proof\nBullet, Collision, Explosion, Fire, Meele etc"))
|
||||||
{
|
{
|
||||||
if (pVeh && !m_bNoDamage)
|
if (pVeh && !m_bNoDamage)
|
||||||
@ -653,7 +650,8 @@ void Vehicle::Draw()
|
|||||||
Ui::CheckboxAddress("Perfect handling", 0x96914C);
|
Ui::CheckboxAddress("Perfect handling", 0x96914C);
|
||||||
Ui::CheckboxAddress("Tank mode", 0x969164);
|
Ui::CheckboxAddress("Tank mode", 0x969164);
|
||||||
|
|
||||||
Ui::CheckboxWithHint("Unlimited nitro", &m_UnlimitedNitro::m_bEnabled, "Nitro will activate when left clicked\n\
|
Ui::CheckboxWithHint("Unlimited nitro", &m_UnlimitedNitro::m_bEnabled,
|
||||||
|
"Nitro will activate when left clicked\n\
|
||||||
\nEnabling this would disable\nAll cars have nitro\nAll taxis have nitro");
|
\nEnabling this would disable\nAll cars have nitro\nAll taxis have nitro");
|
||||||
#elif GTA3
|
#elif GTA3
|
||||||
Ui::CheckboxAddress("Perfect handling", 0x95CD66);
|
Ui::CheckboxAddress("Perfect handling", 0x95CD66);
|
||||||
@ -681,16 +679,20 @@ void Vehicle::Draw()
|
|||||||
pVeh->m_nVehicleFlags.bAlwaysSkidMarks = state;
|
pVeh->m_nVehicleFlags.bAlwaysSkidMarks = state;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
state = BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof, pVeh->m_nEntityFlags.bBulletProof);
|
state = BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof,
|
||||||
|
pVeh->m_nEntityFlags.bBulletProof);
|
||||||
if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bNoDamage))
|
if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bNoDamage))
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof, pVeh->m_nEntityFlags.bBulletProof) = state;
|
BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof,
|
||||||
|
pVeh->m_nEntityFlags.bBulletProof) = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof, pVeh->m_nEntityFlags.bCollisionProof);
|
state = BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof,
|
||||||
|
pVeh->m_nEntityFlags.bCollisionProof);
|
||||||
if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bNoDamage))
|
if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bNoDamage))
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof, pVeh->m_nEntityFlags.bCollisionProof) = state;
|
BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof,
|
||||||
|
pVeh->m_nEntityFlags.bCollisionProof) = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
@ -716,16 +718,20 @@ void Vehicle::Draw()
|
|||||||
pVeh->m_nVehicleFlags.bEngineOn = state;
|
pVeh->m_nVehicleFlags.bEngineOn = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof, pVeh->m_nEntityFlags.bExplosionProof);
|
state = BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof,
|
||||||
|
pVeh->m_nEntityFlags.bExplosionProof);
|
||||||
if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bNoDamage))
|
if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bNoDamage))
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof, pVeh->m_nEntityFlags.bExplosionProof) = state;
|
BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof,
|
||||||
|
pVeh->m_nEntityFlags.bExplosionProof) = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof, pVeh->m_nEntityFlags.bFireProof);
|
state = BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof,
|
||||||
|
pVeh->m_nEntityFlags.bFireProof);
|
||||||
if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bNoDamage))
|
if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bNoDamage))
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof, pVeh->m_nEntityFlags.bFireProof) = state;
|
BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof,
|
||||||
|
pVeh->m_nEntityFlags.bFireProof) = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
@ -744,18 +750,22 @@ void Vehicle::Draw()
|
|||||||
BY_GAME(pVeh->m_bIsVisible, pVeh->m_nFlags.bIsVisible, pVeh->m_nEntityFlags.bIsVisible) = !state;
|
BY_GAME(pVeh->m_bIsVisible, pVeh->m_nFlags.bIsVisible, pVeh->m_nEntityFlags.bIsVisible) = !state;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = BY_GAME(!pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn, pVeh->m_nVehicleFlags.bLightsOn);
|
state = BY_GAME(!pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn,
|
||||||
|
pVeh->m_nVehicleFlags.bLightsOn);
|
||||||
if (Ui::CheckboxWithHint("Lights on", &state, nullptr, !is_driver))
|
if (Ui::CheckboxWithHint("Lights on", &state, nullptr, !is_driver))
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn, pVeh->m_nVehicleFlags.bLightsOn) = state;
|
BY_GAME(pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn,
|
||||||
|
pVeh->m_nVehicleFlags.bLightsOn) = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
state = BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) == CARLOCK_LOCKED_PLAYER_INSIDE;
|
state =
|
||||||
|
BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) == CARLOCK_LOCKED_PLAYER_INSIDE;
|
||||||
if (Ui::CheckboxWithHint("Lock doors", &state, nullptr, !is_driver))
|
if (Ui::CheckboxWithHint("Lock doors", &state, nullptr, !is_driver))
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) = CARLOCK_LOCKED_PLAYER_INSIDE;
|
BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) =
|
||||||
|
CARLOCK_LOCKED_PLAYER_INSIDE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -763,10 +773,12 @@ void Vehicle::Draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state = BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof, pVeh->m_nEntityFlags.bMeleeProof);
|
state = BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof,
|
||||||
|
pVeh->m_nEntityFlags.bMeleeProof);
|
||||||
if (Ui::CheckboxWithHint("Melee proof", &state, nullptr, m_bNoDamage))
|
if (Ui::CheckboxWithHint("Melee proof", &state, nullptr, m_bNoDamage))
|
||||||
{
|
{
|
||||||
BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof, pVeh->m_nEntityFlags.bMeleeProof) = state;
|
BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof,
|
||||||
|
pVeh->m_nEntityFlags.bMeleeProof) = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
@ -864,8 +876,8 @@ void Vehicle::Draw()
|
|||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
for (CVehicle *pVeh : CPools::ms_pVehiclePool)
|
for (CVehicle *pVeh : CPools::ms_pVehiclePool)
|
||||||
{
|
{
|
||||||
if (DistanceBetweenPoints(pVeh->GetPosition(), player->GetPosition()) < m_nVehRemoveRadius
|
if (DistanceBetweenPoints(pVeh->GetPosition(), player->GetPosition()) < m_nVehRemoveRadius &&
|
||||||
&& player->m_pVehicle != pVeh)
|
player->m_pVehicle != pVeh)
|
||||||
{
|
{
|
||||||
Command<Commands::DELETE_CAR>(CPools::GetVehicleRef(pVeh));
|
Command<Commands::DELETE_CAR>(CPools::GetVehicleRef(pVeh));
|
||||||
}
|
}
|
||||||
@ -879,17 +891,13 @@ void Vehicle::Draw()
|
|||||||
if (ImGui::CollapsingHeader("Traffic options"))
|
if (ImGui::CollapsingHeader("Traffic options"))
|
||||||
{
|
{
|
||||||
|
|
||||||
static std::vector<Ui::NamedMemory> color
|
static std::vector<Ui::NamedMemory> color{{"Black", BY_GAME(0x969151, 0xA10B82)},
|
||||||
{
|
{"Pink", BY_GAME(0x969150, 0xA10B26)}};
|
||||||
{"Black", BY_GAME(0x969151, 0xA10B82)},
|
|
||||||
{"Pink", BY_GAME(0x969150, 0xA10B26)}
|
|
||||||
};
|
|
||||||
Ui::RadioButtonAddress("Color", color);
|
Ui::RadioButtonAddress("Color", color);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static std::vector<Ui::NamedMemory> type{
|
static std::vector<Ui::NamedMemory> type{
|
||||||
{"Cheap", 0x96915E}, {"Country", 0x96917B}, {"Fast", 0x96915F}
|
{"Cheap", 0x96915E}, {"Country", 0x96917B}, {"Fast", 0x96915F}};
|
||||||
};
|
|
||||||
Ui::RadioButtonAddress("Type", type);
|
Ui::RadioButtonAddress("Type", type);
|
||||||
#endif
|
#endif
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
@ -1010,17 +1018,13 @@ void Vehicle::Draw()
|
|||||||
Ui::CheckboxWithHint("Spawn aircraft in air", &m_Spawner::m_bSpawnInAir);
|
Ui::CheckboxWithHint("Spawn aircraft in air", &m_Spawner::m_bSpawnInAir);
|
||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
|
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
ImGui::SetNextItemWidth(ImGui::GetWindowContentRegionWidth() - 2.5);
|
ImGui::SetNextItemWidth(ImGui::GetWindowContentRegionWidth() - 2.5);
|
||||||
ImGui::InputTextWithHint("##LicenseText", "License plate text", m_Spawner::m_nLicenseText, 9);
|
ImGui::InputTextWithHint("##LicenseText", "License plate text", m_Spawner::m_nLicenseText, 9);
|
||||||
|
|
||||||
Ui::DrawImages(m_Spawner::m_VehData, SpawnVehicle, nullptr,
|
Ui::DrawImages(m_Spawner::m_VehData, SpawnVehicle, nullptr,
|
||||||
[](std::string str)
|
[](std::string str) { return GetNameFromModel(std::stoi(str)); });
|
||||||
{
|
|
||||||
return GetNameFromModel(std::stoi(str));
|
|
||||||
});
|
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
Ui::DrawJSON(m_Spawner::m_VehData, SpawnVehicle, nullptr);
|
Ui::DrawJSON(m_Spawner::m_VehData, SpawnVehicle, nullptr);
|
||||||
#endif
|
#endif
|
||||||
@ -1080,8 +1084,9 @@ void Vehicle::Draw()
|
|||||||
|
|
||||||
ImVec2 size = Ui::GetSize();
|
ImVec2 size = Ui::GetSize();
|
||||||
int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2);
|
int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2);
|
||||||
int btnSize = (ImGui::GetWindowContentRegionWidth() - int(ImGuiStyleVar_ItemSpacing) * (btnsInRow -
|
int btnSize = (ImGui::GetWindowContentRegionWidth() -
|
||||||
0.6 * btnsInRow)) / btnsInRow;
|
int(ImGuiStyleVar_ItemSpacing) * (btnsInRow - 0.6 * btnsInRow)) /
|
||||||
|
btnsInRow;
|
||||||
|
|
||||||
ImGui::BeginChild("Colorss");
|
ImGui::BeginChild("Colorss");
|
||||||
|
|
||||||
@ -1089,7 +1094,8 @@ void Vehicle::Draw()
|
|||||||
{
|
{
|
||||||
if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId], ImVec2(btnSize, btnSize)))
|
if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId], ImVec2(btnSize, btnSize)))
|
||||||
{
|
{
|
||||||
*(uint8_replacement*)(int(veh) + BY_GAME(0x433, 0x19F, 0x19B) + m_Color::m_nRadioButton) = colorId;
|
*(uint8_replacement *)(int(veh) + BY_GAME(0x433, 0x19F, 0x19B) + m_Color::m_nRadioButton) =
|
||||||
|
colorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((colorId + 1) % btnsInRow != 0)
|
if ((colorId + 1) % btnsInRow != 0)
|
||||||
@ -1122,7 +1128,8 @@ void Vehicle::Draw()
|
|||||||
|
|
||||||
Ui::CheckboxWithHint("Rainbow neons", &m_Neon::m_bRainbowEffect, "Rainbow effect to neon lights");
|
Ui::CheckboxWithHint("Rainbow neons", &m_Neon::m_bRainbowEffect, "Rainbow effect to neon lights");
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
Ui::CheckboxWithHint("Traffic neons", &m_Neon::m_bApplyOnTraffic, "Adds neon lights to traffic vehicles.\n\
|
Ui::CheckboxWithHint("Traffic neons", &m_Neon::m_bApplyOnTraffic,
|
||||||
|
"Adds neon lights to traffic vehicles.\n\
|
||||||
Only some vehicles will have them.");
|
Only some vehicles will have them.");
|
||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
|
|
||||||
@ -1138,8 +1145,9 @@ void Vehicle::Draw()
|
|||||||
int count = (int)m_CarcolsColorData.size();
|
int count = (int)m_CarcolsColorData.size();
|
||||||
ImVec2 size = Ui::GetSize();
|
ImVec2 size = Ui::GetSize();
|
||||||
int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2);
|
int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2);
|
||||||
int btnSize = (ImGui::GetWindowContentRegionWidth() - int(ImGuiStyleVar_ItemSpacing) * (btnsInRow -
|
int btnSize = (ImGui::GetWindowContentRegionWidth() -
|
||||||
0.6 * btnsInRow)) / btnsInRow;
|
int(ImGuiStyleVar_ItemSpacing) * (btnsInRow - 0.6 * btnsInRow)) /
|
||||||
|
btnsInRow;
|
||||||
|
|
||||||
ImGui::BeginChild("Neonss");
|
ImGui::BeginChild("Neonss");
|
||||||
|
|
||||||
@ -1197,17 +1205,13 @@ void Vehicle::Draw()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Checkbox("Material filter", &m_Color::m_bMatFilter);
|
ImGui::Checkbox("Material filter", &m_Color::m_bMatFilter);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
Ui::DrawImages(m_TextureData,
|
Ui::DrawImages(
|
||||||
[](std::string& str)
|
m_TextureData,
|
||||||
{
|
[](std::string &str) {
|
||||||
Paint::SetNodeTexture(FindPlayerPed()->m_pVehicle, Paint::veh_nodes::selected, str,
|
Paint::SetNodeTexture(FindPlayerPed()->m_pVehicle, Paint::veh_nodes::selected, str,
|
||||||
m_Color::m_bMatFilter);
|
m_Color::m_bMatFilter);
|
||||||
},
|
},
|
||||||
nullptr,
|
nullptr, [](std::string &str) { return str; });
|
||||||
[](std::string& str)
|
|
||||||
{
|
|
||||||
return str;
|
|
||||||
});
|
|
||||||
|
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
@ -1215,15 +1219,12 @@ void Vehicle::Draw()
|
|||||||
if (ImGui::BeginTabItem("Tune"))
|
if (ImGui::BeginTabItem("Tune"))
|
||||||
{
|
{
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
Ui::DrawImages(m_TuneData,
|
Ui::DrawImages(
|
||||||
[](std::string& str) { AddComponent(str); },
|
m_TuneData, [](std::string &str) { AddComponent(str); },
|
||||||
[](std::string& str) { RemoveComponent(str); },
|
[](std::string &str) { RemoveComponent(str); }, [](std::string &str) { return str; },
|
||||||
[](std::string& str) { return str; },
|
[pPlayer](std::string &str) {
|
||||||
[pPlayer](std::string& str)
|
|
||||||
{
|
|
||||||
return ((bool (*)(int, CVehicle *))0x49B010)(std::stoi(str), pPlayer->m_pVehicle);
|
return ((bool (*)(int, CVehicle *))0x49B010)(std::stoi(str), pPlayer->m_pVehicle);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
@ -1274,8 +1275,7 @@ void Vehicle::Draw()
|
|||||||
Ui::EditFloat("Drag mult", pHandling + 0x10, 0.0f, 0.0f, 30.0f);
|
Ui::EditFloat("Drag mult", pHandling + 0x10, 0.0f, 0.0f, 30.0f);
|
||||||
|
|
||||||
static std::vector<Ui::NamedValue> drive_type{
|
static std::vector<Ui::NamedValue> drive_type{
|
||||||
{"Front wheel drive", 70}, {"Rear wheel drive", 82}, {"Four wheel drive", 52}
|
{"Front wheel drive", 70}, {"Rear wheel drive", 82}, {"Four wheel drive", 52}};
|
||||||
};
|
|
||||||
Ui::EditRadioButtonAddressEx("Drive type", pHandling + 0x74, drive_type);
|
Ui::EditRadioButtonAddressEx("Drive type", pHandling + 0x74, drive_type);
|
||||||
|
|
||||||
Ui::EditFloat("Engine acceleration", pHandling + 0x7C, 0.0f, 0.0f, 49.0f, 12500.0f);
|
Ui::EditFloat("Engine acceleration", pHandling + 0x7C, 0.0f, 0.0f, 49.0f, 12500.0f);
|
||||||
@ -1295,7 +1295,8 @@ void Vehicle::Draw()
|
|||||||
Ui::EditFloat("Lower limit", pHandling + 0xBC, -10.0f, -10.0f, 10.0f); // test later
|
Ui::EditFloat("Lower limit", pHandling + 0xBC, -10.0f, -10.0f, 10.0f); // test later
|
||||||
Ui::EditFloat("Mass", pHandling + 0x4, 1.0f, 1.0f, 50000.0f);
|
Ui::EditFloat("Mass", pHandling + 0x4, 1.0f, 1.0f, 50000.0f);
|
||||||
|
|
||||||
///fcommon.UpdateAddress({ name = 'Max velocity',address = phandling + 0x84 ,size = 4,min = 0,max = 2,is_float = true,cvalue = 0.01 , save = false })
|
/// fcommon.UpdateAddress({ name = 'Max velocity',address = phandling + 0x84 ,size = 4,min = 0,max =
|
||||||
|
/// 2,is_float = true,cvalue = 0.01 , save = false })
|
||||||
|
|
||||||
Ui::EditBits("Model flags", pHandling + 0xCC, m_ModelFlagNames);
|
Ui::EditBits("Model flags", pHandling + 0xCC, m_ModelFlagNames);
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ private:
|
|||||||
static inline bool m_bVehWatertight;
|
static inline bool m_bVehWatertight;
|
||||||
static inline bool m_bNoDamage;
|
static inline bool m_bNoDamage;
|
||||||
static inline int m_nDoorMenuButton;
|
static inline int m_nDoorMenuButton;
|
||||||
static inline std::string m_DoorNames[6] =
|
static inline std::string m_DoorNames[6] = {
|
||||||
{ "Hood", "Boot", "Front left door", "Front right door", "Rear left door", "Rear right door" };
|
"Hood", "Boot", "Front left door", "Front right door", "Rear left door", "Rear right door"};
|
||||||
static inline int m_nVehRemoveRadius;
|
static inline int m_nVehRemoveRadius;
|
||||||
static inline bool m_bLockSpeed;
|
static inline bool m_bLockSpeed;
|
||||||
static inline float m_fLockSpeed;
|
static inline float m_fLockSpeed;
|
||||||
@ -64,27 +64,48 @@ private:
|
|||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static inline std::vector<std::string>(m_HandlingFlagNames) = // 32 flags
|
static inline std::vector<std::string>(m_HandlingFlagNames) = // 32 flags
|
||||||
{
|
{"1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL",
|
||||||
"1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", "NO_HANDBRAKE", "STEER_REARWHEELS",
|
"NO_HANDBRAKE", "STEER_REARWHEELS", "HB_REARWHEEL_STEER", "ALT_STEER_OPT",
|
||||||
"HB_REARWHEEL_STEER", "ALT_STEER_OPT",
|
"WHEEL_F_NARROW2", "WHEEL_F_NARROW", "WHEEL_F_WIDE", "WHEEL_F_WIDE2",
|
||||||
"WHEEL_F_NARROW2", "WHEEL_F_NARROW", "WHEEL_F_WIDE", "WHEEL_F_WIDE2", "WHEEL_R_NARROW2", "WHEEL_R_NARROW",
|
"WHEEL_R_NARROW2", "WHEEL_R_NARROW", "WHEEL_R_WIDE", "WHEEL_R_WIDE2",
|
||||||
"WHEEL_R_WIDE", "WHEEL_R_WIDE2",
|
"HYDRAULIC_GEOM", "HYDRAULIC_INST", "HYDRAULIC_NONE", "NOS_INST",
|
||||||
"HYDRAULIC_GEOM", "HYDRAULIC_INST", "HYDRAULIC_NONE", "NOS_INST", "OFFROAD_ABILITY", "OFFROAD_ABILITY2",
|
"OFFROAD_ABILITY", "OFFROAD_ABILITY2", "HALOGEN_LIGHTS", "PROC_REARWHEEL_1ST",
|
||||||
"HALOGEN_LIGHTS", "PROC_REARWHEEL_1ST",
|
"USE_MAXSP_LIMIT", "LOW_RIDER", "STREET_RACER", "SWINGING_CHASSIS",
|
||||||
"USE_MAXSP_LIMIT", "LOW_RIDER", "STREET_RACER", "SWINGING_CHASSIS", "Unused 1", "Unused 2", "Unused 3",
|
"Unused 1", "Unused 2", "Unused 3", "Unused 4"};
|
||||||
"Unused 4"
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline std::vector<std::string>(m_ModelFlagNames) = // 32 flags
|
static inline std::vector<std::string>(m_ModelFlagNames) = // 32 flags
|
||||||
{
|
{"IS_VAN",
|
||||||
"IS_VAN", "IS_BUS", "IS_LOW", "IS_BIG", "REVERSE_BONNET", "HANGING_BOOT", "TAILGATE_BOOT", "NOSWING_BOOT",
|
"IS_BUS",
|
||||||
"NO_DOORS", "TANDEM_SEATS",
|
"IS_LOW",
|
||||||
"SIT_IN_BOAT", "CONVERTIBLE", "NO_EXHAUST", "DOUBLE_EXHAUST", "NO1FPS_LOOK_BEHIND", "FORCE_DOOR_CHECK",
|
"IS_BIG",
|
||||||
"AXLE_F_NOTILT", "AXLE_F_SOLID", "AXLE_F_MCPHERSON",
|
"REVERSE_BONNET",
|
||||||
"AXLE_F_REVERSE", "AXLE_R_NOTILT", "AXLE_R_SOLID", "AXLE_R_MCPHERSON", "AXLE_R_REVERSE", "IS_BIKE", "IS_HELI",
|
"HANGING_BOOT",
|
||||||
"IS_PLANE", "IS_BOAT", "BOUNCE_PANELS",
|
"TAILGATE_BOOT",
|
||||||
"DOUBLE_RWHEELS", "FORCE_GROUND_CLEARANCE", "IS_HATCHBAC1K"
|
"NOSWING_BOOT",
|
||||||
};
|
"NO_DOORS",
|
||||||
|
"TANDEM_SEATS",
|
||||||
|
"SIT_IN_BOAT",
|
||||||
|
"CONVERTIBLE",
|
||||||
|
"NO_EXHAUST",
|
||||||
|
"DOUBLE_EXHAUST",
|
||||||
|
"NO1FPS_LOOK_BEHIND",
|
||||||
|
"FORCE_DOOR_CHECK",
|
||||||
|
"AXLE_F_NOTILT",
|
||||||
|
"AXLE_F_SOLID",
|
||||||
|
"AXLE_F_MCPHERSON",
|
||||||
|
"AXLE_F_REVERSE",
|
||||||
|
"AXLE_R_NOTILT",
|
||||||
|
"AXLE_R_SOLID",
|
||||||
|
"AXLE_R_MCPHERSON",
|
||||||
|
"AXLE_R_REVERSE",
|
||||||
|
"IS_BIKE",
|
||||||
|
"IS_HELI",
|
||||||
|
"IS_PLANE",
|
||||||
|
"IS_BOAT",
|
||||||
|
"BOUNCE_PANELS",
|
||||||
|
"DOUBLE_RWHEELS",
|
||||||
|
"FORCE_GROUND_CLEARANCE",
|
||||||
|
"IS_HATCHBAC1K"};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
149
src/visual.cpp
149
src/visual.cpp
@ -1,9 +1,9 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "visual.h"
|
#include "visual.h"
|
||||||
|
#include "game.h"
|
||||||
|
#include "pch.h"
|
||||||
|
#include "timecycle.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "game.h"
|
|
||||||
#include "timecycle.h"
|
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
#include "CHudColours.h"
|
#include "CHudColours.h"
|
||||||
@ -18,8 +18,7 @@ Visual::Visual()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Events::processScriptsEvent += []
|
Events::processScriptsEvent += [] {
|
||||||
{
|
|
||||||
// TODO: Needs improvement
|
// TODO: Needs improvement
|
||||||
static short m_nBacWeatherType;
|
static short m_nBacWeatherType;
|
||||||
if (m_bLockWeather)
|
if (m_bLockWeather)
|
||||||
@ -34,8 +33,7 @@ Visual::Visual()
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T> int GetTCVal(T *addr, int index)
|
||||||
int GetTCVal(T* addr, int index)
|
|
||||||
{
|
{
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
T *arr = static_cast<T *>(patch::GetPointer(int(addr)));
|
T *arr = static_cast<T *>(patch::GetPointer(int(addr)));
|
||||||
@ -62,7 +60,11 @@ void Visual::GenerateTimecycFile()
|
|||||||
for (uint i = 0; i < m_WeatherNames.size(); ++i)
|
for (uint i = 0; i < m_WeatherNames.size(); ++i)
|
||||||
{
|
{
|
||||||
buffer += "\n// " + m_WeatherNames[i] + "\n";
|
buffer += "\n// " + m_WeatherNames[i] + "\n";
|
||||||
buffer += "// Amb Amb Obj Dir Sky top Sky bot SunCore SunCorona SunSz SprSz SprBght Shdw LightShd PoleShd FarClp FogSt LightOnGround LowCloudsRGB BottomCloudRGB WaterRGBA ARGB1 ARGB2 CloudAlpha IntensityLimit WaterFogAlpha DirMult";
|
buffer += "// Amb Amb Obj Dir Sky top Sky "
|
||||||
|
"bot SunCore SunCorona SunSz SprSz SprBght Shdw "
|
||||||
|
"LightShd PoleShd FarClp FogSt LightOnGround LowCloudsRGB BottomCloudRGB "
|
||||||
|
"WaterRGBA ARGB1 ARGB2 CloudAlpha IntensityLimit "
|
||||||
|
" WaterFogAlpha DirMult";
|
||||||
|
|
||||||
file << buffer << std::endl;
|
file << buffer << std::endl;
|
||||||
for (int j = 0; j < m_nTimecycHour; ++j)
|
for (int j = 0; j < m_nTimecycHour; ++j)
|
||||||
@ -80,35 +82,47 @@ void Visual::GenerateTimecycFile()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (j == 0) buffer = "// Midnight\n";
|
if (j == 0)
|
||||||
if (j == 1) buffer = "// 5 AM\n";
|
buffer = "// Midnight\n";
|
||||||
if (j == 2) buffer = "// 6 AM\n";
|
if (j == 1)
|
||||||
if (j == 3) buffer = "// 7 AM\n";
|
buffer = "// 5 AM\n";
|
||||||
if (j == 4) buffer = "// Midday\n";
|
if (j == 2)
|
||||||
if (j == 5) buffer = "// 7 PM\n";
|
buffer = "// 6 AM\n";
|
||||||
if (j == 6) buffer = "// 8 PM\n";
|
if (j == 3)
|
||||||
if (j == 7) buffer = "// 10 PM\n";
|
buffer = "// 7 AM\n";
|
||||||
|
if (j == 4)
|
||||||
|
buffer = "// Midday\n";
|
||||||
|
if (j == 5)
|
||||||
|
buffer = "// 7 PM\n";
|
||||||
|
if (j == 6)
|
||||||
|
buffer = "// 8 PM\n";
|
||||||
|
if (j == 7)
|
||||||
|
buffer = "// 10 PM\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int val = 23 * j + i;
|
int val = 23 * j + i;
|
||||||
|
|
||||||
buffer += std::format("{} {} {}\t{} {} {}\t255 255 255\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}",
|
buffer += std::format(
|
||||||
|
"{} {} {}\t{} {} {}\t255 255 255\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} "
|
||||||
|
"{}\t{} {} {}\t{} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}",
|
||||||
GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),
|
GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),
|
||||||
GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val),
|
GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val),
|
||||||
GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopBlue, val),
|
GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopBlue, val),
|
||||||
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
|
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
|
||||||
GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreBlue, val),
|
GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreBlue, val),
|
||||||
GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaBlue, val),
|
GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaBlue, val),
|
||||||
GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSpriteBrightness, val) / 10.0f,
|
GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSpriteSize, val) / 10.0f,
|
||||||
GetTCVal(m_nShadowStrength, val), GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_nPoleShadowStrength, val),
|
GetTCVal(m_fSpriteBrightness, val) / 10.0f, GetTCVal(m_nShadowStrength, val),
|
||||||
GetTCVal(m_fFarClip, val), GetTCVal(m_fFogStart, val), GetTCVal(m_fLightsOnGroundBrightness, val)/ 10.0f,
|
GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_nPoleShadowStrength, val), GetTCVal(m_fFarClip, val),
|
||||||
|
GetTCVal(m_fFogStart, val), GetTCVal(m_fLightsOnGroundBrightness, val) / 10.0f,
|
||||||
GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val),
|
GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val),
|
||||||
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
|
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
|
||||||
GetTCVal(m_fWaterRed, val), GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterAlpha, val),
|
GetTCVal(m_fWaterRed, val), GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val),
|
||||||
GetTCVal(m_fPostFx1Red, val), GetTCVal(m_fPostFx1Green, val), GetTCVal(m_fPostFx1Blue, val), GetTCVal(m_fPostFx1Alpha, val),
|
GetTCVal(m_fWaterAlpha, val), GetTCVal(m_fPostFx1Red, val), GetTCVal(m_fPostFx1Green, val),
|
||||||
GetTCVal(m_fPostFx2Red, val), GetTCVal(m_fPostFx2Green, val), GetTCVal(m_fPostFx2Blue, val), GetTCVal(m_fPostFx2Alpha, val),
|
GetTCVal(m_fPostFx1Blue, val), GetTCVal(m_fPostFx1Alpha, val), GetTCVal(m_fPostFx2Red, val),
|
||||||
GetTCVal(m_fCloudAlpha, val), GetTCVal(m_nHighLightMinIntensity, val), GetTCVal(m_nWaterFogAlpha, val), GetTCVal(m_nDirectionalMult, val) / 100.0
|
GetTCVal(m_fPostFx2Green, val), GetTCVal(m_fPostFx2Blue, val), GetTCVal(m_fPostFx2Alpha, val),
|
||||||
);
|
GetTCVal(m_fCloudAlpha, val), GetTCVal(m_nHighLightMinIntensity, val), GetTCVal(m_nWaterFogAlpha, val),
|
||||||
|
GetTCVal(m_nDirectionalMult, val) / 100.0);
|
||||||
file << buffer << std::endl;
|
file << buffer << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,7 +147,9 @@ void Visual::GenerateTimecycFile()
|
|||||||
buffer = "\n// FOGGY\n";
|
buffer = "\n// FOGGY\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer += "// Amb Amb_Obj Amb_bl Amb_Obj_bl Dir Sky top Sky bot SunCore SunCorona SunSz SprSz SprBght Shdw LightShd PoleShd FarClp FogSt LightOnGround LowCloudsRGB TopCloudRGB BottomCloudRGB BlurRGB WaterRGBA";
|
buffer += "// Amb Amb_Obj Amb_bl Amb_Obj_bl Dir Sky top Sky bot SunCore "
|
||||||
|
" SunCorona SunSz SprSz SprBght Shdw LightShd PoleShd FarClp FogSt LightOnGround "
|
||||||
|
"LowCloudsRGB TopCloudRGB BottomCloudRGB BlurRGB WaterRGBA";
|
||||||
|
|
||||||
file << buffer << std::endl;
|
file << buffer << std::endl;
|
||||||
|
|
||||||
@ -151,25 +167,28 @@ void Visual::GenerateTimecycFile()
|
|||||||
|
|
||||||
size_t val = 7 * i + j;
|
size_t val = 7 * i + j;
|
||||||
|
|
||||||
buffer += std::format("{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}",
|
buffer += std::format(
|
||||||
|
"{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} "
|
||||||
|
"{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}",
|
||||||
GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),
|
GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),
|
||||||
GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val),
|
GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val),
|
||||||
GetTCVal(m_nAmbientBlRed, val), GetTCVal(m_nAmbientBlGreen, val), GetTCVal(m_nAmbientBlBlue, val),
|
GetTCVal(m_nAmbientBlRed, val), GetTCVal(m_nAmbientBlGreen, val), GetTCVal(m_nAmbientBlBlue, val),
|
||||||
GetTCVal(m_nAmbientBlRed_Obj, val), GetTCVal(m_nAmbientBlGreen_Obj, val), GetTCVal(m_nAmbientBlBlue_Obj, val),
|
GetTCVal(m_nAmbientBlRed_Obj, val), GetTCVal(m_nAmbientBlGreen_Obj, val),
|
||||||
GetTCVal(m_nDirRed, val), GetTCVal(m_nDirGreen, val), GetTCVal(m_nDirBlue, val),
|
GetTCVal(m_nAmbientBlBlue_Obj, val), GetTCVal(m_nDirRed, val), GetTCVal(m_nDirGreen, val),
|
||||||
GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopBlue, val),
|
GetTCVal(m_nDirBlue, val), GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val),
|
||||||
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
|
GetTCVal(m_nSkyTopBlue, val), GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val),
|
||||||
GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreBlue, val),
|
GetTCVal(m_nSkyBottomBlue, val), GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val),
|
||||||
GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaBlue, val),
|
GetTCVal(m_nSunCoreBlue, val), GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val),
|
||||||
GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSpriteBrightness, val) / 10.0f,
|
GetTCVal(m_nSunCoronaBlue, val), GetTCVal(m_fSunSize, val) / 10.0f,
|
||||||
GetTCVal(m_nShadowStrength, val), GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_nPoleShadowStrength, val),
|
GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSpriteBrightness, val) / 10.0f,
|
||||||
GetTCVal(m_fFarClip, val), GetTCVal(m_fFogStart, val), GetTCVal(m_fLightsOnGroundBrightness, val)/ 10.0f,
|
GetTCVal(m_nShadowStrength, val), GetTCVal(m_nLightShadowStrength, val),
|
||||||
GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val),
|
GetTCVal(m_nPoleShadowStrength, val), GetTCVal(m_fFarClip, val), GetTCVal(m_fFogStart, val),
|
||||||
GetTCVal(m_nTopCloudsRed, val), GetTCVal(m_nTopCloudsGreen, val), GetTCVal(m_nTopCloudsBlue, val),
|
GetTCVal(m_fLightsOnGroundBrightness, val) / 10.0f, GetTCVal(m_nLowCloudsRed, val),
|
||||||
GetTCVal(m_nBottomCloudsRed, val), GetTCVal(m_nBottomCloudsGreen, val), GetTCVal(m_nBottomCloudsBlue, val),
|
GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val), GetTCVal(m_nTopCloudsRed, val),
|
||||||
GetTCVal(m_nBlurRed, val), GetTCVal(m_nBlurGreen, val), GetTCVal(m_nBlurBlue, val),
|
GetTCVal(m_nTopCloudsGreen, val), GetTCVal(m_nTopCloudsBlue, val), GetTCVal(m_nBottomCloudsRed, val),
|
||||||
GetTCVal(m_fWaterRed, val), GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterAlpha, val)
|
GetTCVal(m_nBottomCloudsGreen, val), GetTCVal(m_nBottomCloudsBlue, val), GetTCVal(m_nBlurRed, val),
|
||||||
);
|
GetTCVal(m_nBlurGreen, val), GetTCVal(m_nBlurBlue, val), GetTCVal(m_fWaterRed, val),
|
||||||
|
GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterAlpha, val));
|
||||||
file << buffer << std::endl;
|
file << buffer << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -189,14 +208,22 @@ int Visual::CalcArrayIndex()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (hour < 5) result = 0;
|
if (hour < 5)
|
||||||
if (hour == 5) result = 1;
|
result = 0;
|
||||||
if (hour == 6) result = 2;
|
if (hour == 5)
|
||||||
if (7 <= hour && hour < 12) result = 3;
|
result = 1;
|
||||||
if (12 <= hour && hour < 19) result = 4;
|
if (hour == 6)
|
||||||
if (hour == 19) result = 5;
|
result = 2;
|
||||||
if (hour == 20 || hour == 21) result = 6;
|
if (7 <= hour && hour < 12)
|
||||||
if (hour == 22 || hour == 23) result = 7;
|
result = 3;
|
||||||
|
if (12 <= hour && hour < 19)
|
||||||
|
result = 4;
|
||||||
|
if (hour == 19)
|
||||||
|
result = 5;
|
||||||
|
if (hour == 20 || hour == 21)
|
||||||
|
result = 6;
|
||||||
|
if (hour == 22 || hour == 23)
|
||||||
|
result = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 23 * result + CWeather::OldWeatherType;
|
return 23 * result + CWeather::OldWeatherType;
|
||||||
@ -442,8 +469,8 @@ void Visual::Draw()
|
|||||||
if (ImGui::BeginChild("VisualsChild"))
|
if (ImGui::BeginChild("VisualsChild"))
|
||||||
{
|
{
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
ImGui::TextWrapped(
|
ImGui::TextWrapped("These options won't work if you got any mods that drastically changes the game "
|
||||||
"These options won't work if you got any mods that drastically changes the game hud. i.e. Mobile Hud, GTA 5 Hud etc.");
|
"hud. i.e. Mobile Hud, GTA 5 Hud etc.");
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
Ui::ColorPickerAddress("Armourbar color", *(int *)0x5890FC, ImVec4(225, 225, 225, 255));
|
Ui::ColorPickerAddress("Armourbar color", *(int *)0x5890FC, ImVec4(225, 225, 225, 255));
|
||||||
Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999);
|
Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999);
|
||||||
@ -462,8 +489,7 @@ void Visual::Draw()
|
|||||||
Ui::EditAddress<float>("Money posX", *(int *)0x58F5FC, -999, 32, 999);
|
Ui::EditAddress<float>("Money posX", *(int *)0x58F5FC, -999, 32, 999);
|
||||||
Ui::EditAddress<float>("Money posY", 0x866C88, -999, 89, 999);
|
Ui::EditAddress<float>("Money posY", 0x866C88, -999, 89, 999);
|
||||||
static std::vector<Ui::NamedValue> font_outline{
|
static std::vector<Ui::NamedValue> font_outline{
|
||||||
{"No outline", 0}, {"Thin outline", 1}, {"Default outline", 2}
|
{"No outline", 0}, {"Thin outline", 1}, {"Default outline", 2}};
|
||||||
};
|
|
||||||
Ui::EditRadioButtonAddressEx("Money font outline", 0x58F58D, font_outline);
|
Ui::EditRadioButtonAddressEx("Money font outline", 0x58F58D, font_outline);
|
||||||
static std::vector<Ui::NamedValue> style{{"Style 1", 1}, {"Style 2", 2}, {"Default style", 3}};
|
static std::vector<Ui::NamedValue> style{{"Style 1", 1}, {"Style 2", 2}, {"Default style", 3}};
|
||||||
Ui::EditRadioButtonAddressEx("Money font style", 0x58F57F, style);
|
Ui::EditRadioButtonAddressEx("Money font style", 0x58F57F, style);
|
||||||
@ -533,15 +559,19 @@ void Visual::Draw()
|
|||||||
|
|
||||||
if (ImGui::InputInt("Hour", &hour) & !Game::m_bSyncTime)
|
if (ImGui::InputInt("Hour", &hour) & !Game::m_bSyncTime)
|
||||||
{
|
{
|
||||||
if (hour < 0) hour = 23;
|
if (hour < 0)
|
||||||
if (hour > 23) hour = 0;
|
hour = 23;
|
||||||
|
if (hour > 23)
|
||||||
|
hour = 0;
|
||||||
CClock::ms_nGameClockHours = hour;
|
CClock::ms_nGameClockHours = hour;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::InputInt("Minute", &minute) & !Game::m_bSyncTime)
|
if (ImGui::InputInt("Minute", &minute) & !Game::m_bSyncTime)
|
||||||
{
|
{
|
||||||
if (minute < 0) minute = 59;
|
if (minute < 0)
|
||||||
if (minute > 59) minute = 0;
|
minute = 59;
|
||||||
|
if (minute > 59)
|
||||||
|
minute = 0;
|
||||||
CClock::ms_nGameClockMinutes = minute;
|
CClock::ms_nGameClockMinutes = minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,7 +608,8 @@ void Visual::Draw()
|
|||||||
m_nFluffyCloudsBottomBlue);
|
m_nFluffyCloudsBottomBlue);
|
||||||
#elif GTAVC
|
#elif GTAVC
|
||||||
TimeCycColorEdit3("Ambient bl", m_nAmbientBlRed, m_nAmbientBlGreen, m_nAmbientBlBlue);
|
TimeCycColorEdit3("Ambient bl", m_nAmbientBlRed, m_nAmbientBlGreen, m_nAmbientBlBlue);
|
||||||
TimeCycColorEdit3("Ambient obj bl", m_nAmbientBlRed_Obj, m_nAmbientBlGreen_Obj, m_nAmbientBlBlue_Obj);
|
TimeCycColorEdit3("Ambient obj bl", m_nAmbientBlRed_Obj, m_nAmbientBlGreen_Obj,
|
||||||
|
m_nAmbientBlBlue_Obj);
|
||||||
TimeCycColorEdit3("Blur", m_nBlurRed, m_nBlurGreen, m_nBlurBlue);
|
TimeCycColorEdit3("Blur", m_nBlurRed, m_nBlurGreen, m_nBlurBlue);
|
||||||
TimeCycColorEdit3("Clouds bottom", m_nBottomCloudsRed, m_nBottomCloudsGreen, m_nBottomCloudsBlue);
|
TimeCycColorEdit3("Clouds bottom", m_nBottomCloudsRed, m_nBottomCloudsGreen, m_nBottomCloudsBlue);
|
||||||
TimeCycColorEdit3("Clouds top", m_nTopCloudsRed, m_nTopCloudsGreen, m_nTopCloudsBlue);
|
TimeCycColorEdit3("Clouds top", m_nTopCloudsRed, m_nTopCloudsGreen, m_nTopCloudsBlue);
|
||||||
|
30
src/visual.h
30
src/visual.h
@ -14,28 +14,32 @@ private:
|
|||||||
|
|
||||||
// Timecyc stuff
|
// Timecyc stuff
|
||||||
static inline int m_nTimecycHour = 8;
|
static inline int m_nTimecycHour = 8;
|
||||||
static inline std::vector<std::string> m_WeatherNames
|
static inline std::vector<std::string> m_WeatherNames{"EXTRASUNNY LA", "SUNNY LA",
|
||||||
{
|
"EXTRASUNNY SMOG LA", "SUNNY SMOG LA",
|
||||||
"EXTRASUNNY LA", "SUNNY LA", "EXTRASUNNY SMOG LA", "SUNNY SMOG LA", "CLOUDY LA", "SUNNY SF", "EXTRASUNNY SF",
|
"CLOUDY LA", "SUNNY SF",
|
||||||
"CLOUDY SF", "RAINY SF", "FOGGY SF",
|
"EXTRASUNNY SF", "CLOUDY SF",
|
||||||
"SUNNY VEGAS", "EXTRASUNNY VEGAS", "CLOUDY VEGAS", "EXTRASUNNY COUNTRYSIDE", "SUNNY COUNTRYSIDE",
|
"RAINY SF", "FOGGY SF",
|
||||||
"CLOUDY COUNTRYSIDE", "RAINY COUNTRYSIDE",
|
"SUNNY VEGAS", "EXTRASUNNY VEGAS",
|
||||||
"EXTRASUNNY DESERT", "SUNNY DESERT", "SANDSTORM DESERT", "UNDERWATER", "EXTRACOLOURS 1", "EXTRACOLOURS 2"
|
"CLOUDY VEGAS", "EXTRASUNNY COUNTRYSIDE",
|
||||||
};
|
"SUNNY COUNTRYSIDE", "CLOUDY COUNTRYSIDE",
|
||||||
|
"RAINY COUNTRYSIDE", "EXTRASUNNY DESERT",
|
||||||
|
"SUNNY DESERT", "SANDSTORM DESERT",
|
||||||
|
"UNDERWATER", "EXTRACOLOURS 1",
|
||||||
|
"EXTRACOLOURS 2"};
|
||||||
|
|
||||||
static void GenerateTimecycFile();
|
static void GenerateTimecycFile();
|
||||||
static int CalcArrayIndex();
|
static int CalcArrayIndex();
|
||||||
static bool TimeCycColorEdit3(const char *label, uchar *r, uchar *g, uchar *b, ImGuiColorEditFlags flags = 0);
|
static bool TimeCycColorEdit3(const char *label, uchar *r, uchar *g, uchar *b, ImGuiColorEditFlags flags = 0);
|
||||||
static bool TimeCycColorEdit4(const char* label, uchar* r, uchar* g, uchar* b, uchar* a, ImGuiColorEditFlags flags = 0);
|
static bool TimeCycColorEdit4(const char *label, uchar *r, uchar *g, uchar *b, uchar *a,
|
||||||
template <typename T>
|
ImGuiColorEditFlags flags = 0);
|
||||||
static void TimecycSlider(const char* label, T* data, int min, int max);
|
template <typename T> static void TimecycSlider(const char *label, T *data, int min, int max);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Visual();
|
Visual();
|
||||||
static void Draw();
|
static void Draw();
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T> void Visual::TimecycSlider(const char *label, T *ptr, int min, int max)
|
||||||
void Visual::TimecycSlider(const char* label, T* ptr, int min, int max)
|
|
||||||
{
|
{
|
||||||
int val = CalcArrayIndex();
|
int val = CalcArrayIndex();
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
|
@ -38,10 +38,7 @@
|
|||||||
#define VK_KEY_Y 0x59
|
#define VK_KEY_Y 0x59
|
||||||
#define VK_KEY_Z 0x5A
|
#define VK_KEY_Z 0x5A
|
||||||
|
|
||||||
|
static std::string key_names[]{"LMB",
|
||||||
static std::string key_names[]
|
|
||||||
{
|
|
||||||
"LMB",
|
|
||||||
"RMB",
|
"RMB",
|
||||||
"Cancel",
|
"Cancel",
|
||||||
"MMB",
|
"MMB",
|
||||||
@ -206,5 +203,4 @@ static std::string key_names[]
|
|||||||
"LCtrl",
|
"LCtrl",
|
||||||
"RCtrl",
|
"RCtrl",
|
||||||
"LMenu",
|
"LMenu",
|
||||||
"RMenu"
|
"RMenu"};
|
||||||
};
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
#include "pch.h"
|
|
||||||
#include "weapon.h"
|
#include "weapon.h"
|
||||||
|
#include "CWeaponInfo.h"
|
||||||
|
#include "pch.h"
|
||||||
|
#include "ped.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ped.h"
|
|
||||||
#include "CWeaponInfo.h"
|
|
||||||
|
|
||||||
Weapon::Weapon()
|
Weapon::Weapon()
|
||||||
{
|
{
|
||||||
Events::processScriptsEvent += []
|
Events::processScriptsEvent += [] {
|
||||||
{
|
|
||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
@ -28,7 +27,6 @@ Weapon::Weapon()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
uchar slot = BY_GAME(player->m_nActiveWeaponSlot, player->m_nActiveWeaponSlot, player->m_nCurrentWeapon);
|
uchar slot = BY_GAME(player->m_nActiveWeaponSlot, player->m_nActiveWeaponSlot, player->m_nCurrentWeapon);
|
||||||
if (m_nCurrentWeaponSlot != slot)
|
if (m_nCurrentWeaponSlot != slot)
|
||||||
{
|
{
|
||||||
@ -68,14 +66,14 @@ Weapon::Weapon()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
if (m_bRapidFire && weaponType != BY_GAME(WEAPON_MINIGUN, WEAPONTYPE_MINIGUN)) // mingun doesn't work with rapidfire
|
if (m_bRapidFire &&
|
||||||
|
weaponType != BY_GAME(WEAPON_MINIGUN, WEAPONTYPE_MINIGUN)) // mingun doesn't work with rapidfire
|
||||||
{
|
{
|
||||||
pWeaponInfo->m_nFlags.bContinuosFire = true;
|
pWeaponInfo->m_nFlags.bContinuosFire = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_bDualWeild && (weaponType == WEAPON_PISTOL || weaponType == WEAPON_MICRO_UZI || weaponType ==
|
if (m_bDualWeild && (weaponType == WEAPON_PISTOL || weaponType == WEAPON_MICRO_UZI ||
|
||||||
WEAPON_TEC9 || weaponType == WEAPON_SAWNOFF))
|
weaponType == WEAPON_TEC9 || weaponType == WEAPON_SAWNOFF))
|
||||||
{
|
{
|
||||||
pWeaponInfo->m_nFlags.bTwinPistol = true;
|
pWeaponInfo->m_nFlags.bTwinPistol = true;
|
||||||
}
|
}
|
||||||
@ -99,8 +97,8 @@ Weapon::Weapon()
|
|||||||
void Weapon::SetGangWeapon(std::string &weapon_type)
|
void Weapon::SetGangWeapon(std::string &weapon_type)
|
||||||
{
|
{
|
||||||
m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon] = std::stoi(weapon_type);
|
m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon] = std::stoi(weapon_type);
|
||||||
CGangs::SetGangWeapons(m_nSelectedGang, m_nGangWeaponList[m_nSelectedGang][0], m_nGangWeaponList[m_nSelectedGang][1],
|
CGangs::SetGangWeapons(m_nSelectedGang, m_nGangWeaponList[m_nSelectedGang][0],
|
||||||
m_nGangWeaponList[m_nSelectedGang][2]);
|
m_nGangWeaponList[m_nSelectedGang][1], m_nGangWeaponList[m_nSelectedGang][2]);
|
||||||
}
|
}
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
// Implementation of SA opcode 0x555
|
// Implementation of SA opcode 0x555
|
||||||
@ -152,7 +150,8 @@ static eWeaponType GetWeaponTypeFromModel(int model)
|
|||||||
for (size_t i = 0; i < 37; i++)
|
for (size_t i = 0; i < 37; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
int temp = CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(i); // int __cdecl CPickups::ModelForWeapon(int a1)
|
int temp =
|
||||||
|
CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(i); // int __cdecl CPickups::ModelForWeapon(int a1)
|
||||||
|
|
||||||
if (temp == model)
|
if (temp == model)
|
||||||
{
|
{
|
||||||
@ -250,7 +249,8 @@ void Weapon::Draw()
|
|||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Command<Commands::GET_WEAPONTYPE_MODEL>(weaponType, &model);
|
Command<Commands::GET_WEAPONTYPE_MODEL>(weaponType, &model);
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
model = CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(weaponType); // int __cdecl CPickups::ModelForWeapon(int a1)
|
model = CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(
|
||||||
|
weaponType); // int __cdecl CPickups::ModelForWeapon(int a1)
|
||||||
#endif
|
#endif
|
||||||
Command<Commands::CREATE_PICKUP_WITH_AMMO>(model, 3, 999, x, y, z, &pickup);
|
Command<Commands::CREATE_PICKUP_WITH_AMMO>(model, 3, 999, x, y, z, &pickup);
|
||||||
|
|
||||||
@ -292,7 +292,9 @@ void Weapon::Draw()
|
|||||||
Ui::ShowTooltip("Weapon tweaks apply globally\nto every ped weapon type");
|
Ui::ShowTooltip("Weapon tweaks apply globally\nto every ped weapon type");
|
||||||
ImGui::Columns(2, 0, false);
|
ImGui::Columns(2, 0, false);
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Ui::CheckboxWithHint("Fast aim", &m_bAutoAim, "Enables aim assist on keyboard\n\nQ = left E = right\n\nPress Q and E to switch targets.\nMoving mouse removes the target!");
|
Ui::CheckboxWithHint("Fast aim", &m_bAutoAim,
|
||||||
|
"Enables aim assist on keyboard\n\nQ = left E = right\n\nPress Q and E to switch "
|
||||||
|
"targets.\nMoving mouse removes the target!");
|
||||||
if (Ui::CheckboxWithHint("Dual wield", &m_bDualWeild,
|
if (Ui::CheckboxWithHint("Dual wield", &m_bDualWeild,
|
||||||
"Dual wield pistol, shawoff, uzi, tec9\n(Other weapons don't work)"))
|
"Dual wield pistol, shawoff, uzi, tec9\n(Other weapons don't work)"))
|
||||||
{
|
{
|
||||||
@ -302,7 +304,8 @@ void Weapon::Draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (Ui::CheckboxWithHint("Huge damage", &m_bHugeDamage, "Also enable 'Long range' if weapon range is short"))
|
if (Ui::CheckboxWithHint("Huge damage", &m_bHugeDamage,
|
||||||
|
"Also enable 'Long range' if weapon range is short"))
|
||||||
{
|
{
|
||||||
if (!m_bHugeDamage)
|
if (!m_bHugeDamage)
|
||||||
{
|
{
|
||||||
@ -364,10 +367,12 @@ void Weapon::Draw()
|
|||||||
m_nAmmoCount = (m_nAmmoCount > 99999) ? 99999 : m_nAmmoCount;
|
m_nAmmoCount = (m_nAmmoCount > 99999) ? 99999 : m_nAmmoCount;
|
||||||
}
|
}
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
Ui::DrawImages(m_WeaponData, GiveWeaponToPlayer, nullptr,
|
Ui::DrawImages(
|
||||||
|
m_WeaponData, GiveWeaponToPlayer, nullptr,
|
||||||
[](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); },
|
[](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); },
|
||||||
[](std::string str) { return str != "0"; /*Unarmed*/ }
|
[](std::string str) {
|
||||||
);
|
return str != "0"; /*Unarmed*/
|
||||||
|
});
|
||||||
#else // GTA3 & GTAVC
|
#else // GTA3 & GTAVC
|
||||||
Ui::DrawJSON(m_WeaponData, GiveWeaponToPlayer, nullptr);
|
Ui::DrawJSON(m_WeaponData, GiveWeaponToPlayer, nullptr);
|
||||||
#endif
|
#endif
|
||||||
@ -388,14 +393,18 @@ void Weapon::Draw()
|
|||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::Text("Current weapon: %s",
|
ImGui::Text(
|
||||||
m_WeaponData.m_pJson->m_Data[std::to_string(m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon])].get<
|
"Current weapon: %s",
|
||||||
std::string>().c_str());
|
m_WeaponData.m_pJson->m_Data[std::to_string(m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon])]
|
||||||
|
.get<std::string>()
|
||||||
|
.c_str());
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
Ui::DrawImages(m_WeaponData, SetGangWeapon, nullptr,
|
Ui::DrawImages(
|
||||||
|
m_WeaponData, SetGangWeapon, nullptr,
|
||||||
[](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); },
|
[](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); },
|
||||||
[](std::string str) { return str != "-1"; /*Jetpack*/ }
|
[](std::string str) {
|
||||||
);
|
return str != "-1"; /*Jetpack*/
|
||||||
|
});
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,8 +25,7 @@ public:
|
|||||||
static inline int m_nSelectedWeapon;
|
static inline int m_nSelectedWeapon;
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static inline int m_nGangWeaponList[10][3] =
|
static inline int m_nGangWeaponList[10][3] = {
|
||||||
{
|
|
||||||
{WEAPON_PISTOL, WEAPON_MICRO_UZI, WEAPON_UNARMED}, // Ballas
|
{WEAPON_PISTOL, WEAPON_MICRO_UZI, WEAPON_UNARMED}, // Ballas
|
||||||
{WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Grove
|
{WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Grove
|
||||||
{WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Vagos
|
{WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Vagos
|
||||||
|
Loading…
Reference in New Issue
Block a user