allow swapping between different trade quest items

This commit is contained in:
gymnast86
2026-05-04 06:47:09 -07:00
parent 18f688e4b3
commit 89621dbff5
2 changed files with 42 additions and 0 deletions
+39
View File
@@ -28,6 +28,9 @@
#include <cstring>
#include <cstdio>
#if TARGET_PC
#include "dusk/randomizer/game/tools.h"
#endif
#if TARGET_PC
#include "dusk/game_clock.h"
@@ -1248,6 +1251,12 @@ void dMenu_Ring_c::setActiveCursor() {
// If the player is a wolf or somehow manages to access an item slot with no item, error
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
}
#if TARGET_PC
else if (randomizer_IsActive() && mItemSlots[mCurrentSlot] == 0x15 && mDoCPd_c::getTrigRight(PAD_1)) {
setNextWarashibeItem();
updateSlotImage(0x15);
}
#endif
}
}
@@ -2199,3 +2208,33 @@ u8 dMenu_Ring_c::openExplain(u8 param_0) {
static const u32 i_expID[2] = {0x4DF, 0x4E1};
return mpItemExplain->openExplainTx(i_nameID[idx], i_expID[idx]);
}
#if TARGET_PC
void dMenu_Ring_c::updateSlotImage(u8 slot) {
for (int i = 0; i < mTotalItemTexToAlloc; i++) {
if (mItemSlots[i] == slot) {
u8 item = dComIfGs_getItem(mItemSlots[i], false);
s32 i_textureNum =
dMeter2Info_readItemTexture(item, mpItemBuf[i][0], NULL, mpItemBuf[i][1], NULL,
mpItemBuf[i][2], NULL, NULL, NULL, -1);
for (int k = 0; k < i_textureNum; k++) {
// Delete old texture so we aren't leaking memory
if (mpItemTex[i][k] != NULL) {
JKR_DELETE(mpItemTex[i][k]);
}
mpItemTex[i][k] = JKR_NEW J2DPicture(mpItemBuf[i][k]);
mpItemTex[i][k]->setBasePosition(J2DBasePosition_4);
}
dMeter2Info_setItemColor(item, mpItemTex[i][0], mpItemTex[i][1], mpItemTex[i][2], NULL);
u8 texScale = dItem_data::getTexScale(item);
f32 fVar1 = (texScale / 100.0f);
f32 fVar2 = (mpItemBuf[i][0]->width / 48.0f);
fVar1 = fVar2 * fVar1;
mItemSlotParam1[i] = fVar1;
mItemSlotParam2[i] = (mpItemBuf[i][0]->height / 48.0f * (texScale / 100.0f));
}
}
}
#endif