some more zukan/scrollList cleanup

This commit is contained in:
PikHacker 2024-01-05 21:14:06 -05:00
parent dd7b89a68b
commit 2a8c6f0a24
5 changed files with 119 additions and 129 deletions

View File

@ -132,13 +132,13 @@
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/tamagoMushi.cpp">tamagoMushi.cpp</a> | 13404 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/panModokiState.cpp">panModokiState.cpp</a> | 21666 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/scrollList.cpp">scrollList.cpp</a> | 25910 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/dayEndCount.cpp">dayEndCount.cpp</a> | 26683 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/scrollList.cpp">scrollList.cpp</a> | 25920 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/dayEndCount.cpp">dayEndCount.cpp</a> | 26683 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/tyre.cpp">tyre.cpp</a> | 26703 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/hurryUp2D.cpp">hurryUp2D.cpp</a> | 27145 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/miulin.cpp">miulin.cpp</a> | 34325 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/jigumo.cpp">jigumo.cpp</a> | 41070 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/shijimiChou.cpp">shijimiChou.cpp</a> | 43374 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/kingChappyState.cpp">kingChappyState.cpp</a> | 49428 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/panModoki.cpp">panModoki.cpp</a> | 53555 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/umiMushi.cpp">umiMushi.cpp</a> | 58724 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/kingChappy.cpp">kingChappy.cpp</a> | 63903 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/hiScore2D.cpp">hiScore2D.cpp</a> | 103201 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/blackMan.cpp">blackMan.cpp</a> | 121218 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/zukan2D.cpp">zukan2D.cpp</a> | 132567 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/blackMan.cpp">blackMan.cpp</a> | 121218 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/zukan2D.cpp">zukan2D.cpp</a> | 133600 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/challengeResult2D.cpp">challengeResult2D.cpp</a> | 146509 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/challengeSelect2D.cpp">challengeSelect2D.cpp</a> | 169821 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectMorimuraU/vsSelect2D.cpp">vsSelect2D.cpp</a> | 200915 | | |

View File

