[III]Add big head, fix issue with custom animation
This commit is contained in:
parent
7c34e35922
commit
d5b8c6276b
@ -178,7 +178,7 @@ void Animation::_PlayAnimation(RpClump* pClump, int animGroup, int animID, float
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void Animation::PlayAnimation(std::string& ifp, std::string& anim, std::string& value)
|
void Animation::PlayAnimation(std::string& root, std::string& anim, std::string& ifp)
|
||||||
{
|
{
|
||||||
CPed *pPed = m_PedAnim ? m_pTarget : FindPlayerPed();
|
CPed *pPed = m_PedAnim ? m_pTarget : FindPlayerPed();
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ void Animation::PlayAnimation(std::string& ifp, std::string& anim, std::string&
|
|||||||
if (pPed)
|
if (pPed)
|
||||||
{
|
{
|
||||||
int groupID, animID;
|
int groupID, animID;
|
||||||
sscanf(value.c_str(), "%d$%d,", &groupID, &animID);
|
sscanf(ifp.c_str(), "%d$%d,", &groupID, &animID);
|
||||||
_PlayAnimation(pPed->m_pRwClump, groupID, animID, 4.0f);
|
_PlayAnimation(pPed->m_pRwClump, groupID, animID, 4.0f);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -324,7 +324,7 @@ void Animation::ShowPage()
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::Button(TEXT("Animation.AddAnimation"), Ui::GetSize()))
|
if (ImGui::Button(TEXT("Animation.AddAnimation"), Ui::GetSize()))
|
||||||
{
|
{
|
||||||
m_AnimData.m_pJson->m_Data["Custom"][m_nAnimBuffer] = ("0, " + std::string(m_nIfpBuffer));
|
m_AnimData.m_pJson->m_Data["Custom"][m_nAnimBuffer] = std::string(m_nIfpBuffer);
|
||||||
m_AnimData.m_pJson->WriteToDisk();
|
m_AnimData.m_pJson->WriteToDisk();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
45
src/ped.cpp
45
src/ped.cpp
@ -16,25 +16,25 @@ void Ped::Init()
|
|||||||
{
|
{
|
||||||
m_bExGangWarsInstalled = true;
|
m_bExGangWarsInstalled = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Taken from gta chaos mod by Lordmau5
|
Taken from gta chaos mod by Lordmau5 & _AG
|
||||||
https://github.com/gta-chaos-mod/Trilogy-ASI-Script
|
|
||||||
|
|
||||||
TODO: Implement in VC too
|
TODO: Implement in VC too
|
||||||
*/
|
*/
|
||||||
|
#ifdef GTASA
|
||||||
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);
|
||||||
auto matrices = RpHAnimHierarchyGetMatrixArray (animHier);
|
auto matrices = RpHAnimHierarchyGetMatrixArray (animHier);
|
||||||
|
|
||||||
RwV3d scale = {0.7f, 0.7f, 0.7f};
|
RwV3d scale = {0.7f, 0.7f, 0.7f};
|
||||||
if (m_bThinBody)
|
if (m_bThinBody)
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= 52; i++)
|
for (int i = 1; i <= 54; i++)
|
||||||
{
|
{
|
||||||
RwMatrixScale (&matrices[RpHAnimIDGetIndex (animHier, i)], &scale, rwCOMBINEPRECONCAT);
|
RwMatrixScale (&matrices[RpHAnimIDGetIndex (animHier, i)], &scale, rwCOMBINEPRECONCAT);
|
||||||
}
|
}
|
||||||
@ -42,13 +42,40 @@ void Ped::Init()
|
|||||||
scale = {3.0f, 3.0f, 3.0f};
|
scale = {3.0f, 3.0f, 3.0f};
|
||||||
if (m_bBigHead)
|
if (m_bBigHead)
|
||||||
{
|
{
|
||||||
for (int i = BONE_NECK; i <= BONE_HEAD; i++)
|
for (int i = 5; i <= 8; i++)
|
||||||
{
|
{
|
||||||
RwMatrixScale (&matrices[RpHAnimIDGetIndex (animHier, i)], &scale, rwCOMBINEPRECONCAT);
|
RwMatrixScale (&matrices[RpHAnimIDGetIndex (animHier, i)], &scale, rwCOMBINEPRECONCAT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#elif GTA3
|
||||||
|
CdeclEvent <AddressList<0x4CFE12, H_CALL>, PRIORITY_AFTER, ArgPickN<CPed*, 0>, void(CPed*)> onPreRender;
|
||||||
|
|
||||||
|
onPreRender += [](CPed* ped)
|
||||||
|
{
|
||||||
|
if (!m_bBigHead)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RwFrame* frame = ped->m_apFrames[2]->m_pFrame;
|
||||||
|
|
||||||
|
if (frame)
|
||||||
|
{
|
||||||
|
RwMatrix* headMatrix = RwFrameGetMatrix(frame);
|
||||||
|
|
||||||
|
if (headMatrix)
|
||||||
|
{
|
||||||
|
CMatrix mat;
|
||||||
|
mat.m_pAttachMatrix = NULL;
|
||||||
|
mat.Attach(headMatrix, false);
|
||||||
|
mat.SetScale(3.0f);
|
||||||
|
mat.SetTranslateOnly(0.4f, 0.0f, 0.0f);
|
||||||
|
mat.UpdateRW();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,8 +193,10 @@ void Ped::ShowPage()
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::BeginChild("CheckboxesChild");
|
ImGui::BeginChild("CheckboxesChild");
|
||||||
ImGui::Columns(2, 0, false);
|
ImGui::Columns(2, 0, false);
|
||||||
#ifdef GTASA
|
#ifndef GTAVC
|
||||||
Ui::CheckboxWithHint(TEXT("Ped.BigHead"), &m_bBigHead);
|
Ui::CheckboxWithHint(TEXT("Ped.BigHead"), &m_bBigHead);
|
||||||
|
#endif
|
||||||
|
#ifdef GTASA
|
||||||
Ui::CheckboxAddress(TEXT("Ped.ElvisEverywhere"), 0x969157);
|
Ui::CheckboxAddress(TEXT("Ped.ElvisEverywhere"), 0x969157);
|
||||||
Ui::CheckboxAddress(TEXT("Ped.EveryoneArmed"), 0x969140);
|
Ui::CheckboxAddress(TEXT("Ped.EveryoneArmed"), 0x969140);
|
||||||
Ui::CheckboxAddress(TEXT("Ped.GangsControl"), 0x96915B);
|
Ui::CheckboxAddress(TEXT("Ped.GangsControl"), 0x96915B);
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
class Ped
|
class Ped
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
static inline bool m_bBigHead;
|
||||||
#ifdef GTASA
|
#ifdef GTASA
|
||||||
static inline bool m_bExGangWarsInstalled;
|
static inline bool m_bExGangWarsInstalled;
|
||||||
static inline bool m_bBigHead;
|
|
||||||
static inline bool m_bThinBody;
|
static inline bool m_bThinBody;
|
||||||
static inline std::vector<std::string> m_GangList =
|
static inline std::vector<std::string> m_GangList =
|
||||||
{
|
{
|
||||||
|
@ -341,6 +341,7 @@ void Vehicle::SpawnVehicle(const std::string& rootkey, const std::string& vehNam
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
Command<Commands::DELETE_CAR>(hveh);
|
Command<Commands::DELETE_CAR>(hveh);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
#define MENU_NAME "Cheat Menu"
|
#define MENU_NAME "Cheat Menu"
|
||||||
#define MENU_VERSION_NUMBER "3.3"
|
#define MENU_VERSION_NUMBER "3.3"
|
||||||
#define MENU_VERSION MENU_VERSION_NUMBER"-beta"
|
#define MENU_VERSION MENU_VERSION_NUMBER"-beta"
|
||||||
#define BUILD_NUMBER "20220417"
|
#define BUILD_NUMBER "20220501"
|
||||||
#define MENU_TITLE MENU_NAME " v" MENU_VERSION
|
#define MENU_TITLE MENU_NAME " v" MENU_VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user