Merge c8994e0a94
into 67ee5f8d0e
This commit is contained in:
commit
4e132e83b7
|
@ -607,7 +607,8 @@ const std::vector<FlagTable> flagTables = {
|
|||
{ RAND_INF_ZD_FISH_2, "RAND_INF_ZD_FISH_2" },
|
||||
{ RAND_INF_ZD_FISH_3, "RAND_INF_ZD_FISH_3" },
|
||||
{ RAND_INF_ZD_FISH_4, "RAND_INF_ZD_FISH_4" },
|
||||
{ RAND_INF_ZD_FISH_5, "RAND_INF_ZD_FISH_5" }
|
||||
{ RAND_INF_ZD_FISH_5, "RAND_INF_ZD_FISH_5" },
|
||||
{ RAND_INF_HAS_SKELETON_KEY, "RAND_INF_HAS_SKELETON_KEY" }
|
||||
} },
|
||||
};
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
#include "src/overlays/actors/ovl_En_Tp/z_en_tp.h"
|
||||
#include "src/overlays/actors/ovl_En_Firefly/z_en_firefly.h"
|
||||
#include "src/overlays/actors/ovl_En_Xc/z_en_xc.h"
|
||||
#include "src/overlays//actors/ovl_Fishing/z_fishing.h"
|
||||
#include "src/overlays/actors/ovl_Fishing/z_fishing.h"
|
||||
#include "src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h"
|
||||
#include "src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
|
||||
#include "src/overlays/actors/ovl_En_Door/z_en_door.h"
|
||||
#include "objects/object_link_boy/object_link_boy.h"
|
||||
#include "objects/object_link_child/object_link_child.h"
|
||||
|
||||
|
@ -1706,6 +1708,24 @@ void RegisterRandomizerCompasses() {
|
|||
});
|
||||
}
|
||||
|
||||
void RegisterSkeletonKey() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorUpdate>([](void* refActor) {
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_SKELETON_KEY)) {
|
||||
if (actor->id == ACTOR_EN_DOOR) {
|
||||
EnDoor* door = (EnDoor*)actor;
|
||||
door->lockTimer = 0;
|
||||
} else if (actor->id == ACTOR_DOOR_SHUTTER) {
|
||||
DoorShutter* shutterDoor = (DoorShutter*)actor;
|
||||
if (shutterDoor->doorType == SHUTTER_KEY_LOCKED) {
|
||||
shutterDoor->unk_16E = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void InitMods() {
|
||||
RegisterTTS();
|
||||
RegisterInfiniteMoney();
|
||||
|
@ -1750,4 +1770,5 @@ void InitMods() {
|
|||
RegisterPatchHandHandler();
|
||||
RegisterHurtContainerModeHandler();
|
||||
RegisterPauseMenuHooks();
|
||||
RegisterSkeletonKey();
|
||||
}
|
||||
|
|
|
@ -782,6 +782,10 @@ void GenerateItemPool() {
|
|||
ctx->possibleIceTrapModels.push_back(RG_OCARINA_C_RIGHT_BUTTON);
|
||||
}
|
||||
|
||||
if (ctx->GetOption(RSK_SKELETON_KEY)) {
|
||||
AddItemToMainPool(RG_SKELETON_KEY);
|
||||
}
|
||||
|
||||
if (ctx->GetOption(RSK_SHUFFLE_SWIM)) {
|
||||
AddItemToMainPool(RG_PROGRESSIVE_SCALE);
|
||||
}
|
||||
|
|
|
@ -518,5 +518,55 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI
|
|||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
int skeletonKeyHue = 0;
|
||||
|
||||
// Runs every frame to update rainbow hue, taken from CosmeticsEditor.cpp.
|
||||
Color_RGBA8 GetSkeletonKeyColor() {
|
||||
float rainbowSpeed = 0.6f;
|
||||
|
||||
float frequency = 2 * M_PI / (360 * rainbowSpeed);
|
||||
Color_RGBA8 color;
|
||||
color.r = sin(frequency * skeletonKeyHue + 0) * 127 + 128;
|
||||
color.g = sin(frequency * skeletonKeyHue + (2 * M_PI / 3)) * 127 + 128;
|
||||
color.b = sin(frequency * skeletonKeyHue + (4 * M_PI / 3)) * 127 + 128;
|
||||
color.a = 255;
|
||||
|
||||
skeletonKeyHue++;
|
||||
if (skeletonKeyHue >= (360 * rainbowSpeed)) skeletonKeyHue = 0;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
int test = 0;
|
||||
|
||||
extern "C" void Randomizer_DrawSkeletonKey(PlayState* play, GetItemEntry* getItemEntry) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Color_RGBA8 color = GetSkeletonKeyColor();
|
||||
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
||||
test += 1;
|
||||
|
||||
if (test > 40) {
|
||||
test -= 80;
|
||||
}
|
||||
|
||||
Matrix_RotateZ(M_PI / 40 * test, MTXMODE_APPLY);
|
||||
Matrix_RotateY(M_PI / 40 * test, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
gDPSetGrayscaleColor(POLY_OPA_DISP++, color.r, color.g, color.b, color.a);
|
||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gGiSmallKeyDL);
|
||||
|
||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
|
@ -21,6 +21,7 @@ void Randomizer_DrawTriforcePieceGI(PlayState* play, GetItemEntry getItemEntry);
|
|||
void Randomizer_DrawOcarinaButton(PlayState* play, GetItemEntry* getItemEntry);
|
||||
void Randomizer_DrawBronzeScale(PlayState* play, GetItemEntry* getItemEntry);
|
||||
void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getItemEntry);
|
||||
void Randomizer_DrawSkeletonKey(PlayState* play, GetItemEntry* getItemEntry);
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -288,6 +288,9 @@ void Rando::StaticData::InitItemTable() {
|
|||
itemTable[RG_BRONZE_SCALE] = Item(RG_BRONZE_SCALE, Text{ "Bronze Scale", "!!!", "!!!" }, ITEMTYPE_ITEM, GI_SCALE_SILVER, true, &logic->ProgressiveWallet, RHT_BRONZE_SCALE, RG_BRONZE_SCALE, OBJECT_GI_SCALE, GID_SCALE_SILVER, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER);
|
||||
itemTable[RG_BRONZE_SCALE].SetCustomDrawFunc(Randomizer_DrawBronzeScale);
|
||||
|
||||
itemTable[RG_SKELETON_KEY] = Item(RG_SKELETON_KEY, Text{ "Skeleton Key", "!!!", "!!!" }, ITEMTYPE_ITEM, GI_STONE_OF_AGONY, true, &logic->SkeletonKey, RHT_SKELETON_KEY, RG_SKELETON_KEY, OBJECT_GI_MAP, GID_STONE_OF_AGONY, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_RANDOMIZER);
|
||||
itemTable[RG_SKELETON_KEY].SetCustomDrawFunc(Randomizer_DrawSkeletonKey);
|
||||
|
||||
itemTable[RG_TRIFORCE] = Item(RG_TRIFORCE, Text{ "Triforce", "Triforce", "Triforce" }, ITEMTYPE_EVENT, RG_TRIFORCE, false, &logic->noVariable, RHT_NONE);
|
||||
itemTable[RG_HINT] = Item(RG_HINT, Text{ "Hint", "Indice", "Hinweis" }, ITEMTYPE_EVENT, RG_HINT, false, &logic->noVariable, RHT_NONE);
|
||||
// Individual stages of progressive items (only here for GetItemEntry purposes, not for use in seed gen)
|
||||
|
|
|
@ -411,6 +411,9 @@ namespace Rando {
|
|||
}
|
||||
|
||||
bool Logic::SmallKeys(RandomizerRegion dungeon, uint8_t requiredAmountGlitchless, uint8_t requiredAmountGlitched) {
|
||||
if (SkeletonKey) {
|
||||
return true;
|
||||
}
|
||||
switch (dungeon) {
|
||||
case RR_FOREST_TEMPLE:
|
||||
/*if (IsGlitched && (GetDifficultyValueFromString(GlitchHookshotJump_Boots) >= static_cast<uint8_t>(GlitchDifficulty::INTERMEDIATE) || GetDifficultyValueFromString(GlitchHoverBoost) >= static_cast<uint8_t>(GlitchDifficulty::NOVICE) ||
|
||||
|
@ -671,6 +674,9 @@ namespace Rando {
|
|||
//Triforce Pieces
|
||||
TriforcePieces = 0;
|
||||
|
||||
//Skeleton Key
|
||||
SkeletonKey = false;
|
||||
|
||||
//Boss Souls
|
||||
CanSummonGohma = false;
|
||||
CanSummonKingDodongo = false;
|
||||
|
|
|
@ -169,6 +169,9 @@ class Logic {
|
|||
// Triforce Pieces
|
||||
uint8_t TriforcePieces = 0;
|
||||
|
||||
// Skeleton Key
|
||||
bool SkeletonKey = false;
|
||||
|
||||
// Boss Keys
|
||||
bool BossKeyForestTemple = false;
|
||||
bool BossKeyFireTemple = false;
|
||||
|
|
|
@ -546,6 +546,7 @@ void Settings::CreateOptionDescriptions() {
|
|||
mOptionDescriptions[RSK_BLUE_FIRE_ARROWS] =
|
||||
"Ice Arrows act like Blue Fire, making them able to melt red ice. "
|
||||
"Item placement logic will respect this option, so it might be required to use this to progress.";
|
||||
mOptionDescriptions[RSK_SKELETON_KEY] = "Adds a new item called the \"Skeleton Key\", it unlocks every dungeon door locked by a small key.";
|
||||
mOptionDescriptions[RSK_LIGHT_ARROWS_HINT] =
|
||||
"Light Arrows can be used to light up the sun switches instead of using the Mirror Shield. "
|
||||
"Item placement logic will respect this option, so it might be required to use this to progress.";
|
||||
|
|
|
@ -3242,7 +3242,7 @@ CustomMessage Randomizer::GetGoronMessage(u16 index) {
|
|||
void Randomizer::CreateCustomMessages() {
|
||||
// RANDTODO: Translate into french and german and replace GIMESSAGE_UNTRANSLATED
|
||||
// with GIMESSAGE(getItemID, itemID, english, german, french).
|
||||
const std::array<GetItemMessage, 74> getItemMessages = {{
|
||||
const std::array<GetItemMessage, 75> getItemMessages = {{
|
||||
GIMESSAGE(RG_GREG_RUPEE, ITEM_MASK_GORON,
|
||||
"You found %gGreg%w!",
|
||||
"%gGreg%w! Du hast ihn wirklich gefunden!",
|
||||
|
@ -3514,6 +3514,7 @@ void Randomizer::CreateCustomMessages() {
|
|||
"Vous trouvez la %rtouche %y\xa6%r de&l'Ocarina%w! Vous pouvez&maintenant l'utiliser lorsque&vous en jouez!"),
|
||||
GIMESSAGE_UNTRANSLATED(RG_BRONZE_SCALE, ITEM_SCALE_SILVER, "You got the %rBronze Scale%w!&The power of buoyancy is yours!"),
|
||||
GIMESSAGE_UNTRANSLATED(RG_FISHING_POLE, ITEM_FISHING_POLE, "You found a lost %rFishing Pole%w!&Time to hit the pond!"),
|
||||
GIMESSAGE_UNTRANSLATED(RG_SKELETON_KEY, ITEM_KEY_SMALL, "You found the %rSkeleton Key%w!"),
|
||||
}};
|
||||
CreateGetItemMessages(&getItemMessages);
|
||||
CreateRupeeMessages();
|
||||
|
|
|
@ -1958,6 +1958,7 @@ typedef enum {
|
|||
RG_OCARINA_C_DOWN_BUTTON,
|
||||
RG_OCARINA_C_LEFT_BUTTON,
|
||||
RG_OCARINA_C_RIGHT_BUTTON,
|
||||
RG_SKELETON_KEY,
|
||||
RG_FISHING_POLE,
|
||||
RG_HINT,
|
||||
RG_TYCOON_WALLET,
|
||||
|
@ -3207,6 +3208,7 @@ typedef enum {
|
|||
RHT_OCARINA_C_RIGHT_BUTTON,
|
||||
RHT_BRONZE_SCALE,
|
||||
RHT_FISHING_POLE,
|
||||
RHT_SKELETON_KEY,
|
||||
RHT_EPONA,
|
||||
// Entrances
|
||||
RHT_DESERT_COLOSSUS_TO_COLOSSUS_GROTTO,
|
||||
|
@ -3662,6 +3664,7 @@ typedef enum {
|
|||
RSK_FISHSANITY_POND_COUNT,
|
||||
RSK_FISHSANITY_AGE_SPLIT,
|
||||
RSK_SHUFFLE_FISHING_POLE,
|
||||
RSK_SKELETON_KEY,
|
||||
RSK_MAX
|
||||
} RandomizerSettingKey;
|
||||
|
||||
|
|
|
@ -267,6 +267,8 @@ typedef enum {
|
|||
RAND_INF_ZD_FISH_4,
|
||||
RAND_INF_ZD_FISH_5,
|
||||
|
||||
RAND_INF_HAS_SKELETON_KEY,
|
||||
|
||||
// If you add anything to this list, you need to update the size of randomizerInf in z64save.h to be ceil(RAND_INF_MAX / 16)
|
||||
|
||||
RAND_INF_MAX,
|
||||
|
|
|
@ -180,6 +180,7 @@ void Settings::CreateOptions() {
|
|||
// TODO: Compasses show rewards/woth, maps show dungeon mode
|
||||
mOptions[RSK_BLUE_FIRE_ARROWS] = Option::Bool("Blue Fire Arrows", "gRandomizeBlueFireArrows", mOptionDescriptions[RSK_BLUE_FIRE_ARROWS]);
|
||||
mOptions[RSK_SUNLIGHT_ARROWS] = Option::Bool("Sunlight Arrows", "gRandomizeSunlightArrows", mOptionDescriptions[RSK_SUNLIGHT_ARROWS]);
|
||||
mOptions[RSK_SKELETON_KEY] = Option::Bool("Skeleton Key", "gRandomizeSkeletonKey", mOptionDescriptions[RSK_SKELETON_KEY]);
|
||||
mOptions[RSK_ITEM_POOL] = Option::U8("Item Pool", {"Plentiful", "Balanced", "Scarce", "Minimal"}, OptionCategory::Setting, "gRandomizeItemPool", mOptionDescriptions[RSK_ITEM_POOL], WidgetType::Combobox, RO_ITEM_POOL_BALANCED);
|
||||
mOptions[RSK_ICE_TRAPS] = Option::U8("Ice Traps", {"Off", "Normal", "Extra", "Mayhem", "Onslaught"}, OptionCategory::Setting, "gRandomizeIceTraps", mOptionDescriptions[RSK_ICE_TRAPS], WidgetType::Combobox, RO_ICE_TRAPS_NORMAL);
|
||||
// TODO: Remove Double Defense, Progressive Goron Sword
|
||||
|
@ -758,7 +759,8 @@ void Settings::CreateOptions() {
|
|||
&mOptions[RSK_BOMBCHUS_IN_LOGIC],
|
||||
&mOptions[RSK_ENABLE_BOMBCHU_DROPS],
|
||||
&mOptions[RSK_BLUE_FIRE_ARROWS],
|
||||
&mOptions[RSK_SUNLIGHT_ARROWS]
|
||||
&mOptions[RSK_SUNLIGHT_ARROWS],
|
||||
&mOptions[RSK_SKELETON_KEY],
|
||||
}, false, WidgetContainerType::COLUMN);
|
||||
mOptionGroups[RSG_GAMEPLAY_IMGUI_TABLE] = OptionGroup::SubGroup("Gameplay", {
|
||||
&mOptionGroups[RSG_TIMESAVERS_IMGUI],
|
||||
|
@ -979,6 +981,7 @@ void Settings::CreateOptions() {
|
|||
&mOptions[RSK_DAMAGE_MULTIPLIER],
|
||||
&mOptions[RSK_BLUE_FIRE_ARROWS],
|
||||
&mOptions[RSK_SUNLIGHT_ARROWS],
|
||||
&mOptions[RSK_SKELETON_KEY],
|
||||
});
|
||||
mOptionGroups[RSG_ITEM_POOL] = OptionGroup("Item Pool Settings", std::initializer_list<Option*>({
|
||||
&mOptions[RSK_ITEM_POOL],
|
||||
|
@ -1192,6 +1195,7 @@ void Settings::CreateOptions() {
|
|||
{ "Miscellaneous Settings:Hint Distribution", RSK_HINT_DISTRIBUTION },
|
||||
{ "Miscellaneous Settings:Blue Fire Arrows", RSK_BLUE_FIRE_ARROWS },
|
||||
{ "Miscellaneous Settings:Sunlight Arrows", RSK_SUNLIGHT_ARROWS },
|
||||
{ "Miscellaneous Settings:Skeleton Key", RSK_SKELETON_KEY },
|
||||
{ "Timesaver Settings:Skip Child Zelda", RSK_SKIP_CHILD_ZELDA },
|
||||
{ "Start with Consumables", RSK_STARTING_CONSUMABLES },
|
||||
{ "Full Wallets", RSK_FULL_WALLETS },
|
||||
|
@ -2278,6 +2282,7 @@ void Settings::ParseJson(nlohmann::json spoilerFileJson) {
|
|||
case RSK_SKULLS_SUNS_SONG:
|
||||
case RSK_BLUE_FIRE_ARROWS:
|
||||
case RSK_SUNLIGHT_ARROWS:
|
||||
case RSK_SKELETON_KEY:
|
||||
case RSK_BOMBCHUS_IN_LOGIC:
|
||||
case RSK_TOT_ALTAR_HINT:
|
||||
case RSK_LIGHT_ARROWS_HINT:
|
||||
|
|
|
@ -2694,6 +2694,11 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
|
|||
return Return_Item_Entry(giEntry, RG_NONE);
|
||||
}
|
||||
|
||||
if (item == RG_SKELETON_KEY) {
|
||||
Flags_SetRandomizerInf(RAND_INF_HAS_SKELETON_KEY);
|
||||
return Return_Item_Entry(giEntry, RG_NONE);
|
||||
}
|
||||
|
||||
temp = gSaveContext.inventory.items[slot];
|
||||
osSyncPrintf("Item_Register(%d)=%d %d\n", slot, item, temp);
|
||||
INV_CONTENT(item) = item;
|
||||
|
@ -5254,83 +5259,86 @@ void Interface_Draw(PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_FOREST_TEMPLE:
|
||||
case SCENE_FIRE_TEMPLE:
|
||||
case SCENE_WATER_TEMPLE:
|
||||
case SCENE_SPIRIT_TEMPLE:
|
||||
case SCENE_SHADOW_TEMPLE:
|
||||
case SCENE_BOTTOM_OF_THE_WELL:
|
||||
case SCENE_ICE_CAVERN:
|
||||
case SCENE_GANONS_TOWER:
|
||||
case SCENE_GERUDO_TRAINING_GROUND:
|
||||
case SCENE_THIEVES_HIDEOUT:
|
||||
case SCENE_INSIDE_GANONS_CASTLE:
|
||||
case SCENE_GANONS_TOWER_COLLAPSE_INTERIOR:
|
||||
case SCENE_INSIDE_GANONS_CASTLE_COLLAPSE:
|
||||
case SCENE_TREASURE_BOX_SHOP:
|
||||
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) {
|
||||
s16 X_Margins_SKC;
|
||||
s16 Y_Margins_SKC;
|
||||
if (CVarGetInteger("gSKCUseMargins", 0) != 0) {
|
||||
if (CVarGetInteger("gSKCPosType", 0) == 0) {X_Margins_SKC = Left_HUD_Margin;};
|
||||
Y_Margins_SKC = Bottom_HUD_Margin;
|
||||
} else {
|
||||
X_Margins_SKC = 0;
|
||||
Y_Margins_SKC = 0;
|
||||
}
|
||||
s16 PosX_SKC_ori = OTRGetRectDimensionFromLeftEdge(26+X_Margins_SKC);
|
||||
s16 PosY_SKC_ori = 190+Y_Margins_SKC;
|
||||
s16 PosX_SKC;
|
||||
s16 PosY_SKC;
|
||||
if (CVarGetInteger("gSKCPosType", 0) != 0) {
|
||||
PosY_SKC = CVarGetInteger("gSKCPosY", 0)+Y_Margins_SKC;
|
||||
if (CVarGetInteger("gSKCPosType", 0) == 1) {//Anchor Left
|
||||
if (CVarGetInteger("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Left_HUD_Margin;};
|
||||
PosX_SKC = OTRGetDimensionFromLeftEdge(CVarGetInteger("gSKCPosX", 0)+X_Margins_SKC);
|
||||
} else if (CVarGetInteger("gSKCPosType", 0) == 2) {//Anchor Right
|
||||
if (CVarGetInteger("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Right_HUD_Margin;};
|
||||
PosX_SKC = OTRGetDimensionFromRightEdge(CVarGetInteger("gSKCPosX", 0)+X_Margins_SKC);
|
||||
} else if (CVarGetInteger("gSKCPosType", 0) == 3) {//Anchor None
|
||||
PosX_SKC = CVarGetInteger("gSKCPosX", 0);
|
||||
} else if (CVarGetInteger("gSKCPosType", 0) == 4) {//Hidden
|
||||
PosX_SKC = -9999;
|
||||
//when having the skeleton key in rando, don't render the small key counter
|
||||
if (!Flags_GetRandomizerInf(RAND_INF_HAS_SKELETON_KEY)) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_FOREST_TEMPLE:
|
||||
case SCENE_FIRE_TEMPLE:
|
||||
case SCENE_WATER_TEMPLE:
|
||||
case SCENE_SPIRIT_TEMPLE:
|
||||
case SCENE_SHADOW_TEMPLE:
|
||||
case SCENE_BOTTOM_OF_THE_WELL:
|
||||
case SCENE_ICE_CAVERN:
|
||||
case SCENE_GANONS_TOWER:
|
||||
case SCENE_GERUDO_TRAINING_GROUND:
|
||||
case SCENE_THIEVES_HIDEOUT:
|
||||
case SCENE_INSIDE_GANONS_CASTLE:
|
||||
case SCENE_GANONS_TOWER_COLLAPSE_INTERIOR:
|
||||
case SCENE_INSIDE_GANONS_CASTLE_COLLAPSE:
|
||||
case SCENE_TREASURE_BOX_SHOP:
|
||||
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) {
|
||||
s16 X_Margins_SKC;
|
||||
s16 Y_Margins_SKC;
|
||||
if (CVarGetInteger("gSKCUseMargins", 0) != 0) {
|
||||
if (CVarGetInteger("gSKCPosType", 0) == 0) {X_Margins_SKC = Left_HUD_Margin;};
|
||||
Y_Margins_SKC = Bottom_HUD_Margin;
|
||||
} else {
|
||||
X_Margins_SKC = 0;
|
||||
Y_Margins_SKC = 0;
|
||||
}
|
||||
} else {
|
||||
PosY_SKC = PosY_SKC_ori;
|
||||
PosX_SKC = PosX_SKC_ori;
|
||||
s16 PosX_SKC_ori = OTRGetRectDimensionFromLeftEdge(26+X_Margins_SKC);
|
||||
s16 PosY_SKC_ori = 190+Y_Margins_SKC;
|
||||
s16 PosX_SKC;
|
||||
s16 PosY_SKC;
|
||||
if (CVarGetInteger("gSKCPosType", 0) != 0) {
|
||||
PosY_SKC = CVarGetInteger("gSKCPosY", 0)+Y_Margins_SKC;
|
||||
if (CVarGetInteger("gSKCPosType", 0) == 1) {//Anchor Left
|
||||
if (CVarGetInteger("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Left_HUD_Margin;};
|
||||
PosX_SKC = OTRGetDimensionFromLeftEdge(CVarGetInteger("gSKCPosX", 0)+X_Margins_SKC);
|
||||
} else if (CVarGetInteger("gSKCPosType", 0) == 2) {//Anchor Right
|
||||
if (CVarGetInteger("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Right_HUD_Margin;};
|
||||
PosX_SKC = OTRGetDimensionFromRightEdge(CVarGetInteger("gSKCPosX", 0)+X_Margins_SKC);
|
||||
} else if (CVarGetInteger("gSKCPosType", 0) == 3) {//Anchor None
|
||||
PosX_SKC = CVarGetInteger("gSKCPosX", 0);
|
||||
} else if (CVarGetInteger("gSKCPosType", 0) == 4) {//Hidden
|
||||
PosX_SKC = -9999;
|
||||
}
|
||||
} else {
|
||||
PosY_SKC = PosY_SKC_ori;
|
||||
PosX_SKC = PosX_SKC_ori;
|
||||
}
|
||||
// Small Key Icon
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, keyCountColor.r,keyCountColor.g,keyCountColor.b, interfaceCtx->magicAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); //We reset this here so it match user color :)
|
||||
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, PosX_SKC, PosY_SKC, 16, 16,
|
||||
1 << 10, 1 << 10);
|
||||
|
||||
// Small Key Counter
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
interfaceCtx->counterDigits[2] = 0;
|
||||
interfaceCtx->counterDigits[3] = gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex];
|
||||
|
||||
while (interfaceCtx->counterDigits[3] >= 10) {
|
||||
interfaceCtx->counterDigits[2]++;
|
||||
interfaceCtx->counterDigits[3] -= 10;
|
||||
}
|
||||
|
||||
if (interfaceCtx->counterDigits[2] != 0) {
|
||||
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, 16, PosX_SKC+8, PosY_SKC, 8, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, PosX_SKC+16, PosY_SKC, 8, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
// Small Key Icon
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, keyCountColor.r,keyCountColor.g,keyCountColor.b, interfaceCtx->magicAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); //We reset this here so it match user color :)
|
||||
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, PosX_SKC, PosY_SKC, 16, 16,
|
||||
1 << 10, 1 << 10);
|
||||
|
||||
// Small Key Counter
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
interfaceCtx->counterDigits[2] = 0;
|
||||
interfaceCtx->counterDigits[3] = gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex];
|
||||
|
||||
while (interfaceCtx->counterDigits[3] >= 10) {
|
||||
interfaceCtx->counterDigits[2]++;
|
||||
interfaceCtx->counterDigits[3] -= 10;
|
||||
}
|
||||
|
||||
if (interfaceCtx->counterDigits[2] != 0) {
|
||||
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, 16, PosX_SKC+8, PosY_SKC, 8, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, PosX_SKC+16, PosY_SKC, 8, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Rupee Counter
|
||||
|
|
|
@ -57,6 +57,9 @@ typedef struct EnDoor {
|
|||
/* 0x01D4 */ EnDoorActionFunc actionFunc;
|
||||
} EnDoor; // size = 0x01D8
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
void EnDoor_SetupType(EnDoor* enDoor, PlayState* play);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue