mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Merge pull request #1 from MelonSpeedruns/testing-out-item-replacement-melon
This commit is contained in:
commit
4393cdb034
10 changed files with 121 additions and 34 deletions
|
@ -813,6 +813,12 @@ namespace SohImGui {
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginMenu("Randomizer"))
|
||||||
|
{
|
||||||
|
EnhancementCheckbox("Enable Randomizer", "gRandomizer");
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui::BeginMenu("Developer Tools"))
|
if (ImGui::BeginMenu("Developer Tools"))
|
||||||
{
|
{
|
||||||
EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled");
|
EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled");
|
||||||
|
|
|
@ -529,13 +529,18 @@ void Randomizer::PopulateItemLocations(std::string spoilerFileName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetItemID Randomizer::GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams) {
|
GetItemID Randomizer::GetItemFromActor(s16 actorId, GetItemID ogItemId) {
|
||||||
return GetItemFromGet(this->itemLocations[GetCheckFromSceneAndParams(sceneNum, actorParams)]);
|
return GetItemFromGet(this->itemLocations[GetCheckFromActor(actorId, ogItemId)], ogItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
GetItemID Randomizer::GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams, GetItemID ogItemId) {
|
||||||
// todo update this to handle progressive upgrades (need to pass in more than just randoGet)
|
return GetItemFromGet(this->itemLocations[GetCheckFromSceneAndParams(sceneNum, actorParams)], ogItemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId) {
|
||||||
switch(randoGet) {
|
switch(randoGet) {
|
||||||
|
case UNKNOWN_GET:
|
||||||
|
return ogItemId;
|
||||||
case KOKIRI_SWORD:
|
case KOKIRI_SWORD:
|
||||||
return GI_SWORD_KOKIRI;
|
return GI_SWORD_KOKIRI;
|
||||||
case DEKU_SHIELD:
|
case DEKU_SHIELD:
|
||||||
|
@ -553,9 +558,23 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
case BOMBCHUS_10:
|
case BOMBCHUS_10:
|
||||||
return GI_BOMBCHUS_10;
|
return GI_BOMBCHUS_10;
|
||||||
case BOW:
|
case BOW:
|
||||||
|
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||||
|
case 0:
|
||||||
return GI_BOW;
|
return GI_BOW;
|
||||||
|
case 1:
|
||||||
|
return GI_QUIVER_40;
|
||||||
|
case 2:
|
||||||
|
return GI_QUIVER_50;
|
||||||
|
}
|
||||||
case SLINGSHOT:
|
case SLINGSHOT:
|
||||||
|
switch (CUR_UPG_VALUE(UPG_BULLET_BAG)) {
|
||||||
|
case 0:
|
||||||
return GI_SLINGSHOT;
|
return GI_SLINGSHOT;
|
||||||
|
case 1:
|
||||||
|
return GI_BULLET_BAG_40;
|
||||||
|
case 2:
|
||||||
|
return GI_BULLET_BAG_50;
|
||||||
|
}
|
||||||
case BOOMERANG:
|
case BOOMERANG:
|
||||||
return GI_BOOMERANG;
|
return GI_BOOMERANG;
|
||||||
case PROGRESSIVE_HOOKSHOT:
|
case PROGRESSIVE_HOOKSHOT:
|
||||||
|
@ -586,7 +605,7 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
case HOVER_BOOTS:
|
case HOVER_BOOTS:
|
||||||
return GI_BOOTS_HOVER;
|
return GI_BOOTS_HOVER;
|
||||||
case BOMB_BAG:
|
case BOMB_BAG:
|
||||||
switch (CUR_UPG_VALUE(1)) {
|
switch (CUR_UPG_VALUE(UPG_BOMB_BAG)) {
|
||||||
case ITEM_NONE:
|
case ITEM_NONE:
|
||||||
return GI_BOMB_BAG_20;
|
return GI_BOMB_BAG_20;
|
||||||
case ITEM_BOMB_BAG_20:
|
case ITEM_BOMB_BAG_20:
|
||||||
|
@ -595,7 +614,7 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
return GI_BOMB_BAG_40;
|
return GI_BOMB_BAG_40;
|
||||||
}
|
}
|
||||||
case PROGRESSIVE_STRENGTH_UPGRADE:
|
case PROGRESSIVE_STRENGTH_UPGRADE:
|
||||||
switch (CUR_UPG_VALUE(3)) {
|
switch (CUR_UPG_VALUE(UPG_STRENGTH)) {
|
||||||
case 0:
|
case 0:
|
||||||
return GI_BRACELET;
|
return GI_BRACELET;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -604,7 +623,7 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
return GI_GAUNTLETS_GOLD;
|
return GI_GAUNTLETS_GOLD;
|
||||||
}
|
}
|
||||||
case PROGRESSIVE_SCALE:
|
case PROGRESSIVE_SCALE:
|
||||||
switch (CUR_UPG_VALUE(2)) {
|
switch (CUR_UPG_VALUE(UPG_SCALE)) {
|
||||||
case 0:
|
case 0:
|
||||||
return GI_SCALE_SILVER;
|
return GI_SCALE_SILVER;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -645,7 +664,7 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
return GI_MAGIC_LARGE;
|
return GI_MAGIC_LARGE;
|
||||||
}
|
}
|
||||||
case PROGRESSIVE_WALLET:
|
case PROGRESSIVE_WALLET:
|
||||||
switch (CUR_UPG_VALUE(4)) {
|
switch (CUR_UPG_VALUE(UPG_WALLET)) {
|
||||||
case 0:
|
case 0:
|
||||||
return GI_WALLET_ADULT;
|
return GI_WALLET_ADULT;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -688,14 +707,14 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
case PIECE_OF_HEART_TREASURE_CHEST_GAME:
|
case PIECE_OF_HEART_TREASURE_CHEST_GAME:
|
||||||
return GI_HEART_PIECE_WIN;
|
return GI_HEART_PIECE_WIN;
|
||||||
case DEKU_STICK_CAPACITY:
|
case DEKU_STICK_CAPACITY:
|
||||||
switch (CUR_UPG_VALUE(6)) {
|
switch (CUR_UPG_VALUE(UPG_STICKS)) {
|
||||||
case 0:
|
case 0:
|
||||||
return GI_STICK_UPGRADE_20;
|
return GI_STICK_UPGRADE_20;
|
||||||
case 1:
|
case 1:
|
||||||
return GI_STICK_UPGRADE_30;
|
return GI_STICK_UPGRADE_30;
|
||||||
}
|
}
|
||||||
case DEKU_NUT_CAPACITY:
|
case DEKU_NUT_CAPACITY:
|
||||||
switch (CUR_UPG_VALUE(7)) {
|
switch (CUR_UPG_VALUE(UPG_NUTS)) {
|
||||||
case 0:
|
case 0:
|
||||||
return GI_NUT_UPGRADE_30;
|
return GI_NUT_UPGRADE_30;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -712,11 +731,33 @@ GetItemID Randomizer::GetItemFromGet(RandomizerGet randoGet) {
|
||||||
case DEKU_STICK_1:
|
case DEKU_STICK_1:
|
||||||
return GI_STICKS_1;
|
return GI_STICKS_1;
|
||||||
default:
|
default:
|
||||||
return GI_NONE;
|
return ogItemId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RandomizerCheck Randomizer::GetCheckFromActor(s16 actorId, GetItemID ogItemId) {
|
||||||
|
if (!gSaveContext.n64ddFlag) {
|
||||||
|
return UNKNOWN_CHECK;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (actorId) {
|
||||||
|
case 316:
|
||||||
|
switch (ogItemId) {
|
||||||
|
case GI_BOTTLE:
|
||||||
|
return KAK_ANJU_AS_CHILD;
|
||||||
|
case GI_POCKET_EGG:
|
||||||
|
return KAK_ANJU_AS_ADULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return UNKNOWN_CHECK;
|
||||||
|
}
|
||||||
|
|
||||||
RandomizerCheck Randomizer::GetCheckFromSceneAndParams(s16 sceneNum, s16 actorParams) {
|
RandomizerCheck Randomizer::GetCheckFromSceneAndParams(s16 sceneNum, s16 actorParams) {
|
||||||
|
if (!gSaveContext.n64ddFlag) {
|
||||||
|
return UNKNOWN_CHECK;
|
||||||
|
}
|
||||||
|
|
||||||
switch(sceneNum) {
|
switch(sceneNum) {
|
||||||
case 40:
|
case 40:
|
||||||
switch(actorParams) {
|
switch(actorParams) {
|
||||||
|
|
|
@ -506,7 +506,8 @@ typedef enum {
|
||||||
class Randomizer {
|
class Randomizer {
|
||||||
private:
|
private:
|
||||||
std::unordered_map<RandomizerCheck, RandomizerGet> itemLocations;
|
std::unordered_map<RandomizerCheck, RandomizerGet> itemLocations;
|
||||||
GetItemID GetItemFromGet(RandomizerGet randoGet);
|
GetItemID GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId);
|
||||||
|
RandomizerCheck GetCheckFromActor(s16 actorId, GetItemID ogItemId);
|
||||||
RandomizerCheck GetCheckFromSceneAndParams(s16 sceneNum, s16 actorParams);
|
RandomizerCheck GetCheckFromSceneAndParams(s16 sceneNum, s16 actorParams);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -514,7 +515,8 @@ class Randomizer {
|
||||||
~Randomizer();
|
~Randomizer();
|
||||||
|
|
||||||
void PopulateItemLocations(std::string spoilerfilename);
|
void PopulateItemLocations(std::string spoilerfilename);
|
||||||
GetItemID GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams);
|
GetItemID GetItemFromActor(s16 actorId, GetItemID ogItemId);
|
||||||
|
GetItemID GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams, GetItemID ogItemId);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1000,6 +1000,10 @@ extern "C" void PopulateItemLocations(const char* spoilerfilename) {
|
||||||
OTRGlobals::Instance->gRandomizer->PopulateItemLocations(spoilerfilename);
|
OTRGlobals::Instance->gRandomizer->PopulateItemLocations(spoilerfilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" GetItemID GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams) {
|
extern "C" GetItemID GetItemFromActor(s16 actorId, GetItemID ogItemId) {
|
||||||
return OTRGlobals::Instance->gRandomizer->GetItemFromSceneAndParams(sceneNum, actorParams);
|
return OTRGlobals::Instance->gRandomizer->GetItemFromActor(actorId, ogItemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" GetItemID GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams, GetItemID ogItemId) {
|
||||||
|
return OTRGlobals::Instance->gRandomizer->GetItemFromSceneAndParams(sceneNum, actorParams, ogItemId);
|
||||||
}
|
}
|
|
@ -75,7 +75,8 @@ void AudioPlayer_Play(const uint8_t* buf, uint32_t len);
|
||||||
void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples);
|
void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples);
|
||||||
int Controller_ShouldRumble(size_t i);
|
int Controller_ShouldRumble(size_t i);
|
||||||
void PopulateItemLocations(const char* spoilerfilename);
|
void PopulateItemLocations(const char* spoilerfilename);
|
||||||
GetItemID GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams);
|
GetItemID GetItemFromActor(s16 actorId, GetItemID ogItemId);
|
||||||
|
GetItemID GetItemFromSceneAndParams(s16 sceneNum, s16 actorParams, GetItemID ogItemId);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -4,7 +4,7 @@ void TitleSetup_InitImpl(GameState* gameState) {
|
||||||
osSyncPrintf("ゼルダ共通データ初期化\n"); // "Zelda common data initalization"
|
osSyncPrintf("ゼルダ共通データ初期化\n"); // "Zelda common data initalization"
|
||||||
SaveContext_Init();
|
SaveContext_Init();
|
||||||
gameState->running = false;
|
gameState->running = false;
|
||||||
SET_NEXT_GAMESTATE(gameState, Title_Init, TitleContext);
|
SET_NEXT_GAMESTATE(gameState, FileChoose_Init, TitleContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TitleSetup_Destroy(GameState* gameState) {
|
void TitleSetup_Destroy(GameState* gameState) {
|
||||||
|
|
|
@ -383,11 +383,8 @@ void EnBox_AppearAnimation(EnBox* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 GetRandomizedItemId(s16 actorParams, s16 sceneNum) {
|
s32 EnBox_GetRandomizedItemId(s16 actorParams, s16 sceneNum) {
|
||||||
s32 itemId = GetItemFromSceneAndParams(sceneNum, actorParams);
|
s32 itemId = GetItemFromSceneAndParams(sceneNum, actorParams, actorParams >> 5 & 0x7F);
|
||||||
if (itemId == GI_NONE) {
|
|
||||||
itemId = actorParams >> 5 & 0x7F;
|
|
||||||
}
|
|
||||||
return 0 - itemId;
|
return 0 - itemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +429,8 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
|
||||||
func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos);
|
func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos);
|
||||||
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
|
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
|
||||||
Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) {
|
||||||
func_8002F554(&this->dyna.actor, globalCtx, GetRandomizedItemId(this->dyna.actor.params, globalCtx->sceneNum));
|
func_8002F554(&this->dyna.actor, globalCtx,
|
||||||
|
EnBox_GetRandomizedItemId(this->dyna.actor.params, globalCtx->sceneNum));
|
||||||
}
|
}
|
||||||
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
|
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
|
||||||
EnBox_SetupAction(this, EnBox_Open);
|
EnBox_SetupAction(this, EnBox_Open);
|
||||||
|
|
|
@ -294,6 +294,11 @@ void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s32 NiwLady_GetRandomizedItemId(EnNiwLady* this, GetItemID ogId) {
|
||||||
|
s32 itemId = GetItemFromActor(this->actor.id, ogId);
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
if (this->unk_262 == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx)) {
|
if (this->unk_262 == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx)) {
|
||||||
Message_CloseTextbox(globalCtx);
|
Message_CloseTextbox(globalCtx);
|
||||||
|
@ -303,8 +308,10 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
this->unk_26E = 0xB;
|
this->unk_26E = 0xB;
|
||||||
if (!(gSaveContext.itemGetInf[0] & 0x1000)) {
|
if (!(gSaveContext.itemGetInf[0] & 0x1000)) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
this->getItemId = GI_BOTTLE;
|
|
||||||
func_8002F434(&this->actor, globalCtx, GI_BOTTLE, 100.0f, 50.0f);
|
this->getItemId = NiwLady_GetRandomizedItemId(this, GI_BOTTLE);
|
||||||
|
|
||||||
|
func_8002F434(&this->actor, globalCtx, NiwLady_GetRandomizedItemId(this, GI_BOTTLE), 100.0f, 50.0f);
|
||||||
this->actionFunc = func_80ABAC00;
|
this->actionFunc = func_80ABAC00;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +445,8 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
||||||
} else {
|
} else {
|
||||||
getItemId = this->getItemId;
|
getItemId = this->getItemId;
|
||||||
if (LINK_IS_ADULT) {
|
if (LINK_IS_ADULT) {
|
||||||
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
getItemId =
|
||||||
|
!(gSaveContext.itemGetInf[2] & 0x1000) ? NiwLady_GetRandomizedItemId(this, GI_POCKET_EGG) : GI_COJIRO;
|
||||||
}
|
}
|
||||||
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,15 +198,24 @@ void FileChoose_UpdateMainMenu(GameState* thisx) {
|
||||||
this->nameEntryBoxPosX = 120;
|
this->nameEntryBoxPosX = 120;
|
||||||
this->nameEntryBoxAlpha = 0;
|
this->nameEntryBoxAlpha = 0;
|
||||||
memcpy(&this->fileNames[this->buttonIndex][0], &emptyName, 8);
|
memcpy(&this->fileNames[this->buttonIndex][0], &emptyName, 8);
|
||||||
} else if (this->n64ddFlags[this->buttonIndex] == this->n64ddFlag) {
|
} else if (this->n64ddFlags[this->buttonIndex] == 0 && CVar_GetS32("gRandomizer", 0) == 0) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||||
this->actionTimer = 8;
|
this->actionTimer = 8;
|
||||||
this->selectMode = SM_FADE_MAIN_TO_SELECT;
|
this->selectMode = SM_FADE_MAIN_TO_SELECT;
|
||||||
this->selectedFileIndex = this->buttonIndex;
|
this->selectedFileIndex = this->buttonIndex;
|
||||||
this->menuMode = FS_MENU_MODE_SELECT;
|
this->menuMode = FS_MENU_MODE_SELECT;
|
||||||
this->nextTitleLabel = FS_TITLE_OPEN_FILE;
|
this->nextTitleLabel = FS_TITLE_OPEN_FILE;
|
||||||
} else if (!this->n64ddFlags[this->buttonIndex]) {
|
} else if (this->n64ddFlags[this->buttonIndex] == 0 && CVar_GetS32("gRandomizer", 0) != 0) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||||
|
} else if (this->n64ddFlags[this->buttonIndex] != 0 && CVar_GetS32("gRandomizer", 0) == 0) {
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||||
|
} else if (this->n64ddFlags[this->buttonIndex] != 0 && CVar_GetS32("gRandomizer", 0) != 0) {
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||||
|
this->actionTimer = 8;
|
||||||
|
this->selectMode = SM_FADE_MAIN_TO_SELECT;
|
||||||
|
this->selectedFileIndex = this->buttonIndex;
|
||||||
|
this->menuMode = FS_MENU_MODE_SELECT;
|
||||||
|
this->nextTitleLabel = FS_TITLE_OPEN_FILE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->warningLabel == FS_WARNING_NONE) {
|
if (this->warningLabel == FS_WARNING_NONE) {
|
||||||
|
@ -990,7 +999,11 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
||||||
// draw file button
|
// draw file button
|
||||||
gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0);
|
gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0);
|
||||||
|
|
||||||
isActive = ((this->n64ddFlag == this->n64ddFlags[i]) || (this->nameBoxAlpha[i] == 0)) ? 0 : 1;
|
isActive =
|
||||||
|
(((this->n64ddFlags[i] == 0 && CVar_GetS32("gRandomizer", 0) == 0) ||
|
||||||
|
(this->n64ddFlags[i] != 0 && CVar_GetS32("gRandomizer", 0) != 0) || (this->nameBoxAlpha[i] == 0)
|
||||||
|
? 0
|
||||||
|
: 1));
|
||||||
|
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1],
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1],
|
||||||
sWindowContentColors[isActive][2], this->fileButtonAlpha[i]);
|
sWindowContentColors[isActive][2], this->fileButtonAlpha[i]);
|
||||||
|
@ -1032,7 +1045,12 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
||||||
|
|
||||||
// draw file info
|
// draw file info
|
||||||
for (fileIndex = 0; fileIndex < 3; fileIndex++) {
|
for (fileIndex = 0; fileIndex < 3; fileIndex++) {
|
||||||
isActive = ((this->n64ddFlag == this->n64ddFlags[fileIndex]) || (this->nameBoxAlpha[fileIndex] == 0)) ? 0 : 1;
|
isActive =
|
||||||
|
(((this->n64ddFlags[fileIndex] == 0 && CVar_GetS32("gRandomizer", 0) == 0) ||
|
||||||
|
(this->n64ddFlags[fileIndex] != 0 && CVar_GetS32("gRandomizer", 0) != 0) ||
|
||||||
|
(this->nameBoxAlpha[fileIndex] == 0)
|
||||||
|
? 0
|
||||||
|
: 1));
|
||||||
FileChoose_DrawFileInfo(&this->state, fileIndex, isActive);
|
FileChoose_DrawFileInfo(&this->state, fileIndex, isActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1598,8 +1616,6 @@ void FileChoose_Main(GameState* thisx) {
|
||||||
|
|
||||||
OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2898);
|
OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2898);
|
||||||
|
|
||||||
this->n64ddFlag = 0;
|
|
||||||
|
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
|
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment);
|
gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x02, this->parameterSegment);
|
gSPSegment(POLY_OPA_DISP++, 0x02, this->parameterSegment);
|
||||||
|
@ -1852,8 +1868,10 @@ void FileChoose_InitContext(GameState* thisx) {
|
||||||
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
|
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
|
||||||
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||||
|
|
||||||
|
/*
|
||||||
this->n64ddFlags[0] = this->n64ddFlags[1] = this->n64ddFlags[2] = this->defense[0] = this->defense[1] =
|
this->n64ddFlags[0] = this->n64ddFlags[1] = this->n64ddFlags[2] = this->defense[0] = this->defense[1] =
|
||||||
this->defense[2] = 0;
|
this->defense[2] = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ);
|
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ);
|
||||||
|
|
||||||
|
|
|
@ -436,12 +436,21 @@ void FileChoose_DrawNameEntry(GameState* thisx) {
|
||||||
if (validName) {
|
if (validName) {
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
||||||
&D_801333E8);
|
&D_801333E8);
|
||||||
|
|
||||||
gSaveContext.fileNum = this->buttonIndex;
|
gSaveContext.fileNum = this->buttonIndex;
|
||||||
|
|
||||||
|
this->n64ddFlags[this->buttonIndex] = CVar_GetS32("gRandomizer", 0) != 0;
|
||||||
|
gSaveContext.n64ddFlag = CVar_GetS32("gRandomizer", 0) != 0;
|
||||||
|
|
||||||
dayTime = ((void)0, gSaveContext.dayTime);
|
dayTime = ((void)0, gSaveContext.dayTime);
|
||||||
Sram_InitSave(this, &this->sramCtx);
|
Sram_InitSave(this, &this->sramCtx);
|
||||||
|
|
||||||
// todo: load spoilerfile data
|
// todo: load spoilerfile data
|
||||||
|
|
||||||
PopulateItemLocations("blarg");
|
PopulateItemLocations("blarg");
|
||||||
|
|
||||||
// todo: fill link's pocket here
|
// todo: fill link's pocket here
|
||||||
|
|
||||||
gSaveContext.dayTime = dayTime;
|
gSaveContext.dayTime = dayTime;
|
||||||
this->configMode = CM_NAME_ENTRY_TO_MAIN;
|
this->configMode = CM_NAME_ENTRY_TO_MAIN;
|
||||||
this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200;
|
this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue