diff options
| author | Tina H. (sheepytina) <99330992+sheepytina@users.noreply.github.com> | 2024-02-16 12:47:13 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-15 19:47:13 -0600 |
| commit | eeb6c7faaa16d50ce0d094e191c5778cc2ce904e (patch) | |
| tree | 0eabefcb000da97fb7a92ddd977702466c757a19 /soh/src/code | |
| parent | e68b281b18f5cff7d3bac92d4de797043e207ff5 (diff) | |
Fix Cosmetics Editor getting stuck on weapon trails (#3913)
* Partially fix cosmetics editor getting stuck on sword trails.
* No reason for "reset" to be static.
* bombchu
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_eff_blure.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/soh/src/code/z_eff_blure.c b/soh/src/code/z_eff_blure.c index 91ac43766..e770a9096 100644 --- a/soh/src/code/z_eff_blure.c +++ b/soh/src/code/z_eff_blure.c @@ -203,13 +203,17 @@ s32 EffectBlure_Update(void* thisx) { EffectBlure* this = (EffectBlure*)thisx; s32 i; Color_RGBA8 color; - u8 changed = 0; + static u8 changed = 0; + u8 reset = 0; switch (this->trailType) { //there HAS to be a better way to do this. case 2: if (CVarGetInteger("gCosmetics.Trails_Boomerang.Changed", 0)) { color = CVarGetColor("gCosmetics.Trails_Boomerang.Value", (Color_RGBA8){ 255, 255, 100, 255 }); changed = 1; + } else if (changed) { + color = (Color_RGBA8){ 255, 255, 100, 255 }; + reset = 1; } break; case 3: @@ -227,36 +231,65 @@ s32 EffectBlure_Update(void* thisx) { this->p2StartColor.b = color.b * 0.8f; this->p1EndColor.b = color.b * 0.6f; this->p2EndColor.b = color.b * 0.4f; + } else if (changed) { + color = (Color_RGBA8){ 250, 0, 0, 255 }; + this->p1StartColor.r = color.r; + this->p2StartColor.r = color.r * 0.8f; + this->p1EndColor.r = color.r * 0.6f; + this->p2EndColor.r = color.r * 0.4f; + this->p1StartColor.g = color.g; + this->p2StartColor.g = color.g * 0.8f; + this->p1EndColor.g = color.g * 0.6f; + this->p2EndColor.g = color.g * 0.4f; + this->p1StartColor.b = color.b; + this->p2StartColor.b = color.b * 0.8f; + this->p1EndColor.b = color.b * 0.6f; + this->p2EndColor.b = color.b * 0.4f; } break; case 4: if (CVarGetInteger("gCosmetics.Trails_KokiriSword.Changed", 0)) { color = CVarGetColor("gCosmetics.Trails_KokiriSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; + } else if (changed) { + color = (Color_RGBA8){ 255, 255, 255, 255 }; + reset = 1; } break; case 5: if (CVarGetInteger("gCosmetics.Trails_MasterSword.Changed", 0)) { color = CVarGetColor("gCosmetics.Trails_MasterSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; + } else if (changed) { + color = (Color_RGBA8){ 255, 255, 255, 255 }; + reset = 1; } break; case 6: if (CVarGetInteger("gCosmetics.Trails_BiggoronSword.Changed", 0)) { color = CVarGetColor("gCosmetics.Trails_BiggoronSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; + } else if (changed) { + color = (Color_RGBA8){ 255, 255, 255, 255 }; + reset = 1; } break; case 7: if (CVarGetInteger("gCosmetics.Trails_Stick.Changed", 0)) { color = CVarGetColor("gCosmetics.Trails_Stick.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; + } else if (changed) { + color = (Color_RGBA8){ 255, 255, 255, 255 }; + reset = 1; } break; case 8: if (CVarGetInteger("gCosmetics.Trails_Hammer.Changed", 0)) { color = CVarGetColor("gCosmetics.Trails_Hammer.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; + } else if (changed) { + color = (Color_RGBA8){ 255, 255, 255, 255 }; + reset = 1; } break; default: // don't do anything @@ -278,6 +311,9 @@ s32 EffectBlure_Update(void* thisx) { this->p1EndColor.b = color.b; this->p2EndColor.b = color.b; } + if (reset) { + changed = 0; + } // Don't override boomerang and bombchu trail durations if (this->trailType != 2 && this->trailType != 3) { |
