From 5c362867819875d5d77d61fee54fd93e223f9e93 Mon Sep 17 00:00:00 2001
From: kalilistic <35899782+kalilistic@users.noreply.github.com>
Date: Sat, 2 Oct 2021 11:18:14 -0400
Subject: [PATCH 01/13] feat: add more imgui colors
---
Dalamud/Interface/Colors/ImGuiColors.cs | 65 ++++++++++++++++---
.../Internal/Windows/ColorDemoWindow.cs | 9 +++
2 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/Dalamud/Interface/Colors/ImGuiColors.cs b/Dalamud/Interface/Colors/ImGuiColors.cs
index 341460efe..a8cb2f6fb 100644
--- a/Dalamud/Interface/Colors/ImGuiColors.cs
+++ b/Dalamud/Interface/Colors/ImGuiColors.cs
@@ -10,51 +10,96 @@ namespace Dalamud.Interface.Colors
///
/// Gets red used in dalamud.
///
- public static Vector4 DalamudRed { get; internal set; } = new Vector4(1f, 0f, 0f, 1f);
+ public static Vector4 DalamudRed { get; internal set; } = new(1f, 0f, 0f, 1f);
///
/// Gets grey used in dalamud.
///
- public static Vector4 DalamudGrey { get; internal set; } = new Vector4(0.7f, 0.7f, 0.7f, 1f);
+ public static Vector4 DalamudGrey { get; internal set; } = new(0.7f, 0.7f, 0.7f, 1f);
///
/// Gets grey used in dalamud.
///
- public static Vector4 DalamudGrey2 { get; internal set; } = new Vector4(0.7f, 0.7f, 0.7f, 1f);
+ public static Vector4 DalamudGrey2 { get; internal set; } = new(0.7f, 0.7f, 0.7f, 1f);
///
/// Gets grey used in dalamud.
///
- public static Vector4 DalamudGrey3 { get; internal set; } = new Vector4(0.5f, 0.5f, 0.5f, 1f);
+ public static Vector4 DalamudGrey3 { get; internal set; } = new(0.5f, 0.5f, 0.5f, 1f);
///
/// Gets white used in dalamud.
///
- public static Vector4 DalamudWhite { get; internal set; } = new Vector4(1f, 1f, 1f, 1f);
+ public static Vector4 DalamudWhite { get; internal set; } = new(1f, 1f, 1f, 1f);
///
/// Gets white used in dalamud.
///
- public static Vector4 DalamudWhite2 { get; internal set; } = new Vector4(0.878f, 0.878f, 0.878f, 1f);
+ public static Vector4 DalamudWhite2 { get; internal set; } = new(0.878f, 0.878f, 0.878f, 1f);
///
/// Gets orange used in dalamud.
///
- public static Vector4 DalamudOrange { get; internal set; } = new Vector4(1f, 0.709f, 0f, 1f);
+ public static Vector4 DalamudOrange { get; internal set; } = new(1f, 0.709f, 0f, 1f);
+
+ ///
+ /// Gets yellow used in dalamud.
+ ///
+ public static Vector4 DalamudYellow { get; } = new(1f, 1f, .4f, 1f);
+
+ ///
+ /// Gets violet used in dalamud.
+ ///
+ public static Vector4 DalamudViolet { get; } = new(0.770f, 0.700f, 0.965f, 1.000f);
///
/// Gets tank blue (UIColor37).
///
- public static Vector4 TankBlue { get; internal set; } = new Vector4(0f, 0.6f, 1f, 1f);
+ public static Vector4 TankBlue { get; internal set; } = new(0f, 0.6f, 1f, 1f);
///
/// Gets healer green (UIColor504).
///
- public static Vector4 HealerGreen { get; internal set; } = new Vector4(0f, 0.8f, 0.1333333f, 1f);
+ public static Vector4 HealerGreen { get; internal set; } = new(0f, 0.8f, 0.1333333f, 1f);
///
/// Gets dps red (UIColor545).
///
- public static Vector4 DPSRed { get; internal set; } = new Vector4(0.7058824f, 0f, 0f, 1f);
+ public static Vector4 DPSRed { get; internal set; } = new(0.7058824f, 0f, 0f, 1f);
+
+ ///
+ /// Gets parsed grey.
+ ///
+ public static Vector4 ParsedGrey { get; } = new(0.4f, 0.4f, 0.4f, 1f);
+
+ ///
+ /// Gets parsed green.
+ ///
+ public static Vector4 ParsedGreen { get; } = new(0.117f, 1f, 0f, 1f);
+
+ ///
+ /// Gets parsed blue.
+ ///
+ public static Vector4 ParsedBlue { get; } = new(0f, 0.439f, 1f, 1f);
+
+ ///
+ /// Gets parsed purple.
+ ///
+ public static Vector4 ParsedPurple { get; } = new(0.639f, 0.207f, 0.933f, 1f);
+
+ ///
+ /// Gets parsed orange.
+ ///
+ public static Vector4 ParsedOrange { get; } = new(1f, 0.501f, 0f, 1f);
+
+ ///
+ /// Gets parsed pink.
+ ///
+ public static Vector4 ParsedPink { get; } = new(0.886f, 0.407f, 0.658f, 1f);
+
+ ///
+ /// Gets parsed gold.
+ ///
+ public static Vector4 ParsedGold { get; } = new(0.898f, 0.8f, 0.501f, 1f);
}
}
diff --git a/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs b/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs
index 8dcb1bb95..aeabf5e5f 100644
--- a/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/ColorDemoWindow.cs
@@ -34,9 +34,18 @@ namespace Dalamud.Interface.Internal.Windows
("DalamudWhite", ImGuiColors.DalamudWhite),
("DalamudWhite2", ImGuiColors.DalamudWhite2),
("DalamudOrange", ImGuiColors.DalamudOrange),
+ ("DalamudYellow", ImGuiColors.DalamudYellow),
+ ("DalamudViolet", ImGuiColors.DalamudViolet),
("TankBlue", ImGuiColors.TankBlue),
("HealerGreen", ImGuiColors.HealerGreen),
("DPSRed", ImGuiColors.DPSRed),
+ ("ParsedGrey", ImGuiColors.ParsedGrey),
+ ("ParsedGreen", ImGuiColors.ParsedGreen),
+ ("ParsedBlue", ImGuiColors.ParsedBlue),
+ ("ParsedPurple", ImGuiColors.ParsedPurple),
+ ("ParsedOrange", ImGuiColors.ParsedOrange),
+ ("ParsedPink", ImGuiColors.ParsedPink),
+ ("ParsedGold", ImGuiColors.ParsedGold),
}.OrderBy(colorDemo => colorDemo.Name).ToList();
}
From d10a6dab82599d05a38a9653e906a377427a8203 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Sun, 3 Oct 2021 11:09:52 -0400
Subject: [PATCH 02/13] implicit types
---
Dalamud/Interface/Internal/PluginCategoryManager.cs | 8 ++++----
.../Internal/Windows/PluginInstallerWindow.cs | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Dalamud/Interface/Internal/PluginCategoryManager.cs b/Dalamud/Interface/Internal/PluginCategoryManager.cs
index bccd58162..b7a6a6d6c 100644
--- a/Dalamud/Interface/Internal/PluginCategoryManager.cs
+++ b/Dalamud/Interface/Internal/PluginCategoryManager.cs
@@ -149,10 +149,10 @@ namespace Dalamud.Interface.Internal
foreach (var tag in pluginCategoryTags)
{
// only tags from whitelist can be accepted
- int matchIdx = Array.FindIndex(this.CategoryList, x => x.Tag.Equals(tag, StringComparison.InvariantCultureIgnoreCase));
+ var matchIdx = Array.FindIndex(this.CategoryList, x => x.Tag.Equals(tag, StringComparison.InvariantCultureIgnoreCase));
if (matchIdx >= 0)
{
- int categoryId = this.CategoryList[matchIdx].CategoryId;
+ var categoryId = this.CategoryList[matchIdx].CategoryId;
if (categoryId >= FirstTagBasedCategoryId)
{
categoryList.Add(categoryId);
@@ -202,7 +202,7 @@ namespace Dalamud.Interface.Internal
{
var groupInfo = this.groupList[this.currentGroupIdx];
- bool includeAll = (this.currentCategoryIdx == 0) || (groupInfo.GroupKind != GroupKind.Available);
+ var includeAll = (this.currentCategoryIdx == 0) || (groupInfo.GroupKind != GroupKind.Available);
if (includeAll)
{
result.AddRange(plugins);
@@ -215,7 +215,7 @@ namespace Dalamud.Interface.Internal
{
if (this.mapPluginCategories.TryGetValue(plugin, out var pluginCategoryIds))
{
- int matchIdx = Array.IndexOf(pluginCategoryIds, selectedCategoryInfo.CategoryId);
+ var matchIdx = Array.IndexOf(pluginCategoryIds, selectedCategoryInfo.CategoryId);
if (matchIdx >= 0)
{
result.Add(plugin);
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index d9c3156f9..02f0a3247 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -610,10 +610,10 @@ namespace Dalamud.Interface.Internal.Windows
private void DrawPluginCategories()
{
- float useContentHeight = -40; // button height + spacing
- float useMenuWidth = 180; // works fine as static value, table can be resized by user
+ var useContentHeight = -40f; // button height + spacing
+ var useMenuWidth = 180f; // works fine as static value, table can be resized by user
- float useContentWidth = ImGui.GetContentRegionAvail().X;
+ var useContentWidth = ImGui.GetContentRegionAvail().X;
if (ImGui.BeginChild("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale)))
{
@@ -654,7 +654,7 @@ namespace Dalamud.Interface.Internal.Windows
}
}
- for (int groupIdx = 0; groupIdx < this.categoryManager.GroupList.Length; groupIdx++)
+ for (var groupIdx = 0; groupIdx < this.categoryManager.GroupList.Length; groupIdx++)
{
var groupInfo = this.categoryManager.GroupList[groupIdx];
var canShowGroup = (groupInfo.GroupKind != PluginCategoryManager.GroupKind.DevTools) || this.hasDevPlugins;
@@ -673,11 +673,11 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Indent();
var categoryItemSize = new Vector2(ImGui.GetContentRegionAvail().X - (5 * ImGuiHelpers.GlobalScale), ImGui.GetTextLineHeight());
- for (int categoryIdx = 0; categoryIdx < groupInfo.Categories.Count; categoryIdx++)
+ for (var categoryIdx = 0; categoryIdx < groupInfo.Categories.Count; categoryIdx++)
{
var categoryInfo = Array.Find(this.categoryManager.CategoryList, x => x.CategoryId == groupInfo.Categories[categoryIdx]);
- bool hasSearchHighlight = this.categoryManager.IsCategoryHighlighted(categoryInfo.CategoryId);
+ var hasSearchHighlight = this.categoryManager.IsCategoryHighlighted(categoryInfo.CategoryId);
if (hasSearchHighlight)
{
ImGui.PushStyleColor(ImGuiCol.Text, colorSearchHighlight);
From 8b31936fd927fbb72777e84d97efe13925c60326 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Fri, 1 Oct 2021 21:57:35 -0400
Subject: [PATCH 03/13] fix scrollbar not showing
---
Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index 02f0a3247..feac3e368 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -628,7 +628,7 @@ namespace Dalamud.Interface.Internal.Windows
this.DrawPluginCategorySelectors();
ImGui.TableNextColumn();
- if (ImGui.BeginChild($"ScrollingPlugins", new Vector2(useContentWidth, 0), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoBackground))
+ if (ImGui.BeginChild("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoBackground))
{
this.DrawPluginCategoryContent();
ImGui.EndChild();
From e7f29cb43147b9bb262a23fb5ae7001953d4dca2 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Sun, 3 Oct 2021 10:04:07 -0400
Subject: [PATCH 04/13] EndChild outside Begin
---
Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index feac3e368..0aaa44dd0 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -195,7 +195,6 @@ namespace Dalamud.Interface.Internal.Windows
public override void Draw()
{
this.DrawHeader();
- // this.DrawPluginTabBar();
this.DrawPluginCategories();
this.DrawFooter();
this.DrawErrorModal();
@@ -631,9 +630,9 @@ namespace Dalamud.Interface.Internal.Windows
if (ImGui.BeginChild("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoBackground))
{
this.DrawPluginCategoryContent();
- ImGui.EndChild();
}
+ ImGui.EndChild();
ImGui.EndTable();
}
From 3801a7fb1399b9e20ead32f1e6b4904239c9cf5d Mon Sep 17 00:00:00 2001
From: Raymond
Date: Sun, 3 Oct 2021 10:54:31 -0400
Subject: [PATCH 05/13] Remove nulls from image1-5 array
---
.../Interface/Internal/Windows/PluginInstallerWindow.cs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index 0aaa44dd0..c5ad221b0 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -2165,6 +2165,10 @@ namespace Dalamud.Interface.Internal.Windows
if (didAny)
{
Log.Verbose($"Plugin images for {manifest.InternalName} loaded from disk");
+
+ if (pluginImages.Contains(null))
+ pluginImages = pluginImages.Where(image => image != null).ToArray();
+
this.pluginImagesMap[manifest.InternalName] = pluginImages;
return;
@@ -2217,6 +2221,10 @@ namespace Dalamud.Interface.Internal.Windows
if (didAny)
{
Log.Verbose($"Plugin images for {manifest.InternalName} downloaded");
+
+ if (pluginImages.Contains(null))
+ pluginImages = pluginImages.Where(image => image != null).ToArray();
+
this.pluginImagesMap[manifest.InternalName] = pluginImages;
return;
From c3d4d525943ff7447917aa9cd602c093a73aec46 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Sun, 3 Oct 2021 11:09:42 -0400
Subject: [PATCH 06/13] comment unused methods
---
Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index c5ad221b0..8bf4a57ba 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -469,6 +469,7 @@ namespace Dalamud.Interface.Internal.Windows
}
}
+ /*
private void DrawPluginTabBar()
{
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - (5 * ImGuiHelpers.GlobalScale));
@@ -489,7 +490,9 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.PopStyleVar();
}
+ */
+ /*
private void DrawPluginTab(string title, Action drawPluginList)
{
if (ImGui.BeginTabItem(title))
@@ -510,6 +513,7 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.EndTabItem();
}
}
+ */
private void DrawAvailablePluginList()
{
From 893ca93e02979a9408e53cf992e2c48f96be9777 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Sun, 3 Oct 2021 11:14:42 -0400
Subject: [PATCH 07/13] Put ItemSpacing from DrawPluginTabBar into category
view
---
Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index 8bf4a57ba..73e5f99b9 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -715,6 +715,8 @@ namespace Dalamud.Interface.Internal.Windows
return;
}
+ ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, ImGuiHelpers.ScaledVector2(1, 3));
+
var groupInfo = this.categoryManager.GroupList[this.categoryManager.CurrentGroupIdx];
if (groupInfo.GroupKind == PluginCategoryManager.GroupKind.DevTools)
{
@@ -776,6 +778,8 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Text(Locs.TabBody_SearchNoCompatible);
}
}
+
+ ImGui.PopStyleVar();
}
private void DrawImageTester()
From 4b98ea31ccadeb585971fd66c457851ad77e80d6 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Sun, 3 Oct 2021 11:27:31 -0400
Subject: [PATCH 08/13] Merge category code into preexisting method
Keep installed plugins after installation in available tab.
---
.../Internal/Windows/PluginInstallerWindow.cs | 58 +++++--------------
1 file changed, 16 insertions(+), 42 deletions(-)
diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
index 73e5f99b9..e359bbffe 100644
--- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs
@@ -525,30 +525,38 @@ namespace Dalamud.Interface.Internal.Windows
return;
}
- var filteredList = pluginList
+ var filteredManifests = pluginList
.Where(rm => !this.IsManifestFiltered(rm))
.ToList();
- if (filteredList.Count == 0)
+ if (filteredManifests.Count == 0)
{
ImGui.TextColored(ImGuiColors.DalamudGrey2, Locs.TabBody_SearchNoMatching);
return;
}
- var i = 0;
- foreach (var manifest in filteredList)
+ // reset opened list of collapsibles when switching between categories
+ if (this.categoryManager.IsContentDirty)
{
- var (isInstalled, plugin) = this.IsManifestInstalled(manifest);
+ this.openPluginCollapsibles.Clear();
+ }
+
+ var categoryManifestsList = this.categoryManager.GetCurrentCategoryContent(filteredManifests);
+
+ var i = 0;
+ foreach (var manifest in categoryManifestsList)
+ {
+ var remoteManifest = manifest as RemotePluginManifest;
+ var (isInstalled, plugin) = this.IsManifestInstalled(remoteManifest);
ImGui.PushID($"{manifest.InternalName}{manifest.AssemblyVersion}");
-
if (isInstalled)
{
this.DrawInstalledPlugin(plugin, i++, true);
}
else
{
- this.DrawAvailablePlugin(manifest, i++);
+ this.DrawAvailablePlugin(remoteManifest, i++);
}
ImGui.PopID();
@@ -742,41 +750,7 @@ namespace Dalamud.Interface.Internal.Windows
}
else
{
- var pluginList = this.pluginListAvailable;
- if (pluginList.Count > 0)
- {
- // reset opened list of collapsibles when switching between categories
- if (this.categoryManager.IsContentDirty)
- {
- this.openPluginCollapsibles.Clear();
- }
-
- var filteredManifests = pluginList.Where(rm => !this.IsManifestFiltered(rm) && !this.IsManifestInstalled(rm).IsInstalled);
- var categoryManifestsList = this.categoryManager.GetCurrentCategoryContent(filteredManifests);
-
- if (categoryManifestsList.Count > 0)
- {
- var i = 0;
- foreach (var manifest in categoryManifestsList)
- {
- var rmManifest = manifest as RemotePluginManifest;
- if (rmManifest != null)
- {
- ImGui.PushID($"{rmManifest.InternalName}{rmManifest.AssemblyVersion}");
- this.DrawAvailablePlugin(rmManifest, i++);
- ImGui.PopID();
- }
- }
- }
- else
- {
- ImGui.Text(Locs.TabBody_SearchNoMatching);
- }
- }
- else
- {
- ImGui.Text(Locs.TabBody_SearchNoCompatible);
- }
+ this.DrawAvailablePluginList();
}
ImGui.PopStyleVar();
From 59b4ac7610fd7fa20cfbb2b9f55875fe7fa361e8 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Tue, 5 Oct 2021 06:29:37 -0400
Subject: [PATCH 09/13] Fix docstrings
---
Dalamud/Plugin/DalamudPluginInterface.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs
index 3d872029b..d3f416404 100644
--- a/Dalamud/Plugin/DalamudPluginInterface.cs
+++ b/Dalamud/Plugin/DalamudPluginInterface.cs
@@ -165,11 +165,11 @@ namespace Dalamud.Plugin
#region IPC
///
- /// Gets an IPC publisher.
+ /// Gets an IPC provider.
///
/// The return type for funcs. Use object if this is unused.
/// The name of the IPC registration.
- /// An IPC publisher.
+ /// An IPC provider.
/// This is thrown when the requested types do not match the previously registered types are different.
public ICallGateProvider GetIpcProvider(string name)
=> new CallGatePubSub(name);
@@ -211,7 +211,7 @@ namespace Dalamud.Plugin
///
/// The return type for funcs. Use object if this is unused.
/// The name of the IPC registration.
- /// An IPC publisher.
+ /// An IPC subscriber.
public ICallGateSubscriber GetIpcSubscriber(string name)
=> new CallGatePubSub(name);
From e137598604c18a52cb40264ebb97acb72cb40ce2 Mon Sep 17 00:00:00 2001
From: Anna Clemens
Date: Tue, 5 Oct 2021 21:38:25 -0400
Subject: [PATCH 10/13] feat: expose PF last patch timestamp
---
.../Gui/PartyFinder/Internal/PartyFinderPacketListing.cs | 2 +-
Dalamud/Game/Gui/PartyFinder/Types/PartyFinderListing.cs | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Dalamud/Game/Gui/PartyFinder/Internal/PartyFinderPacketListing.cs b/Dalamud/Game/Gui/PartyFinder/Internal/PartyFinderPacketListing.cs
index 75f24c88c..7e8f1e1ef 100644
--- a/Dalamud/Game/Gui/PartyFinder/Internal/PartyFinderPacketListing.cs
+++ b/Dalamud/Game/Gui/PartyFinder/Internal/PartyFinderPacketListing.cs
@@ -51,7 +51,7 @@ namespace Dalamud.Game.Gui.PartyFinder.Internal
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
private readonly byte[] header7; // all zero in every pf I've examined
- private readonly uint lastPatchHotfixTimestamp; // last time the servers were restarted?
+ internal readonly uint LastPatchHotfixTimestamp; // last time the servers were restarted?
internal readonly ushort SecondsRemaining;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
diff --git a/Dalamud/Game/Gui/PartyFinder/Types/PartyFinderListing.cs b/Dalamud/Game/Gui/PartyFinder/Types/PartyFinderListing.cs
index ae885168a..b0dce07b9 100644
--- a/Dalamud/Game/Gui/PartyFinder/Types/PartyFinderListing.cs
+++ b/Dalamud/Game/Gui/PartyFinder/Types/PartyFinderListing.cs
@@ -54,6 +54,7 @@ namespace Dalamud.Game.Gui.PartyFinder.Types
this.MinimumItemLevel = listing.MinimumItemLevel;
this.Parties = listing.NumParties;
this.SlotsAvailable = listing.NumSlots;
+ this.LastPatchHotfixTimestamp = listing.LastPatchHotfixTimestamp;
this.JobsPresent = listing.JobsPresent
.Select(id => new Lazy(
() => id == 0
@@ -143,6 +144,12 @@ namespace Dalamud.Game.Gui.PartyFinder.Types
///
public byte SlotsAvailable { get; }
+ ///
+ /// Gets the time at which the server this listings is on last restarted for a patch/hotfix.
+ /// Probably.
+ ///
+ public uint LastPatchHotfixTimestamp { get; }
+
///
/// Gets a list of player slots that the Party Finder is accepting.
///
From 32f1168f1571fdff72fa4c3add29d3673c651ae5 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Wed, 6 Oct 2021 09:25:57 -0400
Subject: [PATCH 11/13] Implement assemblyLocation and assemblyDirectory in DPI
---
Dalamud/Plugin/DalamudPluginInterface.cs | 15 ++++++++++++++-
Dalamud/Plugin/Internal/LocalPlugin.cs | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs
index d3f416404..fb1741f87 100644
--- a/Dalamud/Plugin/DalamudPluginInterface.cs
+++ b/Dalamud/Plugin/DalamudPluginInterface.cs
@@ -35,9 +35,10 @@ namespace Dalamud.Plugin
/// Set up the interface and populate all fields needed.
///
/// The internal name of the plugin.
+ /// Location of the assembly.
/// The reason the plugin was loaded.
/// A value indicating whether this is a dev plugin.
- internal DalamudPluginInterface(string pluginName, PluginLoadReason reason, bool isDev)
+ internal DalamudPluginInterface(string pluginName, FileInfo assemblyLocation, PluginLoadReason reason, bool isDev)
{
var configuration = Service.Get();
var dataManager = Service.Get();
@@ -46,6 +47,8 @@ namespace Dalamud.Plugin
this.UiBuilder = new UiBuilder(pluginName);
this.pluginName = pluginName;
+ this.AssemblyLocation = assemblyLocation;
+ this.AssemblyDirectory = new DirectoryInfo(assemblyLocation.DirectoryName!);
this.configs = Service.Get().PluginConfigs;
this.Reason = reason;
this.IsDev = isDev;
@@ -113,6 +116,16 @@ namespace Dalamud.Plugin
///
public DirectoryInfo DalamudAssetDirectory => Service.Get().AssetDirectory;
+ ///
+ /// Gets the location of your plugin assembly.
+ ///
+ public FileInfo AssemblyLocation { get; }
+
+ ///
+ /// Gets the directory your plugin assembly and bundled files are stored in.
+ ///
+ public DirectoryInfo AssemblyDirectory { get; }
+
///
/// Gets the directory your plugin configurations are stored in.
///
diff --git a/Dalamud/Plugin/Internal/LocalPlugin.cs b/Dalamud/Plugin/Internal/LocalPlugin.cs
index a0d49e434..8207b08e6 100644
--- a/Dalamud/Plugin/Internal/LocalPlugin.cs
+++ b/Dalamud/Plugin/Internal/LocalPlugin.cs
@@ -309,7 +309,7 @@ namespace Dalamud.Plugin.Internal
// Update the location for the Location and CodeBase patches
PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = new(this.DllFile);
- this.DalamudInterface = new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, reason, this.IsDev);
+ this.DalamudInterface = new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, this.DllFile, reason, this.IsDev);
var ioc = Service.Get();
this.instance = ioc.Create(this.pluginType, this.DalamudInterface) as IDalamudPlugin;
From 6f2dcbff190cfcd1609d3e01ab7e168dfe334013 Mon Sep 17 00:00:00 2001
From: Raymond
Date: Wed, 6 Oct 2021 16:28:42 -0400
Subject: [PATCH 12/13] Remove AssemblyDirectory
---
Dalamud/Plugin/DalamudPluginInterface.cs | 6 ------
1 file changed, 6 deletions(-)
diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs
index fb1741f87..8eaf1a74c 100644
--- a/Dalamud/Plugin/DalamudPluginInterface.cs
+++ b/Dalamud/Plugin/DalamudPluginInterface.cs
@@ -48,7 +48,6 @@ namespace Dalamud.Plugin
this.pluginName = pluginName;
this.AssemblyLocation = assemblyLocation;
- this.AssemblyDirectory = new DirectoryInfo(assemblyLocation.DirectoryName!);
this.configs = Service.Get().PluginConfigs;
this.Reason = reason;
this.IsDev = isDev;
@@ -121,11 +120,6 @@ namespace Dalamud.Plugin
///
public FileInfo AssemblyLocation { get; }
- ///
- /// Gets the directory your plugin assembly and bundled files are stored in.
- ///
- public DirectoryInfo AssemblyDirectory { get; }
-
///
/// Gets the directory your plugin configurations are stored in.
///
From 25c94c9c6d18878ba38fe6b01a99a0f60d89fe3c Mon Sep 17 00:00:00 2001
From: Raymond
Date: Wed, 6 Oct 2021 17:21:06 -0400
Subject: [PATCH 13/13] Fix crash in flytext
---
Dalamud/Game/Gui/FlyText/FlyTextGui.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Dalamud/Game/Gui/FlyText/FlyTextGui.cs b/Dalamud/Game/Gui/FlyText/FlyTextGui.cs
index 043f02755..c3191562a 100644
--- a/Dalamud/Game/Gui/FlyText/FlyTextGui.cs
+++ b/Dalamud/Game/Gui/FlyText/FlyTextGui.cs
@@ -213,8 +213,8 @@ namespace Dalamud.Game.Gui.FlyText
var tmpKind = kind;
var tmpVal1 = val1;
var tmpVal2 = val2;
- var tmpText1 = MemoryHelper.ReadSeStringNullTerminated(text1);
- var tmpText2 = MemoryHelper.ReadSeStringNullTerminated(text2);
+ var tmpText1 = text1 == IntPtr.Zero ? string.Empty : MemoryHelper.ReadSeStringNullTerminated(text1);
+ var tmpText2 = text2 == IntPtr.Zero ? string.Empty : MemoryHelper.ReadSeStringNullTerminated(text2);
var tmpColor = color;
var tmpIcon = icon;
var tmpYOffset = yOffset;