type cleanup
This commit is contained in:
@@ -52,12 +52,12 @@ public class UpdateNotesUi : WindowMediatorSubscriberBase
|
||||
private float _particleSpawnTimer;
|
||||
private readonly Random _random = new();
|
||||
|
||||
private const float HeaderHeight = 150f;
|
||||
private const float ParticleSpawnInterval = 0.2f;
|
||||
private const int MaxParticles = 50;
|
||||
private const int MaxTrailLength = 50;
|
||||
private const float EdgeFadeDistance = 30f;
|
||||
private const float ExtendedParticleHeight = 40f;
|
||||
private const float _headerHeight = 150f;
|
||||
private const float _particleSpawnInterval = 0.2f;
|
||||
private const int _maxParticles = 50;
|
||||
private const int _maxTrailLength = 50;
|
||||
private const float _edgeFadeDistance = 30f;
|
||||
private const float _extendedParticleHeight = 40f;
|
||||
|
||||
public UpdateNotesUi(ILogger<UpdateNotesUi> logger,
|
||||
LightlessMediator mediator,
|
||||
@@ -111,16 +111,16 @@ public class UpdateNotesUi : WindowMediatorSubscriberBase
|
||||
var headerWidth = (800f * ImGuiHelpers.GlobalScale) - (windowPadding.X * 2);
|
||||
|
||||
var headerStart = windowPos + new Vector2(windowPadding.X, windowPadding.Y);
|
||||
var headerEnd = headerStart + new Vector2(headerWidth, HeaderHeight);
|
||||
var headerEnd = headerStart + new Vector2(headerWidth, _headerHeight);
|
||||
|
||||
var extendedParticleSize = new Vector2(headerWidth, HeaderHeight + ExtendedParticleHeight);
|
||||
var extendedParticleSize = new Vector2(headerWidth, _headerHeight + _extendedParticleHeight);
|
||||
|
||||
DrawGradientBackground(headerStart, headerEnd);
|
||||
DrawHeaderText(headerStart);
|
||||
DrawHeaderButtons(headerStart, headerWidth);
|
||||
DrawBottomGradient(headerStart, headerEnd, headerWidth);
|
||||
|
||||
ImGui.SetCursorPosY(windowPadding.Y + HeaderHeight + 5);
|
||||
ImGui.SetCursorPosY(windowPadding.Y + _headerHeight + 5);
|
||||
ImGui.SetCursorPosX(20);
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
@@ -260,7 +260,7 @@ public class UpdateNotesUi : WindowMediatorSubscriberBase
|
||||
var deltaTime = ImGui.GetIO().DeltaTime;
|
||||
_particleSpawnTimer += deltaTime;
|
||||
|
||||
if (_particleSpawnTimer > ParticleSpawnInterval && _particles.Count < MaxParticles)
|
||||
if (_particleSpawnTimer > _particleSpawnInterval && _particles.Count < _maxParticles)
|
||||
{
|
||||
SpawnParticle(bannerSize);
|
||||
_particleSpawnTimer = 0f;
|
||||
@@ -282,7 +282,7 @@ public class UpdateNotesUi : WindowMediatorSubscriberBase
|
||||
if (particle.Type == ParticleType.ShootingStar && particle.Trail != null)
|
||||
{
|
||||
particle.Trail.Insert(0, particle.Position);
|
||||
if (particle.Trail.Count > MaxTrailLength)
|
||||
if (particle.Trail.Count > _maxTrailLength)
|
||||
particle.Trail.RemoveAt(particle.Trail.Count - 1);
|
||||
}
|
||||
|
||||
@@ -316,12 +316,12 @@ public class UpdateNotesUi : WindowMediatorSubscriberBase
|
||||
var lifeFade = Math.Min(fadeIn, fadeOut);
|
||||
|
||||
var edgeFadeX = Math.Min(
|
||||
Math.Min(1f, (particle.Position.X + EdgeFadeDistance) / EdgeFadeDistance),
|
||||
Math.Min(1f, (bannerSize.X - particle.Position.X + EdgeFadeDistance) / EdgeFadeDistance)
|
||||
Math.Min(1f, (particle.Position.X + _edgeFadeDistance) / _edgeFadeDistance),
|
||||
Math.Min(1f, (bannerSize.X - particle.Position.X + _edgeFadeDistance) / _edgeFadeDistance)
|
||||
);
|
||||
var edgeFadeY = Math.Min(
|
||||
Math.Min(1f, (particle.Position.Y + EdgeFadeDistance) / EdgeFadeDistance),
|
||||
Math.Min(1f, (bannerSize.Y - particle.Position.Y + EdgeFadeDistance) / EdgeFadeDistance)
|
||||
Math.Min(1f, (particle.Position.Y + _edgeFadeDistance) / _edgeFadeDistance),
|
||||
Math.Min(1f, (bannerSize.Y - particle.Position.Y + _edgeFadeDistance) / _edgeFadeDistance)
|
||||
);
|
||||
var edgeFade = Math.Min(edgeFadeX, edgeFadeY);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user