aboutsummaryrefslogtreecommitdiffstats
path: root/Malmstone/Windows
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-08-27 22:21:18 -0700
committerPinapelz <yukais@pinapelz.com>2024-08-27 22:21:18 -0700
commit72f85fd952c8e53230c968ef9a433644dae90254 (patch)
treea93b73e9d045243cdc4ee467376ef8573f297d2c /Malmstone/Windows
parentb8c43fbe717d794284c6c4578c9c00ae8e26d711 (diff)
Initial Version 1.0.0.0
Diffstat (limited to 'Malmstone/Windows')
-rw-r--r--Malmstone/Windows/ConfigWindow.cs44
-rw-r--r--Malmstone/Windows/MainWindow.cs136
2 files changed, 180 insertions, 0 deletions
diff --git a/Malmstone/Windows/ConfigWindow.cs b/Malmstone/Windows/ConfigWindow.cs
new file mode 100644
index 0000000..8fbe9ba
--- /dev/null
+++ b/Malmstone/Windows/ConfigWindow.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Numerics;
+using Dalamud.Interface.Windowing;
+using ImGuiNET;
+
+namespace Malmstone.Windows;
+
+public class ConfigWindow : Window, IDisposable
+{
+ private Configuration Configuration;
+
+ public ConfigWindow(Plugin plugin) : base("Malmstone Config")
+ {
+ Flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollbar |
+ ImGuiWindowFlags.NoScrollWithMouse;
+
+ Size = new Vector2(232, 150);
+ Configuration = plugin.Configuration;
+ }
+
+ public void Dispose() { }
+
+ public override void PreDraw()
+ {
+ }
+
+ public override void Draw()
+ {
+ ImGui.Text("Default Series Rank");
+ var savedTargetSeriesRank = Configuration.DefaultTargetRankProperty;
+ if (ImGui.InputInt("##SavedTargetSeriesRank", ref savedTargetSeriesRank, 1))
+ {
+ Configuration.DefaultTargetRankProperty = savedTargetSeriesRank;
+ }
+
+ ImGui.Spacing();
+
+ if (ImGui.Button("Save and Close"))
+ {
+ Configuration.Save();
+ IsOpen = false;
+ }
+ }
+}
diff --git a/Malmstone/Windows/MainWindow.cs b/Malmstone/Windows/MainWindow.cs
new file mode 100644
index 0000000..917dd64
--- /dev/null
+++ b/Malmstone/Windows/MainWindow.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Numerics;
+using Dalamud.Interface.Windowing;
+using ImGuiNET;
+using Malmstone.Services;
+using Malmstone.Utils;
+
+namespace Malmstone.Windows
+{
+ public class MainWindow : Window, IDisposable
+ {
+ private Plugin Plugin;
+ private PvPService PvPService;
+ private int TargetSeriesRank;
+
+ public MainWindow(Plugin plugin)
+ : base("Malmstone", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
+ {
+ SizeConstraints = new WindowSizeConstraints
+ {
+ MinimumSize = new Vector2(375, 310),
+ MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
+ };
+
+ Plugin = plugin;
+ PvPService = new PvPService();
+ TargetSeriesRank = Plugin.Configuration.DefaultTargetRankProperty;
+ }
+
+ public void Dispose() { }
+
+ public override void Draw()
+ {
+ var pvpInfo = PvPService.GetPvPSeriesInfo();
+ if (pvpInfo != null)
+ {
+ ImGui.Text($"Current Series Rank: {pvpInfo.CurrentSeriesRank}");
+ ImGui.Text($"Current Rank Series Experience: {pvpInfo.SeriesExperience}");
+ if (pvpInfo.CurrentSeriesRank != pvpInfo.ClaimedSeriesRank)
+ {
+ ImGui.Text("Don't forget to claim your rank rewards!");
+
+ }
+ ImGui.Spacing();
+
+ ImGui.Text("Target Rank:");
+ ImGui.InputInt("##TargetSeriesRank", ref TargetSeriesRank, 1);
+ }
+ else
+ {
+ ImGui.Text("PvP Profile is not loaded.");
+ }
+
+ if (TargetSeriesRank < 1) TargetSeriesRank = 1;
+
+ ImGui.Spacing();
+ ImGui.Separator();
+
+ if (pvpInfo != null)
+ {
+ var xpResult = MalmstoneXPCalculator.CalculateXp(pvpInfo.CurrentSeriesRank, TargetSeriesRank, pvpInfo.SeriesExperience);
+
+ ImGui.Spacing();
+ ImGui.Text($"You have {xpResult.RemainingXp} remaining series EXP to go until you reach rank {xpResult.TargetLevel}");
+
+ ImGui.Spacing();
+ ImGui.Separator();
+
+ // Crystalline Conflict Section
+ ImGui.TextColored(new Vector4(0.6f, 0.8f, 1f, 1f), "Crystalline Conflict");
+ ImGui.Spacing();
+ if (xpResult.ActivityCounts.ContainsKey("Crystalline Conflict Win"))
+ {
+ ImGui.BulletText($"Win: {xpResult.ActivityCounts["Crystalline Conflict Win"]} times");
+ }
+ if (xpResult.ActivityCounts.ContainsKey("Crystalline Conflict Lose"))
+ {
+ ImGui.BulletText($"Lose: {xpResult.ActivityCounts["Crystalline Conflict Lose"]} times");
+ }
+
+ ImGui.Spacing();
+ ImGui.Separator();
+
+ // Frontlines Section
+ ImGui.TextColored(new Vector4(0.8f, 0.6f, 0.6f, 1f), "Frontlines");
+ ImGui.Spacing();
+ if (xpResult.ActivityCounts.ContainsKey("Frontline Win"))
+ {
+ ImGui.BulletText($"Take 1st Place: {xpResult.ActivityCounts["Frontline Win"]} times");
+ }
+ if (xpResult.ActivityCounts.ContainsKey("Frontline Lose 2nd"))
+ {
+ ImGui.BulletText($"Take 2nd Place: {xpResult.ActivityCounts["Frontline Lose 2nd"]} times");
+ }
+ if (xpResult.ActivityCounts.ContainsKey("Frontline Lose 3rd"))
+ {
+ ImGui.BulletText($"Take 3rd Place: {xpResult.ActivityCounts["Frontline Lose 3rd"]} times");
+ }
+
+ // Frontlines Section
+ ImGui.TextColored(new Vector4(0.8f, 0.6f, 0.6f, 1f), "Frontlines (Roulette)");
+ ImGui.Spacing();
+ if (xpResult.ActivityCounts.ContainsKey("Frontline Daily Win"))
+ {
+ ImGui.BulletText($"Take 1st Place: {xpResult.ActivityCounts["Frontline Daily Win"]} times");
+ }
+ if (xpResult.ActivityCounts.ContainsKey("Frontline Daily Lose 2nd"))
+ {
+ ImGui.BulletText($"Take 2nd Place: {xpResult.ActivityCounts["Frontline Daily Lose 2nd"]} times");
+ }
+ if (xpResult.ActivityCounts.ContainsKey("Frontline Daily Lose 3rd"))
+ {
+ ImGui.BulletText($"Take 3rd Place: {xpResult.ActivityCounts["Frontline Daily Lose 3rd"]} times");
+ }
+
+ ImGui.Spacing();
+ ImGui.Separator();
+
+ // Rival Wings Section
+ ImGui.TextColored(new Vector4(0.6f, 0.8f, 0.6f, 1f), "Rival Wings");
+ ImGui.Spacing();
+ if (xpResult.ActivityCounts.ContainsKey("Rival Wings Win"))
+ {
+ ImGui.BulletText($"Win: {xpResult.ActivityCounts["Rival Wings Win"]} times");
+ }
+ if (xpResult.ActivityCounts.ContainsKey("Rival Wings Lose"))
+ {
+ ImGui.BulletText($"Lose: {xpResult.ActivityCounts["Rival Wings Lose"]} times");
+ }
+
+ ImGui.Spacing();
+ ImGui.Separator();
+ }
+ }
+ }
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage