From e6e13d4a49a6db0e95a1a7b8e50bf15aa897a9c0 Mon Sep 17 00:00:00 2001 From: Felscream Date: Thu, 5 Sep 2024 13:34:05 +0200 Subject: [PATCH] Added a window to explain how things work --- DragoonMayCry/UI/ConfigWindow.cs | 9 +++- DragoonMayCry/UI/HowItWorksWindows.cs | 61 +++++++++++++++++++++++++++ DragoonMayCry/UI/PluginUI.cs | 15 ++++++- 3 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 DragoonMayCry/UI/HowItWorksWindows.cs diff --git a/DragoonMayCry/UI/ConfigWindow.cs b/DragoonMayCry/UI/ConfigWindow.cs index a38e975..f7545f1 100644 --- a/DragoonMayCry/UI/ConfigWindow.cs +++ b/DragoonMayCry/UI/ConfigWindow.cs @@ -11,23 +11,30 @@ public class ConfigWindow : Window, IDisposable { public EventHandler ActiveOutsideInstanceChange; private readonly DmcConfiguration configuration; + private readonly PluginUI pluginUI; // We give this window a constant ID using ### // This allows for labels being dynamic, like "{FPS Counter}fps###XYZ counter window", // and the window ID will always be "###XYZ counter window" for ImGui - public ConfigWindow(DmcConfiguration configuration) : base("Dragoon May Cry###DmC") + public ConfigWindow(PluginUI pluginUi, DmcConfiguration configuration) : base("DragoonMayCry - Configuration") { Size = new Vector2(400,250); SizeCondition = ImGuiCond.FirstUseEver; this.configuration = configuration; + this.pluginUI = pluginUi; } public void Dispose() { } public override void Draw() { + if (ImGui.Button("How it works")) + { + pluginUI.ToggleHowItWorks(); + } + var lockScoreWindow = configuration.StyleRankUiConfiguration.LockScoreWindow; if (ImGui.Checkbox("Lock rank window", ref lockScoreWindow)) { diff --git a/DragoonMayCry/UI/HowItWorksWindows.cs b/DragoonMayCry/UI/HowItWorksWindows.cs new file mode 100644 index 0000000..5717915 --- /dev/null +++ b/DragoonMayCry/UI/HowItWorksWindows.cs @@ -0,0 +1,61 @@ +using Dalamud.Interface.Windowing; +using ImGuiNET; +using System; +using System.Numerics; + +namespace DragoonMayCry.UI +{ + public class HowItWorksWindow : Window, IDisposable + { + private readonly Vector4 goldColor = new Vector4(229, 48, 0, 255); + public HowItWorksWindow(): base("DragoonMayCry - How it works") + { + this.Size = new Vector2(800,400); + this.SizeCondition = ImGuiCond.Appearing; + } + + public override void Draw() + { + ImGui.AlignTextToFramePadding(); + ImGui.PushTextWrapPos(760); + ImGui.Indent(); + ImGui.Text("\nDragoonMayCry tries to add flavour to the game's combat by ranking you using a Devil May Cry like 'style' system."); + ImGui.Text("Classes and PvP are not supported."); + + ImGui.TextColored(goldColor, "\nRanking up"); + ImGui.Text("- You fill your style gauge by dealing damage. The value is read from the flying text."); + ImGui.Text("- DoTs are not currently tracked. Auto-attacks and DoT's that deal no damage on application will not be added to your score."); + ImGui.Text("- The expected damage output is based on your role and iLvL at the start of the encounter. It is calculated using an exponential regression on the nDPS 80th percentile from FFLogs on Dawntrail and Endwalker content, and some legacy ultimates pulls in 7.05."); + ImGui.Text("- Limit breaks are cool."); + + ImGui.TextColored(goldColor, "\nDemotions"); + ImGui.Text("- You lose points over time. The higher your rank, the more points you lose."); + ImGui.Text("- You will be demoted if your style gauge in under a threshold for more than 5 seconds."); + ImGui.Text("- You won't get demoted if you can't act due to fights mechanics (ex : out of the action, fetters) and the demotion timer didn't already start."); + + ImGui.TextColored(goldColor, "\nBlunders"); + ImGui.Text("Blunders affect your rank significantly."); + ImGui.Text("- Clipping your GCD will substract points from your current gauge, and heavily reduce points gained for the next 8 seconds."); + ImGui.Text("- Holding your GCD, if you are not incapacited, will move you to the previous tier. But if you were in tier S or above, you will return to B tier."); + ImGui.Text("- Receiving a damage down or any other debuffs applied after a failed mechanic resolution will move you to D*. This only applies if you had no other 'blunder' debuffs before."); + ImGui.Text("- Dying is bad."); + + ImGui.TextColored(goldColor, "\nFinal rank"); + ImGui.Text("- A final rank between D and S is attributed at the end of combat by selecting the tier in which you spent the most time in."); + ImGui.Text("- Getting demoted to a rank lower than A will substract time spent in S tier."); + + ImGui.Text("\nI'd appreciate any feedback or bug report to improve the experience. You can find me on the XIVLauncher & Dalamud discord server."); + + ImGui.TextColored(new Vector4(.75f, .75f, .75f, 1), "\nTo healers"); + ImGui.TextColored(new Vector4(.75f, .75f, .75f, 1), "Listen people, I don't play the role so I have no idea how the experience is using this plugin as a healer. If you've got some ideas to improve it, send them to me :)"); + + ImGui.TextColored(new Vector4(.75f, .75f, .75f, 1), "\n * Not all debuffs across all content have been identified, and some demotions may be applied wrongfully. Don't hesitate to send feedback if you find a debuff that should be removed or added."); + + } + + public void Dispose() + { + + } + } +} diff --git a/DragoonMayCry/UI/PluginUI.cs b/DragoonMayCry/UI/PluginUI.cs index 5d54802..916b0eb 100644 --- a/DragoonMayCry/UI/PluginUI.cs +++ b/DragoonMayCry/UI/PluginUI.cs @@ -3,6 +3,7 @@ using DragoonMayCry.Score; using DragoonMayCry.Score.Style; using DragoonMayCry.State; +using Lumina.Excel.GeneratedSheets; using System; using System.Diagnostics; @@ -12,6 +13,7 @@ public sealed class PluginUI : IDisposable { private readonly WindowSystem windowSystem = new("DragoonMayCry"); private ConfigWindow ConfigWindow { get; init; } + private HowItWorksWindow HowItWorksWindow { get; init; } private readonly StyleRankUI styleRankUi; private readonly IDalamudPluginInterface pluginInterface; @@ -21,16 +23,19 @@ public sealed class PluginUI : IDisposable public PluginUI(ScoreProgressBar scoreProgressBar, StyleRankHandler styleRankHandler, ScoreManager scoreManager, FinalRankCalculator finalRankCalculator, EventHandler OnActiveOutsideInstanceChange) { - ConfigWindow = new ConfigWindow(Plugin.Configuration!); + ConfigWindow = new ConfigWindow(this, Plugin.Configuration!); ConfigWindow.ActiveOutsideInstanceChange += OnActiveOutsideInstanceChange; + HowItWorksWindow = new HowItWorksWindow(); + styleRankUi = new StyleRankUI(scoreProgressBar, styleRankHandler, scoreManager, finalRankCalculator); windowSystem.AddWindow(ConfigWindow); + windowSystem.AddWindow(HowItWorksWindow); pluginInterface = Plugin.PluginInterface; pluginInterface.UiBuilder.Draw += DrawUI; - pluginInterface.UiBuilder.OpenMainUi += ToggleConfigUI; + pluginInterface.UiBuilder.OpenMainUi += ToggleHowItWorks; pluginInterface.UiBuilder.OpenConfigUi += ToggleConfigUI; this.playerState = PlayerState.GetInstance(); @@ -49,6 +54,7 @@ public void Dispose() windowSystem.RemoveAllWindows(); ConfigWindow.Dispose(); + HowItWorksWindow.Dispose(); } private void DrawUI() @@ -93,5 +99,10 @@ public void ToggleConfigUI() { ConfigWindow.Toggle(); } + + public void ToggleHowItWorks() + { + HowItWorksWindow.Toggle(); + } } }