From 520fc58e957f9f05d622cc9953ab877445730eed Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Thu, 5 Oct 2023 16:00:53 +0200 Subject: [PATCH] Improve Messaging. --- Glamourer/Automation/AutoDesignManager.cs | 23 +++++++++++-------- Glamourer/Automation/FixedDesignMigrator.cs | 11 +++++---- Glamourer/Configuration.cs | 4 ++-- Glamourer/Designs/Design.cs | 5 ++-- Glamourer/Designs/DesignBase.cs | 15 ++++++------ Glamourer/Designs/DesignFileSystem.cs | 5 ++-- Glamourer/Glamourer.cs | 6 ++--- Glamourer/Gui/MainWindow.cs | 13 ++++++++--- Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs | 9 ++++---- .../Gui/Tabs/DesignTab/DesignDetailTab.cs | 6 ++--- .../DesignTab/DesignFileSystemSelector.cs | 5 ++-- Glamourer/Gui/Tabs/DesignTab/DesignPanel.cs | 9 ++++---- .../Gui/Tabs/DesignTab/ModAssociationsTab.cs | 3 ++- Glamourer/Gui/Tabs/MessageTab.cs | 22 ++++++++++++++++++ Glamourer/Interop/DatFileService.cs | 7 +++--- Glamourer/Interop/Penumbra/PenumbraService.cs | 4 ++-- Glamourer/Services/ServiceManager.cs | 3 ++- Glamourer/State/FunModule.cs | 3 ++- Glamourer/Unlocks/UnlockDictionaryHelpers.cs | 12 +++++----- OtterGui | 2 +- 20 files changed, 100 insertions(+), 67 deletions(-) create mode 100644 Glamourer/Gui/Tabs/MessageTab.cs diff --git a/Glamourer/Automation/AutoDesignManager.cs b/Glamourer/Automation/AutoDesignManager.cs index ff1988c..14fb084 100644 --- a/Glamourer/Automation/AutoDesignManager.cs +++ b/Glamourer/Automation/AutoDesignManager.cs @@ -14,6 +14,7 @@ using Glamourer.Structs; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OtterGui; +using OtterGui.Classes; using OtterGui.Filesystem; using Penumbra.GameData.Actors; @@ -359,7 +360,7 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos { case < 1: case > CurrentVersion: - Glamourer.Chat.NotificationMessage("Failure to load automated designs: No valid version available.", "Error", + Glamourer.Messager.NotificationMessage("Failure to load automated designs: No valid version available.", NotificationType.Error); break; case 1: @@ -369,8 +370,8 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, "Failure to load automated designs: Error during parsing.", - "Failure to load automated designs", "Error", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, "Failure to load automated designs: Error during parsing.", + "Failure to load automated designs", NotificationType.Error); } } @@ -384,14 +385,14 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos var name = obj["Name"]?.ToObject() ?? string.Empty; if (name.Length == 0) { - Glamourer.Chat.NotificationMessage("Skipped loading Automation Set: No name provided.", "Warning", NotificationType.Warning); + Glamourer.Messager.NotificationMessage("Skipped loading Automation Set: No name provided.", NotificationType.Warning); continue; } var id = _actors.AwaitedService.FromJson(obj["Identifier"] as JObject); if (!IdentifierValid(id, out var group)) { - Glamourer.Chat.NotificationMessage("Skipped loading Automation Set: Invalid Identifier.", "Warning", NotificationType.Warning); + Glamourer.Messager.NotificationMessage("Skipped loading Automation Set: Invalid Identifier.", NotificationType.Warning); continue; } @@ -419,7 +420,8 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos { if (designObj is not JObject j) { - Glamourer.Chat.NotificationMessage($"Skipped loading design in Automation Set for {id.Incognito(null)}: Unknown design."); + Glamourer.Messager.NotificationMessage( + $"Skipped loading design in Automation Set for {id.Incognito(null)}: Unknown design."); continue; } @@ -439,13 +441,13 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos { if (designIdentifier.Length == 0) { - Glamourer.Chat.NotificationMessage("Error parsing automatically applied design: No design specified."); + Glamourer.Messager.NotificationMessage("Error parsing automatically applied design: No design specified."); return null; } if (!Guid.TryParse(designIdentifier, out var guid)) { - Glamourer.Chat.NotificationMessage($"Error parsing automatically applied design: {designIdentifier} is not a valid GUID."); + Glamourer.Messager.NotificationMessage($"Error parsing automatically applied design: {designIdentifier} is not a valid GUID."); return null; } @@ -453,7 +455,8 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos design = _designs.Designs.FirstOrDefault(d => d.Identifier == guid); if (design == null) { - Glamourer.Chat.NotificationMessage($"Error parsing automatically applied design: The specified design {guid} does not exist."); + Glamourer.Messager.NotificationMessage( + $"Error parsing automatically applied design: The specified design {guid} does not exist."); return null; } } @@ -475,7 +478,7 @@ public class AutoDesignManager : ISavable, IReadOnlyList, IDispos { if (!_jobs.JobGroups.TryGetValue((ushort)jobs, out var jobGroup)) { - Glamourer.Chat.NotificationMessage($"Error parsing automatically applied design: The job condition {jobs} does not exist."); + Glamourer.Messager.NotificationMessage($"Error parsing automatically applied design: The job condition {jobs} does not exist."); return null; } diff --git a/Glamourer/Automation/FixedDesignMigrator.cs b/Glamourer/Automation/FixedDesignMigrator.cs index 088a098..0dc20b4 100644 --- a/Glamourer/Automation/FixedDesignMigrator.cs +++ b/Glamourer/Automation/FixedDesignMigrator.cs @@ -6,6 +6,7 @@ using Glamourer.Interop; using Glamourer.Services; using Glamourer.Structs; using Newtonsoft.Json.Linq; +using OtterGui.Classes; using Penumbra.GameData.Actors; using Penumbra.String; @@ -45,7 +46,7 @@ public class FixedDesignMigrator id = actors.AwaitedService.CreatePlayer(byteString, actors.AwaitedService.Data.Worlds.First().Key); if (!id.IsValid) { - Glamourer.Chat.NotificationMessage($"Could not migrate fixed design {data.Name}.", "Error", NotificationType.Error); + Glamourer.Messager.NotificationMessage($"Could not migrate fixed design {data.Name}.", NotificationType.Error); allEnabled = false; continue; } @@ -58,7 +59,7 @@ public class FixedDesignMigrator { if (!designFileSystem.Find(design.Item1, out var child) || child is not DesignFileSystem.Leaf leaf) { - Glamourer.Chat.NotificationMessage($"Could not find design with path {design.Item1}, skipped fixed design.", "Warning", + Glamourer.Messager.NotificationMessage($"Could not find design with path {design.Item1}, skipped fixed design.", NotificationType.Warning); continue; } @@ -81,7 +82,7 @@ public class FixedDesignMigrator var name = obj["Name"]?.ToObject() ?? string.Empty; if (name.Length == 0) { - Glamourer.Chat.NotificationMessage("Could not semi-migrate fixed design: No character name available.", "Warning", + Glamourer.Messager.NotificationMessage("Could not semi-migrate fixed design: No character name available.", NotificationType.Warning); continue; } @@ -89,7 +90,7 @@ public class FixedDesignMigrator var path = obj["Path"]?.ToObject() ?? string.Empty; if (path.Length == 0) { - Glamourer.Chat.NotificationMessage("Could not semi-migrate fixed design: No design path available.", "Warning", + Glamourer.Messager.NotificationMessage("Could not semi-migrate fixed design: No design path available.", NotificationType.Warning); continue; } @@ -97,7 +98,7 @@ public class FixedDesignMigrator var job = obj["JobGroups"]?.ToObject() ?? -1; if (job < 0 || !_jobs.JobGroups.TryGetValue((ushort)job, out var group)) { - Glamourer.Chat.NotificationMessage("Could not semi-migrate fixed design: Invalid job group specified.", "Warning", + Glamourer.Messager.NotificationMessage("Could not semi-migrate fixed design: Invalid job group specified.", NotificationType.Warning); continue; } diff --git a/Glamourer/Configuration.cs b/Glamourer/Configuration.cs index 1c1f49d..6aaa11c 100644 --- a/Glamourer/Configuration.cs +++ b/Glamourer/Configuration.cs @@ -93,9 +93,9 @@ public class Configuration : IPluginConfiguration, ISavable } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, + Glamourer.Messager.NotificationMessage(ex, "Error reading Configuration, reverting to default.\nYou may be able to restore your configuration using the rolling backups in the XIVLauncher/backups/Glamourer directory.", - "Error reading Configuration", "Error", NotificationType.Error); + "Error reading Configuration", NotificationType.Error); } migrator.Migrate(this); diff --git a/Glamourer/Designs/Design.cs b/Glamourer/Designs/Design.cs index aa1e5e6..e6593a9 100644 --- a/Glamourer/Designs/Design.cs +++ b/Glamourer/Designs/Design.cs @@ -146,7 +146,7 @@ public sealed class Design : DesignBase, ISavable var enabled = tok["Enabled"]?.ToObject(); if (name == null || directory == null || enabled == null) { - Glamourer.Chat.NotificationMessage("The loaded design contains an invalid mod, skipped.", "Warning", NotificationType.Warning); + Glamourer.Messager.NotificationMessage("The loaded design contains an invalid mod, skipped.", NotificationType.Warning); continue; } @@ -156,8 +156,7 @@ public sealed class Design : DesignBase, ISavable settings.Add(key, value); var priority = tok["Priority"]?.ToObject() ?? 0; if (!design.AssociatedMods.TryAdd(new Mod(name, directory), new ModSettings(settings, priority, enabled.Value))) - Glamourer.Chat.NotificationMessage("The loaded design contains a mod more than once, skipped.", "Warning", - NotificationType.Warning); + Glamourer.Messager.NotificationMessage("The loaded design contains a mod more than once, skipped.", NotificationType.Warning); } } diff --git a/Glamourer/Designs/DesignBase.cs b/Glamourer/Designs/DesignBase.cs index c2d7509..f89c807 100644 --- a/Glamourer/Designs/DesignBase.cs +++ b/Glamourer/Designs/DesignBase.cs @@ -286,7 +286,7 @@ public class DesignBase if (equip == null) { design.DesignData.SetDefaultEquipment(items); - Glamourer.Chat.NotificationMessage("The loaded design does not contain any equipment data, reset to default.", "Warning", + Glamourer.Messager.NotificationMessage("The loaded design does not contain any equipment data, reset to default.", NotificationType.Warning); return; } @@ -310,7 +310,7 @@ public class DesignBase void PrintWarning(string msg) { if (msg.Length > 0 && name != "Temporary Design") - Glamourer.Chat.NotificationMessage($"{msg} ({name})", "Warning", NotificationType.Warning); + Glamourer.Messager.NotificationMessage($"{msg} ({name})", NotificationType.Warning); } foreach (var slot in EquipSlotExtensions.EqdpSlots) @@ -366,7 +366,7 @@ public class DesignBase design.DesignData.ModelId = 0; design.DesignData.IsHuman = true; design.DesignData.Customize = Customize.Default; - Glamourer.Chat.NotificationMessage("The loaded design does not contain any customization data, reset to default.", "Warning", + Glamourer.Messager.NotificationMessage("The loaded design does not contain any customization data, reset to default.", NotificationType.Warning); return; } @@ -374,9 +374,9 @@ public class DesignBase void PrintWarning(string msg) { if (msg.Length > 0) - Glamourer.Chat.NotificationMessage( - $"{msg} ({name})\n\nThis change is not saved automatically. If you want this replacement to stick and the warning to stop appearing, please save the design manually once by changing something in it.", - "Warning", NotificationType.Warning); + Glamourer.Messager.NotificationMessage( + $"{msg} ({name})\nThis change is not saved automatically. If you want this replacement to stick and the warning to stop appearing, please save the design manually once by changing something in it.", + NotificationType.Warning); } var wetness = QuadBool.FromJObject(json["Wetness"], "Value", "Apply", QuadBool.NullFalse); @@ -451,8 +451,7 @@ public class DesignBase } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, "Could not parse Base64 design.", "Could not parse Base64 design", "Failure", - NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, "Could not parse Base64 design.", NotificationType.Error); } } diff --git a/Glamourer/Designs/DesignFileSystem.cs b/Glamourer/Designs/DesignFileSystem.cs index f998fc6..960c460 100644 --- a/Glamourer/Designs/DesignFileSystem.cs +++ b/Glamourer/Designs/DesignFileSystem.cs @@ -10,6 +10,7 @@ using Glamourer.Interop.Penumbra; using Glamourer.Services; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using OtterGui.Classes; using OtterGui.Filesystem; namespace Glamourer.Designs; @@ -111,9 +112,7 @@ public sealed class DesignFileSystem : FileSystem, IDisposable, ISavable } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Could not move design to {path} because the folder could not be created.", - $"Could not move design to {path} because the folder could not be created", "Error", - NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, $"Could not move design to {path} because the folder could not be created.", NotificationType.Error); } CreateDuplicateLeaf(parent, design.Name.Text, design); diff --git a/Glamourer/Glamourer.cs b/Glamourer/Glamourer.cs index c1705c6..31942da 100644 --- a/Glamourer/Glamourer.cs +++ b/Glamourer/Glamourer.cs @@ -20,8 +20,8 @@ public class Glamourer : IDalamudPlugin Assembly.GetExecutingAssembly().GetCustomAttribute()?.InformationalVersion ?? "Unknown"; - public static readonly Logger Log = new(); - public static ChatService Chat { get; private set; } = null!; + public static readonly Logger Log = new(); + public static MessageService Messager { get; private set; } = null!; private readonly ServiceProvider _services; @@ -30,7 +30,7 @@ public class Glamourer : IDalamudPlugin try { _services = ServiceManager.CreateProvider(pluginInterface, Log); - Chat = _services.GetRequiredService(); + Messager = _services.GetRequiredService(); _services.GetRequiredService(); // initialize ui. _services.GetRequiredService(); // initialize commands. _services.GetRequiredService(); diff --git a/Glamourer/Gui/MainWindow.cs b/Glamourer/Gui/MainWindow.cs index 6c823a8..1a68018 100644 --- a/Glamourer/Gui/MainWindow.cs +++ b/Glamourer/Gui/MainWindow.cs @@ -27,6 +27,7 @@ public class MainWindow : Window, IDisposable Designs = 3, Automation = 4, Unlocks = 5, + Messages = 6, } private readonly Configuration _config; @@ -40,11 +41,13 @@ public class MainWindow : Window, IDisposable public readonly DesignTab Designs; public readonly AutomationTab Automation; public readonly UnlocksTab Unlocks; + public readonly MessagesTab Messages; public TabType SelectTab = TabType.None; public MainWindow(DalamudPluginInterface pi, Configuration config, SettingsTab settings, ActorTab actors, DesignTab designs, - DebugTab debugTab, AutomationTab automation, UnlocksTab unlocks, TabSelected @event, ConvenienceRevertButtons convenienceButtons) + DebugTab debugTab, AutomationTab automation, UnlocksTab unlocks, TabSelected @event, ConvenienceRevertButtons convenienceButtons, + MessagesTab messages) : base(GetLabel()) { pi.UiBuilder.DisableGposeUiHide = true; @@ -61,6 +64,7 @@ public class MainWindow : Window, IDisposable Unlocks = unlocks; _event = @event; _convenienceButtons = convenienceButtons; + Messages = messages; _config = config; _tabs = new ITab[] { @@ -69,6 +73,7 @@ public class MainWindow : Window, IDisposable designs, automation, unlocks, + messages, debugTab, }; _event.Subscribe(OnTabSelected, TabSelected.Priority.MainWindow); @@ -100,6 +105,7 @@ public class MainWindow : Window, IDisposable TabType.Designs => Designs.Label, TabType.Automation => Automation.Label, TabType.Unlocks => Unlocks.Label, + TabType.Messages => Messages.Label, _ => ReadOnlySpan.Empty, }; @@ -111,6 +117,7 @@ public class MainWindow : Window, IDisposable if (label == Settings.Label) return TabType.Settings; if (label == Automation.Label) return TabType.Automation; if (label == Unlocks.Label) return TabType.Unlocks; + if (label == Messages.Label) return TabType.Messages; if (label == Debug.Label) return TabType.Debug; // @formatter:on return TabType.None; @@ -126,10 +133,10 @@ public class MainWindow : Window, IDisposable xPos -= ImGui.GetStyle().ScrollbarSize + ImGui.GetStyle().FramePadding.X; ImGui.SetCursorPos(new Vector2(xPos, 0)); - CustomGui.DrawDiscordButton(Glamourer.Chat, width); + CustomGui.DrawDiscordButton(Glamourer.Messager, width); ImGui.SetCursorPos(new Vector2(xPos, ImGui.GetFrameHeightWithSpacing())); - CustomGui.DrawGuideButton(Glamourer.Chat, width); + CustomGui.DrawGuideButton(Glamourer.Messager, width); ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing())); if (ImGui.Button("Show Changelogs", new Vector2(width, 0))) diff --git a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs index ac9269b..b1fd1f8 100644 --- a/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs +++ b/Glamourer/Gui/Tabs/ActorTab/ActorPanel.cs @@ -17,6 +17,7 @@ using Glamourer.Services; using Glamourer.State; using ImGuiNET; using OtterGui; +using OtterGui.Classes; using OtterGui.Raii; using Penumbra.GameData.Actors; using Penumbra.GameData.Enums; @@ -354,8 +355,8 @@ public class ActorPanel } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Could not apply clipboard to {_identifier}.", - $"Could not apply clipboard to design {_identifier.Incognito(null)}", "Failure", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, $"Could not apply clipboard to {_identifier}.", + $"Could not apply clipboard to design {_identifier.Incognito(null)}", NotificationType.Error, false); } } @@ -369,8 +370,8 @@ public class ActorPanel } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Could not copy {_identifier} data to clipboard.", - $"Could not copy data from design {_identifier.Incognito(null)} to clipboard", "Failure", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, $"Could not copy {_identifier} data to clipboard.", + $"Could not copy data from design {_identifier.Incognito(null)} to clipboard", NotificationType.Error); } } diff --git a/Glamourer/Gui/Tabs/DesignTab/DesignDetailTab.cs b/Glamourer/Gui/Tabs/DesignTab/DesignDetailTab.cs index 42953b1..38fd5f8 100644 --- a/Glamourer/Gui/Tabs/DesignTab/DesignDetailTab.cs +++ b/Glamourer/Gui/Tabs/DesignTab/DesignDetailTab.cs @@ -7,6 +7,7 @@ using Glamourer.Designs; using Glamourer.Services; using ImGuiNET; using OtterGui; +using OtterGui.Classes; using OtterGui.Raii; using OtterGui.Widgets; @@ -88,8 +89,7 @@ public class DesignDetailTab } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Could not open file {fileName}.", $"Could not open file {fileName}", "Failure", - NotificationType.Warning); + Glamourer.Messager.NotificationMessage(ex, $"Could not open file {fileName}.", $"Could not open file {fileName}", NotificationType.Warning); } } @@ -114,7 +114,7 @@ public class DesignDetailTab } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, ex.Message, "Could not rename or move design", "Error", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, ex.Message, "Could not rename or move design", NotificationType.Error); } ImGuiUtil.DrawFrameColumn("Creation Date"); diff --git a/Glamourer/Gui/Tabs/DesignTab/DesignFileSystemSelector.cs b/Glamourer/Gui/Tabs/DesignTab/DesignFileSystemSelector.cs index 8a4188c..114a527 100644 --- a/Glamourer/Gui/Tabs/DesignTab/DesignFileSystemSelector.cs +++ b/Glamourer/Gui/Tabs/DesignTab/DesignFileSystemSelector.cs @@ -141,7 +141,7 @@ public sealed class DesignFileSystemSelector : FileSystemSelector 0) - Glamourer.Chat.NotificationMessage(text, "Failure", NotificationType.Warning); + Glamourer.Messager.NotificationMessage(text, NotificationType.Warning, false); } DrawAssociatedModTooltip(settings); diff --git a/Glamourer/Gui/Tabs/MessageTab.cs b/Glamourer/Gui/Tabs/MessageTab.cs new file mode 100644 index 0000000..69a2a2c --- /dev/null +++ b/Glamourer/Gui/Tabs/MessageTab.cs @@ -0,0 +1,22 @@ +using System; +using OtterGui.Classes; +using OtterGui.Widgets; + +namespace Glamourer.Gui.Tabs; + +public class MessagesTab : ITab +{ + private readonly MessageService _messages; + + public MessagesTab(MessageService messages) + => _messages = messages; + + public ReadOnlySpan Label + => "Messages"u8; + + public bool IsVisible + => _messages.Count > 0; + + public void DrawContent() + => _messages.Draw(); +} diff --git a/Glamourer/Interop/DatFileService.cs b/Glamourer/Interop/DatFileService.cs index 12d8939..0d27bcc 100644 --- a/Glamourer/Interop/DatFileService.cs +++ b/Glamourer/Interop/DatFileService.cs @@ -7,6 +7,7 @@ using Glamourer.Customization; using Glamourer.Services; using Glamourer.Unlocks; using ImGuiNET; +using OtterGui.Classes; namespace Glamourer.Interop; @@ -62,8 +63,7 @@ public class DatFileService } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Could not read character data file {path}.", - $"Could not read character data file {path}", "Failure", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, $"Could not read character data file {path}.", NotificationType.Error); file = default; } @@ -94,8 +94,7 @@ public class DatFileService } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Could not save character data to file {path}.", - $"Could not save character data to file {path}", "Failure", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, $"Could not save character data to file {path}.", "Failure", NotificationType.Error); return false; } } diff --git a/Glamourer/Interop/Penumbra/PenumbraService.cs b/Glamourer/Interop/Penumbra/PenumbraService.cs index 16c1138..4515b7c 100644 --- a/Glamourer/Interop/Penumbra/PenumbraService.cs +++ b/Glamourer/Interop/Penumbra/PenumbraService.cs @@ -8,6 +8,7 @@ using Dalamud.Logging; using Dalamud.Plugin; using Glamourer.Events; using Glamourer.Interop.Structs; +using OtterGui.Classes; using Penumbra.Api; using Penumbra.Api.Enums; using Penumbra.Api.Helpers; @@ -147,8 +148,7 @@ public unsafe class PenumbraService : IDisposable public void OpenModPage(Mod mod) { if (_openModPage.Invoke(TabType.Mods, mod.DirectoryName, mod.Name) == PenumbraApiEc.ModMissing) - Glamourer.Chat.NotificationMessage($"Could not open the mod {mod.Name}, no fitting mod was found in your Penumbra install.", - "Mod Missing", NotificationType.Info); + Glamourer.Messager.NotificationMessage($"Could not open the mod {mod.Name}, no fitting mod was found in your Penumbra install.", NotificationType.Info, false); } public string CurrentCollection diff --git a/Glamourer/Services/ServiceManager.cs b/Glamourer/Services/ServiceManager.cs index 2a1cbc8..1171388 100644 --- a/Glamourer/Services/ServiceManager.cs +++ b/Glamourer/Services/ServiceManager.cs @@ -48,7 +48,7 @@ public static class ServiceManager } private static IServiceCollection AddMeta(this IServiceCollection services) - => services.AddSingleton() + => services.AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton() @@ -115,6 +115,7 @@ public static class ServiceManager private static IServiceCollection AddUi(this IServiceCollection services) => services.AddSingleton() + .AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton() diff --git a/Glamourer/State/FunModule.cs b/Glamourer/State/FunModule.cs index b603def..c92993d 100644 --- a/Glamourer/State/FunModule.cs +++ b/Glamourer/State/FunModule.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using Dalamud.Game.ClientState.Objects.Enums; +using Dalamud.Interface.Internal.Notifications; using Glamourer.Customization; using Glamourer.Designs; using Glamourer.Gui; @@ -247,7 +248,7 @@ public unsafe class FunModule : IDisposable tmp.FixCustomizeApplication(_customizations, CustomizeFlagExtensions.AllRelevant); var data = _designConverter.ShareBase64(tmp); ImGui.SetClipboardText(data); - Glamourer.Chat.NotificationMessage($"Copied current actual design of {actor.Utf8Name} to clipboard."); + Glamourer.Messager.NotificationMessage($"Copied current actual design of {actor.Utf8Name} to clipboard.", NotificationType.Info, false); } catch { diff --git a/Glamourer/Unlocks/UnlockDictionaryHelpers.cs b/Glamourer/Unlocks/UnlockDictionaryHelpers.cs index e9a31bf..a1523d0 100644 --- a/Glamourer/Unlocks/UnlockDictionaryHelpers.cs +++ b/Glamourer/Unlocks/UnlockDictionaryHelpers.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using Dalamud.Interface.Internal.Notifications; +using OtterGui.Classes; namespace Glamourer.Unlocks; @@ -47,8 +48,7 @@ public static class UnlockDictionaryHelpers revertEndian = true; break; default: - Glamourer.Chat.NotificationMessage($"Loading unlocked {type}s failed: Invalid magic number.", "Warning", - NotificationType.Warning); + Glamourer.Messager.NotificationMessage($"Loading unlocked {type}s failed: Invalid magic number.", NotificationType.Warning); return -1; } @@ -80,12 +80,12 @@ public static class UnlockDictionaryHelpers } if (skips > 0) - Glamourer.Chat.NotificationMessage($"Skipped {skips} unlocked {type}s while loading unlocked {type}s.", "Warning", + Glamourer.Messager.NotificationMessage($"Skipped {skips} unlocked {type}s while loading unlocked {type}s.", NotificationType.Warning); break; default: - Glamourer.Chat.NotificationMessage($"Loading unlocked {type}s failed: Version {version} is unknown.", "Warning", + Glamourer.Messager.NotificationMessage($"Loading unlocked {type}s failed: Version {version} is unknown.", NotificationType.Warning); return version; } @@ -95,8 +95,8 @@ public static class UnlockDictionaryHelpers } catch (Exception ex) { - Glamourer.Chat.NotificationMessage(ex, $"Loading unlocked {type}s failed: Unknown Error.", $"Loading unlocked {type}s failed:\n", - "Error", NotificationType.Error); + Glamourer.Messager.NotificationMessage(ex, $"Loading unlocked {type}s failed: Unknown Error.", + $"Loading unlocked {type}s failed:\n", NotificationType.Error); return -1; } diff --git a/OtterGui b/OtterGui index df07c4e..96c9055 160000 --- a/OtterGui +++ b/OtterGui @@ -1 +1 @@ -Subproject commit df07c4ed08e8e6c1188867c7863a19e02c8adb53 +Subproject commit 96c9055a1d8a19d9cdb61f41ddfb372871e204ac