mirror of
https://github.com/zeldaret/ss
synced 2026-09-01 09:32:58 -04:00
Merge pull request #234 from robojumper/d_lyt_game_over
d_lyt_game_over almost OK
This commit is contained in:
+7
-7
@@ -36,18 +36,18 @@ bool dFader_c::create() {
|
||||
return false;
|
||||
}
|
||||
|
||||
mFadeOutType = 0;
|
||||
mFadeInType = 0;
|
||||
mFadeOutType = FADER_BLACK;
|
||||
mFadeInType = FADER_BLACK;
|
||||
mFadeInFrame = 0x1E;
|
||||
mFadeOutFrame = 0x1E;
|
||||
setFader(0);
|
||||
setFader(FADER_BLACK);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dFader_c::setFader(s32 fader) {
|
||||
switch (fader) {
|
||||
case 0:
|
||||
case FADER_BLACK:
|
||||
if (mFader_c::setFader(mpColorFader)) {
|
||||
if (mpColorFader->getStatus() == mFaderBase_c::FADED_IN) {
|
||||
mpColorFader->setColor(mColor(0, 0, 0, 0xFF));
|
||||
@@ -55,7 +55,7 @@ bool dFader_c::setFader(s32 fader) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case FADER_GREY:
|
||||
if (mFader_c::setFader(mpColorFader)) {
|
||||
if (mpColorFader->getStatus() == mFaderBase_c::FADED_IN) {
|
||||
mpColorFader->setColor(mFaderColor);
|
||||
@@ -63,7 +63,7 @@ bool dFader_c::setFader(s32 fader) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case FADER_LYT:
|
||||
if (mFader_c::setFader(mpLytFader)) {
|
||||
if (mpLytFader->getStatus() == mFaderBase_c::FADED_IN) {
|
||||
mpLytFader->setColor(mColor(0, 0, 0, 0xFF));
|
||||
@@ -71,7 +71,7 @@ bool dFader_c::setFader(s32 fader) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case FADER_SCREEN:
|
||||
if (mFader_c::setFader(mpScreenFader)) {
|
||||
if (mpScreenFader->getStatus() == mFaderBase_c::FADED_IN) {
|
||||
mpScreenFader->setColor(mColor(0, 0, 0, 0xFF));
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_base.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "d/d_gfx.h"
|
||||
#include "d/d_stage_mgr.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
@@ -104,7 +105,7 @@ void dScGame_c::deleteReady() {
|
||||
sFPhaseBase::sFPhaseState dScGame_c::cb1() {
|
||||
mFader.create();
|
||||
mFader.setFrames(15, 15);
|
||||
mFader.setTypes(1, 1);
|
||||
mFader.setTypes(dFader_c::FADER_GREY, dFader_c::FADER_GREY);
|
||||
mFader.initForLyt();
|
||||
mRelCtrl.do_link();
|
||||
mLayoutCtrl.load(nullptr);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_dvd_unk.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "d/d_heap.h"
|
||||
#include "d/d_message.h"
|
||||
#include "d/d_pad.h"
|
||||
@@ -24,11 +25,10 @@ SPECIAL_BASE_PROFILE(TITLE, dScTitle_c, fProfile::TITLE, 0, 0);
|
||||
|
||||
dScTitle_c *dScTitle_c::sInstance;
|
||||
bool dScTitle_c::sPreventEmptyFilesTitle;
|
||||
extern "C" {
|
||||
u8 lbl_80575785;
|
||||
u8 lbl_80575786;
|
||||
u8 lbl_80575787;
|
||||
}
|
||||
|
||||
u8 dScTitle_c::lbl_80575785;
|
||||
u8 dScTitle_c::lbl_80575786;
|
||||
u8 dScTitle_c::lbl_80575787;
|
||||
|
||||
static u16 sModulesToLoad[] = {
|
||||
// ??? not sure what these correspond to
|
||||
@@ -159,11 +159,11 @@ void dScTitle_c::loadTitleScreen(u32 params) {
|
||||
params = 2;
|
||||
}
|
||||
TITLE_SCREEN_CHANGE = params;
|
||||
setRootActor(fProfile::TITLE, params, 0, 0);
|
||||
setRootActor(fProfile::TITLE, params, dFader_c::FADER_BLACK, dFader_c::FADER_BLACK);
|
||||
if (checkAllSaveFilesEmpty() == true) {
|
||||
actuallyTriggerEntrance("F000", 0, 26, 55, 0, 0, 0, 15, -1);
|
||||
actuallyTriggerEntrance("F000", 0, 26, 55, 0, 0, dFader_c::FADER_BLACK, 15, -1);
|
||||
} else {
|
||||
actuallyTriggerEntrance("F000", 0, 28, 48, 0, 0, 0, 15, -1);
|
||||
actuallyTriggerEntrance("F000", 0, 28, 48, 0, 0, dFader_c::FADER_BLACK, 15, -1);
|
||||
}
|
||||
fn_80362150(ENEMY_SOUND_MGR, 30);
|
||||
}
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/d_base.h"
|
||||
#include "d/d_bzs_types.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "d/d_room.h"
|
||||
#include "d/d_rumble.h"
|
||||
#include "d/d_sc_game.h"
|
||||
@@ -124,7 +125,7 @@ sFPhaseBase::sFPhaseState dStage_c::createRooms() {
|
||||
// TODO
|
||||
// if (dScGame_c::sCo)
|
||||
mFader.create();
|
||||
mFader.setTypes(1, 1);
|
||||
mFader.setTypes(dFader_c::FADER_GREY, dFader_c::FADER_GREY);
|
||||
mFader.setFadeInFrame(1);
|
||||
mFader.fadeIn();
|
||||
mFader.calc();
|
||||
|
||||
@@ -0,0 +1,584 @@
|
||||
#include "d/lyt/d_lyt_game_over.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_base.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "d/d_message.h"
|
||||
#include "d/d_sc_game.h"
|
||||
#include "d/d_sc_title.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/flag/sceneflag_manager.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_window.h"
|
||||
#include "d/snd/d_snd_wzsound.h"
|
||||
#include "f/f_base.h"
|
||||
#include "nw4r/lyt/lyt_group.h"
|
||||
#include "toBeSorted/arc_managers/layout_arc_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "toBeSorted/minigame_mgr.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
#include "toBeSorted/music_mgrs.h"
|
||||
|
||||
STATE_DEFINE(dLytGameOver_c, Init);
|
||||
STATE_DEFINE(dLytGameOver_c, In);
|
||||
STATE_DEFINE(dLytGameOver_c, Wait);
|
||||
STATE_DEFINE(dLytGameOver_c, Out);
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap2[] = {
|
||||
{"gameOver_02_gameOver.brlan", "G_gameOver_00"},
|
||||
{ "gameOver_02_loop.brlan", "G_loop_00"},
|
||||
{ "gameOver_02_textOut.brlan", "G_textInOut_00"},
|
||||
{ "gameOver_02_textIn.brlan", "G_textInOut_00"},
|
||||
{ "gameOver_02_fade.brlan", "G_fade_00"},
|
||||
};
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap3[] = {
|
||||
{"gameOver_03_gameOver.brlan", "G_gameOver_00"},
|
||||
{ "gameOver_03_loop.brlan", "G_loop_00"},
|
||||
{ "gameOver_03_textOut.brlan", "G_textInOut_00"},
|
||||
{ "gameOver_03_textIn.brlan", "G_textInOut_00"},
|
||||
{ "gameOver_03_fade.brlan", "G_fade_00"},
|
||||
};
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap1[] = {
|
||||
{"gameOver_01_gameOver.brlan", "G_gameOver_00"},
|
||||
{ "gameOver_01_loop.brlan", "G_loop_00"},
|
||||
{ "gameOver_01_textOut.brlan", "G_textInOut_00"},
|
||||
{ "gameOver_01_textIn.brlan", "G_textInOut_00"},
|
||||
{ "gameOver_01_fade.brlan", "G_fade_00"},
|
||||
};
|
||||
|
||||
#define GAME_OVER_ANIM_GAME_OVER 0
|
||||
#define GAME_OVER_ANIM_LOOP 1
|
||||
#define GAME_OVER_ANIM_TEXT_OUT 2
|
||||
#define GAME_OVER_ANIM_TEXT_IN 3
|
||||
#define GAME_OVER_ANIM_TEXT_FADE 4
|
||||
|
||||
#define GAME_OVER_NUM_ANIMS 5
|
||||
|
||||
static const char *sGroupName = "G_ref_00";
|
||||
|
||||
dLytGameOver_c::dLytGameOver_c() : mStateMgr(*this) {
|
||||
init();
|
||||
}
|
||||
|
||||
extern "C" u8 fn_80054F30();
|
||||
|
||||
bool dLytGameOver_c::build() {
|
||||
u8 lang = fn_80054F30();
|
||||
s32 variant;
|
||||
if (lang == 3) {
|
||||
variant = 1;
|
||||
} else if (lang == 4) {
|
||||
variant = 2;
|
||||
} else {
|
||||
variant = 0;
|
||||
}
|
||||
|
||||
if (variant == 0) {
|
||||
void *data = LayoutArcManager::GetInstance()->getLoadedData("gameOver_01");
|
||||
mResAcc1.attach(data, "");
|
||||
} else if (variant == 1) {
|
||||
void *data = LayoutArcManager::GetInstance()->getLoadedData("gameOver_02");
|
||||
mResAcc1.attach(data, "");
|
||||
} else {
|
||||
void *data = LayoutArcManager::GetInstance()->getLoadedData("gameOver_03");
|
||||
mResAcc1.attach(data, "");
|
||||
}
|
||||
void *data2 = LayoutArcManager::GetInstance()->getLoadedData("System2D");
|
||||
mResAcc2.attach(data2, "");
|
||||
|
||||
switch (variant) {
|
||||
case 1: {
|
||||
mLyt.setResAcc(&mResAcc1);
|
||||
mLyt.build("gameOver_02.brlyt", nullptr);
|
||||
for (int i = 0; i < GAME_OVER_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap2[i].mFile, &mResAcc1, mLyt.getLayout(), brlanMap2[i].mName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
mLyt.setResAcc(&mResAcc1);
|
||||
mLyt.build("gameOver_03.brlyt", nullptr);
|
||||
for (int i = 0; i < GAME_OVER_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap3[i].mFile, &mResAcc1, mLyt.getLayout(), brlanMap3[i].mName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
mLyt.setResAcc(&mResAcc1);
|
||||
mLyt.build("gameOver_01.brlyt", nullptr);
|
||||
for (int i = 0; i < GAME_OVER_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap1[i].mFile, &mResAcc1, mLyt.getLayout(), brlanMap1[i].mName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mLyt.setPriority(0x8A);
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mSubpanes[i].mpLytPane = &mSelectBtn;
|
||||
mSelectBtn.build(&mResAcc2);
|
||||
mSubpaneList.PushBack(&mSubpanes[i]);
|
||||
}
|
||||
|
||||
if (mLyt.getLayout()->GetGroupContainer() != nullptr) {
|
||||
nw4r::lyt::Group *g = mLyt.getLayout()->GetGroupContainer()->FindGroupByName(sGroupName);
|
||||
if (g != nullptr) {
|
||||
d2d::dSubPane::linkMeters(g, &mSubpaneList);
|
||||
}
|
||||
}
|
||||
|
||||
mSelectBtn.setField_0x9C4(1);
|
||||
mSelectBtn.setField_0x99C(1);
|
||||
mSelectBtn.setField_0x9A0(2);
|
||||
|
||||
mStateMgr.changeState(StateID_Init);
|
||||
|
||||
field_0x1338 = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytGameOver_c::remove() {
|
||||
for (d2d::SubPaneList::Iterator it = mSubpaneList.GetBeginIter(); it != mSubpaneList.GetEndIter(); ++it) {
|
||||
d2d::dSubPane *subPane = it->mpLytPane;
|
||||
if (subPane != nullptr) {
|
||||
nw4r::lyt::Pane *parent = subPane->getPane()->GetParent();
|
||||
parent->RemoveChild(subPane->getPane());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mSubpanes[i].mpLytPane->remove();
|
||||
}
|
||||
|
||||
mLyt.unbindAnims();
|
||||
|
||||
for (int i = 0; i < GAME_OVER_NUM_ANIMS; i++) {
|
||||
mAnm[i].remove();
|
||||
}
|
||||
|
||||
mResAcc2.detach();
|
||||
mResAcc1.detach();
|
||||
|
||||
dBase_c::s_NextExecuteControlFlags &= ~0x200;
|
||||
dBase_c::s_DrawControlFlags &= ~0x200;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytGameOver_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
mLyt.calc();
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mSubpanes[i].mpLytPane->execute();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytGameOver_c::draw() {
|
||||
if (mIsVisible != true) {
|
||||
return true;
|
||||
}
|
||||
mLyt.addToDrawList();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytGameOver_c::requestIn(const char *label, s32 p1, s32 p2) {
|
||||
mLabel = label;
|
||||
mVariant = p1;
|
||||
mInType = p2;
|
||||
mInRequest = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytGameOver_c::requestOut(s32 type) {
|
||||
if (!mStateMgr.getStateID()->isEqual(StateID_Wait)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mOutType = type;
|
||||
mOutRequest = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytGameOver_c::initializeState_Init() {
|
||||
init();
|
||||
}
|
||||
void dLytGameOver_c::executeState_Init() {
|
||||
if (mInRequest == true) {
|
||||
mInRequest = false;
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
void dLytGameOver_c::finalizeState_Init() {}
|
||||
|
||||
void dLytGameOver_c::initializeState_In() {
|
||||
mStep = 0;
|
||||
mIsVisible = true;
|
||||
u32 anim = GAME_OVER_ANIM_TEXT_IN;
|
||||
if (mInType == 0) {
|
||||
anim = GAME_OVER_ANIM_GAME_OVER;
|
||||
}
|
||||
setAnm(anim);
|
||||
applyText();
|
||||
field_0x1338 = 0;
|
||||
}
|
||||
void dLytGameOver_c::executeState_In() {
|
||||
u32 anim = GAME_OVER_ANIM_TEXT_IN;
|
||||
if (mInType == 0) {
|
||||
anim = GAME_OVER_ANIM_GAME_OVER;
|
||||
}
|
||||
|
||||
d2d::AnmGroup_c &anm = mAnm[anim];
|
||||
if (anm.isEndReached() == true) {
|
||||
stopAnm(anim);
|
||||
setAnm(GAME_OVER_ANIM_LOOP);
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
setupButtons();
|
||||
}
|
||||
anm.play();
|
||||
}
|
||||
void dLytGameOver_c::finalizeState_In() {
|
||||
mSelectBtn.getPane()->SetVisible(true);
|
||||
}
|
||||
|
||||
void dLytGameOver_c::initializeState_Wait() {
|
||||
mStep = 0;
|
||||
}
|
||||
void dLytGameOver_c::executeState_Wait() {
|
||||
d2d::AnmGroup_c &anm = mAnm[GAME_OVER_ANIM_LOOP];
|
||||
anm.play();
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
if (mSelectBtn.getField_0x9B4() >= 0) {
|
||||
mSelectedOption = mSelectBtn.getField_0x9B4();
|
||||
mStep += 1;
|
||||
mIsChangingState = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (mStep == 1 && mOutRequest == true) {
|
||||
mIsChangingState = false;
|
||||
mOutRequest = false;
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void dLytGameOver_c::finalizeState_Wait() {}
|
||||
|
||||
void dLytGameOver_c::initializeState_Out() {
|
||||
mStep = 0;
|
||||
if (mOutType == 0) {
|
||||
setAnm(GAME_OVER_ANIM_TEXT_OUT);
|
||||
} else {
|
||||
setAnm(GAME_OVER_ANIM_TEXT_FADE);
|
||||
}
|
||||
}
|
||||
void dLytGameOver_c::executeState_Out() {
|
||||
u32 anim = GAME_OVER_ANIM_TEXT_OUT;
|
||||
if (mOutType != 0) {
|
||||
anim = GAME_OVER_ANIM_TEXT_FADE;
|
||||
}
|
||||
d2d::AnmGroup_c &anm = mAnm[anim];
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
if (anm.isEndReached() == true) {
|
||||
stopAnm(GAME_OVER_ANIM_TEXT_OUT);
|
||||
stopAnm(GAME_OVER_ANIM_LOOP);
|
||||
mIsVisible = false;
|
||||
mIsChangingState = true;
|
||||
mSelectBtn.getPane()->SetVisible(false);
|
||||
mStep = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
mStateMgr.changeState(StateID_Init);
|
||||
break;
|
||||
}
|
||||
}
|
||||
anm.play();
|
||||
}
|
||||
void dLytGameOver_c::finalizeState_Out() {}
|
||||
|
||||
void dLytGameOver_c::init() {
|
||||
mIsVisible = false;
|
||||
mIsChangingState = false;
|
||||
mInRequest = false;
|
||||
mOutRequest = false;
|
||||
mSelectedOption = 0;
|
||||
}
|
||||
|
||||
void dLytGameOver_c::setAnm(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
}
|
||||
|
||||
void dLytGameOver_c::stopAnm(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.unbind();
|
||||
}
|
||||
|
||||
void dLytGameOver_c::applyText() {
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mLabel, true, nullptr, 0);
|
||||
mLyt.getTextBox("T_select_00")->setTextWithGlobalTextProcessor(text);
|
||||
mLyt.getTextBox("T_selectS_00")->setTextWithGlobalTextProcessor(text);
|
||||
|
||||
dWindow_c *window = mLyt.getWindow("W_bgP_00");
|
||||
window->UpdateSize(mLyt.getSizeBoxInWindow("W_bgP_00"), 32.0f);
|
||||
}
|
||||
|
||||
void dLytGameOver_c::setupButtons() {
|
||||
s32 numOptions = 2;
|
||||
if (mVariant == 1) {
|
||||
numOptions = 3;
|
||||
} else if (mVariant == 2) {
|
||||
numOptions = 4;
|
||||
}
|
||||
|
||||
for (int i = 0; i < numOptions; i++) {
|
||||
const wchar_t *buf = dMessage_c::getGlobalTagProcessor()->getBuf(i);
|
||||
mSelectBtn.getSelectTextBox(i, 0)->setTextWithGlobalTextProcessor(buf);
|
||||
mSelectBtn.getSelectTextBox(i, 1)->setTextWithGlobalTextProcessor(buf);
|
||||
}
|
||||
mSelectBtn.setTagProcessor(dMessage_c::getGlobalTagProcessor());
|
||||
u32 tmp = dMessage_c::getGlobalTagProcessor()->getField_0x828();
|
||||
mSelectBtn.setField_0x9BC(tmp);
|
||||
mSelectBtn.setField_0x990(tmp);
|
||||
mSelectBtn.fn_8011E5D0(numOptions, true);
|
||||
}
|
||||
|
||||
SPECIAL_BASE_PROFILE(LYT_GAMEOVER_MGR, dLytGameOverMgr_c, fProfile::LYT_GAMEOVER_MGR, 0x02AC, 0x0201);
|
||||
|
||||
STATE_DEFINE(dLytGameOverMgr_c, Init);
|
||||
STATE_DEFINE(dLytGameOverMgr_c, FadeOut);
|
||||
STATE_DEFINE(dLytGameOverMgr_c, Select);
|
||||
|
||||
dLytGameOverMgr_c::dLytGameOverMgr_c() : mStateMgr(*this) {
|
||||
sInstance = this;
|
||||
init();
|
||||
}
|
||||
|
||||
dLytGameOverMgr_c::~dLytGameOverMgr_c() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
int dLytGameOverMgr_c::create() {
|
||||
mMain.build();
|
||||
mStateMgr.changeState(StateID_Init);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dLytGameOverMgr_c::doDelete() {
|
||||
mMain.remove();
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dLytGameOverMgr_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dLytGameOverMgr_c::draw() {
|
||||
mMain.draw();
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
void dLytGameOverMgr_c::initializeState_Init() {}
|
||||
void dLytGameOverMgr_c::executeState_Init() {
|
||||
mStateMgr.changeState(StateID_FadeOut);
|
||||
}
|
||||
void dLytGameOverMgr_c::finalizeState_Init() {}
|
||||
|
||||
void dLytGameOverMgr_c::initializeState_FadeOut() {
|
||||
dStage_c::GetInstance()->fadeOut(dFader_c::FADER_BLACK, 40);
|
||||
}
|
||||
void dLytGameOverMgr_c::executeState_FadeOut() {
|
||||
if (dStage_c::GetInstance()->isFadedOut() == true) {
|
||||
// "Do you want to continue adventuring? [1]Continue[2]Quit"
|
||||
if (mMain.requestIn("SYS_GAMEOVER_01", 0, 0)) {
|
||||
mMain.setField_0x1338(true);
|
||||
mStateMgr.changeState(StateID_Select);
|
||||
AnotherSoundMgr__playSound(FANFARE_SOUND_MGR, FAN_GAMEOVER);
|
||||
}
|
||||
}
|
||||
}
|
||||
void dLytGameOverMgr_c::finalizeState_FadeOut() {}
|
||||
|
||||
void dLytGameOverMgr_c::initializeState_Select() {
|
||||
mStep = 0;
|
||||
mTimer = 0;
|
||||
}
|
||||
void dLytGameOverMgr_c::executeState_Select() {
|
||||
// TODO - regswaps https://decomp.me/scratch/IPWjo
|
||||
// FileManager::GetInstance() causes even more regswaps
|
||||
FileManager *fileManager = FileManager::sInstance;
|
||||
|
||||
// I'm not sure if all these were declared here - it'd make
|
||||
// sense for a switch statement...
|
||||
const char *stage;
|
||||
u8 entrance;
|
||||
u16 room;
|
||||
u8 layer;
|
||||
bool isSpecialMinigame;
|
||||
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
if (mTimer < 20) {
|
||||
mTimer++;
|
||||
if (mTimer == 20) {
|
||||
dBase_c::s_NextExecuteControlFlags |= 1;
|
||||
dBase_c::s_DrawControlFlags |= 1;
|
||||
}
|
||||
}
|
||||
if (mMain.isChangingState() == true) {
|
||||
if (mMain.getSelectedOption() == 0) {
|
||||
mStep = 20;
|
||||
} else {
|
||||
mStep = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 10: {
|
||||
if (mMain.requestOut(0) == true) {
|
||||
mStep++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case 11: {
|
||||
if (mMain.isChangingState() == true) {
|
||||
mStep++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
// "Are you sure you want to quit? [1]Quit[2-]Cancel"
|
||||
if (mMain.requestIn("SYS_GAMEOVER_03", 0, 1)) {
|
||||
mStep++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
if (mMain.isChangingState() == true) {
|
||||
if (mMain.getSelectedOption() == 0) {
|
||||
mStep++;
|
||||
} else {
|
||||
mStep = 10;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
case 20: {
|
||||
if (mMain.requestOut(1) == true) {
|
||||
mStep++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
dScTitle_c::loadTitleScreen(1);
|
||||
mStep = 100;
|
||||
// break;
|
||||
}
|
||||
case 12: {
|
||||
// "Do you want to continue adventuring? [1]Continue[2]Quit"
|
||||
if (mMain.requestIn("SYS_GAMEOVER_01", 0, 1)) {
|
||||
mStep = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 21: {
|
||||
if (mMain.isChangingState() == true) {
|
||||
dScTitle_c::setLbl_80575787(true);
|
||||
dScGame_c::sPreventClearingSomeFlag = true;
|
||||
// Maybe an inline? Would have to use the inverse condition and then negate...
|
||||
isSpecialMinigame = false;
|
||||
if (MinigameManager::isInMinigameState(MinigameManager::TRIAL_TIME_ATTACK) ||
|
||||
MinigameManager::isInMinigameState(MinigameManager::BOSS_RUSH)) {
|
||||
isSpecialMinigame = true;
|
||||
}
|
||||
|
||||
if (params != 0 && !isSpecialMinigame) {
|
||||
dScGame_c::setReloaderType(1);
|
||||
dScGame_c::sCopyFileBToCurrentAfterRespawn = true;
|
||||
entrance = fileManager->getEntranceT1_FileB();
|
||||
room = fileManager->getLoadRoomT1_FileB();
|
||||
layer = fileManager->getForcedLayerT1_FileB();
|
||||
// TODO document this logic
|
||||
if (dScGame_c::isCurrentStage("F403") && layer == 2) {
|
||||
layer = 7;
|
||||
}
|
||||
stage = fileManager->getAreaT1_FileB();
|
||||
// TODO - this is weird, why is dScGame_c::sInstance being loaded first?
|
||||
// inlines? But we're using the fileManager from above for this call...
|
||||
// Probably the reason for the regswaps...
|
||||
dScGame_c::GetInstance()->triggerEntrance(
|
||||
stage, room, layer, entrance, fileManager->getNightT1_FileB()
|
||||
);
|
||||
} else {
|
||||
dScGame_c::setReloaderType(3);
|
||||
entrance = fileManager->getEntranceT3();
|
||||
room = fileManager->getLoadRoomT3();
|
||||
layer = fileManager->getForcedLayerT3();
|
||||
// TODO - document this logic
|
||||
if (dScGame_c::isCurrentStage("B400") && !isSpecialMinigame) {
|
||||
dScGame_c::setReloaderType(4);
|
||||
entrance = 8;
|
||||
room = 1;
|
||||
layer = 3;
|
||||
}
|
||||
stage = fileManager->getAreaT3();
|
||||
// TODO - same as above
|
||||
dScGame_c::GetInstance()->triggerEntrance(stage, room, layer, entrance, fileManager->getNightT3());
|
||||
}
|
||||
|
||||
// TODO - document this logic
|
||||
if (dScGame_c::isCurrentStage("F401")) {
|
||||
if (fileManager->getCurrentHealth() < 24) {
|
||||
fileManager->setCurrentHealth(24);
|
||||
}
|
||||
} else {
|
||||
fileManager->setCurrentHealth(24);
|
||||
}
|
||||
|
||||
// TODO - document this logic
|
||||
if (dScGame_c::isCurrentStage("F302")) {
|
||||
// "Minecart Escort related"
|
||||
SceneflagManager::sInstance->unsetTempflag_i(0x3F, 0);
|
||||
}
|
||||
restoreSkykeepPuzzleFromGlobal();
|
||||
mStep = 100;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 100: {
|
||||
dBase_c::s_NextExecuteControlFlags &= ~0x1;
|
||||
dBase_c::s_DrawControlFlags &= ~0x1;
|
||||
|
||||
dBase_c::s_NextExecuteControlFlags |= 0x200;
|
||||
dBase_c::s_DrawControlFlags |= 0x200;
|
||||
|
||||
mStep++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mMain.execute();
|
||||
}
|
||||
void dLytGameOverMgr_c::finalizeState_Select() {}
|
||||
|
||||
void dLytGameOverMgr_c::init() {
|
||||
mStep = 0;
|
||||
mTimer = 0;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "d/lyt/d_lyt_wipe.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "d/d_stage.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "toBeSorted/arc_managers/layout_arc_manager.h"
|
||||
@@ -148,7 +149,7 @@ void dLytWipe_c::executeState_None() {
|
||||
mIsSettled = false;
|
||||
// State IN fades OUT, because I guess the fader fades the scene out,
|
||||
// which means Wipe is In
|
||||
if (dStage_c::GetInstance()->fadeOut(2, 16)) {
|
||||
if (dStage_c::GetInstance()->fadeOut(dFader_c::FADER_LYT, 16)) {
|
||||
mStateMgr.changeState(StateID_In);
|
||||
mWantsIn = false;
|
||||
mVisible = true;
|
||||
@@ -207,7 +208,7 @@ void dLytWipe_c::executeState_Out() {
|
||||
dStage_c::GetInstance()->forceFadeOut();
|
||||
mFadeDelay--;
|
||||
if (mFadeDelay == 0) {
|
||||
dStage_c::GetInstance()->fadeIn(2, 16);
|
||||
dStage_c::GetInstance()->fadeIn(dFader_c::FADER_LYT, 16);
|
||||
mMain.gotoNone();
|
||||
mTransitionStage = 2;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ void dLytMeterHeart_c::executeInternal() {
|
||||
mStoredHealth = mStoredHealth + 1;
|
||||
if (mpAlphaPane->IsVisible() && mpAlphaPane->GetGlobalAlpha() != 0 && mStoredHealth % 4 == 0 &&
|
||||
(!(dScGame_c::currentSpawnInfo.stageName == "F406") || dScGame_c::currentSpawnInfo.layer != 13) &&
|
||||
dLytGameOver_c::GetInstance() == nullptr) {
|
||||
dLytGameOverMgr_c::GetInstance() == nullptr) {
|
||||
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_HP_GAUGE_UP);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -199,16 +199,16 @@ u16 *FileManager::getStoryFlagsMut() {
|
||||
/* 8000BDD0 */ u16 FileManager::getHitCountFromEnemy(u8 enemy) {}
|
||||
|
||||
/* 8000BE50 */ void FileManager::setLoadRoomT1_FileB(s16 roomId) {}
|
||||
/* 8000BE80 */ s16 FileManager::getLoadRoomT1_FileB() {}
|
||||
/* 8000BE80 */ u16 FileManager::getLoadRoomT1_FileB() {}
|
||||
/* 8000BE90 */ void FileManager::setEntranceT1_FileB(u8 entrance) {}
|
||||
/* 8000BEC0 */ u8 FileManager::getEntranceT1_FileB() {}
|
||||
/* 8000BED0 */ void FileManager::setAreaT1_FileB(const char *name) {}
|
||||
/* 8000BF80 */ char *FileManager::getAreaT1_FileB() {}
|
||||
/* 8000C080 */ void FileManager::setNightT1_FileB(bool night) {}
|
||||
/* 8000C0B0 */ bool FileManager::getNightT1_FileB() {}
|
||||
/* 8000C0B0 */ u8 FileManager::getNightT1_FileB() {}
|
||||
/* 8000C0C0 */ void FileManager::setEntranceT1LoadFlag_FileB(u8 flag) {}
|
||||
/* 8000C0F0 */ void FileManager::setForcedLayerT1_FileB(u8 layer) {}
|
||||
/* 8000C120 */ void FileManager::getForcedLayerT1_FileB() {}
|
||||
/* 8000C120 */ u8 FileManager::getForcedLayerT1_FileB() {}
|
||||
/* 8000C130 */ void FileManager::setCurrentHealth_FileB(s16 health) {}
|
||||
|
||||
/* 8000C160 */ void FileManager::setHeroname(const wchar_t *name) {}
|
||||
@@ -233,7 +233,7 @@ u16 *FileManager::getStoryFlagsMut() {
|
||||
|
||||
/* 8000CA00 */ bool FileManager::getNightT1() {}
|
||||
/* 8000CA50 */ void FileManager::setNightT3(bool night) {}
|
||||
/* 8000CA80 */ bool FileManager::getNightT3() {}
|
||||
/* 8000CA80 */ u8 FileManager::getNightT3() {}
|
||||
|
||||
/* 8000CAD0 */ bool FileManager::isNew_FileA() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user