TWEAK: Kokiri Draw distance V2 (#486)

* ADD: Saria's logic

* TWEAK: Kokiri Draw Distance change doesn't need a reload anymore

* ADD: Mido's logic
This commit is contained in:
PurpleHato 2022-06-20 19:50:32 +02:00 committed by GitHub
parent 950f954c89
commit 5549ad9388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 8 deletions

View File

@ -1047,7 +1047,7 @@ namespace SohImGui {
CVar_SetS32("gDisableKokiriDrawDistance", 0);
} else if (CVar_GetS32("gDisableDrawDistance", 0) == 1) {
EnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance");
Tooltip("Kokiris are mystical being that appear from a certain distance\nEnable this will remove their draw distance\nNeeds to reload the map to take effect");
Tooltip("Kokiris are mystical being that appear from a certain distance\nEnable this will remove their draw distance");
}
ImGui::EndMenu();

View File

@ -1053,7 +1053,7 @@ void func_80A98CD8(EnKo* this) {
this->actor.targetMode = info->targetMode;
this->lookDist = info->lookDist;
this->lookDist += this->collider.dim.radius;
this->appearDist = CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0 ? 32767 : info->appearDist;
this->appearDist = info->appearDist;
}
// Used to fetch actor animation?
@ -1080,7 +1080,15 @@ void func_80A98DB4(EnKo* this, GlobalContext* globalCtx) {
dist = this->actor.xzDistToPlayer;
}
Math_SmoothStepToF(&this->modelAlpha, (this->appearDist < dist) ? 0.0f : 255.0f, 0.3f, 40.0f, 1.0f);
if (CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0) {
this->appearDist = 32767.0f;
Math_SmoothStepToF(&this->modelAlpha, (this->appearDist < dist) ? 0.0f : 255.0f, 0.3f, 40.0f, 1.0f);
f32 test = this->appearDist;
} else {
this->appearDist = 180.0f;
Math_SmoothStepToF(&this->modelAlpha, (this->appearDist < dist) ? 0.0f : 255.0f, 0.3f, 40.0f, 1.0f);
}
if (this->modelAlpha < 10.0f) {
this->actor.flags &= ~ACTOR_FLAG_0;
} else {

View File

@ -613,10 +613,18 @@ void func_80AAB5A4(EnMd* this, GlobalContext* globalCtx) {
f32 temp;
if (globalCtx->sceneNum != SCENE_KOKIRI_HOME4) {
temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
(globalCtx->sceneNum == SCENE_SPOT04))
? 100.0f
: 400.0f;
if (CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0) {
temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
(globalCtx->sceneNum == SCENE_SPOT04))
? 100.0f
: 32767.0f;
} else {
temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
(globalCtx->sceneNum == SCENE_SPOT04))
? 100.0f
: 400.0f;
}
this->alpha = func_80034DD4(&this->actor, globalCtx, this->alpha, temp);
this->actor.shape.shadowAlpha = this->alpha;
} else {

View File

@ -727,7 +727,12 @@ void EnSa_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->actionFunc != func_80AF68E4) {
this->alpha = func_80034DD4(&this->actor, globalCtx, this->alpha, 400.0f);
if (CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0) {
this->alpha = func_80034DD4(&this->actor, globalCtx, this->alpha, 32767);
}
else {
this->alpha = func_80034DD4(&this->actor, globalCtx, this->alpha, 400.0f);
}
} else {
this->alpha = 255;
}