forked from MonsterDruide1/OdysseyDecomp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement StageSceneStateStartSeparatePlay and StageSceneStateEndSepa…
…ratePlay Co-authored-by: GRAnimated <[email protected]>
- Loading branch information
1 parent
0559e0b
commit bae967e
Showing
10 changed files
with
489 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include "Library/Layout/LayoutActor.h" | ||
|
||
namespace al { | ||
class LayoutInitInfo; | ||
|
||
class WipeSimple : public LayoutActor { | ||
public: | ||
WipeSimple(const char*, const char*, const LayoutInitInfo&, const char*); | ||
|
||
void startClose(s32); | ||
void tryStartClose(s32); | ||
void startCloseEnd(); | ||
void startOpen(s32); | ||
void tryStartOpen(s32); | ||
bool isCloseEnd() const; | ||
bool isOpenEnd() const; | ||
void exeClose(); | ||
void exeCloseEnd(); | ||
void exeOpen(); | ||
|
||
virtual void appear(); | ||
|
||
private: | ||
s32 mTime = -1; | ||
}; | ||
|
||
} // namespace al |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#include "Scene/StageSceneStateEndSeparatePlay.h" | ||
|
||
#include "Library/Nerve/NerveSetupUtil.h" | ||
#include "Library/Nerve/NerveUtil.h" | ||
#include "Library/Wipe/WipeSimple.h" | ||
|
||
#include "Scene/StageSceneStatePauseMenu.h" | ||
#include "Util/StageInputFunction.h" | ||
|
||
namespace { | ||
NERVE_IMPL(StageSceneStateEndSeparatePlay, FadeOut); | ||
NERVE_IMPL(StageSceneStateEndSeparatePlay, FadeIn); | ||
NERVE_IMPL(StageSceneStateEndSeparatePlay, Applet); | ||
NERVE_IMPL(StageSceneStateEndSeparatePlay, WaitDraw); | ||
|
||
NERVES_MAKE_NOSTRUCT(StageSceneStateEndSeparatePlay, Applet); | ||
NERVES_MAKE_STRUCT(StageSceneStateEndSeparatePlay, FadeOut, FadeIn, WaitDraw); | ||
} // namespace | ||
|
||
StageSceneStateEndSeparatePlay::StageSceneStateEndSeparatePlay(const char* name, | ||
StageSceneStatePauseMenu* host, | ||
const al::LayoutInitInfo& info, | ||
al::WipeSimple* wipeSimple, | ||
al::GamePadSystem* gamePadSystem) | ||
: al::HostStateBase<StageSceneStatePauseMenu>(name, host), mGamePadSystem(gamePadSystem), | ||
mWipeSimple(wipeSimple) { | ||
initNerve(&NrvStageSceneStateEndSeparatePlay.FadeOut, 0); | ||
} | ||
|
||
void StageSceneStateEndSeparatePlay::appear() { | ||
setDead(false); | ||
field_30 = false; | ||
al::setNerve(this, &NrvStageSceneStateEndSeparatePlay.FadeOut); | ||
} | ||
|
||
bool StageSceneStateEndSeparatePlay::isNeedRequestGraphicsPreset() const { | ||
return (field_30 && al::isNerve(this, &NrvStageSceneStateEndSeparatePlay.FadeIn)) || | ||
al::isNerve(this, &NrvStageSceneStateEndSeparatePlay.FadeOut); | ||
} | ||
|
||
void StageSceneStateEndSeparatePlay::exeFadeOut() { | ||
if (al::isFirstStep(this)) | ||
mWipeSimple->startClose(-1); | ||
if (mWipeSimple->isCloseEnd()) | ||
al::setNerve(this, &Applet); | ||
} | ||
|
||
void StageSceneStateEndSeparatePlay::exeApplet() { | ||
if (ControllerAppletFunction::connectControllerSinglePlay(mGamePadSystem)) | ||
rs::changeSeparatePlayMode(getScene(), false); | ||
else | ||
field_30 = true; | ||
al::setNerve(this, &NrvStageSceneStateEndSeparatePlay.WaitDraw); | ||
} | ||
|
||
al::Scene* StageSceneStateEndSeparatePlay::getScene() { | ||
return getHost()->getHost(); | ||
} | ||
|
||
void StageSceneStateEndSeparatePlay::exeFadeIn() { | ||
if (al::isFirstStep(this)) | ||
mWipeSimple->startOpen(-1); | ||
if (mWipeSimple->isOpenEnd()) | ||
kill(); | ||
} | ||
|
||
void StageSceneStateEndSeparatePlay::exeWaitDraw() { | ||
if (al::isFirstStep(this) && !field_30) | ||
getHost()->killPauseMenu(); | ||
if (al::isGreaterEqualStep(this, 2)) | ||
al::setNerve(this, &NrvStageSceneStateEndSeparatePlay.FadeIn); | ||
} | ||
|
||
bool StageSceneStateEndSeparatePlay::isDrawViewRenderer() const { | ||
if (isDead() || field_30) | ||
return false; | ||
return al::isNerve(this, &NrvStageSceneStateEndSeparatePlay.WaitDraw) || | ||
al::isNerve(this, &NrvStageSceneStateEndSeparatePlay.FadeIn); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include "Library/Nerve/NerveStateBase.h" | ||
|
||
namespace al { | ||
class GamePadSystem; | ||
class LayoutInitInfo; | ||
class Scene; | ||
class WipeSimple; | ||
} // namespace al | ||
class StageSceneStatePauseMenu; | ||
|
||
class StageSceneStateEndSeparatePlay : public al::HostStateBase<StageSceneStatePauseMenu> { | ||
public: | ||
StageSceneStateEndSeparatePlay(const char* name, StageSceneStatePauseMenu* host, | ||
const al::LayoutInitInfo& info, al::WipeSimple* wipeSimple, | ||
al::GamePadSystem* gamePadSystem); | ||
|
||
virtual void appear(); | ||
|
||
bool isNeedRequestGraphicsPreset() const; | ||
void exeFadeOut(); | ||
void exeApplet(); | ||
al::Scene* getScene(); | ||
void exeFadeIn(); | ||
void exeWaitDraw(); | ||
bool isDrawViewRenderer() const; | ||
|
||
bool getField30() const { return field_30; } | ||
|
||
private: | ||
al::GamePadSystem* mGamePadSystem = nullptr; | ||
al::WipeSimple* mWipeSimple = nullptr; | ||
bool field_30 = false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#pragma once | ||
|
||
#include "Library/Nerve/NerveStateBase.h" | ||
|
||
#include "System/GameDataHolderAccessor.h" | ||
|
||
namespace al { | ||
class ActorInitInfo; | ||
class HtmlViewer; | ||
class KeyRepeatCtrl; | ||
class LayoutInitInfo; | ||
class PauseCameraCtrl; | ||
class Scene; | ||
struct SceneInitInfo; | ||
class SimpleLayoutAppearWaitEnd; | ||
class WindowConfirm; | ||
class WipeSimple; | ||
} // namespace al | ||
class FooterParts; | ||
class GameDataHolder; | ||
class MenuSelectParts; | ||
class SceneAudioSystemPauseController; | ||
class StageSceneLayout; | ||
class StageSceneStateEndSeparatePlay; | ||
class StageSceneStateOption; | ||
class StageSceneStateStartSeparatePlay; | ||
|
||
class StageSceneStatePauseMenu : public al::HostStateBase<al::Scene> { | ||
public: | ||
StageSceneStatePauseMenu(const char* name, al::Scene* host, | ||
al::SimpleLayoutAppearWaitEnd* menuLayout, | ||
GameDataHolder* gameDataHolder, const al::SceneInitInfo& sceneInitInfo, | ||
const al::ActorInitInfo& actorInitInfo, | ||
const al::LayoutInitInfo& layoutInitInfo, | ||
al::WindowConfirm* windowConfirm, StageSceneLayout* stageSceneLayout, | ||
bool a11, | ||
SceneAudioSystemPauseController* sceneAudioSystemPauseController); | ||
|
||
virtual void appear(); | ||
virtual void kill(); | ||
|
||
void killPauseMenu(); | ||
void killMarioModel(); | ||
bool isNeedKillHost() const; | ||
void startNormal(); | ||
void startAfterTitle(); | ||
void killAllOptionLayout(); | ||
bool isEndToCancel() const; | ||
bool isEndToHelp() const; | ||
bool isLoadData() const; | ||
s32 getSelectedFileId() const; | ||
bool isChangeLanguage() const; | ||
const char* getLanguage() const; | ||
bool isNewGame() const; | ||
bool isModeSelectEnd() const; | ||
bool checkNeedKillByHostAndEnd(); | ||
void startActionMario(const char*); | ||
al::LiveActor* getMarioActor() const; | ||
bool isDrawLayout() const; | ||
bool isDrawLayoutMain() const; | ||
bool isDrawViewRenderer() const; | ||
bool isDrawChromakey() const; | ||
void exeAppear(); | ||
void setNormal(); | ||
void appearMarioModel(); | ||
void updatePlayerPose(); | ||
void exeWait(); | ||
void changeNerveAndReturn(const al::Nerve* nerve); | ||
void exeFadeBeforeHelp(); | ||
void exeStartHelp(); | ||
void exeWaitDraw(); | ||
void exeEnd(); | ||
void exeStartSeparatePlay(); | ||
void exeEndSeparatePlay(); | ||
void exeOption(); | ||
void exeSave(); | ||
void exeConfirmNewGame(); | ||
void exeNotExistEmptyFile(); | ||
void startPauseCamera(); | ||
void setAfterTitle(); | ||
|
||
private: | ||
al::SimpleLayoutAppearWaitEnd* mMenuLayout = nullptr; | ||
al::SimpleLayoutAppearWaitEnd* mMenuGuide = nullptr; | ||
al::SimpleLayoutAppearWaitEnd* mMenuRight = nullptr; | ||
FooterParts* mFooterParts; | ||
MenuSelectParts* mSelectParts = nullptr; | ||
al::WipeSimple* mMenuWipe = nullptr; | ||
al::WipeSimple* mHelpWipe = nullptr; | ||
s32 mStartType = 0; | ||
StageSceneStateStartSeparatePlay* mStateStartSeparatePlay = nullptr; | ||
StageSceneStateEndSeparatePlay* mStateEndSeparatePlay = nullptr; | ||
StageSceneStateOption* mStateOption = nullptr; | ||
al::LiveActor* mMarioHigh = nullptr; | ||
char field_0x80[40]; | ||
GameDataHolderAccessor mGameDataHolderAccessor; | ||
al::PauseCameraCtrl* mPauseCameraCtrl = nullptr; | ||
al::WindowConfirm* mWindowConfirm = nullptr; | ||
bool mIsNewGame = false; | ||
al::KeyRepeatCtrl* mKeyRepeatCtrl = nullptr; | ||
StageSceneLayout* mStageSceneLayout = nullptr; | ||
bool mIsNormal = true; | ||
bool mIsPauseMenu = false; | ||
f32 mPrevNearClipDistance = 25.0f; | ||
SceneAudioSystemPauseController* mSceneAudioSystemPauseController = nullptr; | ||
al::HtmlViewer* mHtmlViewer = nullptr; | ||
}; |
Oops, something went wrong.