mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-05-14 07:00:42 -04:00
implement MxControlPresenter::ParseExtra (#477)
* MxControlPresenter::ParseExtra * Update mxcontrolpresenter.h * fix loop --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
parent
7b0d4dd502
commit
05bc94f030
2 changed files with 64 additions and 8 deletions
LEGO1/lego/legoomni
|
@ -41,12 +41,12 @@ private:
|
||||||
MxBool FUN_10044480(undefined4, undefined4*);
|
MxBool FUN_10044480(undefined4, undefined4*);
|
||||||
void FUN_10044540(undefined2);
|
void FUN_10044540(undefined2);
|
||||||
|
|
||||||
undefined2 m_unk0x4c; // 0x4c
|
undefined2 m_unk0x4c; // 0x4c
|
||||||
MxS16 m_unk0x4e; // 0x4e
|
MxS16 m_unk0x4e; // 0x4e
|
||||||
MxBool m_unk0x50; // 0x50
|
MxBool m_unk0x50; // 0x50
|
||||||
undefined2 m_unk0x52; // 0x52
|
undefined2 m_unk0x52; // 0x52
|
||||||
undefined2 m_unk0x54; // 0x54
|
undefined2 m_unk0x54; // 0x54
|
||||||
undefined4* m_unk0x58; // 0x58
|
MxS16* m_unk0x58; // 0x58
|
||||||
};
|
};
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100440f0
|
// SYNTHETIC: LEGO1 0x100440f0
|
||||||
|
|
|
@ -1,10 +1,27 @@
|
||||||
#include "mxcontrolpresenter.h"
|
#include "mxcontrolpresenter.h"
|
||||||
|
|
||||||
|
#include "define.h"
|
||||||
#include "mxticklemanager.h"
|
#include "mxticklemanager.h"
|
||||||
#include "mxutil.h"
|
#include "mxutil.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
|
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
|
||||||
|
|
||||||
|
// GLOBAL: LEGO1 0x10102064
|
||||||
|
// STRING: LEGO1 0x10101fec
|
||||||
|
const char* g_style = "STYLE";
|
||||||
|
|
||||||
|
// GLOBAL: LEGO1 0x10102068
|
||||||
|
// STRING: LEGO1 0x10101fe4
|
||||||
|
const char* g_grid = "GRID";
|
||||||
|
|
||||||
|
// GLOBAL: LEGO1 0x1010206c
|
||||||
|
// STRING: LEGO1 0x10101fe0
|
||||||
|
const char* g_map = "MAP";
|
||||||
|
|
||||||
|
// GLOBAL: LEGO1 0x10102074
|
||||||
|
// STRING: LEGO1 0x10101fd0
|
||||||
|
const char* g_toggle = "TOGGLE";
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10043f50
|
// FUNCTION: LEGO1 0x10043f50
|
||||||
MxControlPresenter::MxControlPresenter()
|
MxControlPresenter::MxControlPresenter()
|
||||||
{
|
{
|
||||||
|
@ -109,10 +126,49 @@ void MxControlPresenter::ReadyTickle()
|
||||||
ProgressTickleState(e_repeating);
|
ProgressTickleState(e_repeating);
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10044640
|
// FUNCTION: LEGO1 0x10044640
|
||||||
void MxControlPresenter::ParseExtra()
|
void MxControlPresenter::ParseExtra()
|
||||||
{
|
{
|
||||||
// TODO
|
char result[256];
|
||||||
|
MxU16 len = m_action->GetExtraLength();
|
||||||
|
if (len) {
|
||||||
|
char buffer[256];
|
||||||
|
memcpy(buffer, m_action->GetExtraData(), m_action->GetExtraLength());
|
||||||
|
buffer[len] = 0;
|
||||||
|
|
||||||
|
if (KeyValueStringParse(result, g_style, buffer)) {
|
||||||
|
char* str = strtok(result, g_parseExtraTokens);
|
||||||
|
if (!strcmpi(str, g_toggle)) {
|
||||||
|
m_unk0x4c = 1;
|
||||||
|
}
|
||||||
|
else if (!strcmpi(str, g_grid)) {
|
||||||
|
m_unk0x4c = 2;
|
||||||
|
m_unk0x52 = atoi(strtok(NULL, g_parseExtraTokens));
|
||||||
|
m_unk0x54 = atoi(strtok(NULL, g_parseExtraTokens));
|
||||||
|
}
|
||||||
|
else if (!strcmpi(str, g_map)) {
|
||||||
|
m_unk0x4c = 3;
|
||||||
|
str = strtok(NULL, g_parseExtraTokens);
|
||||||
|
if (str) {
|
||||||
|
MxS16 count = atoi(str);
|
||||||
|
m_unk0x58 = new MxS16[count + 1];
|
||||||
|
*m_unk0x58 = count;
|
||||||
|
for (MxS16 i = 1; i <= count; i++) {
|
||||||
|
m_unk0x58[i] = atoi(strtok(NULL, g_parseExtraTokens));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_unk0x4c = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (KeyValueStringParse(result, g_strVISIBILITY, buffer)) {
|
||||||
|
if (!strcmpi(result, "FALSE")) {
|
||||||
|
Enable(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10044820
|
// FUNCTION: LEGO1 0x10044820
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue