Compare commits

...

1 Commits

Author SHA1 Message Date
coah
802960edff cleanup(iplButton): name anim-wait and new-mail anm flags
Rename Button calc busy flag and new-mail animation controls; update
ChannelTitle setter call sites.
2026-10-01 19:09:59 -05:00
3 changed files with 16 additions and 16 deletions

View File

@@ -309,8 +309,8 @@ namespace ipl {
return mbArrowVisible[i]; return mbArrowVisible[i];
} }
void setUnk_0x105(bool flag) { void setSuppressNewMailAnm(bool flag) {
unk_0x105 = flag; mbSuppressNewMailAnm = flag;
} }
protected: protected:
@@ -354,7 +354,7 @@ namespace ipl {
ANIM_MAX, ANIM_MAX,
}; };
int unk_0x54; int mAnimWait;
layout::Object* mpLayout; // 0x58 layout::Object* mpLayout; // 0x58
nand::LayoutFile* mpLayoutFile; // 0x5C nand::LayoutFile* mpLayoutFile; // 0x5C
@@ -373,8 +373,8 @@ namespace ipl {
BOOL mbHovered[BTN_MAX]; // 0xD8 BOOL mbHovered[BTN_MAX]; // 0xD8
bool unk_0x104; bool mbNewMailAnm;
bool unk_0x105; bool mbSuppressNewMailAnm;
utility::timer mTimer; // 0x108 utility::timer mTimer; // 0x108
bool mbEnabled; // 0x110 bool mbEnabled; // 0x110

View File

@@ -185,7 +185,7 @@ namespace ipl {
}; };
// clang-format on // clang-format on
Button::Button(EGG::Heap* heap) : Base(heap), unk_0x54(0), mOptOutBtn(), mSdMenuBtn(), unk_0x104(false), unk_0x105(false), mReservedCmd() { Button::Button(EGG::Heap* heap) : Base(heap), mAnimWait(0), mOptOutBtn(), mSdMenuBtn(), mbNewMailAnm(false), mbSuppressNewMailAnm(false), mReservedCmd() {
for (int i = 0; i < ARROW_BTN_MAX; i++) { for (int i = 0; i < ARROW_BTN_MAX; i++) {
mbArrowVisible[i] = true; mbArrowVisible[i] = true;
} }
@@ -293,7 +293,7 @@ namespace ipl {
} }
void Button::calc() { void Button::calc() {
switch (unk_0x54) { switch (mAnimWait) {
case 0: { case 0: {
if (mReservedCmd.get_current_index() != 0) { if (mReservedCmd.get_current_index() != 0) {
Command popped = mReservedCmd.get_popped_item(); Command popped = mReservedCmd.get_popped_item();
@@ -312,7 +312,7 @@ namespace ipl {
if (!mpButtonAnim[ANIM_SCENE_CHANGE]->isPlaying() && !mpButtonAnim[ANIM_CALENDAR_EXIT]->isPlaying() && if (!mpButtonAnim[ANIM_SCENE_CHANGE]->isPlaying() && !mpButtonAnim[ANIM_CALENDAR_EXIT]->isPlaying() &&
!mpButtonAnim[ANIM_COMMON_BUTTON]->isPlaying() && !mpButtonAnim[ANIM_TRASH_DELETE]->isPlaying() && !mpButtonAnim[ANIM_COMMON_BUTTON]->isPlaying() && !mpButtonAnim[ANIM_TRASH_DELETE]->isPlaying() &&
!mOptOutBtn.mpLayout->isPlaying()) { !mOptOutBtn.mpLayout->isPlaying()) {
unk_0x54 = 0; mAnimWait = 0;
} }
break; break;
} }
@@ -335,7 +335,7 @@ namespace ipl {
mpBalloons[i]->calc(); mpBalloons[i]->calc();
} }
if (unk_0x104 && !unk_0x105 && mTimer()) { if (mbNewMailAnm && !mbSuppressNewMailAnm && mTimer()) {
startNewMailAnm_(); startNewMailAnm_();
} }
} }
@@ -457,7 +457,7 @@ namespace ipl {
bool Button::isActive() const { bool Button::isActive() const {
bool result = false; bool result = false;
if (isSceneCreated() && unk_0x54 != 1) { if (isSceneCreated() && mAnimWait != 1) {
result = true; result = true;
} }
return result; return result;
@@ -668,7 +668,7 @@ namespace ipl {
} }
} }
unk_0x54 = 1; mAnimWait = 1;
} }
void Button::initArrowAppearance(int arrowType, bool bAppear) { void Button::initArrowAppearance(int arrowType, bool bAppear) {
@@ -752,8 +752,8 @@ namespace ipl {
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMinFrame(scLoopAnmFrame.start); mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMinFrame(scLoopAnmFrame.start);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(scLoopAnmFrame.end); mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(scLoopAnmFrame.end);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(1.0f); mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(1.0f);
unk_0x104 = true; mbNewMailAnm = true;
if (!unk_0x105) { if (!mbSuppressNewMailAnm) {
startNewMailAnm_(); startNewMailAnm_();
} }
} }
@@ -773,7 +773,7 @@ namespace ipl {
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(1.0f); mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(1.0f);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(0.0f); mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(0.0f);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->play(); mpButtonAnim[ANIM_BOARD_BBS_NEW]->play();
unk_0x104 = false; mbNewMailAnm = false;
} }
void Button::enableBtn() { void Button::enableBtn() {

View File

@@ -449,7 +449,7 @@ namespace ipl {
mpRsoExpHeaps[0] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL); mpRsoExpHeaps[0] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL);
mpRsoExpHeaps[1] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL); mpRsoExpHeaps[1] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL);
getButton()->setUnk_0x105(true); getButton()->setSuppressNewMailAnm(true);
} }
void ChannelTitle::calcCommon() { void ChannelTitle::calcCommon() {
@@ -931,7 +931,7 @@ namespace ipl {
System::getChannelManager()->resetChJumpLoad(); System::getChannelManager()->resetChJumpLoad();
getButton()->setUnk_0x105(false); getButton()->setSuppressNewMailAnm(false);
} }
BOOL ChannelTitle::isResetAcceptable() const { BOOL ChannelTitle::isResetAcceptable() const {