Fixes gerudo fortress checks showing in tracker when settings have them removed

This commit is contained in:
sonoftunk 2022-11-06 12:44:08 -05:00
parent d481181170
commit d83c7722df
3 changed files with 27 additions and 4 deletions

View File

@ -937,7 +937,12 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() {
((locationIt.rcType != RCTYPE_SMALL_KEY) || CVar_GetS32("gRandomizeKeysanity", 0) != 1) && // 1 is the value for "vanilla" small keys
((locationIt.rcType != RCTYPE_GF_KEY) || CVar_GetS32("randoShuffleGerudoFortressKeys", 0) != 0) && // 0 is the value for "vanilla" gf keys
((locationIt.rcType != RCTYPE_BOSS_KEY) || CVar_GetS32("gRandomizeBossKeysanity", 0) != 1) && // 1 is the value for "vanilla" boss keys
((locationIt.rcType != RCTYPE_GANON_BOSS_KEY) || CVar_GetS32("gRandomizeShuffleGanonBossKey", 0) != 0) // 0 is the value for "vanilla" ganon's boss key
((locationIt.rcType != RCTYPE_GANON_BOSS_KEY) || CVar_GetS32("gRandomizeShuffleGanonBossKey", 0) != 0) && // 0 is the value for "vanilla" ganon's boss key
((!RC_IS_CARPENTER(locationIt.rc) && locationIt.rc != RC_GF_GERUDO_MEMBERSHIP_CARD) ||
(CVar_GetS32("gRandomizeGerudoFortress", 0) == 2 && !RC_IS_CARPENTER(locationIt.rc) && locationIt.rc != RC_GF_GERUDO_MEMBERSHIP_CARD) || //2 is the value for "open" gerudo's fortress
(CVar_GetS32("gRandomizeGerudoFortress", 0) == 1 && locationIt.rc == RC_GF_NORTH_F1_CARPENTER) || //1 is the value for "fast" gerudo's fortress
(CVar_GetS32("gRandomizeGerudoFortress", 0) == 0) //0 is the value for "normal" gerudo's fortress
)
);
}
}

View File

@ -72,6 +72,12 @@ typedef enum {
#define RC_OBJECT(rc, rc_v_or_mq, rc_type, rc_area, actor_id, scene_id, actor_params, og_item_id, rc_shortname, rc_spoilername) \
{ rc, {rc, rc_v_or_mq, rc_type, rc_area, actor_id, scene_id, actor_params, og_item_id, false, rc_shortname, rc_spoilername} }
#define RC_IS_CARPENTER(a) \
(a == RC_GF_NORTH_F1_CARPENTER || \
a == RC_GF_NORTH_F2_CARPENTER || \
a == RC_GF_SOUTH_F1_CARPENTER || \
a == RC_GF_SOUTH_F2_CARPENTER)
typedef struct {
RandomizerCheck rc;
RandomizerCheckVanillaOrMQ vOrMQ;

View File

@ -729,7 +729,10 @@ void DrawLocations() {
for (auto& [rcArea, rcObjects] : RandomizerCheckObjects::GetAllRCObjectsByArea()) {
bool hasItems = false;
for (auto& locationIt : rcObjects) {
if (locationIt.second.visibleInImgui && !checkedLocations.count(locationIt.second.rc) &&
if (!locationIt.second.visibleInImgui)
continue;
if (!checkedLocations.count(locationIt.second.rc) &&
locationSearch.PassFilter(locationIt.second.rcSpoilerName.c_str())) {
hasItems = true;
@ -748,6 +751,9 @@ void DrawLocations() {
doAreaScroll = false;
}
for (auto& locationIt : rcObjects) {
if (!locationIt.second.visibleInImgui)
continue;
// If the location has its scene flag set
if (inGame && HasItemBeenCollected(locationIt.second)) { // && checkedLocations.find(locationIt.rc) != checkedLocations.end()) {
// show it as checked
@ -807,10 +813,13 @@ void DrawLocations() {
for (auto& [rcArea, rcObjects] : RandomizerCheckObjects::GetAllRCObjectsByArea()) {
bool hasItems = false;
for (auto& locationIt : rcObjects) {
if (locationIt.second.visibleInImgui && checkedLocations.count(locationIt.second.rc)) {
if (!locationIt.second.visibleInImgui)
continue;
if (checkedLocations.count(locationIt.second.rc)) {
hasItems = true;
doAreaScroll =
(currentArea != RCAREA_INVALID && sceneId != SCENE_KAKUSIANA && // Don't move for grottos
(currentArea != RCAREA_INVALID && sceneId != SCENE_KAKUSIANA && // Don't move for kakusiana/grottos
currentArea != lastArea && currentArea == rcArea);
break;
}
@ -824,6 +833,9 @@ void DrawLocations() {
doAreaScroll = false;
}
for (auto& locationIt : rcObjects) {
if (!locationIt.second.visibleInImgui)
continue;
auto elfound = checkedLocations.find(locationIt.second.rc);
if (locationIt.second.visibleInImgui && elfound != checkedLocations.end()) {
// If the location has its scene flag set