[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
|
||||
|
||||
|
||||
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();
|
||||
|
||||
@ -215,7 +215,7 @@ void Animation::PlayAnimation(std::string& ifp, std::string& anim, std::string&
|
||||
if (pPed)
|
||||
{
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
@ -324,7 +324,7 @@ void Animation::ShowPage()
|
||||
ImGui::Spacing();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
43
src/ped.cpp
43
src/ped.cpp
@ -16,17 +16,17 @@ void Ped::Init()
|
||||
{
|
||||
m_bExGangWarsInstalled = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
Taken from gta chaos mod by Lordmau5
|
||||
https://github.com/gta-chaos-mod/Trilogy-ASI-Script
|
||||
|
||||
Taken from gta chaos mod by Lordmau5 & _AG
|
||||
TODO: Implement in VC too
|
||||
*/
|
||||
#ifdef GTASA
|
||||
Events::pedRenderEvent += [](CPed *ped)
|
||||
{
|
||||
|
||||
if (m_bBigHead || m_bThinBody)
|
||||
if (m_bBigHead)// || m_bThinBody)
|
||||
{
|
||||
auto animHier = GetAnimHierarchyFromSkinClump(ped->m_pRwClump);
|
||||
auto matrices = RpHAnimHierarchyGetMatrixArray (animHier);
|
||||
@ -34,7 +34,7 @@ void Ped::Init()
|
||||
RwV3d scale = {0.7f, 0.7f, 0.7f};
|
||||
if (m_bThinBody)
|
||||
{
|
||||
for (int i = 1; i <= 52; i++)
|
||||
for (int i = 1; i <= 54; i++)
|
||||
{
|
||||
RwMatrixScale (&matrices[RpHAnimIDGetIndex (animHier, i)], &scale, rwCOMBINEPRECONCAT);
|
||||
}
|
||||
@ -42,13 +42,40 @@ void Ped::Init()
|
||||
scale = {3.0f, 3.0f, 3.0f};
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
#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
|
||||
}
|
||||
|
||||
@ -166,8 +193,10 @@ void Ped::ShowPage()
|
||||
ImGui::Spacing();
|
||||
ImGui::BeginChild("CheckboxesChild");
|
||||
ImGui::Columns(2, 0, false);
|
||||
#ifdef GTASA
|
||||
#ifndef GTAVC
|
||||
Ui::CheckboxWithHint(TEXT("Ped.BigHead"), &m_bBigHead);
|
||||
#endif
|
||||
#ifdef GTASA
|
||||
Ui::CheckboxAddress(TEXT("Ped.ElvisEverywhere"), 0x969157);
|
||||
Ui::CheckboxAddress(TEXT("Ped.EveryoneArmed"), 0x969140);
|
||||
Ui::CheckboxAddress(TEXT("Ped.GangsControl"), 0x96915B);
|
||||
|
@ -4,9 +4,9 @@
|
||||
class Ped
|
||||
{
|
||||
private:
|
||||
static inline bool m_bBigHead;
|
||||
#ifdef GTASA
|
||||
static inline bool m_bExGangWarsInstalled;
|
||||
static inline bool m_bBigHead;
|
||||
static inline bool m_bThinBody;
|
||||
static inline std::vector<std::string> m_GangList =
|
||||
{
|
||||
|
@ -341,6 +341,7 @@ void Vehicle::SpawnVehicle(const std::string& rootkey, const std::string& vehNam
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Command<Commands::DELETE_CAR>(hveh);
|
||||
}
|
||||
#else
|
||||
|
@ -2,5 +2,5 @@
|
||||
#define MENU_NAME "Cheat Menu"
|
||||
#define MENU_VERSION_NUMBER "3.3"
|
||||
#define MENU_VERSION MENU_VERSION_NUMBER"-beta"
|
||||
#define BUILD_NUMBER "20220417"
|
||||
#define BUILD_NUMBER "20220501"
|
||||
#define MENU_TITLE MENU_NAME " v" MENU_VERSION
|
||||
|
Loading…
Reference in New Issue
Block a user