settings animated header

This commit is contained in:
choco
2025-12-23 17:36:36 +01:00
parent 5b81caf5a8
commit 6c1cc77aaa

View File

@@ -69,6 +69,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
private readonly UiSharedService _uiShared;
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
private readonly NameplateService _nameplateService;
private readonly AnimatedHeader _animatedHeader = new();
private (int, int, FileCacheEntity) _currentProgress;
private bool _deleteAccountPopupModalShown = false;
private bool _deleteFilesPopupModalShown = false;
@@ -203,7 +205,10 @@ public class SettingsUi : WindowMediatorSubscriberBase
_nameplateService = nameplateService;
_actorObjectService = actorObjectService;
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
_animatedHeader.Height = 120f;
_animatedHeader.EnableBottomGradient = true;
_animatedHeader.GradientHeight = 250f;
_animatedHeader.EnableParticles = _configService.Current.EnableParticleEffects;
WindowBuilder.For(this)
.AllowPinning(true)
.AllowClickthrough(false)
@@ -239,6 +244,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
public override void OnClose()
{
_animatedHeader.ClearParticles();
_uiShared.EditTrackerPosition = false;
_uidToAddForIgnore = string.Empty;
_secretKeysConversionCts = _secretKeysConversionCts.CancelRecreate();
@@ -253,8 +259,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
protected override void DrawInternal()
{
_animatedHeader.Draw(ImGui.GetContentRegionAvail().X, (_, _) => { });
_ = _uiShared.DrawOtherPluginState();
DrawSettingsContent();
}
private static Vector3 PackedColorToVector3(uint color)
@@ -2151,6 +2157,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
_configService.Save();
}
_uiShared.DrawHelpText("This will enable particle effects in the UI.");
if (ImGui.Checkbox("Enable Game Right Click Menu Entries", ref enableRightClickMenu))
{
_configService.Current.EnableRightClickMenus = enableRightClickMenu;