Merge branch 'refs/heads/master' into apiX

# Conflicts:
#	Dalamud/Game/Libc/LibcFunction.cs
#	Dalamud/Game/Libc/LibcFunctionAddressResolver.cs
#	Dalamud/Game/Libc/OwnedStdString.cs
#	Dalamud/Game/Libc/StdString.cs
#	Dalamud/Interface/UiBuilder.cs
This commit is contained in:
Kaz Wolfe 2024-04-28 11:54:54 -07:00
commit b32ed39826
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
297 changed files with 768 additions and 543 deletions

View file

@ -12,6 +12,7 @@ jobs:
matrix:
branches:
- new_im_hooks
- apiX
defaults:
run:

View file

@ -27,7 +27,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lumina" Version="3.16.0" />
<PackageReference Include="Lumina" Version="3.17.0" />
<PackageReference Include="Lumina.Excel" Version="6.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">

View file

@ -2,7 +2,6 @@ using System;
using System.IO;
using Dalamud.Configuration.Internal;
using Dalamud.Game;
using Dalamud.Game.Command;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;

View file

@ -1,10 +1,11 @@
namespace Dalamud;
using Dalamud.Utility;
// TODO(v10): Delete this, and use Dalamud.Common.ClientLanguage instead for everything.
namespace Dalamud;
/// <summary>
/// Enum describing the language the game loads in.
/// </summary>
[Api10ToDo("Delete this, and use Dalamud.Common.ClientLanguage instead for everything.")]
public enum ClientLanguage
{
/// <summary>

View file

@ -1,10 +1,11 @@
using System;
using Dalamud.Utility;
namespace Dalamud;
/// <summary>
/// Extension methods for the <see cref="ClientLanguage"/> class.
/// </summary>
[Api10ToDo("Delete this, and use Dalamud.Common.ClientLanguage instead for everything.")]
public static class ClientLanguageExtensions
{
/// <summary>

View file

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
namespace Dalamud.Configuration.Internal;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Configuration.Internal;
/// <summary>

View file

@ -33,8 +33,9 @@ internal sealed class Dalamud : IServiceType
{
#region Internals
private static int shownServiceError = 0;
private readonly ManualResetEvent unloadSignal;
#endregion
/// <summary>
@ -68,54 +69,47 @@ internal sealed class Dalamud : IServiceType
// Set up FFXIVClientStructs
this.SetupClientStructsResolver(cacheDir);
if (!configuration.IsResumeGameAfterPluginLoad)
void KickoffGameThread()
{
Log.Verbose("=============== GAME THREAD KICKOFF ===============");
Timings.Event("Game thread kickoff");
NativeFunctions.SetEvent(mainThreadContinueEvent);
ServiceManager.InitializeEarlyLoadableServices()
.ContinueWith(t =>
}
void HandleServiceInitFailure(Task t)
{
Log.Error(t.Exception!, "Service initialization failure");
if (Interlocked.CompareExchange(ref shownServiceError, 1, 0) != 0)
return;
Util.Fatal(
"Dalamud failed to load all necessary services.\n\nThe game will continue, but you may not be able to use plugins.",
"Dalamud", false);
}
ServiceManager.InitializeEarlyLoadableServices()
.ContinueWith(
t =>
{
if (t.IsCompletedSuccessfully)
return;
Log.Error(t.Exception!, "Service initialization failure");
Util.Fatal(
"Dalamud failed to load all necessary services.\n\nThe game will continue, but you may not be able to use plugins.",
"Dalamud", false);
HandleServiceInitFailure(t);
});
}
else
{
Task.Run(async () =>
ServiceManager.BlockingResolved.ContinueWith(
t =>
{
try
if (t.IsCompletedSuccessfully)
{
var tasks = new[]
{
ServiceManager.InitializeEarlyLoadableServices(),
ServiceManager.BlockingResolved,
};
await Task.WhenAny(tasks);
var faultedTasks = tasks.Where(x => x.IsFaulted).Select(x => (Exception)x.Exception!).ToArray();
if (faultedTasks.Any())
throw new AggregateException(faultedTasks);
NativeFunctions.SetEvent(mainThreadContinueEvent);
await Task.WhenAll(tasks);
}
catch (Exception e)
{
Log.Error(e, "Service initialization failure");
Util.Fatal("Dalamud could not initialize correctly. Please report this error. \n\nThe game will continue, but you may not be able to use plugins.", "Dalamud", false);
}
finally
{
NativeFunctions.SetEvent(mainThreadContinueEvent);
KickoffGameThread();
return;
}
HandleServiceInitFailure(t);
});
}
this.DefaultExceptionFilter = NativeFunctions.SetUnhandledExceptionFilter(nint.Zero);
NativeFunctions.SetUnhandledExceptionFilter(this.DefaultExceptionFilter);

View file

@ -8,7 +8,7 @@
</PropertyGroup>
<PropertyGroup Label="Feature">
<DalamudVersion>9.1.0.5</DalamudVersion>
<DalamudVersion>9.1.0.7</DalamudVersion>
<Description>XIV Launcher addon framework</Description>
<AssemblyVersion>$(DalamudVersion)</AssemblyVersion>
<Version>$(DalamudVersion)</Version>
@ -68,9 +68,9 @@
<PackageReference Include="goaaats.Reloaded.Hooks" Version="4.2.0-goat.4" />
<PackageReference Include="goaaats.Reloaded.Assembler" Version="1.0.14-goat.2" />
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0" />
<PackageReference Include="Lumina" Version="3.16.0" />
<PackageReference Include="Lumina" Version="3.17.0" />
<PackageReference Include="Lumina.Excel" Version="6.5.2" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="9.0.0-preview.1.24081.5" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View file

@ -1,4 +1,3 @@
using System.Diagnostics;
using System.IO;
using System.Threading;
@ -52,15 +51,12 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
DefaultExcelLanguage = this.Language.ToLumina(),
};
var processModule = Process.GetCurrentProcess().MainModule;
if (processModule != null)
this.GameData = new(
Path.Combine(Path.GetDirectoryName(Environment.ProcessPath)!, "sqpack"),
luminaOptions)
{
this.GameData = new GameData(Path.Combine(Path.GetDirectoryName(processModule.FileName)!, "sqpack"), luminaOptions);
}
else
{
throw new Exception("Could not main module.");
}
StreamPool = new(),
};
Log.Information("Lumina is ready: {0}", this.GameData.DataPath);
@ -107,7 +103,8 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
}
catch (Exception ex)
{
Log.Error(ex, "Could not download data.");
Log.Error(ex, "Could not initialize Lumina");
throw;
}
}
@ -161,6 +158,7 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
void IInternalDisposableService.DisposeService()
{
this.luminaCancellationTokenSource.Cancel();
this.GameData.Dispose();
}
private class LauncherTroubleshootingInfo

