From 08cd003ee768cc891526e10a03be6ae2fd5f0664 Mon Sep 17 00:00:00 2001 From: Koenari Date: Mon, 24 Oct 2022 13:16:01 +0200 Subject: [PATCH 1/5] feat: adapt to CheapLoc's new function signature --- Dalamud/Localization.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dalamud/Localization.cs b/Dalamud/Localization.cs index a050b71a0..51febc0e3 100644 --- a/Dalamud/Localization.cs +++ b/Dalamud/Localization.cs @@ -140,9 +140,10 @@ namespace Dalamud /// /// Saves localizable JSON data in the current working directory for the provided assembly. /// - public void ExportLocalizable() + /// If set to true, this ignores malformed Localize functions instead of failing. + public void ExportLocalizable(bool ignoreInvalidFunctions = false) { - Loc.ExportLocalizableForAssembly(this.assembly); + Loc.ExportLocalizableForAssembly(this.assembly, ignoreInvalidFunctions); } private string ReadLocData(string langCode) From b6fc0b877b95c11eacd9a74b5d8845cf9bb742f1 Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Thu, 5 Jan 2023 23:47:46 -0800 Subject: [PATCH 2/5] feat: Add testing flag to plugin interface - Add IsTesting flag to allow plugins to determine if a testing version has been loaded. --- Dalamud/Plugin/DalamudPluginInterface.cs | 19 ++++++++++++++++--- Dalamud/Plugin/Internal/Types/LocalPlugin.cs | 6 ++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs index aac4376ea..7e39a85d7 100644 --- a/Dalamud/Plugin/DalamudPluginInterface.cs +++ b/Dalamud/Plugin/DalamudPluginInterface.cs @@ -43,7 +43,7 @@ public sealed class DalamudPluginInterface : IDisposable /// The reason the plugin was loaded. /// A value indicating whether this is a dev plugin. /// The repository from which the plugin is installed. - internal DalamudPluginInterface(string pluginName, FileInfo assemblyLocation, PluginLoadReason reason, bool isDev, string sourceRepository) + internal DalamudPluginInterface(string pluginName, FileInfo assemblyLocation, PluginLoadReason reason, bool isDev, LocalPluginManifest manifest) { var configuration = Service.Get(); var dataManager = Service.Get(); @@ -56,7 +56,8 @@ public sealed class DalamudPluginInterface : IDisposable this.configs = Service.Get().PluginConfigs; this.Reason = reason; this.IsDev = isDev; - this.SourceRepository = isDev ? LocalPluginManifest.FlagDevPlugin : sourceRepository; + this.SourceRepository = isDev ? LocalPluginManifest.FlagDevPlugin : manifest.InstalledFromUrl; + this.IsTesting = manifest.Testing; this.LoadTime = DateTime.Now; this.LoadTimeUTC = DateTime.UtcNow; @@ -97,7 +98,11 @@ public sealed class DalamudPluginInterface : IDisposable public PluginLoadReason Reason { get; } /// - /// Gets the custom repository from which this plugin is installed, , or . + /// Gets the repository from which this plugin was installed. + /// + /// If a plugin was installed from the official/main repository, this will return the value of + /// . Developer plugins will return the value of + /// . /// public string SourceRepository { get; } @@ -106,6 +111,14 @@ public sealed class DalamudPluginInterface : IDisposable /// public bool IsDev { get; } + /// + /// Gets a value indicating whether this is a testing release of a plugin. + /// + /// + /// Dev plugins have undefined behavior for this value, but can be expected to return false. + /// + public bool IsTesting { get; } + /// /// Gets the time that this plugin was loaded. /// diff --git a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs index b49f5799c..7fae1b079 100644 --- a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs +++ b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs @@ -15,7 +15,6 @@ using Dalamud.Logging.Internal; using Dalamud.Plugin.Internal.Exceptions; using Dalamud.Plugin.Internal.Loader; using Dalamud.Utility; -using Dalamud.Utility.Signatures; namespace Dalamud.Plugin.Internal.Types; @@ -397,11 +396,10 @@ internal class LocalPlugin : IDisposable } // Update the location for the Location and CodeBase patches - PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = - new PluginPatchData(this.DllFile); + PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = new PluginPatchData(this.DllFile); this.DalamudInterface = - new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, this.DllFile, reason, this.IsDev, this.Manifest.InstalledFromUrl); + new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, this.DllFile, reason, this.IsDev, this.Manifest); if (this.Manifest.LoadSync && this.Manifest.LoadRequiredState is 0 or 1) { From fb9aeae1bcb45af9f7487b11496072e994874300 Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Sat, 7 Jan 2023 14:33:41 -0800 Subject: [PATCH 3/5] Fix a bad docstring that squicked through --- Dalamud/Plugin/DalamudPluginInterface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs index 7e39a85d7..6524c90a8 100644 --- a/Dalamud/Plugin/DalamudPluginInterface.cs +++ b/Dalamud/Plugin/DalamudPluginInterface.cs @@ -42,7 +42,7 @@ public sealed class DalamudPluginInterface : IDisposable /// Location of the assembly. /// The reason the plugin was loaded. /// A value indicating whether this is a dev plugin. - /// The repository from which the plugin is installed. + /// The local manifest for this plugin. internal DalamudPluginInterface(string pluginName, FileInfo assemblyLocation, PluginLoadReason reason, bool isDev, LocalPluginManifest manifest) { var configuration = Service.Get(); From 37b895653b0d7e6ae4cfee7c67ac74690b3ab66c Mon Sep 17 00:00:00 2001 From: karashiiro <49822414+karashiiro@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:08:06 -0800 Subject: [PATCH 4/5] Send listing IDs in market board requests --- .../Universalis/UniversalisMarketBoardUploader.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Dalamud/Game/Network/Internal/MarketBoardUploaders/Universalis/UniversalisMarketBoardUploader.cs b/Dalamud/Game/Network/Internal/MarketBoardUploaders/Universalis/UniversalisMarketBoardUploader.cs index 78634e608..2e974d4ac 100644 --- a/Dalamud/Game/Network/Internal/MarketBoardUploaders/Universalis/UniversalisMarketBoardUploader.cs +++ b/Dalamud/Game/Network/Internal/MarketBoardUploaders/Universalis/UniversalisMarketBoardUploader.cs @@ -53,6 +53,7 @@ internal class UniversalisMarketBoardUploader : IMarketBoardUploader { var universalisListing = new UniversalisItemListingsEntry { + ListingId = marketBoardItemListing.ListingId.ToString(), Hq = marketBoardItemListing.IsHq, SellerId = marketBoardItemListing.RetainerOwnerId.ToString(), RetainerName = marketBoardItemListing.RetainerName, From a0383a80a998d3cd47ee277214c10bd4193c9493 Mon Sep 17 00:00:00 2001 From: Harmony <19539165+BitsOfAByte@users.noreply.github.com> Date: Mon, 28 Nov 2022 21:16:11 +0000 Subject: [PATCH 5/5] feat(interface): don't allow object table in PvP --- Dalamud/Interface/Internal/Windows/DataWindow.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index fcfe3edd8..cab595544 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -450,6 +450,10 @@ internal class DataWindow : Window { ImGui.TextUnformatted("LocalPlayer null."); } + else if (clientState.IsPvPExcludingDen) + { + ImGui.TextUnformatted("Cannot access object table while in PvP."); + } else { stateString += $"ObjectTableLen: {objectTable.Length}\n";