Add model editor, fix typo
This commit is contained in:
parent
442c70a6e3
commit
3a5fbe3a7b
@ -264,6 +264,7 @@ AddPed = "Add ped"
|
|||||||
AddPedMSG = "Ped added"
|
AddPedMSG = "Ped added"
|
||||||
BigHead = "Big head effect"
|
BigHead = "Big head effect"
|
||||||
ConfigTab = "Config"
|
ConfigTab = "Config"
|
||||||
|
CurrentModels = "Current models"
|
||||||
DownloadExGangWars = "Download ExGangWars"
|
DownloadExGangWars = "Download ExGangWars"
|
||||||
ElvisEverywhere = "Elvis everywhere"
|
ElvisEverywhere = "Elvis everywhere"
|
||||||
EndWar = "End gang war"
|
EndWar = "End gang war"
|
||||||
@ -273,6 +274,7 @@ ExGangWarsTip = "You'll need ExGangWars plugin to display some turf colors"
|
|||||||
GangsControl = "Gangs control streets"
|
GangsControl = "Gangs control streets"
|
||||||
GangsEverywhere = "Gangs everywhere"
|
GangsEverywhere = "Gangs everywhere"
|
||||||
Gangs = "Gangs"
|
Gangs = "Gangs"
|
||||||
|
GangModelEditor = "Gang model editor"
|
||||||
GangWars = "Gang wars"
|
GangWars = "Gang wars"
|
||||||
GetPlayerModel = "Insert player model"
|
GetPlayerModel = "Insert player model"
|
||||||
Health = "Health"
|
Health = "Health"
|
||||||
@ -292,6 +294,7 @@ RecruitAnyone = "Recruit anyone"
|
|||||||
RemoveFrozen = "Remove frozen peds"
|
RemoveFrozen = "Remove frozen peds"
|
||||||
RemovePeds = "Remove peds"
|
RemovePeds = "Remove peds"
|
||||||
RemovePedsRadius = "Remove peds in radius"
|
RemovePedsRadius = "Remove peds in radius"
|
||||||
|
ResetModels = "Reset models"
|
||||||
SelectedWeapon = "Selected weapon: %s"
|
SelectedWeapon = "Selected weapon: %s"
|
||||||
SelectWeapon = "Select weapon"
|
SelectWeapon = "Select weapon"
|
||||||
SlutMagnet = "Slut magnet"
|
SlutMagnet = "Slut magnet"
|
||||||
@ -783,6 +786,7 @@ MoveWhenFiring = "Move when firing"
|
|||||||
NoSpread = "No spread"
|
NoSpread = "No spread"
|
||||||
RapidFire = "Rapid fire"
|
RapidFire = "Rapid fire"
|
||||||
SelectGang = "Select gang"
|
SelectGang = "Select gang"
|
||||||
|
SelectMember = "Select member"
|
||||||
Weapon1 = "Weapon 1"
|
Weapon1 = "Weapon 1"
|
||||||
Weapon2 = "Weapon 2"
|
Weapon2 = "Weapon 2"
|
||||||
Weapon3 = "Weapon 3"
|
Weapon3 = "Weapon 3"
|
||||||
|
@ -121,6 +121,22 @@ void PedPage::AddNewPed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
|
|
||||||
|
unsigned int PedPage::GangStruct::GetModel(unsigned int gangId, unsigned int memberId)
|
||||||
|
{
|
||||||
|
return CPopulation::m_PedGroups[42 + static_cast<int>(gangId)][memberId];
|
||||||
|
}
|
||||||
|
|
||||||
|
void PedPage::GangStruct::SetModel(unsigned int gangId, unsigned int memberId, unsigned int model)
|
||||||
|
{
|
||||||
|
CPopulation::m_PedGroups[42 + static_cast<int>(gangId)][memberId] = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PedPage::GangStruct::ResetModels()
|
||||||
|
{
|
||||||
|
CPopulation::LoadPedGroups();
|
||||||
|
}
|
||||||
|
|
||||||
void PedPage::SpawnPed(std::string& model)
|
void PedPage::SpawnPed(std::string& model)
|
||||||
#else
|
#else
|
||||||
void PedPage::SpawnPed(std::string& cat, std::string& name, std::string& model)
|
void PedPage::SpawnPed(std::string& cat, std::string& name, std::string& model)
|
||||||
@ -413,64 +429,99 @@ void PedPage::Draw()
|
|||||||
}
|
}
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
if (ImGui::BeginTabItem(TEXT("Ped.Gangs")))
|
if (ImGui::BeginTabItem(TEXT("Ped.Gangs")))
|
||||||
{
|
{
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::Button(TEXT("Ped.StartWar"), ImVec2(Widget::CalcSize(2))))
|
|
||||||
{
|
|
||||||
if (Util::GetLargestGangInZone() == 1)
|
|
||||||
{
|
|
||||||
CGangWars::StartDefensiveGangWar();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CGangWars::StartOffensiveGangWar();
|
|
||||||
}
|
|
||||||
CGangWars::bGangWarsActive = true;
|
|
||||||
}
|
|
||||||
ImGui::SameLine();
|
|
||||||
if (ImGui::Button(TEXT("Ped.EndWar"), ImVec2(Widget::CalcSize(2))))
|
|
||||||
{
|
|
||||||
CGangWars::EndGangWar(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(0, 20));
|
if (ImGui::BeginTabBar("GANGGGG"))
|
||||||
ImGui::TextWrapped(TEXT("Ped.ZoneDensity"));
|
|
||||||
ImGui::Spacing();
|
|
||||||
|
|
||||||
static const char* m_GangList[] =
|
|
||||||
{
|
{
|
||||||
"Ballas", "Grove street families", "Los santos vagos", "San fierro rifa",
|
if (ImGui::BeginTabItem(TEXT("Ped.GangWars")))
|
||||||
"Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"
|
|
||||||
};
|
|
||||||
ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() / 2);
|
|
||||||
for (int i = 0; i != 10; ++i)
|
|
||||||
{
|
|
||||||
CVector pos = FindPlayerPed()->GetPosition();
|
|
||||||
CZoneInfo* info = CTheZones::GetZoneInfo(&pos, nullptr);
|
|
||||||
int density = info->m_nGangDensity[i];
|
|
||||||
if (ImGui::SliderInt(m_GangList[i], &density, 0, 127))
|
|
||||||
{
|
{
|
||||||
info->m_nGangDensity[i] = static_cast<int8_t>(density);
|
ImGui::Spacing();
|
||||||
Command<Commands::CLEAR_SPECIFIC_ZONES_TO_TRIGGER_GANG_WAR>();
|
if (ImGui::Button(TEXT("Ped.StartWar"), ImVec2(Widget::CalcSize(2))))
|
||||||
CGangWars::bGangWarsActive = true;
|
{
|
||||||
}
|
if (Util::GetLargestGangInZone() == 1)
|
||||||
}
|
{
|
||||||
ImGui::PopItemWidth();
|
CGangWars::StartDefensiveGangWar();
|
||||||
static bool pluginRequired = (GetModuleHandle("ExGangWars.asi") == 0);
|
}
|
||||||
if (pluginRequired)
|
else
|
||||||
{
|
{
|
||||||
ImGui::Spacing();
|
CGangWars::StartOffensiveGangWar();
|
||||||
ImGui::TextWrapped(TEXT("Ped.ExGangWarsTip"));
|
}
|
||||||
ImGui::Spacing();
|
CGangWars::bGangWarsActive = true;
|
||||||
if (ImGui::Button(TEXT("Ped.DownloadExGangWars"), Widget::CalcSize(1)))
|
}
|
||||||
{
|
ImGui::SameLine();
|
||||||
OPEN_LINK("https://gtaforums.com/topic/682194-extended-gang-wars/");
|
if (ImGui::Button(TEXT("Ped.EndWar"), ImVec2(Widget::CalcSize(2))))
|
||||||
}
|
{
|
||||||
}
|
CGangWars::EndGangWar(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2(0, 20));
|
||||||
|
ImGui::TextWrapped(TEXT("Ped.ZoneDensity"));
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
static const char* m_GangList[] =
|
||||||
|
{
|
||||||
|
"Ballas", "Grove street families", "Los santos vagos", "San fierro rifa",
|
||||||
|
"Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"
|
||||||
|
};
|
||||||
|
ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() / 2);
|
||||||
|
for (int i = 0; i != 10; ++i)
|
||||||
|
{
|
||||||
|
CVector pos = FindPlayerPed()->GetPosition();
|
||||||
|
CZoneInfo* info = CTheZones::GetZoneInfo(&pos, nullptr);
|
||||||
|
int density = info->m_nGangDensity[i];
|
||||||
|
if (ImGui::SliderInt(m_GangList[i], &density, 0, 127))
|
||||||
|
{
|
||||||
|
info->m_nGangDensity[i] = static_cast<int8_t>(density);
|
||||||
|
Command<Commands::CLEAR_SPECIFIC_ZONES_TO_TRIGGER_GANG_WAR>();
|
||||||
|
CGangWars::bGangWarsActive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::PopItemWidth();
|
||||||
|
static bool pluginRequired = (GetModuleHandle("ExGangWars.asi") == 0);
|
||||||
|
if (pluginRequired)
|
||||||
|
{
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::TextWrapped(TEXT("Ped.ExGangWarsTip"));
|
||||||
|
ImGui::Spacing();
|
||||||
|
if (ImGui::Button(TEXT("Ped.DownloadExGangWars"), Widget::CalcSize(1)))
|
||||||
|
{
|
||||||
|
OPEN_LINK("https://gtaforums.com/topic/682194-extended-gang-wars/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
if (ImGui::BeginTabItem(TEXT("Ped.GangModelEditor")))
|
||||||
|
{
|
||||||
|
ImGui::Spacing();
|
||||||
|
if (ImGui::Button(TEXT("Ped.ResetModels"), Widget::CalcSize(1)))
|
||||||
|
{
|
||||||
|
m_Gang.ResetModels();
|
||||||
|
}
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::Combo(TEXT("Weapon.SelectGang"), &m_Gang.m_nSelected, pedPage.m_GangList);
|
||||||
|
ImGui::Combo(TEXT("Ped.SelectMember"), &m_Gang.m_nSelectedMember, "Member 1\0Member 2\0Member 3\0");
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
int mem1 = m_Gang.GetModel(m_Gang.m_nSelected, 0);
|
||||||
|
int mem2 = m_Gang.GetModel(m_Gang.m_nSelected, 1);
|
||||||
|
int mem3 = m_Gang.GetModel(m_Gang.m_nSelected, 2);
|
||||||
|
ImGui::Text("%s: %d, %d, %d", TEXT("Ped.CurrentModels"), mem1, mem2, mem3);
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
Widget::ImageList(m_PedData, [this](str &id){
|
||||||
|
m_Gang.SetModel(m_Gang.m_nSelected, m_Gang.m_nSelectedMember, std::stoi(id));
|
||||||
|
},
|
||||||
|
[this](str &text){
|
||||||
|
return m_PedData.m_pData->Get(text.c_str(), "Unknown");
|
||||||
|
});
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
ImGui::EndTabBar();
|
||||||
|
}
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,6 +18,16 @@ private:
|
|||||||
int m_nWeaponId;
|
int m_nWeaponId;
|
||||||
} m_Spawner;
|
} m_Spawner;
|
||||||
|
|
||||||
|
struct GangStruct
|
||||||
|
{
|
||||||
|
int m_nSelected;
|
||||||
|
int m_nSelectedMember;
|
||||||
|
|
||||||
|
unsigned int GetModel(unsigned int gangId, unsigned int memberId);
|
||||||
|
void SetModel(unsigned int gangId, unsigned int memberId, unsigned int model);
|
||||||
|
void ResetModels();
|
||||||
|
} m_Gang;
|
||||||
|
|
||||||
|
|
||||||
friend class IFeature;
|
friend class IFeature;
|
||||||
PedPage();
|
PedPage();
|
||||||
@ -37,6 +47,12 @@ public:
|
|||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
DataStore m_SpecialPedData {"special_peds"};
|
DataStore m_SpecialPedData {"special_peds"};
|
||||||
ResourceStore m_PedData{"peds", eResourceType::TYPE_IMAGE_TEXT, ImVec2(65, 110)};
|
ResourceStore m_PedData{"peds", eResourceType::TYPE_IMAGE_TEXT, ImVec2(65, 110)};
|
||||||
|
|
||||||
|
const char* m_GangList =
|
||||||
|
{
|
||||||
|
"Ballas\0Grove street families\0Los santos vagos\0San fierro rifa\0Da nang boys\0"
|
||||||
|
"Mafia\0Mountain cloud triad\0Varrio los aztecas\0Gang9\0Gang10\0"
|
||||||
|
};
|
||||||
#else
|
#else
|
||||||
ResourceStore m_PedData {"peds", eResourceType::TYPE_TEXT};
|
ResourceStore m_PedData {"peds", eResourceType::TYPE_TEXT};
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,6 +129,7 @@ PlayerPage::PlayerPage()
|
|||||||
player->m_nFlags.bExplosionProof = 1;
|
player->m_nFlags.bExplosionProof = 1;
|
||||||
player->m_nFlags.bFireProof = 1;
|
player->m_nFlags.bFireProof = 1;
|
||||||
player->m_nFlags.bMeleeProof = 1;
|
player->m_nFlags.bMeleeProof = 1;
|
||||||
|
player->m_nFlags.bImmuneToNonPlayerDamage = 1;
|
||||||
#else
|
#else
|
||||||
player->m_nFlags.bBulletProof = 1;
|
player->m_nFlags.bBulletProof = 1;
|
||||||
player->m_nFlags.bCollisionProof = 1;
|
player->m_nFlags.bCollisionProof = 1;
|
||||||
@ -396,6 +397,7 @@ void PlayerPage::Draw()
|
|||||||
pPlayer->m_nFlags.bExplosionProof = m_bGodMode;
|
pPlayer->m_nFlags.bExplosionProof = m_bGodMode;
|
||||||
pPlayer->m_nFlags.bFireProof = m_bGodMode;
|
pPlayer->m_nFlags.bFireProof = m_bGodMode;
|
||||||
pPlayer->m_nFlags.bMeleeProof = m_bGodMode;
|
pPlayer->m_nFlags.bMeleeProof = m_bGodMode;
|
||||||
|
pPlayer->m_nFlags.bImmuneToNonPlayerDamage = m_bGodMode;
|
||||||
#else
|
#else
|
||||||
pPlayer->m_nFlags.bBulletProof = m_bGodMode;
|
pPlayer->m_nFlags.bBulletProof = m_bGodMode;
|
||||||
pPlayer->m_nFlags.bCollisionProof = m_bGodMode;
|
pPlayer->m_nFlags.bCollisionProof = m_bGodMode;
|
||||||
@ -589,7 +591,7 @@ void PlayerPage::Draw()
|
|||||||
|
|
||||||
state = BY_GAME(pPlayer->m_nPhysicalFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof,
|
state = BY_GAME(pPlayer->m_nPhysicalFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof,
|
||||||
pPlayer->m_nFlags.bMeleeProof);
|
pPlayer->m_nFlags.bMeleeProof);
|
||||||
if (Widget::Checkbox(TEXT("Player.MeeleProof"), &state, nullptr, m_bGodMode))
|
if (Widget::Checkbox(TEXT("Player.MeleeProof"), &state, nullptr, m_bGodMode))
|
||||||
{
|
{
|
||||||
BY_GAME(pPlayer->m_nPhysicalFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof,
|
BY_GAME(pPlayer->m_nPhysicalFlags.bMeleeProof, pPlayer->m_nFlags.bMeleeProof,
|
||||||
pPlayer->m_nFlags.bMeleeProof) = state;
|
pPlayer->m_nFlags.bMeleeProof) = state;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "utils/widget.h"
|
#include "utils/widget.h"
|
||||||
#include "utils/util.h"
|
#include "utils/util.h"
|
||||||
#include <CWeaponInfo.h>
|
#include <CWeaponInfo.h>
|
||||||
|
#include "pages/ped.h"
|
||||||
|
|
||||||
WeaponPage& weaponPage = WeaponPage::Get();
|
WeaponPage& weaponPage = WeaponPage::Get();
|
||||||
WeaponPage::WeaponPage()
|
WeaponPage::WeaponPage()
|
||||||
@ -396,12 +397,7 @@ void WeaponPage::Draw()
|
|||||||
if (ImGui::BeginTabItem(TEXT("Weapon.GangWeaponEditor")))
|
if (ImGui::BeginTabItem(TEXT("Weapon.GangWeaponEditor")))
|
||||||
{
|
{
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
static const char* gangList =
|
ImGui::Combo(TEXT("Weapon.SelectGang"), &m_Gang.m_nSelected, pedPage.m_GangList);
|
||||||
{
|
|
||||||
"Ballas\0Grove street families\0Los santos vagos\0San fierro rifa\0Da nang boys\0"
|
|
||||||
"Mafia\0Mountain cloud triad\0Varrio los aztecas\0Gang9\0Gang10\0"
|
|
||||||
};
|
|
||||||
ImGui::Combo(TEXT("Weapon.SelectGang"), &m_Gang.m_nSelected, gangList);
|
|
||||||
ImGui::Combo(TEXT("Ped.SelectWeapon"), &m_Gang.m_nSelectedWeapon, "Weapon 1\0Weapon 2\0Weapon 3\0");
|
ImGui::Combo(TEXT("Ped.SelectWeapon"), &m_Gang.m_nSelectedWeapon, "Weapon 1\0Weapon 2\0Weapon 3\0");
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include <CPopulation.h>
|
||||||
|
|
||||||
ImVec2 Util::ConvertScreenToMap(ImVec2 pos, ImVec2 mapSz, ImVec2 screenSz)
|
ImVec2 Util::ConvertScreenToMap(ImVec2 pos, ImVec2 mapSz, ImVec2 screenSz)
|
||||||
{
|
{
|
||||||
|
@ -35,11 +35,12 @@ public:
|
|||||||
static bool IsInCar(CPed *pPed = FindPlayerPed());
|
static bool IsInCar(CPed *pPed = FindPlayerPed());
|
||||||
static void UnFlipCar(CVehicle *pVeh);
|
static void UnFlipCar(CVehicle *pVeh);
|
||||||
|
|
||||||
|
static CPed* GetClosestPed();
|
||||||
|
|
||||||
static void GetCPUUsageInit();
|
static void GetCPUUsageInit();
|
||||||
static double GetCurrentCPUUsage();
|
static double GetCurrentCPUUsage();
|
||||||
static float RoundFloat(float val);
|
static float RoundFloat(float val);
|
||||||
|
|
||||||
static CPed* GetClosestPed();
|
|
||||||
static std::string GetLocationName(CVector* pos);
|
static std::string GetLocationName(CVector* pos);
|
||||||
static bool IsOnCutscene();
|
static bool IsOnCutscene();
|
||||||
static void RainbowValues(int& r, int& g, int& b, float speed);
|
static void RainbowValues(int& r, int& g, int& b, float speed);
|
||||||
|
Loading…
Reference in New Issue
Block a user