af8a4af...8a2a718
commit 8a2a718a0544d5c1707f10b75498e528a7912726 Author: Joonas Rikkonen <poe.regalis@gmail.com> Date: Tue Mar 19 16:47:49 2019 +0200 Only update affliction icons every 0.5 seconds (or when switching limb selection in the health interface). Otherwise afflictions can flicker rapidly when the player for example has status effects that cause an affliction's strength to fluctuate around the ShowIconThreshold. Also set the default ShowIconThreshold value to 0.05. Closes #1304
This commit is contained in:
@@ -18,14 +18,13 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Animation\Ragdoll.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Attack.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Character.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\CharacterHealth.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Health\CharacterHealth.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\CharacterHUD.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\CharacterInfo.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\CharacterNetworking.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\CharacterSound.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Health\AfflictionHusk.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Health\AfflictionPsychosis.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Health\CharacterHealth.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Health\DamageModifier.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\HUDProgressBar.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Characters\Jobs\JobPrefab.cs" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -151,7 +151,7 @@ namespace Barotrauma
|
||||
//how high the strength has to be for the affliction to take affect
|
||||
public readonly float ActivationThreshold = 0.0f;
|
||||
//how high the strength has to be for the affliction icon to be shown in the UI
|
||||
public readonly float ShowIconThreshold = 0.0f;
|
||||
public readonly float ShowIconThreshold = 0.05f;
|
||||
public readonly float MaxStrength = 100.0f;
|
||||
|
||||
public float BurnOverlayAlpha;
|
||||
@@ -254,7 +254,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
ActivationThreshold = element.GetAttributeFloat("activationthreshold", 0.0f);
|
||||
ShowIconThreshold = element.GetAttributeFloat("showiconthreshold", ActivationThreshold);
|
||||
ShowIconThreshold = element.GetAttributeFloat("showiconthreshold", Math.Max(ActivationThreshold, 0.05f));
|
||||
MaxStrength = element.GetAttributeFloat("maxstrength", 100.0f);
|
||||
|
||||
DamageOverlayAlpha = element.GetAttributeFloat("damageoverlayalpha", 0.0f);
|
||||
|
||||
@@ -753,6 +753,15 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Float comparison. Note that may still fail in some cases.
|
||||
/// </summary>
|
||||
public static bool NearlyEqual(Vector2 a, Vector2 b, float epsilon = 0.0001f)
|
||||
{
|
||||
return NearlyEqual(a.X, b.X, epsilon) && NearlyEqual(a.Y, b.Y, epsilon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a position in a curve.
|
||||
/// </summary>
|
||||
public static Vector2 Bezier(Vector2 start, Vector2 control, Vector2 end, float t)
|
||||
|
||||
Reference in New Issue
Block a user