Don't apply lighting changes on housing skybox replacements (fixes windows)
This commit is contained in:
parent
4f25d3f0d4
commit
57258598c0
@ -70,7 +70,7 @@ public sealed unsafe class Plugin : IDalamudPlugin
|
||||
Service.Plugin = null!;
|
||||
}
|
||||
|
||||
private void Replace(EnvState* env)
|
||||
private void Replace(EnvState* env, bool housing)
|
||||
{
|
||||
var config = Service.Config;
|
||||
if (!config.IsEnabled)
|
||||
@ -85,22 +85,25 @@ public sealed unsafe class Plugin : IDalamudPlugin
|
||||
}
|
||||
|
||||
var savedEnvVal = savedEnv.Value;
|
||||
Replace(env, &savedEnvVal);
|
||||
Replace(env, &savedEnvVal, housing);
|
||||
}
|
||||
|
||||
private void Replace(EnvState* to, EnvState* from)
|
||||
private void Replace(EnvState* to, EnvState* from, bool housing)
|
||||
{
|
||||
to->SkyId = from->SkyId;
|
||||
|
||||
to->Lighting.SunLightColor = from->Lighting.SunLightColor;
|
||||
to->Lighting.MoonLightColor = from->Lighting.MoonLightColor;
|
||||
to->Lighting.Ambient = from->Lighting.Ambient;
|
||||
to->Lighting._unk1 = from->Lighting._unk1;
|
||||
to->Lighting.AmbientSaturation = from->Lighting.AmbientSaturation;
|
||||
to->Lighting.Temperature = from->Lighting.Temperature;
|
||||
to->Lighting._unk2 = from->Lighting._unk2;
|
||||
to->Lighting._unk3 = from->Lighting._unk3;
|
||||
to->Lighting._unk4 = from->Lighting._unk4;
|
||||
if (!housing)
|
||||
{
|
||||
to->Lighting.SunLightColor = from->Lighting.SunLightColor;
|
||||
to->Lighting.MoonLightColor = from->Lighting.MoonLightColor;
|
||||
to->Lighting.Ambient = from->Lighting.Ambient;
|
||||
to->Lighting._unk1 = from->Lighting._unk1;
|
||||
to->Lighting.AmbientSaturation = from->Lighting.AmbientSaturation;
|
||||
to->Lighting.Temperature = from->Lighting.Temperature;
|
||||
to->Lighting._unk2 = from->Lighting._unk2;
|
||||
to->Lighting._unk3 = from->Lighting._unk3;
|
||||
to->Lighting._unk4 = from->Lighting._unk4;
|
||||
}
|
||||
|
||||
to->Stars.ConstellationIntensity = from->Stars.ConstellationIntensity;
|
||||
to->Stars.Constellations = from->Stars.Constellations;
|
||||
@ -163,6 +166,7 @@ public sealed unsafe class Plugin : IDalamudPlugin
|
||||
var exec = _envStateCopyHook.Original(dest, src);
|
||||
|
||||
var replace = Preview != null;
|
||||
var housing = false;
|
||||
|
||||
if (!Service.ClientState.IsLoggedIn)
|
||||
{
|
||||
@ -170,7 +174,7 @@ public sealed unsafe class Plugin : IDalamudPlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
replace |=
|
||||
housing |=
|
||||
dest->SkyId == 0 &&
|
||||
dest->Clouds.Gradient == 0.5f &&
|
||||
dest->Lighting._unk1 == 0.5f &&
|
||||
@ -183,11 +187,13 @@ public sealed unsafe class Plugin : IDalamudPlugin
|
||||
dest->Fog._unk2 == 1.0f &&
|
||||
dest->Fog.Opacity == 0.0f &&
|
||||
dest->Fog.SkyVisibility == 1.0f;
|
||||
|
||||
replace |= housing;
|
||||
}
|
||||
|
||||
if (replace)
|
||||
{
|
||||
Replace(dest);
|
||||
Replace(dest, housing);
|
||||
}
|
||||
|
||||
return exec;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors>0x0ade</Authors>
|
||||
<Company></Company>
|
||||
<Version>0.1.0.9</Version>
|
||||
<Version>0.1.0.10</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl></PackageProjectUrl>
|
||||
|
Loading…
Reference in New Issue
Block a user