NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_controller_information.cpp
1#include <game/bases/d_controller_information.hpp>
5#include <game/framework/f_profile_name.hpp>
6#include <game/snd/snd_audio_mgr.hpp>
7
8BASE_PROFILE(CONTROLLER_INFORMATION, dControllerInformation_c);
9
11
13
15 if (mIsCreated) {
16 return SUCCEEDED;
17 }
18
19 if (!createLayout()) {
20 return NOT_READY;
21 }
22
23 mLayout.ReverseAnimeStartSetup(IN2BTN, false);
24 mLayout.AnimePlay();
25 mLayout.calc();
26 mIsCreated = true;
27 mVisible = false;
28 mState = IDLE;
29
30 return SUCCEEDED;
31}
32
34
35 static const char *animeNames[] = {
36 "ControllerInformation_07_in2btn.brlan",
37 "ControllerInformation_07_loop2btn.brlan",
38 "ControllerInformation_07_hit2btn.brlan"
39 };
40
41 static const int groupIdxs[] = {0, 1, 2};
42 static const char *groupNames[] = {
43 "A00_2btn_00",
44 "A00_2btn_00",
45 "A00_2btn_00"
46 };
47
48 static const int textBoxMsgs[] = {
49 MSG_HOLD_WIIMOTE_SIDEWAYS,
50 MSG_HOLD_WIIMOTE_SIDEWAYS,
51 };
52
53 static const char *textBoxNames[] = {
54 "T_contInfo_00",
55 "T_contInfo_01"
56 };
57
58 bool res = mLayout.ReadResource("ControllerInformation/ControllerInformation.arc", false);
59 if (!res) {
60 return false;
61 }
62
63 mLayout.build("ControllerInformation_07.brlyt", nullptr);
64 mLayout.AnimeResRegister(animeNames, ARRAY_SIZE(animeNames));
65 mLayout.GroupRegister(groupNames, groupIdxs, ARRAY_SIZE(groupNames));
66 mLayout.TPaneNameRegister(textBoxNames, textBoxMsgs, BMG_CATEGORY_CONTROLLER_INFORMATION, ARRAY_SIZE(textBoxNames));
67
68 return true;
69}
70
72 if (mIsCreated && mVisible) {
73 switch (mState) {
74 case SHOW_IN:
75 mLayout.AnimeStartSetup(IN2BTN, false);
77 break;
78
79 case SHOW_LOOP:
80 if (!mLayout.isAnime(IN2BTN)) {
81 mLayout.LoopAnimeStartSetup(LOOP2BTN);
83 }
84 break;
85
86 case END:
87 SndAudioMgr::sInstance->startSystemSe(SE_SYS_BUTTON_SKIP, 1);
88 mLayout.AnimeEndSetup(IN2BTN);
89 mLayout.AnimeEndSetup(LOOP2BTN);
90 mLayout.AnimeStartSetup(HIT2BTN, false);
91 mState = IDLE;
92 break;
93 }
94 mLayout.AnimePlay();
95 mLayout.calc();
96 }
97 return SUCCEEDED;
98}
99
101 if (mIsCreated && mVisible) {
102 mLayout.entry();
103 }
104 return SUCCEEDED;
105}
106
108 return mLayout.doDelete();
109}
Displays the controller information screen.
bool mIsCreated
If the layout has been successfully created.
STATE_e mState
Which state the base is currently in.
@ WAITING_FOR_END
Playing the button animation while waiting for user input.
@ SHOW_IN
Playing the button pop-out animation.
@ END
Playing the button pressed sound effect and the button shrinking animation.
@ SHOW_LOOP
Waiting for the pop-out to finish.
@ IDLE
Initial state; waiting for layout creation.
virtual int execute()
do method for the execute operation.
virtual int doDelete()
do method for the delete operation.
dControllerInformation_c()
Constructs a new base.
virtual int draw()
do method for the draw operation.
virtual int create()
do method for the create operation.
bool mVisible
If the layout should be rendered.
bool createLayout()
Loads the resources and creates the layout for the base.
LytBase_c mLayout
The layout of the base.
@ LOOP2BTN
The button's blinking loop animation.
@ HIT2BTN
The button's hit animation.
@ IN2BTN
The button's pop-out animation.
virtual ~dControllerInformation_c()
Destroys the base.
@ NOT_READY
The step could not completed at this time.
Definition f_base.hpp:146
@ SUCCEEDED
The step was completed successfully.
Definition f_base.hpp:147
#define BASE_PROFILE(profName, className)
Creates a basic profile, using the profile number as the execute and draw order value.
Definition f_profile.hpp:23