mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Implement/match LegoEntity::ClickAnimation (#994)
* Implement/match LegoEntity::VTable0x38 * Update names
This commit is contained in:

committed by
GitHub

parent
6a9f68872b
commit
f6c923a84e
@@ -441,7 +441,7 @@ LegoBuildingInfo* LegoBuildingManager::GetInfo(LegoEntity* p_entity)
|
||||
|
||||
// FUNCTION: LEGO1 0x1002fdb0
|
||||
// FUNCTION: BETA10 0x10064101
|
||||
MxBool LegoBuildingManager::IncrementVariant(LegoEntity* p_entity)
|
||||
MxBool LegoBuildingManager::SwitchVariant(LegoEntity* p_entity)
|
||||
{
|
||||
if (g_buildingManagerConfig <= 1) {
|
||||
return TRUE;
|
||||
|
@@ -21,6 +21,9 @@
|
||||
DECOMP_SIZE_ASSERT(LegoCharacter, 0x08)
|
||||
DECOMP_SIZE_ASSERT(LegoCharacterManager, 0x08)
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4e0
|
||||
MxU32 g_unk0x100fc4e0 = 10;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4e4
|
||||
char* LegoCharacterManager::g_customizeAnimFile = NULL;
|
||||
|
||||
@@ -753,6 +756,19 @@ MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085120
|
||||
// FUNCTION: BETA10 0x1007680c
|
||||
MxU32 LegoCharacterManager::FUN_10085120(LegoROI* p_roi)
|
||||
{
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_unk0x10 + g_unk0x100fc4e0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085140
|
||||
MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
||||
{
|
||||
|
@@ -56,8 +56,15 @@ MxBool LegoPlantManager::FUN_100269e0(LegoEntity* p_entity)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026b70
|
||||
MxU32 LegoPlantManager::FUN_10026b70(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026ba0
|
||||
MxU32 LegoPlantManager::FUN_10026ba0(LegoEntity*, MxBool)
|
||||
MxU32 LegoPlantManager::FUN_10026ba0(LegoEntity* p_entity, MxBool)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
@@ -93,13 +93,13 @@ ViewManager* GetViewManager()
|
||||
// FUNCTION: LEGO1 0x100157e0
|
||||
LegoPlantManager* PlantManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetLegoPlantManager();
|
||||
return LegoOmni::GetInstance()->GetPlantManager();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100157f0
|
||||
LegoBuildingManager* BuildingManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetLegoBuildingManager();
|
||||
return LegoOmni::GetInstance()->GetBuildingManager();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10015800
|
||||
|
@@ -2,11 +2,13 @@
|
||||
|
||||
#include "3dmanager/lego3dmanager.h"
|
||||
#include "define.h"
|
||||
#include "legoanimationmanager.h"
|
||||
#include "legobuildingmanager.h"
|
||||
#include "legocameracontroller.h"
|
||||
#include "legocharactermanager.h"
|
||||
#include "legoeventnotificationparam.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legomain.h"
|
||||
#include "legoplantmanager.h"
|
||||
#include "legoutils.h"
|
||||
#include "legovideomanager.h"
|
||||
@@ -245,11 +247,12 @@ void LegoEntity::ParseAction(char* p_extra)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10010f10
|
||||
void LegoEntity::VTable0x34(MxBool p_und)
|
||||
// FUNCTION: BETA10 0x1007ee87
|
||||
void LegoEntity::ClickSound(MxBool p_und)
|
||||
{
|
||||
if (!GetUnknown0x10IsSet(c_altBit1)) {
|
||||
MxU32 objectId = 0;
|
||||
const LegoChar* roiName = m_roi->GetName();
|
||||
const char* name = m_roi->GetName();
|
||||
|
||||
switch (m_type) {
|
||||
case e_actor:
|
||||
@@ -269,20 +272,56 @@ void LegoEntity::VTable0x34(MxBool p_und)
|
||||
MxDSAction action;
|
||||
action.SetAtomId(MxAtomId(CharacterManager()->GetCustomizeAnimFile(), e_lowerCase2));
|
||||
action.SetObjectId(objectId);
|
||||
action.AppendExtra(strlen(roiName) + 1, roiName);
|
||||
action.AppendExtra(strlen(name) + 1, name);
|
||||
Start(&action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10011070
|
||||
void LegoEntity::VTable0x38()
|
||||
// FUNCTION: LEGO1 0x10011070
|
||||
// FUNCTION: BETA10 0x1007f062
|
||||
void LegoEntity::ClickAnimation()
|
||||
{
|
||||
// TODO
|
||||
if (!GetUnknown0x10IsSet(c_altBit1)) {
|
||||
MxU32 objectId = 0;
|
||||
MxDSAction action;
|
||||
const char* name = m_roi->GetName();
|
||||
char extra[1024];
|
||||
|
||||
switch (m_type) {
|
||||
case e_actor:
|
||||
objectId = LegoOmni::GetInstance()->GetCharacterManager()->FUN_10085120(m_roi);
|
||||
action.SetAtomId(MxAtomId(LegoCharacterManager::GetCustomizeAnimFile(), e_lowerCase2));
|
||||
sprintf(extra, "SUBST:actor_01:%s", name);
|
||||
break;
|
||||
case e_unk1:
|
||||
break;
|
||||
case e_plant:
|
||||
objectId = LegoOmni::GetInstance()->GetPlantManager()->FUN_10026b70(this);
|
||||
action.SetAtomId(MxAtomId(LegoPlantManager::GetCustomizeAnimFile(), e_lowerCase2));
|
||||
sprintf(extra, "SUBST:bush:%s:tree:%s:flwrred:%s:palm:%s", name, name, name, name);
|
||||
break;
|
||||
case e_building:
|
||||
objectId = LegoOmni::GetInstance()->GetBuildingManager()->GetBuildingEntityId(this);
|
||||
action.SetAtomId(MxAtomId(BuildingManager()->GetCustomizeAnimFile(), e_lowerCase2));
|
||||
sprintf(extra, "SUBST:haus1:%s", name);
|
||||
break;
|
||||
case e_autoROI:
|
||||
break;
|
||||
}
|
||||
|
||||
if (objectId) {
|
||||
action.SetObjectId(objectId);
|
||||
action.AppendExtra(strlen(extra) + 1, extra);
|
||||
LegoOmni::GetInstance()->GetAnimationManager()->StartEntityAction(action, this);
|
||||
m_unk0x10 |= c_altBit1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10011300
|
||||
void LegoEntity::VTable0x3c()
|
||||
// FUNCTION: BETA10 0x1007f35a
|
||||
void LegoEntity::SwitchVariant()
|
||||
{
|
||||
switch (m_type) {
|
||||
case e_actor:
|
||||
@@ -294,45 +333,51 @@ void LegoEntity::VTable0x3c()
|
||||
PlantManager()->FUN_100269e0(this);
|
||||
break;
|
||||
case e_building:
|
||||
BuildingManager()->IncrementVariant(this);
|
||||
BuildingManager()->SwitchVariant(this);
|
||||
break;
|
||||
}
|
||||
|
||||
VTable0x34(FALSE);
|
||||
VTable0x38();
|
||||
ClickSound(FALSE);
|
||||
ClickAnimation();
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10011360
|
||||
// FUNCTION: BETA10 0x1007f411
|
||||
void LegoEntity::VTable0x40()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100113c0
|
||||
// FUNCTION: BETA10 0x1007f4c8
|
||||
void LegoEntity::VTable0x44()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10011420
|
||||
// FUNCTION: BETA10 0x1007f57f
|
||||
void LegoEntity::VTable0x48(LegoROI* p_roi)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10011470
|
||||
// FUNCTION: BETA10 0x1007f62c
|
||||
void LegoEntity::VTable0x4c()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100114e0
|
||||
// FUNCTION: BETA10 0x1007f6f0
|
||||
void LegoEntity::SetType(MxU8 p_type)
|
||||
{
|
||||
m_type = p_type;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100114f0
|
||||
// FUNCTION: BETA10 0x1007f711
|
||||
MxLong LegoEntity::Notify(MxParam& p_param)
|
||||
{
|
||||
LegoEventNotificationParam& param = (LegoEventNotificationParam&) p_param;
|
||||
@@ -349,7 +394,7 @@ MxLong LegoEntity::Notify(MxParam& p_param)
|
||||
case LegoActor::c_pepper:
|
||||
if (GameState()->GetCurrentAct() != LegoGameState::e_act2 &&
|
||||
GameState()->GetCurrentAct() != LegoGameState::e_act3) {
|
||||
VTable0x3c();
|
||||
SwitchVariant();
|
||||
}
|
||||
break;
|
||||
case LegoActor::c_mama:
|
||||
|
Reference in New Issue
Block a user