@ -73,7 +73,7 @@ struct TIndexPane {
mIndex = 0;
mPane = pane;
mPane2 = nullptr;
mSizeType = 0;
mSizeType = Size_Small;
mIconCount = 0;
mPaneSize = 0.0f;
mIconInfos = nullptr;
@ -95,7 +95,16 @@ struct TIndexPane {
inline f32 getPaneOffsetY() const { return mPane->getOffsetY(); }
inline TIconInfo* getIconInfo(int idx) { return mIconInfos[idx]; }
inline TIconInfo* getIconInfo(int idx) const { return mIconInfos[idx]; }
inline J2DPane* getMainPane() const { return mPane; }
enum SizeType {
Size_Small = 0, // small icons in piklopedia, supports 3 icons per row
Size_Small2 = 1, // also small icons in piklopedia?
Size_Big = 2, // used for boss icons in piklopedia
Size_Big2 = 3, // also used for boss icons in piklopedia?
};
int mIndex; // _00
J2DPane* mPane; // _04
@ -140,14 +149,13 @@ struct TScrollList : public TTestBase {
bool updateList();
void changeIndex();
inline TIndexPane* getIndexPane(int i) { return mIndexPaneList[i]; }
inline void paneStuff(int j, f32 yoffs)
inline TIndexPane* getIndexPane(int i) const { return mIndexPaneList[i]; }
inline void updateIDPaneYOffset(int id, f32 yoffs)
{
TIndexPane* idpane = mIndexPaneList[j]; // the mismatch lives here. it's the idpane temp being silly
J2DPane* pane = idpane->mPane;
pane->mOffset.y = idpane->mYOffset + yoffs;
pane->calcMtx();
mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->mPane->mOffset.y;
// should be using r4 instead of r3
getIndexPane(id)->setPaneOffset(yoffs);
getIndexPane(id)->mYOffset = getIndexPane(id)->getPaneOffsetY();
}
// _00 = VTBL1

View File

@ -27,7 +27,14 @@ struct EnemyTexMgr;
namespace Morimura {
extern int eIDInfo[ENEMY_ZUKAN_COUNT][2];
struct TEnemyZukanIndex {
static TEnemyZukanIndex& getIndexInfo(int);
int mZukanID; // _00
int mEnemyID; // _04
};
extern TEnemyZukanIndex eIDInfo[ENEMY_ZUKAN_COUNT];
struct TCallbackScrollMsg : public og::Screen::CallBack_Message {
TCallbackScrollMsg();
@ -340,10 +347,6 @@ struct TZukanBase : public TScrollList {
static JKRExpHeap* mDebugHeap;
};
struct TEnemyZukanIndex {
void getIndexInfo(int);
};
struct TEnemyZukan : public TZukanBase {
// Represents the order of enemies in the piklopedia
@ -461,17 +464,6 @@ struct TEnemyZukan : public TZukanBase {
virtual bool isNewSupply(int, bool); // _E4
virtual bool isPanelExist(); // _E8
inline int* getEnemyInfo(int index)
{
int* data = eIDInfo[0];
for (int i = 0; i < ENEMY_ZUKAN_COUNT; i++) {
if (eIDInfo[i][0] == index) {
return eIDInfo[i];
}
}
return eIDInfo[0];
}
u32 getPrice(int);
u32 getDefeatNum(int);
u32 getKilledNum(int);

View File

@ -84,13 +84,7 @@ void TIndexGroup::speedUpdate(bool check)
bool TIndexGroup::offsetUpdate(f32 offset)
{
if (mStateID != IDGroup_Idle) {
f32 val;
if (mStateID == IDGroup_Up) {
val = mRollSpeed;
} else {
val = -mRollSpeed;
}
f32 val = (mStateID == IDGroup_Up) ? mRollSpeed : -mRollSpeed;
mScrollOffset += val;
if (mScrollOffset > offset) {
@ -130,12 +124,12 @@ void TIndexGroup::rollSpUp()
void TIndexPane::update()
{
if (mIconInfos) {
f32 calc = 1.0f;
f32 scale = 1.0f;
if (mPaneSize != 0.0f) {
calc = 2.0f;
scale = 2.0f;
}
for (int i = 0; i < mIconCount; i++) {
mIconInfos[i]->update(calc);
mIconInfos[i]->update(scale);
}
}
}
@ -167,7 +161,7 @@ void TIndexPane::setIndex(int index)
if (mSizeType) {
offs = 0;
}
if (mSizeType == 1 || index + i > mMaxTextureId) {
if (mSizeType == Size_Small2 || index + i > mMaxTextureId) {
mIconInfos[i]->setInfo(-1, nullptr);
if (i == 1) {
mIconInfos[i]->mParentIndex = mIndex + 1;
@ -183,20 +177,20 @@ void TIndexPane::setIndex(int index)
}
}
switch (mSizeType) {
case 0:
case Size_Small:
mPaneSize = 0.0f;
break;
case 3:
case Size_Big2:
mIconInfos[0]->setInfo(-1, nullptr);
mIconInfos[2]->setInfo(-1, nullptr);
mPaneSize = -20.0f;
break;
case 2:
case Size_Big:
mIconInfos[0]->setInfo(-1, nullptr);
mIconInfos[2]->setInfo(-1, nullptr);
mPaneSize = 20.0f;
break;
case 1:
case Size_Small2:
mPaneSize = 0.01f;
break;
}
@ -212,7 +206,7 @@ int TIndexPane::getIndex()
{
int id;
if (mIconInfos) {
if (mSizeType == 0) {
if (mSizeType == Size_Small) {
id = mIconInfos[TScrollList::mRightOffset]->mParentIndex - 1;
if (id < 0) {
id = -1;
@ -836,7 +830,7 @@ bool TScrollList::updateList()
f32 val = 1.0f;
TIndexPane* indexPane = mIndexPaneList[mCurrActiveRowSel];
if (indexPane->mSizeType != 0) {
if (indexPane->mSizeType != TIndexPane::Size_Small) {
val += 0.5f;
}
@ -849,7 +843,7 @@ bool TScrollList::updateList()
}
TIndexPane* nextPane = mIndexPaneList[idx];
if (nextPane->mSizeType != 0) {
if (nextPane->mSizeType != TIndexPane::Size_Small) {
val += 0.5f;
if (indexPane->mIndex == nextPane->mIndex) {
idx++;
@ -858,7 +852,7 @@ bool TScrollList::updateList()
idx = 0;
}
if (mIndexPaneList[idx]->mSizeType != 0) {
if (mIndexPaneList[idx]->mSizeType != TIndexPane::Size_Small) {
val += 0.5f;
}
}
@ -870,7 +864,7 @@ bool TScrollList::updateList()
}
TIndexPane* prevPane = mIndexPaneList[idx];
if (prevPane->mSizeType != 0) {
if (prevPane->mSizeType != TIndexPane::Size_Small) {
val += 0.5f;
if (indexPane->mIndex == prevPane->mIndex) {
val -= 0.5f;
@ -879,7 +873,7 @@ bool TScrollList::updateList()
idx = mNumActiveRows - 1;
}
if (mIndexPaneList[idx]->mSizeType != 0) {
if (mIndexPaneList[idx]->mSizeType != TIndexPane::Size_Small) {
val += 0.5f;
}
}
@ -887,14 +881,11 @@ bool TScrollList::updateList()
}
group->mOffsetDifference = 0.0f;
val = group->mHeight * val;
bool result = group->offsetUpdate(val);
bool result = group->offsetUpdate(group->mHeight * val);
f32 val2 = mIndexGroup->mScrollOffset;
for (int i = 0; i < mNumActiveRows; i++) {
TIndexPane* pane = mIndexPaneList[i];
pane->mPane->setOffsetY(pane->mYOffset + val2);
mIndexPaneList[i]->setPaneOffset(val2);
changeTextTevBlock(i);
}
@ -913,8 +904,7 @@ bool TScrollList::updateList()
mIndexGroup->mScrollOffset = val2;
for (int i = 0; i < mNumActiveRows; i++) {
TIndexPane* pane = mIndexPaneList[i];
pane->mPane->setOffsetY(pane->mYOffset + val2);
mIndexPaneList[i]->setPaneOffset(val2);
}
mIndexGroup->mIsActiveSpeedUp = 0;

View File

@ -1,19 +1,14 @@
#include "Morimura/Zukan.h"
#include "PSSystem/PSSystemIF.h"
#include "nans.h"
#include "Game/IconTexture.h"
#include "Game/ResultTexMgr.h"
#include "Game/IllustratedBook.h"
#include "trig.h"
#include "Dolphin/rand.h"
#include "Game/gamePlayData.h"
#include "System.h"
#include "Game/Data.h"
#include "Game/enemyInfo.h"
#include "Game/TekiStat.h"
#include "Game/PelletList.h"
#include "P2JME/P2JME.h"
#include "PSSystem/PSSystemIF.h"
#include "Dolphin/rand.h"
#include "efx2d/T2DChangesmoke.h"
#include "nans.h"
static const int unusedArray[] = { 0, 0, 0 };
@ -22,10 +17,10 @@ s16 TZukanBase::mRequestTimerMax = 10;
bool TZukanBase::mIconMove = true;
f32 TZukanBase::mLineSpace = 48.0f; // [vertical spacing between lines of text in message box]
f32 TZukanBase::mWarpRadius = 15.0f;
f32 TZukanBase::mScrollValueCoe = 3.5f; // 3.5f [max scroll speed]
f32 TZukanBase::mScrollSpeedCoe = 0.08f; // 0.08f [acceleration]
f32 TZukanBase::mScrollValueCoe = 3.5f; // [max scroll speed]
f32 TZukanBase::mScrollSpeedCoe = 0.08f; // [acceleration]
f32 TZukanBase::mNewScale = 0.7f;
f32 TZukanBase::mPodIconOffsetX = 480.0f; // 480.0f
f32 TZukanBase::mPodIconOffsetX = 480.0f;
f32 TZukanBase::mLargeCategoryScale = 2.0f;
f32 TZukanBase::mCategoryAlphaRate = 0.6f;
u8 TZukanBase::mDrawLineType = 2;
@ -78,7 +73,7 @@ int TItemZukan::mCategoryArray[TREASUREHOARD_CATEGORY_NUM] = {
};
// this table connects piklopedia order to the actual game enemy id order
int eIDInfo[ENEMY_ZUKAN_COUNT][2] = {
TEnemyZukanIndex eIDInfo[ENEMY_ZUKAN_COUNT] = {
{ TEnemyZukan::Zukan_Chappy, Game::EnemyTypeID::EnemyID_Chappy },
{ TEnemyZukan::Zukan_YellowChappy, Game::EnemyTypeID::EnemyID_YellowChappy },
{ TEnemyZukan::Zukan_BlueChappy, Game::EnemyTypeID::EnemyID_BlueChappy },
@ -513,7 +508,7 @@ bool TZukanBase::doUpdate()
mIndexGroup->downIndex();
}
} else if (pad->getButtonDown() & Controller::ANALOG_RIGHT) {
if (mIndexPaneList[mCurrActiveRowSel]->mSizeType == 0 && isPanelExist()) {
if (mIndexPaneList[mCurrActiveRowSel]->mSizeType == TIndexPane::Size_Small && isPanelExist()) {
mRightOffset++;
if (mRightOffset > 2) {
mRightOffset = 2;
@ -522,7 +517,7 @@ bool TZukanBase::doUpdate()
}
}
} else if (pad->getButtonDown() & Controller::ANALOG_LEFT) {
if (mIndexPaneList[mCurrActiveRowSel]->mSizeType == 0) {
if (mIndexPaneList[mCurrActiveRowSel]->mSizeType == TIndexPane::Size_Small) {
mRightOffset--;
if (mRightOffset < 0) {
mRightOffset = 0;
@ -631,7 +626,7 @@ bool TZukanBase::doUpdate()
// for large panes (bosses), always do the scale animation on the middle pane (if its whats selected),
// otherwise do it based on the horizontal selection
if (pane->mSizeType != 0) {
if (pane->mSizeType != TIndexPane::Size_Small) {
for (int i = 0; i < mNumActiveRows; i++) {
if (mIndexPaneList[mCurrActiveRowSel]->getListIndex() == mIndexPaneList[i]->getListIndex()) {
mIndexPaneList[i]->mIconInfos[1]->startScaleUp(0.5f);
@ -835,7 +830,7 @@ void TZukanBase::doDraw(Graphics& gfx)
for (int i = 0; i < mNumActiveRows; i++) {
TIndexPane* idpane = mIndexPaneList[i];
if (idpane->mPane->isVisible()) {
if (idpane->mSizeType == 0) {
if (idpane->mSizeType == TIndexPane::Size_Small) {
for (int j = 0; j < 3; j++) {
int index = mIndexPaneList[i]->getListIndex();
int id = index + j;
@ -845,7 +840,7 @@ void TZukanBase::doDraw(Graphics& gfx)
mMessageNew->draw(gfx, *graf);
}
}
} else if (idpane->mSizeType != 1) {
} else if (idpane->mSizeType != TIndexPane::Size_Small2) {
if (isNewSupply(idpane->getListIndex(), false)) {
mPaneNew1->mGlobalMtx[0][3] = mLargeNewOffset.x + mIndexPaneList[i]->mIconInfos[1]->mPane->mGlobalMtx[0][3];
mPaneNew1->mGlobalMtx[1][3] = mLargeNewOffset.y + mIndexPaneList[i]->mIconInfos[1]->mPane->mGlobalMtx[1][3];
@ -1192,7 +1187,7 @@ void TZukanBase::doUpdateOut()
int offs2 = mRightOffset;
TIndexPane* pane = mIndexPaneList[mCurrActiveRowSel];
if (pane->mSizeType != 0) {
if (pane->mSizeType != TIndexPane::Size_Small) {
mPaneSelectIcon->setOffset(mSelectIconPos.x + 62.0f, mSelectIconPos.y);
offs2 = 1;
} else {
@ -1279,7 +1274,7 @@ void TZukanBase::doUpdateOut()
J2DPane* pane = icon->mPic;
if (icon->mParentIndex && icon->mPane->isVisible()) {
pane->show();
if (mIndexPaneList[i]->mSizeType == 0) {
if (mIndexPaneList[i]->mSizeType == TIndexPane::Size_Small) {
pane->updateScale(mCategoryScale.x, mCategoryScale.y);
} else {
pane->updateScale(mCategoryScale.x * mLargeCategoryScale, mCategoryScale.y * mLargeCategoryScale);
@ -1373,7 +1368,7 @@ void TZukanBase::setShortenIndex(int paneID, int index, bool)
if (mDoEnableBigIcon && index >= 0 && index < mMaxPane && mIsBigIconList[mViewablePanelIDList[index]]) {
mIndexPaneList[paneID]->setIndex(index);
TIndexPane* pane = mIndexPaneList[paneID];
if (pane->mSizeType != 1) {
if (pane->mSizeType != TIndexPane::Size_Small2) {
if (mIsSection)
pane->getIconInfo(1)->setInfo(mViewablePanelIDList[index], nullptr);
else {
@ -1542,9 +1537,15 @@ void TZukanBase::resetDebugShow()
* @note Address: N/A
* @note Size: 0x4C
*/
void TEnemyZukanIndex::getIndexInfo(int)
TEnemyZukanIndex& TEnemyZukanIndex::getIndexInfo(int index)
{
// UNUSED FUNCTION
TEnemyZukanIndex& data = eIDInfo[0];
for (int i = 0; i < ENEMY_ZUKAN_COUNT; i++) {
if (eIDInfo[i].mZukanID == index) {
return eIDInfo[i];
}
}
return eIDInfo[0];
}
/**
@ -1920,11 +1921,11 @@ void TEnemyZukan::doCreate(JKRArchive* arc)
index2 = _234;
}
}
if (index2 > index && (listIndex == index || mIndexPaneList[mCurrActiveRowSel]->mSizeType == 0)) {
if (mIndexPaneList[mCurrActiveRowSel]->mSizeType != 0) {
if (index2 > index && (listIndex == index || mIndexPaneList[mCurrActiveRowSel]->mSizeType == TIndexPane::Size_Small)) {
if (mIndexPaneList[mCurrActiveRowSel]->mSizeType != TIndexPane::Size_Small) {
yoffs = -yoffs * 0.5f;
for (int j = 0; j < mNumActiveRows; j++) {
paneStuff(j, yoffs);
updateIDPaneYOffset(j, yoffs);
}
mRightOffset = 1;
} else {
@ -1936,7 +1937,7 @@ void TEnemyZukan::doCreate(JKRArchive* arc)
}
for (int j = 0; j < mNumActiveRows; j++) {
paneStuff(j, -yoffs);
updateIDPaneYOffset(j, -yoffs);
}
updateIndex(true);
TIndexGroup* grp = mIndexGroup;
@ -2078,8 +2079,8 @@ bool TEnemyZukan::isListShow(int index)
return mDebugUnlockedList[index];
if (Game::playData) {
int* data = getEnemyInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data[1]);
TEnemyZukanIndex& data = TEnemyZukanIndex::getIndexInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data.mEnemyID);
if (info->mState.isSet(TEKISTAT_STATE_UPDATED)) {
return true;
} else {
@ -2098,8 +2099,9 @@ void TEnemyZukan::indexPaneInit(J2DScreen* screen)
mCurrMinActiveRow = 0;
mCurrActiveRowSel = 4;
mCurrMaxActiveRow = mNumActiveRows - 1;
mNumActiveRows = 14; // 14 rows of enemies are active at once
mCurrActiveRowSel = 6;
mCurrActiveRowSel = 6; // active row is 6 down from the uppermost one
mCurrMaxActiveRow = mNumActiveRows - 1;
u64 tags[14] = { 'Tmenu12', 'Tmenu13', 'Tmenu00', 'Tmenu01', 'Tmenu02', 'Tmenu03', 'Tmenu04',
@ -2223,7 +2225,7 @@ void TEnemyZukan::indexPaneInit(J2DScreen* screen)
J2DPane* pane = mIndexPaneList[i]->mPane;
int index = i * mRowSize;
mIndexPaneList[i]->mSizeType = 0;
mIndexPaneList[i]->mSizeType = TIndexPane::Size_Small;
if (mIsPreDebt) {
index = prevIndex;
}
@ -2233,7 +2235,7 @@ void TEnemyZukan::indexPaneInit(J2DScreen* screen)
index = listIndex;
bool test = true;
switch (mIndexPaneList[i - 1]->mSizeType) {
case 0:
case TIndexPane::Size_Small:
// index = prevIndex;
if (prevIndex == _234) {
index = prevIndex;
@ -2241,23 +2243,23 @@ void TEnemyZukan::indexPaneInit(J2DScreen* screen)
index = listIndex + mRowSize;
}
break;
case 1:
case TIndexPane::Size_Small2:
index = listIndex + 1;
break;
case 2:
case 3:
case TIndexPane::Size_Big:
case TIndexPane::Size_Big2:
test = false;
mIndexPaneList[i]->mSizeType = 1;
mIndexPaneList[i]->mSizeType = TIndexPane::Size_Small2;
}
if (test) {
if (mIsPreDebt) {
if (index < mMaxPane && mIsBigIconList[mViewablePanelIDList[index]]) {
mIndexPaneList[i]->mSizeType = 2;
mIndexPaneList[i]->mSizeType = TIndexPane::Size_Big;
}
} else {
if (mIsBigIconList[index]) {
mIndexPaneList[i]->mSizeType = 2;
mIndexPaneList[i]->mSizeType = TIndexPane::Size_Big;
}
}
}
@ -2314,10 +2316,10 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
if (mIsBigIconList[mViewablePanelIDList[id]]) {
// int test = mIndexPaneList[mCurrMinActiveRow]->mSizeType;
switch (mIndexPaneList[mCurrMinActiveRow]->mSizeType) {
case 1:
case TIndexPane::Size_Small2:
id++;
break;
case 2:
case TIndexPane::Size_Big:
break;
}
} else {
@ -2339,7 +2341,7 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
bool flag2 = false; // r31
bool flag3 = false; // r30
mIndexPaneList[mCurrMinActiveRow]->mSizeType = 0;
mIndexPaneList[mCurrMinActiveRow]->mSizeType = TIndexPane::Size_Small;
if (id == mIndexPaneList[mCurrMaxActiveRow]->getListIndex()) {
flag3 = true;
}
@ -2357,23 +2359,23 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
} else {
switch (mIndexPaneList[mCurrMaxActiveRow]->mSizeType) {
case 2:
case TIndexPane::Size_Big:
if (flag3) {
mIndexPaneList[mCurrMinActiveRow]->mSizeType = 1;
mIndexPaneList[mCurrMinActiveRow]->mSizeType = TIndexPane::Size_Small2;
} else {
JUT_PANICLINE(2921, nullptr);
}
break;
case 1:
case 3:
case TIndexPane::Size_Small2:
case TIndexPane::Size_Big2:
if (flag3) {
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = 2;
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = TIndexPane::Size_Big;
if (mIsPreDebt) {
setShortenIndex(mCurrMaxActiveRow, id, flag);
} else {
mIndexPaneList[mCurrMaxActiveRow]->setIndex(id);
}
mIndexPaneList[mCurrMinActiveRow]->mSizeType = 1;
mIndexPaneList[mCurrMinActiveRow]->mSizeType = TIndexPane::Size_Small2;
} else {
flag2 = true;
id++;
@ -2412,7 +2414,7 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
test = mViewablePanelIDList[test];
}
if (mIsBigIconList[test]) {
mIndexPaneList[mCurrMinActiveRow]->mSizeType = 2;
mIndexPaneList[mCurrMinActiveRow]->mSizeType = TIndexPane::Size_Big;
}
}
}
@ -2435,9 +2437,9 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
newIndex = mNumActiveRows - 1;
}
if (mIndexPaneList[newIndex]->mSizeType == 1) {
if (mIndexPaneList[newIndex]->mSizeType == TIndexPane::Size_Small2) {
if (mIndexPaneList[newIndex]->getListIndex() == mIndexPaneList[mCurrMaxActiveRow]->getListIndex()) {
mIndexPaneList[newIndex]->mSizeType = 2;
mIndexPaneList[newIndex]->mSizeType = TIndexPane::Size_Big;
if (mIsPreDebt) {
setShortenIndex(newIndex, mIndexPaneList[newIndex]->getListIndex(), flag);
} else {
@ -2449,7 +2451,7 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
bool flag2 = false;
bool flag3 = false;
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = 0;
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = TIndexPane::Size_Small;
if (id == mIndexPaneList[mCurrMinActiveRow]->getListIndex()) {
flag3 = true;
}
@ -2487,29 +2489,29 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
flag2 = true;
} else {
switch (mIndexPaneList[mCurrMinActiveRow]->mSizeType) {
case 3:
case TIndexPane::Size_Big2:
if (flag3) {
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = 1;
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = TIndexPane::Size_Small2;
} else {
JUT_PANICLINE(3068, nullptr);
}
break;
case 1:
case 2:
case TIndexPane::Size_Small2:
case TIndexPane::Size_Big:
if (flag3) {
mIndexPaneList[mCurrMinActiveRow]->mSizeType = 3;
mIndexPaneList[mCurrMinActiveRow]->mSizeType = TIndexPane::Size_Big2;
if (mIsPreDebt) {
setShortenIndex(mCurrMinActiveRow, id, flag);
} else {
mIndexPaneList[mCurrMinActiveRow]->setIndex(id);
}
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = 1;
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = TIndexPane::Size_Small2;
} else {
flag2 = true;
id--;
}
break;
case 0:
case TIndexPane::Size_Small:
int prevIdx = id - 1;
if (mIsPreDebt && id > 0) {
prevIdx = mViewablePanelIDList[prevIdx];
@ -2564,7 +2566,7 @@ void TEnemyZukan::getUpdateIndex(int& id, bool flag)
test = mViewablePanelIDList[test];
}
if (mIsBigIconList[test]) {
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = 3;
mIndexPaneList[mCurrMaxActiveRow]->mSizeType = TIndexPane::Size_Big2;
}
}
}
@ -2600,7 +2602,7 @@ u64 TEnemyZukan::getYMsgID(int id) { return mOffsetMsg_YDesc->getMsgID(id); }
* @note Address: 0x80377724
* @note Size: 0x50
*/
int TEnemyZukan::getModelIndex(int index) { return getEnemyInfo(index)[1]; }
int TEnemyZukan::getModelIndex(int index) { return TEnemyZukanIndex::getIndexInfo(index).mEnemyID; }
/**
* @note Address: 0x80377774
@ -2649,8 +2651,8 @@ bool TEnemyZukan::isNewSupply(int index, bool flag)
index = mViewablePanelIDList[index];
}
int* data = getEnemyInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data[1]);
TEnemyZukanIndex& data = TEnemyZukanIndex::getIndexInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data.mEnemyID);
if (info && info->mState.isSet(TEKISTAT_STATE_UPDATED) && !(info->mState.isSet(TEKISTAT_STATE_OUT_OF_DATE))) {
return true;
} else {
@ -2710,8 +2712,8 @@ u32 TEnemyZukan::getPrice(int index)
}
if (Game::playData) {
int* data = getEnemyInfo(index);
int id = data[1];
TEnemyZukanIndex& data = TEnemyZukanIndex::getIndexInfo(index);
int id = data.mEnemyID;
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(id);
if (!(info->mState.isSet(TEKISTAT_STATE_UPDATED))) {
return 0;
@ -2737,8 +2739,8 @@ u32 TEnemyZukan::getDefeatNum(int index)
}
if (Game::playData) {
int* data = getEnemyInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data[1]);
TEnemyZukanIndex& data = TEnemyZukanIndex::getIndexInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data.mEnemyID);
if (info) {
if (info->mState.isSet(TEKISTAT_STATE_UPDATED)) {
return info->mKilledTekiCount;
@ -2760,8 +2762,8 @@ u32 TEnemyZukan::getKilledNum(int index)
}
if (Game::playData) {
int* data = getEnemyInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data[1]);
TEnemyZukanIndex& data = TEnemyZukanIndex::getIndexInfo(index);
Game::TekiStat::Info* info = Game::playData->mTekiStatMgr.getTekiInfo(data.mEnemyID);
if (info) {
if (info->mState.isSet(TEKISTAT_STATE_UPDATED)) {
return info->mKilledPikminCount;
@ -2988,7 +2990,7 @@ void TItemZukan::setShortenIndex(int paneID, int index, bool flag)
if ((_3B4 % 2) == 1) {
if (flag) {
id = 3;
id2--; // WHY DON'T YOU WANNA GO IN r5
id2--;
if (id2 < 0) {
id2 = mNumActiveRows - 1;
}
@ -3532,7 +3534,7 @@ void TItemZukan::doCreate(JKRArchive* arc)
f32 xoffs = 0.0f;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < mNumActiveRows; j++) {
paneStuff(j, yoffs);
updateIDPaneYOffset(j, yoffs);
}
updateIndex(false);
TIndexGroup* grp = mIndexGroup;
@ -3578,7 +3580,7 @@ void TItemZukan::doCreate(JKRArchive* arc)
if (index > 2) {
for (int i = 0; i < index / 3; i++) {
for (int j = 0; j < mNumActiveRows; j++) {
paneStuff(j, -yoffs);
updateIDPaneYOffset(j, -yoffs);
}
updateIndex(true);
TIndexGroup* grp = mIndexGroup;
@ -4231,12 +4233,10 @@ void TItemZukan::setDetail()
mWeightCounter->setBlind(true);
} else {
mInfoVal1 = getPrice(id);
if (mInfoVal1 >= 10000)
JUT_PANICLINE(4726, "price (%d) = %d\n", id, mInfoVal1);
JUT_ASSERTLINE(4726, mInfoVal1 < 10000, "price (%d) = %d\n", id, mInfoVal1);
mInfoVal2 = getWeight(id);
if (mInfoVal2 >= 10000)
JUT_PANICLINE(4728, "weight (%d) = %d\n", id, mInfoVal2);
JUT_ASSERTLINE(4728, mInfoVal2 < 10000, "weight (%d) = %d\n", id, mInfoVal2);
if (isListShow(id)) {
mIsCurrentSelUnlocked = true;