Allows rendering custom models as Ice Traps in GetItem Animations. (#3760)

This commit is contained in:
Christopher Leggett 2023-12-30 12:10:50 -05:00 committed by GitHub
parent dbb1e60734
commit c9907ed5fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 11 deletions

View File

@ -731,11 +731,11 @@ void GenerateItemPool() {
AddItemToMainPool(RG_OCARINA_C_RIGHT_BUTTON);
//TODO: Re-add when custom models work with ice traps
//ctx->possibleIceTrapModels.push_back(RG_OCARINA_A_BUTTON);
//ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_UP_BUTTON);
//ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_DOWN_BUTTON);
//ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_LEFT_BUTTON);
//ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_RIGHT_BUTTON);
ctx->possibleIceTrapModels.push_back(RG_OCARINA_A_BUTTON);
ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_UP_BUTTON);
ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_DOWN_BUTTON);
ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_LEFT_BUTTON);
ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_RIGHT_BUTTON);
}
if (ctx->GetOption(RSK_SHUFFLE_COWS)) {

View File

@ -358,7 +358,7 @@ extern "C" void Randomizer_DrawOcarinaButton(PlayState* play, GetItemEntry* getI
cRightButtonColor = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", cRightButtonColor);
}
s16 slot = getItemEntry->getItemId - RG_OCARINA_A_BUTTON;
s16 slot = getItemEntry->drawItemId - RG_OCARINA_A_BUTTON;
Gfx* dLists[] = {
(Gfx*)gOcarinaAButtonDL,

View File

@ -19,9 +19,9 @@ Item::Item(const RandomizerGet randomizerGet_, Text name_, const ItemType type_,
: randomizerGet(randomizerGet_), name(std::move(name_)), type(type_), getItemId(getItemId_),
advancement(advancement_), logicVar(logicVar_), hintKey(hintKey_), progressive(progressive_), price(price_) {
if (modIndex_ == MOD_RANDOMIZER || getItemId > 0x7D) {
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_RANDOMIZER, static_cast<int16_t>(randomizerGet_), gid_, true, ITEM_FROM_NPC, category_, NULL});
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_RANDOMIZER, static_cast<int16_t>(randomizerGet_), gid_, true, ITEM_FROM_NPC, category_, static_cast<uint16_t>(randomizerGet_), MOD_RANDOMIZER, NULL});
} else {
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_VANILLA, getItemId_, gid_, true, ITEM_FROM_NPC, category_, NULL});
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_VANILLA, getItemId_, gid_, true, ITEM_FROM_NPC, category_, itemId_, modIndex_, NULL});
}
}
@ -33,9 +33,9 @@ Item::Item(const RandomizerGet randomizerGet_, Text name_, const ItemType type_,
: randomizerGet(randomizerGet_), name(std::move(name_)), type(type_), getItemId(getItemId_),
advancement(advancement_), logicVar(logicVar_), hintKey(hintKey_), progressive(progressive_), price(price_) {
if (modIndex_ == MOD_RANDOMIZER || getItemId > 0x7D) {
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_RANDOMIZER, static_cast<int16_t>(randomizerGet_), gid_, true, ITEM_FROM_NPC, category_, NULL});
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_RANDOMIZER, static_cast<int16_t>(randomizerGet_), gid_, true, ITEM_FROM_NPC, category_, static_cast<uint16_t>(randomizerGet_), modIndex_, NULL});
} else {
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_VANILLA, getItemId_, gid_, true, ITEM_FROM_NPC, category_, NULL});
giEntry = std::make_shared<GetItemEntry>(GetItemEntry{itemId_, field_, static_cast<int16_t>((chestAnimation_ != CHEST_ANIM_SHORT ? 1 : -1) * (gid_ + 1)), textId_, objectId_, modIndex_, TABLE_VANILLA, getItemId_, gid_, true, ITEM_FROM_NPC, category_, itemId_, modIndex_, NULL});
}
}

View File

@ -1508,7 +1508,11 @@ void Player_DrawGetItemIceTrap(PlayState* play, Player* this, Vec3f* refPos, s32
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
// Draw fake item model.
GetItem_Draw(play, drawIdPlusOne - 1);
if (this->getItemEntry.drawFunc != NULL) {
this->getItemEntry.drawFunc(play, &this->getItemEntry);
} else {
GetItem_Draw(play, drawIdPlusOne - 1);
}
}
CLOSE_DISPS(play->state.gfxCtx);