mirror of
https://github.com/zeldaret/ss
synced 2026-06-09 12:36:09 -04:00
Some dLytAreaCaption_c (#63)
This commit is contained in:
+3
-3
@@ -821,7 +821,7 @@ bool AnmGroupBase_c::init(nw4r::lyt::AnimTransform *transform, const char *name,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AnmGroupBase_c::fn_800AC6D0(bool b) {
|
||||
bool AnmGroupBase_c::setDirection(bool b) {
|
||||
nw4r::lyt::AnimTransform *anmTransform = mpAnmTransform;
|
||||
if (anmTransform == nullptr) {
|
||||
return false;
|
||||
@@ -849,7 +849,7 @@ bool AnmGroupBase_c::fn_800AC6D0(bool b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AnmGroupBase_c::fn_800AC7D0() {
|
||||
bool AnmGroupBase_c::unbind() {
|
||||
nw4r::lyt::AnimTransform *anmTransform = mpAnmTransform;
|
||||
if (anmTransform == nullptr) {
|
||||
return false;
|
||||
@@ -865,7 +865,7 @@ bool AnmGroupBase_c::fn_800AC7D0() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AnmGroupBase_c::fn_800AC860() {
|
||||
bool AnmGroupBase_c::afterUnbind() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
#include <d/lyt/d_lyt_area_caption.h>
|
||||
#include <d/lyt/d_textbox.h>
|
||||
#include <toBeSorted/arc_managers/layout_arc_manager.h>
|
||||
|
||||
STATE_DEFINE(dLytAreaCaptionParts_c, Wait);
|
||||
STATE_DEFINE(dLytAreaCaptionParts_c, Start);
|
||||
STATE_DEFINE(dLytAreaCaptionParts_c, Out);
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap1[] = {
|
||||
{ "areaCaption_00_start.brlan", "G__start_00"},
|
||||
{ "areaCaption_00_type.brlan", "G_type_00"},
|
||||
{"areaCaption_00_textLine.brlan", "G_textLine_00"},
|
||||
{ "", ""},
|
||||
};
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap2[] = {
|
||||
{ "areaCaption_01_start.brlan", "G__start_00"},
|
||||
{ "areaCaption_01_type.brlan", "G_type_00"},
|
||||
{"areaCaption_01_textLine.brlan", "G_textLine_00"},
|
||||
{ "areaCaption_01_out.brlan", "G_inOut_00"},
|
||||
};
|
||||
|
||||
static const char *captionBoxes[] = {
|
||||
"T_caption_00",
|
||||
"T_captionS_00",
|
||||
"T_captionS_01",
|
||||
};
|
||||
|
||||
bool dLytAreaCaptionParts_c::init(int first) {
|
||||
void *data = LayoutArcManager::sInstance->getLoadedData("DoButton");
|
||||
mResAcc.attach(data, "");
|
||||
mLyt.setResAcc(&mResAcc);
|
||||
|
||||
mFirst = first;
|
||||
if (mFirst != 0) {
|
||||
mLyt.build("areaCaption_00.brlyt", nullptr);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (brlanMap1[i].mFile[0] == '\0') {
|
||||
mAnmCtrlInUse[i] = false;
|
||||
} else {
|
||||
mAnmGroups[i].init(brlanMap1[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap1[i].mName);
|
||||
mAnmGroups[i].setDirection(false);
|
||||
mAnmGroups[i].setAnimEnable(false);
|
||||
mAnmCtrlInUse[i] = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mLyt.build("areaCaption_01.brlyt", nullptr);
|
||||
mLyt.setPriority(0x8A);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (brlanMap2[i].mFile[0] == '\0') {
|
||||
mAnmCtrlInUse[i] = false;
|
||||
} else {
|
||||
mAnmGroups[i].init(brlanMap2[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap2[i].mName);
|
||||
mAnmGroups[i].setDirection(false);
|
||||
mAnmGroups[i].setAnimEnable(false);
|
||||
mAnmCtrlInUse[i] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
mTextBoxes[i] = mLyt.getTextBox(captionBoxes[i]);
|
||||
}
|
||||
|
||||
field_0x54C = 0;
|
||||
field_0x54D = 0;
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
mLyt.calc();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaptionParts_c::remove() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (mAnmCtrlInUse[i]) {
|
||||
mAnmGroups[i].unbind();
|
||||
mAnmGroups[i].afterUnbind();
|
||||
}
|
||||
}
|
||||
mResAcc.detach();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaptionParts_c::update() {
|
||||
mStateMgr.executeState();
|
||||
if (*mStateMgr.getStateID() != StateID_Wait) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (mAnmCtrlInUse[i] && mAnmGroups[i].isFlag2()) {
|
||||
mAnmGroups[i].play();
|
||||
}
|
||||
}
|
||||
mLyt.calc();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaptionParts_c::draw() {
|
||||
mLyt.addToDrawList();
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytAreaCaptionParts_c::setTextIfWaiting(const char *text) {
|
||||
if (*mStateMgr.getStateID() == StateID_Wait) {
|
||||
mTextBoxes[0]->fn_800E0A60(text, nullptr);
|
||||
mTextBoxes[1]->fn_800E0A60(text, nullptr);
|
||||
mTextBoxes[2]->fn_800E0A60(text, nullptr);
|
||||
field_0x54C = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaptionParts_c::check() {
|
||||
if (*mStateMgr.getStateID() == StateID_Start) {
|
||||
field_0x54D = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaptionParts_c::initializeState_Wait() {}
|
||||
void dLytAreaCaptionParts_c::executeState_Wait() {
|
||||
mTextBoxes[0]->fn_800E0A60("N_inOut_00", nullptr);
|
||||
}
|
||||
void dLytAreaCaptionParts_c::finalizeState_Wait() {}
|
||||
|
||||
void dLytAreaCaptionParts_c::initializeState_Start() {}
|
||||
void dLytAreaCaptionParts_c::executeState_Start() {}
|
||||
void dLytAreaCaptionParts_c::finalizeState_Start() {}
|
||||
|
||||
void dLytAreaCaptionParts_c::initializeState_Out() {}
|
||||
void dLytAreaCaptionParts_c::executeState_Out() {}
|
||||
void dLytAreaCaptionParts_c::finalizeState_Out() {}
|
||||
|
||||
bool dLytAreaCaption_c::create() {
|
||||
new dLytAreaCaption_c();
|
||||
if (dLytAreaCaption_c::sInstance == nullptr) {
|
||||
return false;
|
||||
}
|
||||
sInstance->init();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::remove() {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->deinit();
|
||||
delete sInstance;
|
||||
sInstance = nullptr;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::update() {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->doUpdate();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::draw() {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->doDraw();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::setTextIfWaiting(const char *text) {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->doSetTextIfWaiting(text);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::setArea(int id) {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->doSetArea(id);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::check() {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->doCheck();
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::set0xAAC(u8 arg) {
|
||||
if (sInstance != nullptr) {
|
||||
sInstance->field_0xAAC = arg;
|
||||
}
|
||||
}
|
||||
|
||||
u8 dLytAreaCaption_c::get0xAAC() {
|
||||
if (sInstance != nullptr) {
|
||||
return sInstance->field_0xAAC;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::init() {
|
||||
int first = 1;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mParts[i].init(first);
|
||||
first = 0;
|
||||
}
|
||||
mPartToDraw = 0;
|
||||
field_0xAAC = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::deinit() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mParts[i].remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::doUpdate() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mParts[i].update();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytAreaCaption_c::doDraw() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (i == mPartToDraw) {
|
||||
mParts[i].draw();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::doSetTextIfWaiting(const char *text) {
|
||||
mPartToDraw = 0;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mParts[i].setTextIfWaiting(text);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::doSetArea(int id) {
|
||||
mPartToDraw = 1;
|
||||
SizedString<16> str;
|
||||
str.sprintf("MAP_%02d", id);
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mParts[i].setTextIfWaiting(str);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytAreaCaption_c::doCheck() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mParts[i].check();
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ bool dLytBattery_c::init() {
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mAnmGroups[i].init(brlanMap[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap[i].mName);
|
||||
mAnmGroups[i].fn_800AC6D0(false);
|
||||
mAnmGroups[i].setDirection(false);
|
||||
mAnmGroups[i].setAnimEnable(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ bool dLytCommonArrow_c::fn_80168490() {
|
||||
d2d::dLytStructDList::sInstance->removeFromList2(&field_0x680);
|
||||
mLytBase.unbindAnims();
|
||||
for (int i = 0; i < 9; i++) {
|
||||
field_0x440[i].fn_800AC860();
|
||||
field_0x440[i].afterUnbind();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void dLytCommonArrow_c::fn_80168790(s32 idx, f32 frame) {
|
||||
}
|
||||
|
||||
void dLytCommonArrow_c::fn_80168800(s32 idx) {
|
||||
field_0x440[idx].fn_800AC7D0();
|
||||
field_0x440[idx].unbind();
|
||||
}
|
||||
|
||||
void dLytCommonArrow_c::fn_80168810(d2d::AnmGroup_c *ctrl) {
|
||||
|
||||
@@ -14,7 +14,7 @@ dLytFader_c::~dLytFader_c() {
|
||||
|
||||
if (field_0x4DD == true) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
mLytStructAs[i].fn_800AC860();
|
||||
mLytStructAs[i].afterUnbind();
|
||||
}
|
||||
mResAcc.detach();
|
||||
}
|
||||
@@ -25,7 +25,7 @@ void dLytFader_c::setStatus(EStatus status) {
|
||||
mStatus = FADED_OUT;
|
||||
mLytBase.unbindAnims();
|
||||
d2d::AnmGroup_c *s = &mLytStructAs[0];
|
||||
s->fn_800AC6D0(false);
|
||||
s->setDirection(false);
|
||||
s->setToEnd();
|
||||
s->setAnimEnable(true);
|
||||
s->play();
|
||||
@@ -36,7 +36,7 @@ void dLytFader_c::setStatus(EStatus status) {
|
||||
mStatus = FADED_IN;
|
||||
mLytBase.unbindAnims();
|
||||
d2d::AnmGroup_c *s = &mLytStructAs[0];
|
||||
s->fn_800AC6D0(false);
|
||||
s->setDirection(false);
|
||||
s->setToStart();
|
||||
s->setAnimEnable(true);
|
||||
mLytBase.calc();
|
||||
@@ -112,7 +112,7 @@ void dLytFader_c::fn_801758F0() {
|
||||
fn_80175BC0(0);
|
||||
mLytBase.unbindAnims();
|
||||
d2d::AnmGroup_c *s = &mLytStructAs[0];
|
||||
s->fn_800AC6D0(false);
|
||||
s->setDirection(false);
|
||||
s->setFrame(0.0f);
|
||||
s->setRate(20.0f / (mFrame - 1));
|
||||
mLytBase.getLayout()->GetRootPane()->SetVisible(true);
|
||||
@@ -132,7 +132,7 @@ void dLytFader_c::fn_80175A50() {
|
||||
fn_80175BC0(1);
|
||||
mLytBase.unbindAnims();
|
||||
d2d::AnmGroup_c *s = &mLytStructAs[1];
|
||||
s->fn_800AC6D0(false);
|
||||
s->setDirection(false);
|
||||
s->setFrame(0.0f);
|
||||
s->setRate(20.0f / (mFrame - 1));
|
||||
mLytBase.getLayout()->GetRootPane()->SetVisible(true);
|
||||
|
||||
Reference in New Issue
Block a user