2024-02-10 20:52:16 -05:00
|
|
|
#include "legovariables.h"
|
|
|
|
|
2024-05-03 12:19:12 -04:00
|
|
|
#include "3dmanager/lego3dmanager.h"
|
2024-02-21 15:30:02 -05:00
|
|
|
#include "legobuildingmanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legocharactermanager.h"
|
2024-03-19 14:44:42 -04:00
|
|
|
#include "legogamestate.h"
|
|
|
|
#include "legonavcontroller.h"
|
2024-02-21 15:30:02 -05:00
|
|
|
#include "legoplantmanager.h"
|
2024-03-19 14:44:42 -04:00
|
|
|
#include "legovideomanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "misc.h"
|
2024-03-19 14:44:42 -04:00
|
|
|
#include "roi/legoroi.h"
|
2024-02-21 15:30:02 -05:00
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(VisibilityVariable, 0x24)
|
|
|
|
DECOMP_SIZE_ASSERT(CameraLocationVariable, 0x24)
|
|
|
|
DECOMP_SIZE_ASSERT(CursorVariable, 0x24)
|
|
|
|
DECOMP_SIZE_ASSERT(WhoAmIVariable, 0x24)
|
|
|
|
DECOMP_SIZE_ASSERT(CustomizeAnimFileVariable, 0x24)
|
|
|
|
|
2024-03-24 17:28:44 -04:00
|
|
|
// GLOBAL: LEGO1 0x100f39bc
|
|
|
|
// STRING: LEGO1 0x100f39a0
|
|
|
|
const char* g_varAMBULFUEL = "ambulFUEL";
|
|
|
|
|
2024-05-24 14:44:09 -04:00
|
|
|
// GLOBAL: LEGO1 0x100f43b4
|
|
|
|
// STRING: LEGO1 0x100f439c
|
|
|
|
const char* g_varTOWFUEL = "towFUEL";
|
|
|
|
|
2024-02-10 20:52:16 -05:00
|
|
|
// GLOBAL: LEGO1 0x100f3a40
|
|
|
|
// STRING: LEGO1 0x100f3808
|
|
|
|
const char* g_varVISIBILITY = "VISIBILITY";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a44
|
|
|
|
// STRING: LEGO1 0x100f3a30
|
|
|
|
const char* g_varCAMERALOCATION = "CAMERA_LOCATION";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a48
|
|
|
|
// STRING: LEGO1 0x100f3a28
|
|
|
|
const char* g_varCURSOR = "CURSOR";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a4c
|
|
|
|
// STRING: LEGO1 0x100f3a1c
|
|
|
|
const char* g_varWHOAMI = "WHO_AM_I";
|
|
|
|
|
2024-03-19 14:44:42 -04:00
|
|
|
// GLOBAL: LEGO1 0x100f3a50
|
|
|
|
// STRING: LEGO1 0x100f3a18
|
|
|
|
const char* g_delimiter2 = " \t";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a54
|
|
|
|
// STRING: LEGO1 0x100f3a10
|
|
|
|
const char* g_varHIDE = "HIDE";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a58
|
|
|
|
// STRING: LEGO1 0x100f3a08
|
|
|
|
const char* g_varSHOW = "SHOW";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a5c
|
|
|
|
// STRING: LEGO1 0x100f3a00
|
|
|
|
const char* g_papa = "Papa";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a60
|
|
|
|
// STRING: LEGO1 0x100f39f8
|
|
|
|
const char* g_mama = "Mama";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a64
|
|
|
|
// STRING: LEGO1 0x100f39f0
|
|
|
|
const char* g_pepper = "Pepper";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a68
|
|
|
|
// STRING: LEGO1 0x100f39e8
|
|
|
|
const char* g_nick = "Nick";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f3a6c
|
|
|
|
// STRING: LEGO1 0x100f39e0
|
|
|
|
const char* g_laura = "Laura";
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10037d00
|
2024-04-24 12:10:51 -04:00
|
|
|
// FUNCTION: BETA10 0x100d5620
|
2024-02-10 20:52:16 -05:00
|
|
|
void VisibilityVariable::SetValue(const char* p_value)
|
|
|
|
{
|
2024-03-19 14:44:42 -04:00
|
|
|
MxVariable::SetValue(p_value);
|
|
|
|
|
|
|
|
if (p_value) {
|
2024-04-24 12:10:51 -04:00
|
|
|
char* instruction = strtok(m_value.GetData(), g_delimiter2);
|
2024-03-19 14:44:42 -04:00
|
|
|
char* name = strtok(NULL, g_delimiter2);
|
|
|
|
MxBool show;
|
|
|
|
|
|
|
|
if (!strcmpi(instruction, g_varHIDE)) {
|
|
|
|
show = FALSE;
|
|
|
|
}
|
|
|
|
else if (!strcmpi(instruction, g_varSHOW)) {
|
|
|
|
show = TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
LegoROI* roi = FindROI(name);
|
|
|
|
if (roi) {
|
|
|
|
roi->SetVisibility(show);
|
|
|
|
}
|
|
|
|
}
|
2024-02-10 20:52:16 -05:00
|
|
|
}
|
|
|
|
|
2024-03-19 14:44:42 -04:00
|
|
|
// FUNCTION: LEGO1 0x10037d80
|
2024-02-10 20:52:16 -05:00
|
|
|
void CameraLocationVariable::SetValue(const char* p_value)
|
|
|
|
{
|
2024-03-19 14:44:42 -04:00
|
|
|
char buffer[256];
|
|
|
|
MxVariable::SetValue(p_value);
|
|
|
|
|
|
|
|
strcpy(buffer, p_value);
|
|
|
|
|
|
|
|
char* location = strtok(buffer, ",");
|
2024-05-10 14:07:38 -04:00
|
|
|
NavController()->UpdateLocation(location);
|
2024-03-19 14:44:42 -04:00
|
|
|
|
|
|
|
location = strtok(NULL, ",");
|
|
|
|
if (location) {
|
|
|
|
MxFloat pov = (MxFloat) atof(location);
|
|
|
|
VideoManager()->Get3DManager()->SetFrustrum(pov, 0.1f, 250.0f);
|
|
|
|
}
|
2024-02-10 20:52:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10037e30
|
|
|
|
void CursorVariable::SetValue(const char* p_value)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-03-19 14:44:42 -04:00
|
|
|
// FUNCTION: LEGO1 0x10037e40
|
2024-02-10 20:52:16 -05:00
|
|
|
void WhoAmIVariable::SetValue(const char* p_value)
|
|
|
|
{
|
2024-03-19 14:44:42 -04:00
|
|
|
MxVariable::SetValue(p_value);
|
|
|
|
|
|
|
|
if (!strcmpi(p_value, g_papa)) {
|
|
|
|
GameState()->SetActorId(3);
|
|
|
|
}
|
|
|
|
else if (!strcmpi(p_value, g_mama)) {
|
|
|
|
GameState()->SetActorId(2);
|
|
|
|
}
|
|
|
|
else if (!strcmpi(p_value, g_pepper)) {
|
|
|
|
GameState()->SetActorId(1);
|
|
|
|
}
|
|
|
|
else if (!strcmpi(p_value, g_nick)) {
|
|
|
|
GameState()->SetActorId(4);
|
|
|
|
}
|
|
|
|
else if (!strcmpi(p_value, g_laura)) {
|
|
|
|
GameState()->SetActorId(5);
|
|
|
|
}
|
2024-02-10 20:52:16 -05:00
|
|
|
}
|
2024-02-21 15:30:02 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10085aa0
|
|
|
|
CustomizeAnimFileVariable::CustomizeAnimFileVariable(const char* p_key)
|
|
|
|
{
|
|
|
|
m_key = p_key;
|
|
|
|
m_key.ToUpperCase();
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10085b50
|
|
|
|
void CustomizeAnimFileVariable::SetValue(const char* p_value)
|
|
|
|
{
|
|
|
|
// STRING: LEGO1 0x100fc4f4
|
|
|
|
if (strcmp(m_key.GetData(), "CUSTOMIZE_ANIM_FILE") == 0) {
|
2024-03-09 15:07:52 -05:00
|
|
|
CharacterManager()->SetCustomizeAnimFile(p_value);
|
2024-02-21 15:30:02 -05:00
|
|
|
PlantManager()->SetCustomizeAnimFile(p_value);
|
|
|
|
BuildingManager()->SetCustomizeAnimFile(p_value);
|
|
|
|
}
|
|
|
|
}
|