View file

@ -5,6 +5,7 @@ using Dalamud.Game.Gui;
using Dalamud.Logging.Internal;
using Dalamud.Memory;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Addon.Events;

View file

@ -10,6 +10,7 @@ using Dalamud.IoC.Internal;
using Dalamud.Logging.Internal;
using Dalamud.Memory;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Addon.Lifecycle;
@ -133,6 +134,9 @@ internal unsafe class AddonLifecycle : IInternalDisposableService
/// <param name="listener">The listener to unregister.</param>
internal void UnregisterListener(AddonLifecycleEventListener listener)
{
// Set removed state to true immediately, then lazily remove it from the EventListeners list on next Framework Update.
listener.Removed = true;
this.framework.RunOnTick(() =>
{
this.EventListeners.Remove(listener);
@ -167,6 +171,10 @@ internal unsafe class AddonLifecycle : IInternalDisposableService
if (listener.EventType != eventType)
continue;
// If the listener is pending removal, and is waiting until the next Framework Update, don't invoke listener.
if (listener.Removed)
continue;
// Match on string.empty for listeners that want events for all addons.
if (!string.IsNullOrWhiteSpace(listener.AddonName) && !args.IsAddon(listener.AddonName))
continue;

View file

@ -26,6 +26,11 @@ internal class AddonLifecycleEventListener
/// </summary>
public string AddonName { get; init; }
/// <summary>
/// Gets or sets a value indicating whether this event has been unregistered.
/// </summary>
public bool Removed { get; set; }
/// <summary>
/// Gets the event type this listener is looking for.
/// </summary>

View file

@ -4,6 +4,7 @@ using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using Dalamud.Hooking;
using Dalamud.Logging.Internal;
using Dalamud.Memory;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Addon.Lifecycle;

View file

@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using JetBrains.Annotations;
namespace Dalamud.Game;
/// <summary>

View file

@ -4,6 +4,7 @@ using System.Collections.Generic;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using Serilog;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
@ -6,6 +5,7 @@ using System.Runtime.InteropServices;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.ClientState.Buddy;

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.ClientState.Resolvers;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState;
/// <summary>

View file

@ -1,6 +1,7 @@
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.ClientState.Conditions;

View file

@ -1,4 +1,3 @@
using System;
using System.Numerics;
using Dalamud.Data;

View file

@ -1,10 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.ClientState.Fates;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.GamePad;
/// <summary>

View file

@ -1,10 +1,10 @@
using System;
using System.Numerics;
using Dalamud.Hooking;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using ImGuiNET;
using Serilog;

View file

@ -1,6 +1,4 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Enums;
namespace Dalamud.Game.ClientState.JobGauge.Enums;
/// <summary>
/// MNK Nadi types.

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Enums;
/// <summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Reflection;
@ -6,6 +5,7 @@ using Dalamud.Game.ClientState.JobGauge.Types;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.ClientState.JobGauge;

View file

@ -1,4 +1,3 @@
using System;
using System.Linq;
using Dalamud.Game.ClientState.JobGauge.Enums;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.JobGauge.Enums;
using FFXIVClientStructs.FFXIV.Client.Game.Gauge;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Linq;
using Dalamud.Game.ClientState.JobGauge.Enums;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.JobGauge.Enums;
namespace Dalamud.Game.ClientState.JobGauge.Types;

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.JobGauge.Enums;
namespace Dalamud.Game.ClientState.JobGauge.Types;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.JobGauge.Enums;
using FFXIVClientStructs.FFXIV.Client.Game.Gauge;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
@ -6,6 +5,7 @@ using System.Runtime.InteropServices;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.ClientState.Keys;

View file

@ -1,6 +1,4 @@
using System;
namespace Dalamud.Game.ClientState.Keys;
namespace Dalamud.Game.ClientState.Keys;
/// <summary>
/// Attribute describing a VirtualKey.

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.ClientState.Objects.Enums;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.Objects.Types;
namespace Dalamud.Game.ClientState.Objects.SubKinds;

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.Objects.Types;
namespace Dalamud.Game.ClientState.Objects.SubKinds;

View file

@ -1,8 +1,7 @@
using System;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
#pragma warning disable CS0618
namespace Dalamud.Game.ClientState.Objects;

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.Statuses;
using Dalamud.Utility;

View file

@ -1,4 +1,3 @@
using System;
using System.Numerics;
using Dalamud.Game.ClientState.Objects.Enums;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
@ -6,6 +5,7 @@ using System.Runtime.InteropServices;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.ClientState.Party;

View file

@ -1,4 +1,3 @@
using System;
using System.Numerics;
using Dalamud.Game.ClientState.Objects;

View file

@ -1,4 +1,5 @@
using Dalamud.Data;
using Lumina.Excel;
namespace Dalamud.Game.ClientState.Resolvers;

View file

@ -1,5 +1,3 @@
using System;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.ClientState.Resolvers;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;

View file

@ -1,5 +1,3 @@
using System.Reflection;
namespace Dalamud.Game.Command;
/// <summary>

View file

@ -1,6 +1,4 @@
using System;
namespace Dalamud.Game.Config;
namespace Dalamud.Game.Config;
public abstract record ConfigChangeEvent(Enum Option);

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Config;
/// <summary>

View file

@ -1,7 +1,3 @@
using System;
using FFXIVClientStructs.FFXIV.Common.Configuration;
namespace Dalamud.Game.Config;
/// <summary>

View file

@ -1,7 +1,3 @@
using System;
using FFXIVClientStructs.FFXIV.Common.Configuration;
namespace Dalamud.Game.Config;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game;
/// <summary>

View file

@ -268,11 +268,15 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
foreach (var item in items)
{
if (!item.Prefix.HasValue && !item.UseDefaultPrefix)
if (!item.Prefix.HasValue)
{
item.Prefix = MenuItem.DalamudDefaultPrefix;
item.PrefixColor = MenuItem.DalamudDefaultPrefixColor;
Log.Warning($"Menu item \"{item.Name}\" has no prefix, defaulting to Dalamud's. Menu items outside of a submenu must have a prefix.");
if (!item.UseDefaultPrefix)
{
Log.Warning($"Menu item \"{item.Name}\" has no prefix, defaulting to Dalamud's. Menu items outside of a submenu must have a prefix.");
}
}
}

View file

@ -11,6 +11,7 @@ using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Logging.Internal;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Graphics;
using FFXIVClientStructs.FFXIV.Client.System.Memory;
using FFXIVClientStructs.FFXIV.Component.GUI;
@ -73,13 +74,16 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
this.configuration.QueueSave();
}
/// <inheritdoc/>
public IReadOnlyList<IReadOnlyDtrBarEntry> Entries => this.entries;
/// <inheritdoc/>
public DtrBarEntry Get(string title, SeString? text = null)
{
if (this.entries.Any(x => x.Title == title) || this.newEntries.Any(x => x.Title == title))
throw new ArgumentException("An entry with the same title already exists.");
var entry = new DtrBarEntry(title, null);
var entry = new DtrBarEntry(this.configuration, title, null);
entry.Text = text;
// Add the entry to the end of the order list, if it's not there already.
@ -196,7 +200,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
foreach (var data in this.entries)
{
var isHide = this.configuration.DtrIgnore!.Any(x => x == data.Title) || !data.Shown;
var isHide = data.UserHidden || !data.Shown;
if (data is { Dirty: true, Added: true, Text: not null, TextNode: not null })
{
@ -499,6 +503,9 @@ internal class DtrBarPluginScoped : IInternalDisposableService, IDtrBar
private readonly DtrBar dtrBarService = Service<DtrBar>.Get();
private readonly Dictionary<string, DtrBarEntry> pluginEntries = new();
/// <inheritdoc/>
public IReadOnlyList<IReadOnlyDtrBarEntry> Entries => this.dtrBarService.Entries;
/// <inheritdoc/>
void IInternalDisposableService.DisposeService()
@ -510,7 +517,7 @@ internal class DtrBarPluginScoped : IInternalDisposableService, IDtrBar
this.pluginEntries.Clear();
}
/// <inheritdoc/>
public DtrBarEntry Get(string title, SeString? text = null)
{

View file

@ -1,37 +1,114 @@
using System;
using System.Linq;
using Dalamud.Configuration.Internal;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Gui.Dtr;
/// <summary>
/// Interface representing a read-only entry in the server info bar.
/// </summary>
public interface IReadOnlyDtrBarEntry
{
/// <summary>
/// Gets the title of this entry.
/// </summary>
public string Title { get; }
/// <summary>
/// Gets a value indicating whether this entry has a click action.
/// </summary>
public bool HasClickAction { get; }
/// <summary>
/// Gets the text of this entry.
/// </summary>
public SeString Text { get; }
/// <summary>
/// Gets a tooltip to be shown when the user mouses over the dtr entry.
/// </summary>
public SeString Tooltip { get; }
/// <summary>
/// Gets a value indicating whether this entry should be shown.
/// </summary>
public bool Shown { get; }
/// <summary>
/// Gets a value indicating whether or not the user has hidden this entry from view through the Dalamud settings.
/// </summary>
public bool UserHidden { get; }
/// <summary>
/// Triggers the click action of this entry.
/// </summary>
/// <returns>True, if a click action was registered and executed.</returns>
public bool TriggerClickAction();
}
/// <summary>
/// Interface representing an entry in the server info bar.
/// </summary>
public interface IDtrBarEntry : IReadOnlyDtrBarEntry
{
/// <summary>
/// Gets or sets the text of this entry.
/// </summary>
public new SeString? Text { get; set; }
/// <summary>
/// Gets or sets a tooltip to be shown when the user mouses over the dtr entry.
/// </summary>
public new SeString? Tooltip { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this entry is visible.
/// </summary>
public new bool Shown { get; set; }
/// <summary>
/// Gets or sets a action to be invoked when the user clicks on the dtr entry.
/// </summary>
public Action? OnClick { get; set; }
/// <summary>
/// Remove this entry from the bar.
/// You will need to re-acquire it from DtrBar to reuse it.
/// </summary>
public void Remove();
}
/// <summary>
/// Class representing an entry in the server info bar.
/// </summary>
public sealed unsafe class DtrBarEntry : IDisposable
public sealed unsafe class DtrBarEntry : IDisposable, IDtrBarEntry
{
private readonly DalamudConfiguration configuration;
private bool shownBacking = true;
private SeString? textBacking = null;
private SeString? textBacking;
/// <summary>
/// Initializes a new instance of the <see cref="DtrBarEntry"/> class.
/// </summary>
/// <param name="configuration">Dalamud configuration, used to check if the entry is hidden by the user.</param>
/// <param name="title">The title of the bar entry.</param>
/// <param name="textNode">The corresponding text node.</param>
internal DtrBarEntry(string title, AtkTextNode* textNode)
internal DtrBarEntry(DalamudConfiguration configuration, string title, AtkTextNode* textNode)
{
this.configuration = configuration;
this.Title = title;
this.TextNode = textNode;
}
/// <summary>
/// Gets the title of this entry.
/// </summary>
/// <inheritdoc/>
public string Title { get; init; }
/// <summary>
/// Gets or sets the text of this entry.
/// </summary>
/// <inheritdoc cref="IDtrBarEntry.Text" />
public SeString? Text
{
get => this.textBacking;
@ -41,10 +118,8 @@ public sealed unsafe class DtrBarEntry : IDisposable
this.Dirty = true;
}
}
/// <summary>
/// Gets or sets a tooltip to be shown when the user mouses over the dtr entry.
/// </summary>
/// <inheritdoc cref="IDtrBarEntry.Tooltip" />
public SeString? Tooltip { get; set; }
/// <summary>
@ -52,9 +127,10 @@ public sealed unsafe class DtrBarEntry : IDisposable
/// </summary>
public Action? OnClick { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this entry is visible.
/// </summary>
/// <inheritdoc/>
public bool HasClickAction => this.OnClick != null;
/// <inheritdoc cref="IDtrBarEntry.Shown" />
public bool Shown
{
get => this.shownBacking;
@ -65,6 +141,10 @@ public sealed unsafe class DtrBarEntry : IDisposable
}
}
/// <inheritdoc/>
[Api10ToDo("Maybe make this config scoped to internalname?")]
public bool UserHidden => this.configuration.DtrIgnore?.Any(x => x == this.Title) ?? false;
/// <summary>
/// Gets or sets the internal text node of this entry.
/// </summary>
@ -73,17 +153,27 @@ public sealed unsafe class DtrBarEntry : IDisposable
/// <summary>
/// Gets a value indicating whether this entry should be removed.
/// </summary>
internal bool ShouldBeRemoved { get; private set; } = false;
internal bool ShouldBeRemoved { get; private set; }
/// <summary>
/// Gets or sets a value indicating whether this entry is dirty.
/// </summary>
internal bool Dirty { get; set; } = false;
internal bool Dirty { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this entry has just been added.
/// </summary>
internal bool Added { get; set; } = false;
internal bool Added { get; set; }
/// <inheritdoc/>
public bool TriggerClickAction()
{
if (this.OnClick == null)
return false;
this.OnClick.Invoke();
return true;
}
/// <summary>
/// Remove this entry from the bar.

View file

@ -7,6 +7,7 @@ using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Memory;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.Gui.FlyText;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui;
/// <summary>

View file

@ -6,6 +6,7 @@ using Dalamud.Hooking;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Services;
using Serilog;
namespace Dalamud.Game.Gui.PartyFinder;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui.PartyFinder.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui.PartyFinder.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui.PartyFinder.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui.PartyFinder.Types;
/// <summary>

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui.PartyFinder.Types;
/// <summary>

View file

@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Data;
using Dalamud.Game.Gui.PartyFinder.Internal;
using Dalamud.Game.Text.SeStringHandling;
using Lumina.Excel.GeneratedSheets;
namespace Dalamud.Game.Gui.PartyFinder.Types;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Gui.PartyFinder.Types;
/// <summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
#if !DEBUG

View file

@ -1,5 +1,3 @@
using System;
namespace Dalamud.Game.Internal.DXGI;
/// <summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;
using CheapLoc;
@ -9,6 +8,7 @@ using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Hooking;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Windowing;
using FFXIVClientStructs.FFXIV.Component.GUI;
using Serilog;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;

View file

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Dalamud.Game.Network.Internal.MarketBoardUploaders.Universalis.Types;
using Dalamud.Game.Network.Structures;
using Dalamud.Networking.Http;
using Newtonsoft.Json;
using Serilog;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View file

@ -1,4 +1,3 @@
using System;
using System.Net.Sockets;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

View file

@ -1,4 +1,3 @@
using System;
using System.IO;
namespace Dalamud.Game.Network.Structures;

View file

@ -1,4 +1,3 @@
using System;
using System.IO;
namespace Dalamud.Game.Network.Structures;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
@ -7,8 +6,6 @@ using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Iced.Intel;
using Newtonsoft.Json;
using Serilog;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
@ -6,6 +5,7 @@ using System.IO;
using Dalamud.Data;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Plugin.Services;
using Newtonsoft.Json;
using Serilog;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;

View file

@ -1,4 +1,3 @@
using System;
using System.IO;
namespace Dalamud.Game.Text.SeStringHandling.Payloads;

Some files were not shown because too many files have changed in this diff Show more