mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-02 13:53:42 +01:00
Change all IPC Testers and all SameLines.
Some checks are pending
.NET Build / build (push) Waiting to run
Some checks are pending
.NET Build / build (push) Waiting to run
This commit is contained in:
parent
548b4a7cdc
commit
2d11a0ced8
78 changed files with 917 additions and 962 deletions
2
Luna
2
Luna
|
|
@ -1 +1 @@
|
||||||
Subproject commit be965fc152dea611f6a952c5afb2047f0cb89dc2
|
Subproject commit 8fab2f1622f6ccfdab34462bd3ebe7b4947c0589
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 648b6fc2ce600a95ab2b2ced27e1639af2b04502
|
Subproject commit 97fe622e4ec0a5469a26aba8a8c3933fa8ef7fd6
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit f589b17f19c9b15fe91147a369d2480bffa75ea5
|
Subproject commit 3ea62e440aff15a856d5555bb8a0dd1862c40f59
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
using OtterGui.Log;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
|
|
@ -45,7 +44,7 @@ public class ApiHelpers(
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||||
internal static PenumbraApiEc Return(PenumbraApiEc ec, LazyString args, [CallerMemberName] string name = "Unknown")
|
internal static PenumbraApiEc Return(PenumbraApiEc ec, Lazy<string> args, [CallerMemberName] string name = "Unknown")
|
||||||
{
|
{
|
||||||
if (ec is PenumbraApiEc.Success or PenumbraApiEc.NothingChanged)
|
if (ec is PenumbraApiEc.Success or PenumbraApiEc.NothingChanged)
|
||||||
Penumbra.Log.Verbose($"[{name}] Called with {args}, returned {ec}.");
|
Penumbra.Log.Verbose($"[{name}] Called with {args}, returned {ec}.");
|
||||||
|
|
@ -55,12 +54,12 @@ public class ApiHelpers(
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||||
internal static LazyString Args(params object[] arguments)
|
internal static Lazy<string> Args(params object[] arguments)
|
||||||
{
|
{
|
||||||
if (arguments.Length == 0)
|
if (arguments.Length == 0)
|
||||||
return new LazyString(() => "no arguments");
|
return new Lazy<string>("no arguments");
|
||||||
|
|
||||||
return new LazyString(() =>
|
return new Lazy<string>(() =>
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
for (var i = 0; i < arguments.Length / 2; ++i)
|
for (var i = 0; i < arguments.Length / 2; ++i)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,12 @@ public class EditingApi(TextureManager textureManager) : IPenumbraApiEditing, Lu
|
||||||
TextureType.Bc3Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC3, mipMaps, false, inputFile, outputFile),
|
TextureType.Bc3Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC3, mipMaps, false, inputFile, outputFile),
|
||||||
TextureType.Bc7Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, true, inputFile, outputFile),
|
TextureType.Bc7Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, true, inputFile, outputFile),
|
||||||
TextureType.Bc7Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, false, inputFile, outputFile),
|
TextureType.Bc7Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, false, inputFile, outputFile),
|
||||||
|
TextureType.Bc1Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC1, mipMaps, true, inputFile, outputFile),
|
||||||
|
TextureType.Bc1Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC1, mipMaps, false, inputFile, outputFile),
|
||||||
|
TextureType.Bc4Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC4, mipMaps, true, inputFile, outputFile),
|
||||||
|
TextureType.Bc4Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC4, mipMaps, false, inputFile, outputFile),
|
||||||
|
TextureType.Bc5Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC5, mipMaps, true, inputFile, outputFile),
|
||||||
|
TextureType.Bc5Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC5, mipMaps, false, inputFile, outputFile),
|
||||||
_ => Task.FromException(new Exception($"Invalid input value {textureType}.")),
|
_ => Task.FromException(new Exception($"Invalid input value {textureType}.")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -35,6 +41,12 @@ public class EditingApi(TextureManager textureManager) : IPenumbraApiEditing, Lu
|
||||||
TextureType.Bc3Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC3, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
TextureType.Bc3Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC3, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
TextureType.Bc7Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, true, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
TextureType.Bc7Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, true, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
TextureType.Bc7Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
TextureType.Bc7Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC7, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
|
TextureType.Bc1Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC1, mipMaps, true, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
|
TextureType.Bc1Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC1, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
|
TextureType.Bc4Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC4, mipMaps, true, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
|
TextureType.Bc4Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC4, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
|
TextureType.Bc5Tex => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC5, mipMaps, true, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
|
TextureType.Bc5Dds => textureManager.SaveAs(CombinedTexture.TextureSaveType.BC5, mipMaps, false, new BaseImage(), outputFile, rgbaData, width, rgbaData.Length / 4 / width),
|
||||||
_ => Task.FromException(new Exception($"Invalid input value {textureType}.")),
|
_ => Task.FromException(new Exception($"Invalid input value {textureType}.")),
|
||||||
};
|
};
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using Luna;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui;
|
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
using Penumbra.Collections.Cache;
|
using Penumbra.Collections.Cache;
|
||||||
using Penumbra.GameData.Files.AtchStructs;
|
using Penumbra.GameData.Files.AtchStructs;
|
||||||
|
|
@ -13,7 +13,7 @@ using Penumbra.Meta.Manipulations;
|
||||||
namespace Penumbra.Api.Api;
|
namespace Penumbra.Api.Api;
|
||||||
|
|
||||||
public class MetaApi(IFramework framework, CollectionResolver collectionResolver, ApiHelpers helpers)
|
public class MetaApi(IFramework framework, CollectionResolver collectionResolver, ApiHelpers helpers)
|
||||||
: IPenumbraApiMeta, Luna.IApiService
|
: IPenumbraApiMeta, IApiService
|
||||||
{
|
{
|
||||||
public string GetPlayerMetaManipulations()
|
public string GetPlayerMetaManipulations()
|
||||||
{
|
{
|
||||||
|
|
@ -69,7 +69,7 @@ public class MetaApi(IFramework framework, CollectionResolver collectionResolver
|
||||||
MetaDictionary.SerializeTo(array, cache.Atr.Select(kvp => new KeyValuePair<AtrIdentifier, AtrEntry>(kvp.Key, kvp.Value.Entry)));
|
MetaDictionary.SerializeTo(array, cache.Atr.Select(kvp => new KeyValuePair<AtrIdentifier, AtrEntry>(kvp.Key, kvp.Value.Entry)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Functions.ToCompressedBase64(array, 0);
|
return CompressionFunctions.ToCompressedBase64(array, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static unsafe string CompressMetaManipulationsV1(ModCollection? collection)
|
private static unsafe string CompressMetaManipulationsV1(ModCollection? collection)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using OtterGui.Services;
|
using Luna;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Interop.Services;
|
using Penumbra.Interop.Services;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
using OtterGui.Log;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
|
|
@ -159,7 +158,7 @@ public class TemporaryApi(
|
||||||
}
|
}
|
||||||
|
|
||||||
private (PenumbraApiEc ErrorCode, (bool, bool, int, Dictionary<string, List<string>>)? Settings, string Source) QueryTemporaryModSettings(
|
private (PenumbraApiEc ErrorCode, (bool, bool, int, Dictionary<string, List<string>>)? Settings, string Source) QueryTemporaryModSettings(
|
||||||
in LazyString args, ModCollection collection, string modDirectory, string modName, int key)
|
Lazy<string> args, ModCollection collection, string modDirectory, string modName, int key)
|
||||||
{
|
{
|
||||||
if (!modManager.TryGetMod(modDirectory, modName, out var mod))
|
if (!modManager.TryGetMod(modDirectory, modName, out var mod))
|
||||||
return (ApiHelpers.Return(PenumbraApiEc.ModMissing, args), null, string.Empty);
|
return (ApiHelpers.Return(PenumbraApiEc.ModMissing, args), null, string.Empty);
|
||||||
|
|
@ -180,8 +179,7 @@ public class TemporaryApi(
|
||||||
|
|
||||||
|
|
||||||
public PenumbraApiEc SetTemporaryModSettings(Guid collectionId, string modDirectory, string modName, bool inherit, bool enabled,
|
public PenumbraApiEc SetTemporaryModSettings(Guid collectionId, string modDirectory, string modName, bool inherit, bool enabled,
|
||||||
int priority,
|
int priority, IReadOnlyDictionary<string, IReadOnlyList<string>> options, string source, int key)
|
||||||
IReadOnlyDictionary<string, IReadOnlyList<string>> options, string source, int key)
|
|
||||||
{
|
{
|
||||||
var args = ApiHelpers.Args("CollectionId", collectionId, "ModDirectory", modDirectory, "ModName", modName, "Inherit", inherit,
|
var args = ApiHelpers.Args("CollectionId", collectionId, "ModDirectory", modDirectory, "ModName", modName, "Inherit", inherit,
|
||||||
"Enabled", enabled,
|
"Enabled", enabled,
|
||||||
|
|
@ -205,7 +203,7 @@ public class TemporaryApi(
|
||||||
return SetTemporaryModSettings(args, collection, modDirectory, modName, inherit, enabled, priority, options, source, key);
|
return SetTemporaryModSettings(args, collection, modDirectory, modName, inherit, enabled, priority, options, source, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PenumbraApiEc SetTemporaryModSettings(in LazyString args, ModCollection collection, string modDirectory, string modName,
|
private PenumbraApiEc SetTemporaryModSettings(Lazy<string> args, ModCollection collection, string modDirectory, string modName,
|
||||||
bool inherit, bool enabled, int priority, IReadOnlyDictionary<string, IReadOnlyList<string>> options, string source, int key)
|
bool inherit, bool enabled, int priority, IReadOnlyDictionary<string, IReadOnlyList<string>> options, string source, int key)
|
||||||
{
|
{
|
||||||
if (collection.Identity.Index <= 0)
|
if (collection.Identity.Index <= 0)
|
||||||
|
|
@ -218,7 +216,7 @@ public class TemporaryApi(
|
||||||
if (collection.GetTempSettings(mod.Index) is { Lock: > 0 } oldSettings && oldSettings.Lock != key)
|
if (collection.GetTempSettings(mod.Index) is { Lock: > 0 } oldSettings && oldSettings.Lock != key)
|
||||||
return ApiHelpers.Return(PenumbraApiEc.TemporarySettingDisallowed, args);
|
return ApiHelpers.Return(PenumbraApiEc.TemporarySettingDisallowed, args);
|
||||||
|
|
||||||
var newSettings = new TemporaryModSettings()
|
var newSettings = new TemporaryModSettings
|
||||||
{
|
{
|
||||||
ForceInherit = inherit,
|
ForceInherit = inherit,
|
||||||
Enabled = enabled,
|
Enabled = enabled,
|
||||||
|
|
@ -263,7 +261,7 @@ public class TemporaryApi(
|
||||||
return RemoveTemporaryModSettings(args, collection, modDirectory, modName, key);
|
return RemoveTemporaryModSettings(args, collection, modDirectory, modName, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PenumbraApiEc RemoveTemporaryModSettings(in LazyString args, ModCollection collection, string modDirectory, string modName, int key)
|
private PenumbraApiEc RemoveTemporaryModSettings(Lazy<string> args, ModCollection collection, string modDirectory, string modName, int key)
|
||||||
{
|
{
|
||||||
if (collection.Identity.Index <= 0)
|
if (collection.Identity.Index <= 0)
|
||||||
return ApiHelpers.Return(PenumbraApiEc.NothingChanged, args);
|
return ApiHelpers.Return(PenumbraApiEc.NothingChanged, args);
|
||||||
|
|
@ -298,7 +296,7 @@ public class TemporaryApi(
|
||||||
return RemoveAllTemporaryModSettings(args, collection, key);
|
return RemoveAllTemporaryModSettings(args, collection, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PenumbraApiEc RemoveAllTemporaryModSettings(in LazyString args, ModCollection collection, int key)
|
private PenumbraApiEc RemoveAllTemporaryModSettings(Lazy<string> args, ModCollection collection, int key)
|
||||||
{
|
{
|
||||||
if (collection.Identity.Index <= 0)
|
if (collection.Identity.Index <= 0)
|
||||||
return ApiHelpers.Return(PenumbraApiEc.NothingChanged, args);
|
return ApiHelpers.Return(PenumbraApiEc.NothingChanged, args);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using OtterGui.Log;
|
using Luna;
|
||||||
using Penumbra.Api.Api;
|
using Penumbra.Api.Api;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
|
||||||
namespace Penumbra.Api;
|
namespace Penumbra.Api;
|
||||||
|
|
||||||
public sealed class IpcLaunchingProvider : Luna.IApiService
|
public sealed class IpcLaunchingProvider : IApiService
|
||||||
{
|
{
|
||||||
public IpcLaunchingProvider(IDalamudPluginInterface pi, Logger log)
|
public IpcLaunchingProvider(IDalamudPluginInterface pi, Logger log)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using Luna;
|
||||||
using Penumbra.Api.Api;
|
using Penumbra.Api.Api;
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Communication;
|
using Penumbra.Communication;
|
||||||
|
|
@ -6,7 +7,7 @@ using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
|
||||||
|
|
||||||
namespace Penumbra.Api;
|
namespace Penumbra.Api;
|
||||||
|
|
||||||
public sealed class IpcProviders : IDisposable, Luna.IApiService
|
public sealed class IpcProviders : IDisposable, IApiService, IRequiredService
|
||||||
{
|
{
|
||||||
private readonly List<IDisposable> _providers;
|
private readonly List<IDisposable> _providers;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using OtterGui;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
using Penumbra.Collections.Manager;
|
|
||||||
using Penumbra.GameData.Data;
|
using Penumbra.GameData.Data;
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
@ -11,7 +9,6 @@ namespace Penumbra.Api.IpcTester;
|
||||||
public class CollectionsIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
public class CollectionsIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
||||||
{
|
{
|
||||||
private int _objectIdx;
|
private int _objectIdx;
|
||||||
private string _collectionIdString = string.Empty;
|
|
||||||
private Guid? _collectionId;
|
private Guid? _collectionId;
|
||||||
private bool _allowCreation = true;
|
private bool _allowCreation = true;
|
||||||
private bool _allowDeletion = true;
|
private bool _allowDeletion = true;
|
||||||
|
|
@ -28,7 +25,7 @@ public class CollectionsIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGuiUtil.GenericEnumCombo("Collection Type", 200, _type, out _type, t => ((CollectionType)t).ToName());
|
EnumCombo<ApiCollectionType>.Instance.Draw("Collection Type"u8, ref _type, default, 200 * Im.Style.GlobalScale);
|
||||||
Im.Input.Scalar("Object Index##Collections"u8, ref _objectIdx);
|
Im.Input.Scalar("Object Index##Collections"u8, ref _objectIdx);
|
||||||
if (_collectionId.HasValue)
|
if (_collectionId.HasValue)
|
||||||
{
|
{
|
||||||
|
|
@ -57,7 +54,7 @@ public class CollectionsIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
||||||
table.NextRow();
|
table.NextRow();
|
||||||
table.DrawColumn(GetCollectionsByIdentifier.Label);
|
table.DrawColumn(GetCollectionsByIdentifier.Label);
|
||||||
table.DrawColumn("Collection Identifier"u8);
|
table.DrawColumn("Collection Identifier"u8);
|
||||||
var collectionList = new GetCollectionsByIdentifier(pi).Invoke(_collectionIdString);
|
var collectionList = new GetCollectionsByIdentifier(pi).Invoke(_collectionId.GetValueOrDefault().ToString());
|
||||||
if (collectionList.Count == 0)
|
if (collectionList.Count == 0)
|
||||||
{
|
{
|
||||||
DrawCollection(table, null);
|
DrawCollection(table, null);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using OtterGui;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
|
|
||||||
|
|
@ -22,48 +20,35 @@ public class EditingIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Editing");
|
using var _ = Im.Tree.Node("Editing"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputTextWithHint("##inputPath", "Input Texture Path...", ref _inputPath, 256);
|
Im.Input.Text("##inputPath"u8, ref _inputPath, "Input Texture Path..."u8);
|
||||||
ImGui.InputTextWithHint("##outputPath", "Output Texture Path...", ref _outputPath, 256);
|
Im.Input.Text("##outputPath"u8, ref _outputPath, "Output Texture Path..."u8);
|
||||||
ImGui.InputTextWithHint("##inputPath2", "Input Texture Path 2...", ref _inputPath2, 256);
|
Im.Input.Text("##inputPath2"u8, ref _inputPath2, "Input Texture Path 2..."u8);
|
||||||
ImGui.InputTextWithHint("##outputPath2", "Output Texture Path 2...", ref _outputPath2, 256);
|
Im.Input.Text("##outputPath2"u8, ref _outputPath2, "Output Texture Path 2..."u8);
|
||||||
TypeCombo();
|
EnumCombo<TextureType>.Instance.Draw("Convert To"u8, ref _typeSelector, StringU8.Empty, 200 * Im.Style.GlobalScale);
|
||||||
ImGui.Checkbox("Add MipMaps", ref _mipMaps);
|
Im.Checkbox("Add MipMaps"u8, ref _mipMaps);
|
||||||
|
|
||||||
using var table = ImRaii.Table("...", 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("..."u8, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(ConvertTextureFile.Label, (string)"Convert Texture 1");
|
IpcTester.DrawIntro(ConvertTextureFile.Label, "Convert Texture 1"u8);
|
||||||
if (ImGuiUtil.DrawDisabledButton("Save 1", Vector2.Zero, string.Empty, _task1 is { IsCompleted: false }))
|
if (ImEx.Button("Save 1"u8, Vector2.Zero, StringU8.Empty, _task1 is { IsCompleted: false }))
|
||||||
_task1 = new ConvertTextureFile(pi).Invoke(_inputPath, _outputPath, _typeSelector, _mipMaps);
|
_task1 = new ConvertTextureFile(pi).Invoke(_inputPath, _outputPath, _typeSelector, _mipMaps);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_task1 == null ? "Not Initiated" : _task1.Status.ToString());
|
Im.Text(_task1 is null ? "Not Initiated"u8 : $"{_task1.Status}");
|
||||||
if (ImGui.IsItemHovered() && _task1?.Status == TaskStatus.Faulted)
|
if (Im.Item.Hovered() && _task1?.Status is TaskStatus.Faulted)
|
||||||
ImGui.SetTooltip(_task1.Exception?.ToString());
|
Im.Tooltip.Set($"{_task1.Exception}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(ConvertTextureFile.Label, (string)"Convert Texture 2");
|
IpcTester.DrawIntro(ConvertTextureFile.Label, "Convert Texture 2"u8);
|
||||||
if (ImGuiUtil.DrawDisabledButton("Save 2", Vector2.Zero, string.Empty, _task2 is { IsCompleted: false }))
|
if (ImEx.Button("Save 2"u8, Vector2.Zero, StringU8.Empty, _task2 is { IsCompleted: false }))
|
||||||
_task2 = new ConvertTextureFile(pi).Invoke(_inputPath2, _outputPath2, _typeSelector, _mipMaps);
|
_task2 = new ConvertTextureFile(pi).Invoke(_inputPath2, _outputPath2, _typeSelector, _mipMaps);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_task2 == null ? "Not Initiated" : _task2.Status.ToString());
|
Im.Text(_task2 is null ? "Not Initiated"u8 : $"{_task2.Status}");
|
||||||
if (ImGui.IsItemHovered() && _task2?.Status == TaskStatus.Faulted)
|
if (Im.Item.Hovered() && _task2?.Status is TaskStatus.Faulted)
|
||||||
ImGui.SetTooltip(_task2.Exception?.ToString());
|
Im.Tooltip.Set($"{_task2.Exception}");
|
||||||
}
|
|
||||||
|
|
||||||
private void TypeCombo()
|
|
||||||
{
|
|
||||||
using var combo = ImRaii.Combo("Convert To", _typeSelector.ToString());
|
|
||||||
if (!combo)
|
|
||||||
return;
|
|
||||||
|
|
||||||
foreach (var value in Enum.GetValues<TextureType>())
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(value.ToString(), _typeSelector == value))
|
|
||||||
_typeSelector = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using OtterGui.Raii;
|
using ImSharp;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
using Penumbra.String;
|
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
|
|
@ -16,14 +13,14 @@ public class GameStateIpcTester : Luna.IUiService, IDisposable
|
||||||
public readonly EventSubscriber<nint, Guid, nint> CharacterBaseCreated;
|
public readonly EventSubscriber<nint, Guid, nint> CharacterBaseCreated;
|
||||||
public readonly EventSubscriber<nint, string, string> GameObjectResourcePathResolved;
|
public readonly EventSubscriber<nint, string, string> GameObjectResourcePathResolved;
|
||||||
|
|
||||||
private string _lastCreatedGameObjectName = string.Empty;
|
private StringU8 _lastCreatedGameObjectName = StringU8.Empty;
|
||||||
private nint _lastCreatedDrawObject = nint.Zero;
|
private nint _lastCreatedDrawObject = nint.Zero;
|
||||||
private DateTimeOffset _lastCreatedGameObjectTime = DateTimeOffset.MaxValue;
|
private DateTimeOffset _lastCreatedGameObjectTime = DateTimeOffset.MaxValue;
|
||||||
private string _lastResolvedGamePath = string.Empty;
|
private string _lastResolvedGamePath = string.Empty;
|
||||||
private string _lastResolvedFullPath = string.Empty;
|
private string _lastResolvedFullPath = string.Empty;
|
||||||
private string _lastResolvedObject = string.Empty;
|
private StringU8 _lastResolvedObject = StringU8.Empty;
|
||||||
private DateTimeOffset _lastResolvedGamePathTime = DateTimeOffset.MaxValue;
|
private DateTimeOffset _lastResolvedGamePathTime = DateTimeOffset.MaxValue;
|
||||||
private string _currentDrawObjectString = string.Empty;
|
private StringU8 _currentDrawObjectString = StringU8.Empty;
|
||||||
private nint _currentDrawObject = nint.Zero;
|
private nint _currentDrawObject = nint.Zero;
|
||||||
private int _currentCutsceneActor;
|
private int _currentCutsceneActor;
|
||||||
private int _currentCutsceneParent;
|
private int _currentCutsceneParent;
|
||||||
|
|
@ -49,63 +46,58 @@ public class GameStateIpcTester : Luna.IUiService, IDisposable
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Game State");
|
using var _ = Im.Tree.Node("Game State"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ImGui.InputTextWithHint("##drawObject", "Draw Object Address..", ref _currentDrawObjectString, 16,
|
if (Im.Input.Text("##drawObject"u8, ref _currentDrawObjectString, "Draw Object Address.."u8, InputTextFlags.CharsHexadecimal))
|
||||||
ImGuiInputTextFlags.CharsHexadecimal))
|
|
||||||
_currentDrawObject = nint.TryParse(_currentDrawObjectString, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
_currentDrawObject = nint.TryParse(_currentDrawObjectString, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||||
out var tmp)
|
out var tmp)
|
||||||
? tmp
|
? tmp
|
||||||
: nint.Zero;
|
: nint.Zero;
|
||||||
|
|
||||||
ImGui.InputInt("Cutscene Actor", ref _currentCutsceneActor, 0);
|
Im.Input.Scalar("Cutscene Actor"u8, ref _currentCutsceneActor);
|
||||||
ImGui.InputInt("Cutscene Parent", ref _currentCutsceneParent, 0);
|
Im.Input.Scalar("Cutscene Parent"u8, ref _currentCutsceneParent);
|
||||||
if (_cutsceneError is not PenumbraApiEc.Success)
|
if (_cutsceneError is not PenumbraApiEc.Success)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted("Invalid Argument on last Call");
|
Im.Text("Invalid Argument on last Call"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetDrawObjectInfo.Label, "Draw Object Info");
|
IpcTester.DrawIntro(GetDrawObjectInfo.Label, "Draw Object Info"u8);
|
||||||
if (_currentDrawObject == nint.Zero)
|
if (_currentDrawObject == nint.Zero)
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted("Invalid");
|
Im.Text("Invalid"u8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var (ptr, (collectionId, collectionName)) = new GetDrawObjectInfo(_pi).Invoke(_currentDrawObject);
|
var (ptr, (collectionId, collectionName)) = new GetDrawObjectInfo(_pi).Invoke(_currentDrawObject);
|
||||||
ImGui.TextUnformatted(ptr == nint.Zero ? $"No Actor Associated, {collectionName}" : $"{ptr:X}, {collectionName}");
|
Im.Text(ptr == nint.Zero ? $"No Actor Associated, {collectionName}" : $"{ptr:X}, {collectionName}");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
ImEx.MonoText($"{collectionId}");
|
||||||
{
|
|
||||||
ImGui.TextUnformatted(collectionId.ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetCutsceneParentIndex.Label, "Cutscene Parent");
|
IpcTester.DrawIntro(GetCutsceneParentIndex.Label, "Cutscene Parent"u8);
|
||||||
ImGui.TextUnformatted(new GetCutsceneParentIndex(_pi).Invoke(_currentCutsceneActor).ToString());
|
Im.Text($"{new GetCutsceneParentIndex(_pi).Invoke(_currentCutsceneActor)}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(SetCutsceneParentIndex.Label, "Cutscene Parent");
|
IpcTester.DrawIntro(SetCutsceneParentIndex.Label, "Cutscene Parent"u8);
|
||||||
if (ImGui.Button("Set Parent"))
|
if (Im.Button("Set Parent"u8))
|
||||||
_cutsceneError = new SetCutsceneParentIndex(_pi)
|
_cutsceneError = new SetCutsceneParentIndex(_pi)
|
||||||
.Invoke(_currentCutsceneActor, _currentCutsceneParent);
|
.Invoke(_currentCutsceneActor, _currentCutsceneParent);
|
||||||
|
|
||||||
IpcTester.DrawIntro(CreatingCharacterBase.Label, "Last Drawobject created");
|
IpcTester.DrawIntro(CreatingCharacterBase.Label, "Last Drawobject created"u8);
|
||||||
if (_lastCreatedGameObjectTime < DateTimeOffset.Now)
|
if (_lastCreatedGameObjectTime < DateTimeOffset.Now)
|
||||||
ImGui.TextUnformatted(_lastCreatedDrawObject != nint.Zero
|
Im.Text(_lastCreatedDrawObject != nint.Zero
|
||||||
? $"0x{_lastCreatedDrawObject:X} for <{_lastCreatedGameObjectName}> at {_lastCreatedGameObjectTime}"
|
? $"0x{_lastCreatedDrawObject:X} for <{_lastCreatedGameObjectName}> at {_lastCreatedGameObjectTime}"
|
||||||
: $"NULL for <{_lastCreatedGameObjectName}> at {_lastCreatedGameObjectTime}");
|
: $"NULL for <{_lastCreatedGameObjectName}> at {_lastCreatedGameObjectTime}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(IpcSubscribers.GameObjectResourcePathResolved.Label, "Last GamePath resolved");
|
IpcTester.DrawIntro(IpcSubscribers.GameObjectResourcePathResolved.Label, "Last GamePath resolved"u8);
|
||||||
if (_lastResolvedGamePathTime < DateTimeOffset.Now)
|
if (_lastResolvedGamePathTime < DateTimeOffset.Now)
|
||||||
ImGui.TextUnformatted(
|
Im.Text($"{_lastResolvedGamePath} -> {_lastResolvedFullPath} for <{_lastResolvedObject}> at {_lastResolvedGamePathTime}");
|
||||||
$"{_lastResolvedGamePath} -> {_lastResolvedFullPath} for <{_lastResolvedObject}> at {_lastResolvedGamePathTime}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateLastCreated(nint gameObject, Guid _, nint _2, nint _3, nint _4)
|
private void UpdateLastCreated(nint gameObject, Guid _, nint _2, nint _3, nint _4)
|
||||||
|
|
@ -130,9 +122,9 @@ public class GameStateIpcTester : Luna.IUiService, IDisposable
|
||||||
_lastResolvedGamePathTime = DateTimeOffset.Now;
|
_lastResolvedGamePathTime = DateTimeOffset.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static unsafe string GetObjectName(nint gameObject)
|
private static unsafe StringU8 GetObjectName(nint gameObject)
|
||||||
{
|
{
|
||||||
var obj = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)gameObject;
|
var obj = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)gameObject;
|
||||||
return obj != null && obj->Name[0] != 0 ? new ByteString(obj->Name).ToString() : "Unknown";
|
return new StringU8(obj is not null && obj->Name[0] != 0 ? obj->Name : "Unknown"u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using Penumbra.Api.Api;
|
using Penumbra.Api.Api;
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
public class IpcTester(
|
public class IpcTester(
|
||||||
IpcProviders ipcProviders,
|
|
||||||
IPenumbraApi api,
|
IPenumbraApi api,
|
||||||
PluginStateIpcTester pluginStateIpcTester,
|
PluginStateIpcTester pluginStateIpcTester,
|
||||||
UiIpcTester uiIpcTester,
|
UiIpcTester uiIpcTester,
|
||||||
|
|
@ -22,9 +20,8 @@ public class IpcTester(
|
||||||
ResourceTreeIpcTester resourceTreeIpcTester,
|
ResourceTreeIpcTester resourceTreeIpcTester,
|
||||||
IFramework framework) : Luna.IUiService
|
IFramework framework) : Luna.IUiService
|
||||||
{
|
{
|
||||||
private readonly IpcProviders _ipcProviders = ipcProviders;
|
private DateTime _lastUpdate;
|
||||||
private DateTime _lastUpdate;
|
private bool _subscribed;
|
||||||
private bool _subscribed = false;
|
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
|
|
@ -33,7 +30,7 @@ public class IpcTester(
|
||||||
_lastUpdate = framework.LastUpdateUTC.AddSeconds(1);
|
_lastUpdate = framework.LastUpdateUTC.AddSeconds(1);
|
||||||
Subscribe();
|
Subscribe();
|
||||||
|
|
||||||
ImGui.TextUnformatted($"API Version: {api.ApiVersion.Breaking}.{api.ApiVersion.Feature:D4}");
|
Im.Text($"API Version: {api.ApiVersion.Breaking}.{api.ApiVersion.Feature:D4}");
|
||||||
collectionsIpcTester.Draw();
|
collectionsIpcTester.Draw();
|
||||||
editingIpcTester.Draw();
|
editingIpcTester.Draw();
|
||||||
gameStateIpcTester.Draw();
|
gameStateIpcTester.Draw();
|
||||||
|
|
@ -57,12 +54,9 @@ public class IpcTester(
|
||||||
|
|
||||||
internal static void DrawIntro(Utf8StringHandler<LabelStringHandlerBuffer> label, Utf8StringHandler<TextStringHandlerBuffer> info)
|
internal static void DrawIntro(Utf8StringHandler<LabelStringHandlerBuffer> label, Utf8StringHandler<TextStringHandlerBuffer> info)
|
||||||
{
|
{
|
||||||
ImGui.TableNextRow();
|
Im.Table.NextRow();
|
||||||
ImGui.TableNextColumn();
|
Im.Table.DrawColumn(ref label);
|
||||||
Im.Text(ref label);
|
Im.Table.DrawColumn(ref info);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
Im.Text(ref info);
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Subscribe()
|
private void Subscribe()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using OtterGui.Raii;
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Api.Api;
|
using Penumbra.Api.Api;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
|
|
@ -17,35 +15,34 @@ public class MetaIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Meta");
|
using var _ = Im.Tree.Node("Meta"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputInt("##metaIdx", ref _gameObjectIndex, 0, 0);
|
Im.Input.Scalar("##metaIdx"u8, ref _gameObjectIndex);
|
||||||
if (ImUtf8.InputText("##metaText"u8, ref _metaBase64, "Base64 Metadata..."u8))
|
if (Im.Input.Text("##metaText"u8, ref _metaBase64, "Base64 Metadata..."u8))
|
||||||
if (!MetaApi.ConvertManips(_metaBase64, out _metaDict!, out _parsedVersion))
|
_metaDict = MetaApi.ConvertManips(_metaBase64, out var m, out _parsedVersion) ? m : new MetaDictionary();
|
||||||
_metaDict ??= new MetaDictionary();
|
|
||||||
|
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetPlayerMetaManipulations.Label, "Player Meta Manipulations");
|
IpcTester.DrawIntro(GetPlayerMetaManipulations.Label, "Player Meta Manipulations"u8);
|
||||||
if (ImGui.Button("Copy to Clipboard##Player"))
|
if (Im.Button("Copy to Clipboard##Player"u8))
|
||||||
{
|
{
|
||||||
var base64 = new GetPlayerMetaManipulations(pi).Invoke();
|
var base64 = new GetPlayerMetaManipulations(pi).Invoke();
|
||||||
ImGui.SetClipboardText(base64);
|
Im.Clipboard.Set(base64);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetMetaManipulations.Label, "Game Object Manipulations");
|
IpcTester.DrawIntro(GetMetaManipulations.Label, "Game Object Manipulations"u8);
|
||||||
if (ImGui.Button("Copy to Clipboard##GameObject"))
|
if (Im.Button("Copy to Clipboard##GameObject"u8))
|
||||||
{
|
{
|
||||||
var base64 = new GetMetaManipulations(pi).Invoke(_gameObjectIndex);
|
var base64 = new GetMetaManipulations(pi).Invoke(_gameObjectIndex);
|
||||||
ImGui.SetClipboardText(base64);
|
Im.Clipboard.Set(base64);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(string.Empty, "Parsed Data");
|
IpcTester.DrawIntro(string.Empty, "Parsed Data"u8);
|
||||||
ImUtf8.Text($"Version: {_parsedVersion}, Count: {_metaDict.Count}");
|
Im.Text($"Version: {_parsedVersion}, Count: {_metaDict.Count}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,14 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using OtterGui;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
using Penumbra.UI;
|
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
public class ModSettingsIpcTester : Luna.IUiService, IDisposable
|
public class ModSettingsIpcTester : Luna.IUiService, IDisposable
|
||||||
{
|
{
|
||||||
private readonly IDalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
public readonly EventSubscriber<ModSettingChange, Guid, string, bool> SettingChanged;
|
public readonly EventSubscriber<ModSettingChange, Guid, string, bool> SettingChanged;
|
||||||
|
|
||||||
private PenumbraApiEc _lastSettingsError = PenumbraApiEc.Success;
|
private PenumbraApiEc _lastSettingsError = PenumbraApiEc.Success;
|
||||||
|
|
@ -51,43 +47,43 @@ public class ModSettingsIpcTester : Luna.IUiService, IDisposable
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Mod Settings");
|
using var _ = Im.Tree.Node("Mod Settings"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputTextWithHint("##settingsDir", "Mod Directory Name...", ref _settingsModDirectory, 100);
|
Im.Input.Text("##settingsDir"u8, ref _settingsModDirectory, "Mod Directory Name..."u8);
|
||||||
ImGui.InputTextWithHint("##settingsName", "Mod Name...", ref _settingsModName, 100);
|
Im.Input.Text("##settingsName"u8, ref _settingsModName, "Mod Name..."u8);
|
||||||
ImGuiUtil.GuidInput("##settingsCollection", "Collection...", string.Empty, ref _settingsCollection, ref _settingsCollectionName);
|
ImEx.GuidInput("##settingsCollection"u8, ref _settingsCollection, "Collection..."u8);
|
||||||
ImUtf8.Checkbox("Ignore Inheritance"u8, ref _settingsIgnoreInheritance);
|
Im.Checkbox("Ignore Inheritance"u8, ref _settingsIgnoreInheritance);
|
||||||
ImUtf8.Checkbox("Ignore Temporary"u8, ref _settingsIgnoreTemporary);
|
Im.Checkbox("Ignore Temporary"u8, ref _settingsIgnoreTemporary);
|
||||||
ImUtf8.InputScalar("Key"u8, ref _settingsKey);
|
Im.Input.Scalar("Key"u8, ref _settingsKey);
|
||||||
var collection = _settingsCollection.GetValueOrDefault(Guid.Empty);
|
var collection = _settingsCollection.GetValueOrDefault(Guid.Empty);
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro("Last Error", _lastSettingsError.ToString());
|
IpcTester.DrawIntro("Last Error"u8, $"{_lastSettingsError}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(ModSettingChanged.Label, "Last Mod Setting Changed");
|
IpcTester.DrawIntro(ModSettingChanged.Label, "Last Mod Setting Changed"u8);
|
||||||
ImGui.TextUnformatted(_lastSettingChangeMod.Length > 0
|
Im.Text(_lastSettingChangeMod.Length > 0
|
||||||
? $"{_lastSettingChangeType} of {_lastSettingChangeMod} in {_lastSettingChangeCollection}{(_lastSettingChangeInherited ? " (Inherited)" : string.Empty)} at {_lastSettingChange}"
|
? $"{_lastSettingChangeType} of {_lastSettingChangeMod} in {_lastSettingChangeCollection}{(_lastSettingChangeInherited ? " (Inherited)" : string.Empty)} at {_lastSettingChange}"
|
||||||
: "None");
|
: "None"u8);
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetAvailableModSettings.Label, "Get Available Settings");
|
IpcTester.DrawIntro(GetAvailableModSettings.Label, "Get Available Settings"u8);
|
||||||
if (ImGui.Button("Get##Available"))
|
if (Im.Button("Get##Available"u8))
|
||||||
{
|
{
|
||||||
_availableSettings = new GetAvailableModSettings(_pi).Invoke(_settingsModDirectory, _settingsModName);
|
_availableSettings = new GetAvailableModSettings(_pi).Invoke(_settingsModDirectory, _settingsModName);
|
||||||
_lastSettingsError = _availableSettings == null ? PenumbraApiEc.ModMissing : PenumbraApiEc.Success;
|
_lastSettingsError = _availableSettings == null ? PenumbraApiEc.ModMissing : PenumbraApiEc.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetCurrentModSettings.Label, "Get Current Settings");
|
IpcTester.DrawIntro(GetCurrentModSettings.Label, "Get Current Settings"u8);
|
||||||
if (ImGui.Button("Get##Current"))
|
if (Im.Button("Get##Current"u8))
|
||||||
{
|
{
|
||||||
var ret = new GetCurrentModSettings(_pi)
|
var ret = new GetCurrentModSettings(_pi)
|
||||||
.Invoke(collection, _settingsModDirectory, _settingsModName, _settingsIgnoreInheritance);
|
.Invoke(collection, _settingsModDirectory, _settingsModName, _settingsIgnoreInheritance);
|
||||||
_lastSettingsError = ret.Item1;
|
_lastSettingsError = ret.Item1;
|
||||||
if (ret.Item1 == PenumbraApiEc.Success)
|
if (ret.Item1 is PenumbraApiEc.Success)
|
||||||
{
|
{
|
||||||
_settingsEnabled = ret.Item2?.Item1 ?? false;
|
_settingsEnabled = ret.Item2?.Item1 ?? false;
|
||||||
_settingsInherit = ret.Item2?.Item4 ?? true;
|
_settingsInherit = ret.Item2?.Item4 ?? true;
|
||||||
|
|
@ -101,13 +97,14 @@ public class ModSettingsIpcTester : Luna.IUiService, IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetCurrentModSettingsWithTemp.Label, "Get Current Settings With Temp");
|
IpcTester.DrawIntro(GetCurrentModSettingsWithTemp.Label, "Get Current Settings With Temp"u8);
|
||||||
if (ImGui.Button("Get##CurrentTemp"))
|
if (Im.Button("Get##CurrentTemp"u8))
|
||||||
{
|
{
|
||||||
var ret = new GetCurrentModSettingsWithTemp(_pi)
|
var ret = new GetCurrentModSettingsWithTemp(_pi)
|
||||||
.Invoke(collection, _settingsModDirectory, _settingsModName, _settingsIgnoreInheritance, _settingsIgnoreTemporary, _settingsKey);
|
.Invoke(collection, _settingsModDirectory, _settingsModName, _settingsIgnoreInheritance, _settingsIgnoreTemporary,
|
||||||
|
_settingsKey);
|
||||||
_lastSettingsError = ret.Item1;
|
_lastSettingsError = ret.Item1;
|
||||||
if (ret.Item1 == PenumbraApiEc.Success)
|
if (ret.Item1 is PenumbraApiEc.Success)
|
||||||
{
|
{
|
||||||
_settingsEnabled = ret.Item2?.Item1 ?? false;
|
_settingsEnabled = ret.Item2?.Item1 ?? false;
|
||||||
_settingsInherit = ret.Item2?.Item4 ?? true;
|
_settingsInherit = ret.Item2?.Item4 ?? true;
|
||||||
|
|
@ -120,77 +117,76 @@ public class ModSettingsIpcTester : Luna.IUiService, IDisposable
|
||||||
_currentSettings = null;
|
_currentSettings = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetAllModSettings.Label, "Get All Mod Settings");
|
IpcTester.DrawIntro(GetAllModSettings.Label, "Get All Mod Settings"u8);
|
||||||
if (ImGui.Button("Get##All"))
|
if (Im.Button("Get##All"u8))
|
||||||
{
|
{
|
||||||
var ret = new GetAllModSettings(_pi).Invoke(collection, _settingsIgnoreInheritance, _settingsIgnoreTemporary, _settingsKey);
|
var ret = new GetAllModSettings(_pi).Invoke(collection, _settingsIgnoreInheritance, _settingsIgnoreTemporary, _settingsKey);
|
||||||
_lastSettingsError = ret.Item1;
|
_lastSettingsError = ret.Item1;
|
||||||
_allSettings = ret.Item2;
|
_allSettings = ret.Item2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_allSettings != null)
|
if (_allSettings is not null)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Text($"{_allSettings.Count} Mods");
|
Im.Text($"{_allSettings.Count} Mods");
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(TryInheritMod.Label, "Inherit Mod");
|
IpcTester.DrawIntro(TryInheritMod.Label, "Inherit Mod"u8);
|
||||||
ImGui.Checkbox("##inherit", ref _settingsInherit);
|
Im.Checkbox("##inherit"u8, ref _settingsInherit);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Set##Inherit"))
|
if (Im.Button("Set##Inherit"u8))
|
||||||
_lastSettingsError = new TryInheritMod(_pi)
|
_lastSettingsError = new TryInheritMod(_pi)
|
||||||
.Invoke(collection, _settingsModDirectory, _settingsInherit, _settingsModName);
|
.Invoke(collection, _settingsModDirectory, _settingsInherit, _settingsModName);
|
||||||
|
|
||||||
IpcTester.DrawIntro(TrySetMod.Label, "Set Enabled");
|
IpcTester.DrawIntro(TrySetMod.Label, "Set Enabled"u8);
|
||||||
ImGui.Checkbox("##enabled", ref _settingsEnabled);
|
Im.Checkbox("##enabled"u8, ref _settingsEnabled);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Set##Enabled"))
|
if (Im.Button("Set##Enabled"u8))
|
||||||
_lastSettingsError = new TrySetMod(_pi)
|
_lastSettingsError = new TrySetMod(_pi)
|
||||||
.Invoke(collection, _settingsModDirectory, _settingsEnabled, _settingsModName);
|
.Invoke(collection, _settingsModDirectory, _settingsEnabled, _settingsModName);
|
||||||
|
|
||||||
IpcTester.DrawIntro(TrySetModPriority.Label, "Set Priority");
|
IpcTester.DrawIntro(TrySetModPriority.Label, "Set Priority"u8);
|
||||||
ImGui.SetNextItemWidth(200 * UiHelpers.Scale);
|
Im.Item.SetNextWidthScaled(200);
|
||||||
ImGui.DragInt("##Priority", ref _settingsPriority);
|
Im.Drag("##Priority"u8, ref _settingsPriority);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Set##Priority"))
|
if (Im.Button("Set##Priority"u8))
|
||||||
_lastSettingsError = new TrySetModPriority(_pi)
|
_lastSettingsError = new TrySetModPriority(_pi)
|
||||||
.Invoke(collection, _settingsModDirectory, _settingsPriority, _settingsModName);
|
.Invoke(collection, _settingsModDirectory, _settingsPriority, _settingsModName);
|
||||||
|
|
||||||
IpcTester.DrawIntro(CopyModSettings.Label, "Copy Mod Settings");
|
IpcTester.DrawIntro(CopyModSettings.Label, "Copy Mod Settings"u8);
|
||||||
if (ImGui.Button("Copy Settings"))
|
if (Im.Button("Copy Settings"u8))
|
||||||
_lastSettingsError = new CopyModSettings(_pi)
|
_lastSettingsError = new CopyModSettings(_pi)
|
||||||
.Invoke(_settingsCollection, _settingsModDirectory, _settingsModName);
|
.Invoke(_settingsCollection, _settingsModDirectory, _settingsModName);
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip("Copy settings from Mod Directory Name to Mod Name (as directory) in collection.");
|
Im.Tooltip.OnHover("Copy settings from Mod Directory Name to Mod Name (as directory) in collection."u8);
|
||||||
|
|
||||||
IpcTester.DrawIntro(TrySetModSetting.Label, "Set Setting(s)");
|
IpcTester.DrawIntro(TrySetModSetting.Label, "Set Setting(s)"u8);
|
||||||
if (_availableSettings == null)
|
if (_availableSettings == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var (group, (list, type)) in _availableSettings)
|
foreach (var (group, (list, type)) in _availableSettings)
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId(group);
|
using var id = Im.Id.Push(group);
|
||||||
var preview = list.Length > 0 ? list[0] : string.Empty;
|
var preview = list.Length > 0 ? list[0] : string.Empty;
|
||||||
if (_currentSettings != null && _currentSettings.TryGetValue(group, out var current) && current.Count > 0)
|
if (_currentSettings is not null && _currentSettings.TryGetValue(group, out var current) && current.Count > 0)
|
||||||
{
|
{
|
||||||
preview = current[0];
|
preview = current[0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
current = [];
|
current = [];
|
||||||
if (_currentSettings != null)
|
_currentSettings?[group] = current;
|
||||||
_currentSettings[group] = current;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(200 * UiHelpers.Scale);
|
Im.Item.SetNextWidthScaled(200);
|
||||||
using (var c = ImRaii.Combo("##group", preview))
|
using (var c = Im.Combo.Begin("##group"u8, preview))
|
||||||
{
|
{
|
||||||
if (c)
|
if (c)
|
||||||
foreach (var s in list)
|
foreach (var s in list)
|
||||||
{
|
{
|
||||||
var contained = current.Contains(s);
|
var contained = current.Contains(s);
|
||||||
if (ImGui.Checkbox(s, ref contained))
|
if (Im.Checkbox(s, ref contained))
|
||||||
{
|
{
|
||||||
if (contained)
|
if (contained)
|
||||||
current.Add(s);
|
current.Add(s);
|
||||||
|
|
@ -200,15 +196,15 @@ public class ModSettingsIpcTester : Luna.IUiService, IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Set##setting"))
|
if (Im.Button("Set##setting"u8))
|
||||||
_lastSettingsError = type == GroupType.Single
|
_lastSettingsError = type is GroupType.Single
|
||||||
? new TrySetModSetting(_pi).Invoke(collection, _settingsModDirectory, group, current.Count > 0 ? current[0] : string.Empty,
|
? new TrySetModSetting(_pi).Invoke(collection, _settingsModDirectory, group, current.Count > 0 ? current[0] : string.Empty,
|
||||||
_settingsModName)
|
_settingsModName)
|
||||||
: new TrySetModSettings(_pi).Invoke(collection, _settingsModDirectory, group, current.ToArray(), _settingsModName);
|
: new TrySetModSettings(_pi).Invoke(collection, _settingsModDirectory, group, current.ToArray(), _settingsModName);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(group);
|
Im.Text(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using OtterGui.Raii;
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
|
|
@ -73,111 +70,111 @@ public class ModsIpcTester : Luna.IUiService, IDisposable
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Mods");
|
using var _ = Im.Tree.Node("Mods"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputTextWithHint("##install", "Install File Path...", ref _newInstallPath, 100);
|
Im.Input.Text("##install"u8, ref _newInstallPath, "Install File Path..."u8);
|
||||||
ImGui.InputTextWithHint("##modDir", "Mod Directory Name...", ref _modDirectory, 100);
|
Im.Input.Text("##modDir"u8, ref _modDirectory, "Mod Directory Name..."u8);
|
||||||
ImGui.InputTextWithHint("##modName", "Mod Name...", ref _modName, 100);
|
Im.Input.Text("##modName"u8, ref _modName, "Mod Name..."u8);
|
||||||
ImGui.InputTextWithHint("##path", "New Path...", ref _pathInput, 100);
|
Im.Input.Text("##path"u8, ref _pathInput, "New Path..."u8);
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetModList.Label, "Mods");
|
IpcTester.DrawIntro(GetModList.Label, "Mods"u8);
|
||||||
DrawModsPopup();
|
DrawModsPopup();
|
||||||
if (ImGui.Button("Get##Mods"))
|
if (Im.Button("Get##Mods"u8))
|
||||||
{
|
{
|
||||||
_mods = new GetModList(_pi).Invoke();
|
_mods = new GetModList(_pi).Invoke();
|
||||||
ImGui.OpenPopup("Mods");
|
Im.Popup.Open("Mods"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(ReloadMod.Label, "Reload Mod");
|
IpcTester.DrawIntro(ReloadMod.Label, "Reload Mod"u8);
|
||||||
if (ImGui.Button("Reload"))
|
if (Im.Button("Reload"u8))
|
||||||
_lastReloadEc = new ReloadMod(_pi).Invoke(_modDirectory, _modName);
|
_lastReloadEc = new ReloadMod(_pi).Invoke(_modDirectory, _modName);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastReloadEc.ToString());
|
Im.Text($"{_lastReloadEc}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(InstallMod.Label, "Install Mod");
|
IpcTester.DrawIntro(InstallMod.Label, "Install Mod"u8);
|
||||||
if (ImGui.Button("Install"))
|
if (Im.Button("Install"u8))
|
||||||
_lastInstallEc = new InstallMod(_pi).Invoke(_newInstallPath);
|
_lastInstallEc = new InstallMod(_pi).Invoke(_newInstallPath);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastInstallEc.ToString());
|
Im.Text($"{_lastInstallEc}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(AddMod.Label, "Add Mod");
|
IpcTester.DrawIntro(AddMod.Label, "Add Mod"u8);
|
||||||
if (ImGui.Button("Add"))
|
if (Im.Button("Add"u8))
|
||||||
_lastAddEc = new AddMod(_pi).Invoke(_modDirectory);
|
_lastAddEc = new AddMod(_pi).Invoke(_modDirectory);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastAddEc.ToString());
|
Im.Text($"{_lastAddEc}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(DeleteMod.Label, "Delete Mod");
|
IpcTester.DrawIntro(DeleteMod.Label, "Delete Mod"u8);
|
||||||
if (ImGui.Button("Delete"))
|
if (Im.Button("Delete"u8))
|
||||||
_lastDeleteEc = new DeleteMod(_pi).Invoke(_modDirectory, _modName);
|
_lastDeleteEc = new DeleteMod(_pi).Invoke(_modDirectory, _modName);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastDeleteEc.ToString());
|
Im.Text(_lastDeleteEc.ToString());
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetChangedItems.Label, "Get Changed Items");
|
IpcTester.DrawIntro(GetChangedItems.Label, "Get Changed Items"u8);
|
||||||
DrawChangedItemsPopup();
|
DrawChangedItemsPopup();
|
||||||
if (ImUtf8.Button("Get##ChangedItems"u8))
|
if (Im.Button("Get##ChangedItems"u8))
|
||||||
{
|
{
|
||||||
_changedItems = new GetChangedItems(_pi).Invoke(_modDirectory, _modName);
|
_changedItems = new GetChangedItems(_pi).Invoke(_modDirectory, _modName);
|
||||||
ImUtf8.OpenPopup("ChangedItems"u8);
|
Im.Popup.Open("ChangedItems"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetModPath.Label, "Current Path");
|
IpcTester.DrawIntro(GetModPath.Label, "Current Path"u8);
|
||||||
var (ec, path, def, nameDef) = new GetModPath(_pi).Invoke(_modDirectory, _modName);
|
var (ec, path, def, nameDef) = new GetModPath(_pi).Invoke(_modDirectory, _modName);
|
||||||
ImGui.TextUnformatted($"{path} ({(def ? "Custom" : "Default")} Path, {(nameDef ? "Custom" : "Default")} Name) [{ec}]");
|
Im.Text($"{path} ({(def ? "Custom" : "Default")} Path, {(nameDef ? "Custom" : "Default")} Name) [{ec}]");
|
||||||
|
|
||||||
IpcTester.DrawIntro(SetModPath.Label, "Set Path");
|
IpcTester.DrawIntro(SetModPath.Label, "Set Path"u8);
|
||||||
if (ImGui.Button("Set"))
|
if (Im.Button("Set"u8))
|
||||||
_lastSetPathEc = new SetModPath(_pi).Invoke(_modDirectory, _pathInput, _modName);
|
_lastSetPathEc = new SetModPath(_pi).Invoke(_modDirectory, _pathInput, _modName);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastSetPathEc.ToString());
|
Im.Text($"{_lastSetPathEc}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(ModDeleted.Label, "Last Mod Deleted");
|
IpcTester.DrawIntro(ModDeleted.Label, "Last Mod Deleted"u8);
|
||||||
if (_lastDeletedModTime > DateTimeOffset.UnixEpoch)
|
if (_lastDeletedModTime > DateTimeOffset.UnixEpoch)
|
||||||
ImGui.TextUnformatted($"{_lastDeletedMod} at {_lastDeletedModTime}");
|
Im.Text($"{_lastDeletedMod} at {_lastDeletedModTime}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(ModAdded.Label, "Last Mod Added");
|
IpcTester.DrawIntro(ModAdded.Label, "Last Mod Added"u8);
|
||||||
if (_lastAddedModTime > DateTimeOffset.UnixEpoch)
|
if (_lastAddedModTime > DateTimeOffset.UnixEpoch)
|
||||||
ImGui.TextUnformatted($"{_lastAddedMod} at {_lastAddedModTime}");
|
Im.Text($"{_lastAddedMod} at {_lastAddedModTime}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(ModMoved.Label, "Last Mod Moved");
|
IpcTester.DrawIntro(ModMoved.Label, "Last Mod Moved");
|
||||||
if (_lastMovedModTime > DateTimeOffset.UnixEpoch)
|
if (_lastMovedModTime > DateTimeOffset.UnixEpoch)
|
||||||
ImGui.TextUnformatted($"{_lastMovedModFrom} -> {_lastMovedModTo} at {_lastMovedModTime}");
|
Im.Text($"{_lastMovedModFrom} -> {_lastMovedModTo} at {_lastMovedModTime}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawModsPopup()
|
private void DrawModsPopup()
|
||||||
{
|
{
|
||||||
ImGui.SetNextWindowSize(ImGuiHelpers.ScaledVector2(500, 500));
|
Im.Window.SetNextSize(ImEx.ScaledVector(500, 500));
|
||||||
using var p = ImRaii.Popup("Mods");
|
using var p = Im.Popup.Begin("Mods"u8);
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var (modDir, modName) in _mods)
|
foreach (var (modDir, modName) in _mods)
|
||||||
ImGui.TextUnformatted($"{modDir}: {modName}");
|
Im.Text($"{modDir}: {modName}");
|
||||||
|
|
||||||
if (ImGui.Button("Close", -Vector2.UnitX) || !ImGui.IsWindowFocused())
|
if (Im.Button("Close"u8, -Vector2.UnitX) || !Im.Window.Focused())
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawChangedItemsPopup()
|
private void DrawChangedItemsPopup()
|
||||||
{
|
{
|
||||||
ImGui.SetNextWindowSize(ImGuiHelpers.ScaledVector2(500, 500));
|
Im.Window.SetNextSize(ImEx.ScaledVector(500, 500));
|
||||||
using var p = ImUtf8.Popup("ChangedItems"u8);
|
using var p = Im.Popup.Begin("ChangedItems"u8);
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var (name, data) in _changedItems)
|
foreach (var (name, data) in _changedItems)
|
||||||
ImUtf8.Text($"{name}: {data}");
|
Im.Text($"{name}: {data}");
|
||||||
|
|
||||||
if (ImUtf8.Button("Close"u8, -Vector2.UnitX) || !ImGui.IsWindowFocused())
|
if (Im.Button("Close"u8, -Vector2.UnitX) || !Im.Window.Focused())
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,12 @@
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using OtterGui;
|
using Luna;
|
||||||
using OtterGui.Raii;
|
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
public class PluginStateIpcTester : Luna.IUiService, IDisposable
|
public class PluginStateIpcTester : IUiService, IDisposable
|
||||||
{
|
{
|
||||||
private readonly IDalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
public readonly EventSubscriber<string, bool> ModDirectoryChanged;
|
public readonly EventSubscriber<string, bool> ModDirectoryChanged;
|
||||||
|
|
@ -54,82 +50,82 @@ public class PluginStateIpcTester : Luna.IUiService, IDisposable
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Plugin State");
|
using var tree = Im.Tree.Node("Plugin State"u8);
|
||||||
if (!_)
|
if (!tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ImUtf8.InputText("Required Features"u8, ref _requiredFeatureString))
|
if (Im.Input.Text("Required Features"u8, ref _requiredFeatureString))
|
||||||
_requiredFeatures = _requiredFeatureString.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
_requiredFeatures = _requiredFeatureString.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DrawList(IpcSubscribers.Initialized.Label, "Last Initialized", _initializedList);
|
DrawList(IpcSubscribers.Initialized.Label, "Last Initialized"u8, _initializedList);
|
||||||
DrawList(IpcSubscribers.Disposed.Label, "Last Disposed", _disposedList);
|
DrawList(IpcSubscribers.Disposed.Label, "Last Disposed"u8, _disposedList);
|
||||||
|
|
||||||
IpcTester.DrawIntro(ApiVersion.Label, "Current Version");
|
IpcTester.DrawIntro(ApiVersion.Label, "Current Version"u8);
|
||||||
var (breaking, features) = new ApiVersion(_pi).Invoke();
|
var (breaking, features) = new ApiVersion(_pi).Invoke();
|
||||||
ImGui.TextUnformatted($"{breaking}.{features:D4}");
|
Im.Text($"{breaking}.{features:D4}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetEnabledState.Label, "Current State");
|
IpcTester.DrawIntro(GetEnabledState.Label, "Current State"u8);
|
||||||
ImGui.TextUnformatted($"{new GetEnabledState(_pi).Invoke()}");
|
Im.Text($"{new GetEnabledState(_pi).Invoke()}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(IpcSubscribers.EnabledChange.Label, "Last Change");
|
IpcTester.DrawIntro(IpcSubscribers.EnabledChange.Label, "Last Change"u8);
|
||||||
ImGui.TextUnformatted(_lastEnabledValue is { } v ? $"{_lastEnabledChange} (to {v})" : "Never");
|
Im.Text(_lastEnabledValue is { } v ? $"{_lastEnabledChange} (to {v})" : "Never"u8);
|
||||||
|
|
||||||
IpcTester.DrawIntro(SupportedFeatures.Label, "Supported Features");
|
IpcTester.DrawIntro(SupportedFeatures.Label, "Supported Features"u8);
|
||||||
ImUtf8.Text(string.Join(", ", new SupportedFeatures(_pi).Invoke()));
|
Im.Text(StringU8.Join(", "u8, new SupportedFeatures(_pi).Invoke()));
|
||||||
|
|
||||||
IpcTester.DrawIntro(CheckSupportedFeatures.Label, "Missing Features");
|
IpcTester.DrawIntro(CheckSupportedFeatures.Label, "Missing Features"u8);
|
||||||
ImUtf8.Text(string.Join(", ", new CheckSupportedFeatures(_pi).Invoke(_requiredFeatures)));
|
Im.Text(StringU8.Join(", "u8, new CheckSupportedFeatures(_pi).Invoke(_requiredFeatures)));
|
||||||
|
|
||||||
DrawConfigPopup();
|
DrawConfigPopup();
|
||||||
IpcTester.DrawIntro(GetConfiguration.Label, "Configuration");
|
IpcTester.DrawIntro(GetConfiguration.Label, "Configuration"u8);
|
||||||
if (ImGui.Button("Get"))
|
if (Im.Button("Get"u8))
|
||||||
{
|
{
|
||||||
_currentConfiguration = new GetConfiguration(_pi).Invoke();
|
_currentConfiguration = new GetConfiguration(_pi).Invoke();
|
||||||
ImGui.OpenPopup("Config Popup");
|
Im.Popup.Open("Config Popup"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetModDirectory.Label, "Current Mod Directory");
|
IpcTester.DrawIntro(GetModDirectory.Label, "Current Mod Directory"u8);
|
||||||
ImGui.TextUnformatted(new GetModDirectory(_pi).Invoke());
|
Im.Text(new GetModDirectory(_pi).Invoke());
|
||||||
|
|
||||||
IpcTester.DrawIntro(IpcSubscribers.ModDirectoryChanged.Label, "Last Mod Directory Change");
|
IpcTester.DrawIntro(IpcSubscribers.ModDirectoryChanged.Label, "Last Mod Directory Change"u8);
|
||||||
ImGui.TextUnformatted(_lastModDirectoryTime > DateTimeOffset.MinValue
|
Im.Text(_lastModDirectoryTime > DateTimeOffset.MinValue
|
||||||
? $"{_lastModDirectory} ({(_lastModDirectoryValid ? "Valid" : "Invalid")}) at {_lastModDirectoryTime}"
|
? $"{_lastModDirectory} ({(_lastModDirectoryValid ? "Valid" : "Invalid")}) at {_lastModDirectoryTime}"
|
||||||
: "None");
|
: "None"u8);
|
||||||
|
|
||||||
void DrawList(string label, string text, List<DateTimeOffset> list)
|
void DrawList(string label, ReadOnlySpan<byte> text, List<DateTimeOffset> list)
|
||||||
{
|
{
|
||||||
IpcTester.DrawIntro(label, text);
|
IpcTester.DrawIntro(label, text);
|
||||||
if (list.Count == 0)
|
if (list.Count is 0)
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted("Never");
|
Im.Text("Never"u8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(list[^1].LocalDateTime.ToString(CultureInfo.CurrentCulture));
|
Im.Text(list[^1].LocalDateTime.ToString(CultureInfo.CurrentCulture));
|
||||||
if (list.Count > 1 && ImGui.IsItemHovered())
|
if (list.Count > 1 && Im.Item.Hovered())
|
||||||
ImGui.SetTooltip(string.Join("\n",
|
Im.Tooltip.Set(
|
||||||
list.SkipLast(1).Select(t => t.LocalDateTime.ToString(CultureInfo.CurrentCulture))));
|
StringU8.Join((byte)'\n', list.SkipLast(1).Select(t => t.LocalDateTime.ToString(CultureInfo.CurrentCulture))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawConfigPopup()
|
private void DrawConfigPopup()
|
||||||
{
|
{
|
||||||
ImGui.SetNextWindowSize(ImGuiHelpers.ScaledVector2(500, 500));
|
Im.Window.SetNextSize(ImEx.ScaledVector(500, 500));
|
||||||
using var popup = ImRaii.Popup("Config Popup");
|
using var popup = Im.Popup.Begin("Config Popup"u8);
|
||||||
if (!popup)
|
if (!popup)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
using (Im.Font.PushMono())
|
||||||
{
|
{
|
||||||
ImGuiUtil.TextWrapped(_currentConfiguration);
|
Im.TextWrapped(_currentConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Button("Close", -Vector2.UnitX) || !ImGui.IsWindowFocused())
|
if (Im.Button("Close"u8, -Vector2.UnitX) || !Im.Window.Focused())
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateModDirectoryChanged(string path, bool valid)
|
private void UpdateModDirectoryChanged(string path, bool valid)
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,19 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
using Penumbra.GameData.Interop;
|
using Penumbra.GameData.Interop;
|
||||||
using Penumbra.UI;
|
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
public class RedrawingIpcTester : Luna.IUiService, IDisposable
|
public class RedrawingIpcTester : Luna.IUiService, IDisposable
|
||||||
{
|
{
|
||||||
private readonly IDalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
private readonly ObjectManager _objects;
|
private readonly ObjectManager _objects;
|
||||||
public readonly EventSubscriber<nint, int> Redrawn;
|
public readonly EventSubscriber<nint, int> Redrawn;
|
||||||
|
|
||||||
private int _redrawIndex;
|
private int _redrawIndex;
|
||||||
private string _lastRedrawnString = "None";
|
private StringU8 _lastRedrawnString = new("None"u8);
|
||||||
|
|
||||||
public RedrawingIpcTester(IDalamudPluginInterface pi, ObjectManager objects)
|
public RedrawingIpcTester(IDalamudPluginInterface pi, ObjectManager objects)
|
||||||
{
|
{
|
||||||
|
|
@ -32,29 +30,29 @@ public class RedrawingIpcTester : Luna.IUiService, IDisposable
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Redrawing");
|
using var _ = Im.Tree.Node("Redrawing"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(RedrawObject.Label, "Redraw by Index");
|
IpcTester.DrawIntro(RedrawObject.Label, "Redraw by Index"u8);
|
||||||
var tmp = _redrawIndex;
|
var tmp = _redrawIndex;
|
||||||
ImGui.SetNextItemWidth(100 * UiHelpers.Scale);
|
Im.Item.SetNextWidthScaled(100);
|
||||||
if (ImGui.DragInt("##redrawIndex", ref tmp, 0.1f, 0, _objects.TotalCount))
|
if (Im.Drag("##redrawIndex"u8, ref tmp, 0, _objects.TotalCount, 0.1f))
|
||||||
_redrawIndex = Math.Clamp(tmp, 0, _objects.TotalCount);
|
_redrawIndex = Math.Clamp(tmp, 0, _objects.TotalCount);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Redraw##Index"))
|
if (Im.Button("Redraw##Index"u8))
|
||||||
new RedrawObject(_pi).Invoke(_redrawIndex);
|
new RedrawObject(_pi).Invoke(_redrawIndex);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RedrawAll.Label, "Redraw All");
|
IpcTester.DrawIntro(RedrawAll.Label, "Redraw All"u8);
|
||||||
if (ImGui.Button("Redraw##All"))
|
if (Im.Button("Redraw##All"u8))
|
||||||
new RedrawAll(_pi).Invoke();
|
new RedrawAll(_pi).Invoke();
|
||||||
|
|
||||||
IpcTester.DrawIntro(GameObjectRedrawn.Label, "Last Redrawn Object:");
|
IpcTester.DrawIntro(GameObjectRedrawn.Label, "Last Redrawn Object:"u8);
|
||||||
ImGui.TextUnformatted(_lastRedrawnString);
|
Im.Text(_lastRedrawnString);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetLastRedrawn(nint address, int index)
|
private void SetLastRedrawn(nint address, int index)
|
||||||
|
|
@ -63,8 +61,8 @@ public class RedrawingIpcTester : Luna.IUiService, IDisposable
|
||||||
|| index > _objects.TotalCount
|
|| index > _objects.TotalCount
|
||||||
|| address == nint.Zero
|
|| address == nint.Zero
|
||||||
|| _objects[index].Address != address)
|
|| _objects[index].Address != address)
|
||||||
_lastRedrawnString = "Invalid";
|
_lastRedrawnString = new StringU8("Invalid"u8);
|
||||||
|
|
||||||
_lastRedrawnString = $"{_objects[index].Utf8Name} (0x{address:X}, {index})";
|
_lastRedrawnString = new StringU8($"{_objects[index].Utf8Name} (0x{address:X}, {index})");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
using Penumbra.String.Classes;
|
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
|
|
@ -15,97 +13,86 @@ public class ResolveIpcTester(IDalamudPluginInterface pi) : Luna.IUiService
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var tree = ImRaii.TreeNode("Resolving");
|
using var tree = Im.Tree.Node("Resolving"u8);
|
||||||
if (!tree)
|
if (!tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputTextWithHint("##resolvePath", "Resolve this game path...", ref _currentResolvePath, Utf8GamePath.MaxGamePathLength);
|
Im.Input.Text("##resolvePath"u8, ref _currentResolvePath, "Resolve this game path..."u8);
|
||||||
ImGui.InputTextWithHint("##resolveInversePath", "Reverse-resolve this path...", ref _currentReversePath,
|
Im.Input.Text("##resolveInversePath"u8, ref _currentReversePath, "Reverse-resolve this path..."u8);
|
||||||
Utf8GamePath.MaxGamePathLength);
|
Im.Input.Scalar("##resolveIdx"u8, ref _currentReverseIdx);
|
||||||
ImGui.InputInt("##resolveIdx", ref _currentReverseIdx, 0, 0);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(ResolveDefaultPath.Label, "Default Collection Resolve");
|
IpcTester.DrawIntro(ResolveDefaultPath.Label, "Default Collection Resolve"u8);
|
||||||
if (_currentResolvePath.Length != 0)
|
if (_currentResolvePath.Length is not 0)
|
||||||
ImGui.TextUnformatted(new ResolveDefaultPath(pi).Invoke(_currentResolvePath));
|
Im.Text(new ResolveDefaultPath(pi).Invoke(_currentResolvePath));
|
||||||
|
|
||||||
IpcTester.DrawIntro(ResolveInterfacePath.Label, "Interface Collection Resolve");
|
IpcTester.DrawIntro(ResolveInterfacePath.Label, "Interface Collection Resolve"u8);
|
||||||
if (_currentResolvePath.Length != 0)
|
if (_currentResolvePath.Length is not 0)
|
||||||
ImGui.TextUnformatted(new ResolveInterfacePath(pi).Invoke(_currentResolvePath));
|
Im.Text(new ResolveInterfacePath(pi).Invoke(_currentResolvePath));
|
||||||
|
|
||||||
IpcTester.DrawIntro(ResolvePlayerPath.Label, "Player Collection Resolve");
|
IpcTester.DrawIntro(ResolvePlayerPath.Label, "Player Collection Resolve"u8);
|
||||||
if (_currentResolvePath.Length != 0)
|
if (_currentResolvePath.Length is not 0)
|
||||||
ImGui.TextUnformatted(new ResolvePlayerPath(pi).Invoke(_currentResolvePath));
|
Im.Text(new ResolvePlayerPath(pi).Invoke(_currentResolvePath));
|
||||||
|
|
||||||
IpcTester.DrawIntro(ResolveGameObjectPath.Label, "Game Object Collection Resolve");
|
IpcTester.DrawIntro(ResolveGameObjectPath.Label, "Game Object Collection Resolve"u8);
|
||||||
if (_currentResolvePath.Length != 0)
|
if (_currentResolvePath.Length is not 0)
|
||||||
ImGui.TextUnformatted(new ResolveGameObjectPath(pi).Invoke(_currentResolvePath, _currentReverseIdx));
|
Im.Text(new ResolveGameObjectPath(pi).Invoke(_currentResolvePath, _currentReverseIdx));
|
||||||
|
|
||||||
IpcTester.DrawIntro(ReverseResolvePlayerPath.Label, "Reversed Game Paths (Player)");
|
IpcTester.DrawIntro(ReverseResolvePlayerPath.Label, "Reversed Game Paths (Player)"u8);
|
||||||
if (_currentReversePath.Length > 0)
|
if (_currentReversePath.Length is not 0)
|
||||||
{
|
{
|
||||||
var list = new ReverseResolvePlayerPath(pi).Invoke(_currentReversePath);
|
var list = new ReverseResolvePlayerPath(pi).Invoke(_currentReversePath);
|
||||||
if (list.Length > 0)
|
if (list.Length > 0)
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(list[0]);
|
Im.Text(list[0]);
|
||||||
if (list.Length > 1 && ImGui.IsItemHovered())
|
if (list.Length > 1 && Im.Item.Hovered())
|
||||||
ImGui.SetTooltip(string.Join("\n", list.Skip(1)));
|
Im.Tooltip.Set(StringU8.Join((byte)'\n', list.Skip(1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(ReverseResolveGameObjectPath.Label, "Reversed Game Paths (Game Object)");
|
IpcTester.DrawIntro(ReverseResolveGameObjectPath.Label, "Reversed Game Paths (Game Object)"u8);
|
||||||
if (_currentReversePath.Length > 0)
|
if (_currentReversePath.Length is not 0)
|
||||||
{
|
{
|
||||||
var list = new ReverseResolveGameObjectPath(pi).Invoke(_currentReversePath, _currentReverseIdx);
|
var list = new ReverseResolveGameObjectPath(pi).Invoke(_currentReversePath, _currentReverseIdx);
|
||||||
if (list.Length > 0)
|
if (list.Length > 0)
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(list[0]);
|
Im.Text(list[0]);
|
||||||
if (list.Length > 1 && ImGui.IsItemHovered())
|
if (list.Length > 1 && Im.Item.Hovered())
|
||||||
ImGui.SetTooltip(string.Join("\n", list.Skip(1)));
|
Im.Tooltip.Set(StringU8.Join((byte)'\n', list.Skip(1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var forwardArray = _currentResolvePath.Length > 0
|
string[] forwardArray = _currentResolvePath.Length > 0 ? [_currentResolvePath] : [];
|
||||||
? [_currentResolvePath]
|
string[] reverseArray = _currentReversePath.Length > 0 ? [_currentReversePath] : [];
|
||||||
: Array.Empty<string>();
|
|
||||||
var reverseArray = _currentReversePath.Length > 0
|
|
||||||
? [_currentReversePath]
|
|
||||||
: Array.Empty<string>();
|
|
||||||
|
|
||||||
IpcTester.DrawIntro(ResolvePlayerPaths.Label, "Resolved Paths (Player)");
|
IpcTester.DrawIntro(ResolvePlayerPaths.Label, "Resolved Paths (Player)"u8);
|
||||||
if (forwardArray.Length > 0 || reverseArray.Length > 0)
|
if (forwardArray.Length > 0 || reverseArray.Length > 0)
|
||||||
{
|
{
|
||||||
var ret = new ResolvePlayerPaths(pi).Invoke(forwardArray, reverseArray);
|
var ret = new ResolvePlayerPaths(pi).Invoke(forwardArray, reverseArray);
|
||||||
ImGui.TextUnformatted(ConvertText(ret));
|
Im.Text(ConvertText(ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(ResolvePlayerPathsAsync.Label, "Resolved Paths Async (Player)");
|
IpcTester.DrawIntro(ResolvePlayerPathsAsync.Label, "Resolved Paths Async (Player)"u8);
|
||||||
if (ImGui.Button("Start"))
|
if (Im.Button("Start"u8))
|
||||||
_task = new ResolvePlayerPathsAsync(pi).Invoke(forwardArray, reverseArray);
|
_task = new ResolvePlayerPathsAsync(pi).Invoke(forwardArray, reverseArray);
|
||||||
var hovered = ImGui.IsItemHovered();
|
var hovered = Im.Item.Hovered();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.AlignTextToFramePadding();
|
ImEx.TextFrameAligned($"{_task.Status}");
|
||||||
ImGui.TextUnformatted(_task.Status.ToString());
|
if ((hovered || Im.Item.Hovered()) && _task.IsCompletedSuccessfully)
|
||||||
if ((hovered || ImGui.IsItemHovered()) && _task.IsCompletedSuccessfully)
|
Im.Tooltip.Set(ConvertText(_task.Result));
|
||||||
ImGui.SetTooltip(ConvertText(_task.Result));
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static string ConvertText((string[], string[][]) data)
|
static StringU8 ConvertText((string[], string[][]) data)
|
||||||
{
|
{
|
||||||
var text = string.Empty;
|
var text = StringU8.Empty;
|
||||||
if (data.Item1.Length > 0)
|
if (data.Item1.Length > 0)
|
||||||
{
|
text = data.Item2.Length > 0
|
||||||
if (data.Item2.Length > 0)
|
? new StringU8($"Forward: {data.Item1[0]} | Reverse: {StringU8.Join("; "u8, data.Item2[0])}.")
|
||||||
text = $"Forward: {data.Item1[0]} | Reverse: {string.Join("; ", data.Item2[0])}.";
|
: new StringU8($"Forward: {data.Item1[0]}.");
|
||||||
else
|
|
||||||
text = $"Forward: {data.Item1[0]}.";
|
|
||||||
}
|
|
||||||
else if (data.Item2.Length > 0)
|
else if (data.Item2.Length > 0)
|
||||||
{
|
text = new StringU8($"Reverse: {StringU8.Join("; "u8, data.Item2[0])}.");
|
||||||
text = $"Reverse: {string.Join("; ", data.Item2[0])}.";
|
|
||||||
}
|
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Game.ClientState.Objects.Enums;
|
using Dalamud.Game.ClientState.Objects.Enums;
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
|
||||||
using OtterGui.Raii;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
|
|
@ -15,7 +11,7 @@ using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager objects) : Luna.IUiService
|
public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager objects) : IUiService
|
||||||
{
|
{
|
||||||
private readonly Stopwatch _stopwatch = new();
|
private readonly Stopwatch _stopwatch = new();
|
||||||
|
|
||||||
|
|
@ -23,30 +19,30 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
private ResourceType _type = ResourceType.Mtrl;
|
private ResourceType _type = ResourceType.Mtrl;
|
||||||
private bool _withUiData;
|
private bool _withUiData;
|
||||||
|
|
||||||
private (string, Dictionary<string, HashSet<string>>?)[]? _lastGameObjectResourcePaths;
|
private (StringU8, Dictionary<string, HashSet<string>>?)[]? _lastGameObjectResourcePaths;
|
||||||
private (string, Dictionary<string, HashSet<string>>?)[]? _lastPlayerResourcePaths;
|
private (StringU8, Dictionary<string, HashSet<string>>?)[]? _lastPlayerResourcePaths;
|
||||||
private (string, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)[]? _lastGameObjectResourcesOfType;
|
private (StringU8, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)[]? _lastGameObjectResourcesOfType;
|
||||||
private (string, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)[]? _lastPlayerResourcesOfType;
|
private (StringU8, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)[]? _lastPlayerResourcesOfType;
|
||||||
private (string, ResourceTreeDto?)[]? _lastGameObjectResourceTrees;
|
private (StringU8, ResourceTreeDto?)[]? _lastGameObjectResourceTrees;
|
||||||
private (string, ResourceTreeDto)[]? _lastPlayerResourceTrees;
|
private (StringU8, ResourceTreeDto)[]? _lastPlayerResourceTrees;
|
||||||
private TimeSpan _lastCallDuration;
|
private TimeSpan _lastCallDuration;
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Resource Tree");
|
using var _ = Im.Tree.Node("Resource Tree"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputText("GameObject indices", ref _gameObjectIndices, 511);
|
Im.Input.Text("GameObject indices"u8, ref _gameObjectIndices);
|
||||||
ImGuiUtil.GenericEnumCombo("Resource type", ImGui.CalcItemWidth(), _type, out _type, Enum.GetValues<ResourceType>());
|
EnumCombo<ResourceType>.Instance.Draw("Resource type"u8, ref _type, default, Im.Item.Size.X);
|
||||||
ImGui.Checkbox("Also get names and icons", ref _withUiData);
|
Im.Checkbox("Also get names and icons"u8, ref _withUiData);
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetGameObjectResourcePaths.Label, "Get GameObject resource paths");
|
IpcTester.DrawIntro(GetGameObjectResourcePaths.Label, "Get GameObject resource paths"u8);
|
||||||
if (ImGui.Button("Get##GameObjectResourcePaths"))
|
if (Im.Button("Get##GameObjectResourcePaths"u8))
|
||||||
{
|
{
|
||||||
var gameObjects = GetSelectedGameObjects();
|
var gameObjects = GetSelectedGameObjects();
|
||||||
var subscriber = new GetGameObjectResourcePaths(pi);
|
var subscriber = new GetGameObjectResourcePaths(pi);
|
||||||
|
|
@ -59,11 +55,11 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
.Zip(resourcePaths)
|
.Zip(resourcePaths)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
ImGui.OpenPopup(nameof(GetGameObjectResourcePaths));
|
Im.Popup.Open("GetGameObjectResourcePaths"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetPlayerResourcePaths.Label, "Get local player resource paths");
|
IpcTester.DrawIntro(GetPlayerResourcePaths.Label, "Get local player resource paths"u8);
|
||||||
if (ImGui.Button("Get##PlayerResourcePaths"))
|
if (Im.Button("Get##PlayerResourcePaths"u8))
|
||||||
{
|
{
|
||||||
var subscriber = new GetPlayerResourcePaths(pi);
|
var subscriber = new GetPlayerResourcePaths(pi);
|
||||||
_stopwatch.Restart();
|
_stopwatch.Restart();
|
||||||
|
|
@ -74,11 +70,11 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
.Select(pair => (GameObjectToString(pair.Key), pair.Value))
|
.Select(pair => (GameObjectToString(pair.Key), pair.Value))
|
||||||
.ToArray()!;
|
.ToArray()!;
|
||||||
|
|
||||||
ImGui.OpenPopup(nameof(GetPlayerResourcePaths));
|
Im.Popup.Open("GetPlayerResourcePaths"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetGameObjectResourcesOfType.Label, "Get GameObject resources of type");
|
IpcTester.DrawIntro(GetGameObjectResourcesOfType.Label, "Get GameObject resources of type"u8);
|
||||||
if (ImGui.Button("Get##GameObjectResourcesOfType"))
|
if (Im.Button("Get##GameObjectResourcesOfType"u8))
|
||||||
{
|
{
|
||||||
var gameObjects = GetSelectedGameObjects();
|
var gameObjects = GetSelectedGameObjects();
|
||||||
var subscriber = new GetGameObjectResourcesOfType(pi);
|
var subscriber = new GetGameObjectResourcesOfType(pi);
|
||||||
|
|
@ -91,11 +87,11 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
.Zip(resourcesOfType)
|
.Zip(resourcesOfType)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
ImGui.OpenPopup(nameof(GetGameObjectResourcesOfType));
|
Im.Popup.Open("GetGameObjectResourcesOfType"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetPlayerResourcesOfType.Label, "Get local player resources of type");
|
IpcTester.DrawIntro(GetPlayerResourcesOfType.Label, "Get local player resources of type"u8);
|
||||||
if (ImGui.Button("Get##PlayerResourcesOfType"))
|
if (Im.Button("Get##PlayerResourcesOfType"u8))
|
||||||
{
|
{
|
||||||
var subscriber = new GetPlayerResourcesOfType(pi);
|
var subscriber = new GetPlayerResourcesOfType(pi);
|
||||||
_stopwatch.Restart();
|
_stopwatch.Restart();
|
||||||
|
|
@ -106,11 +102,11 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
.Select(pair => (GameObjectToString(pair.Key), (IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)pair.Value))
|
.Select(pair => (GameObjectToString(pair.Key), (IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)pair.Value))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
ImGui.OpenPopup(nameof(GetPlayerResourcesOfType));
|
Im.Popup.Open("GetPlayerResourcesOfType"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetGameObjectResourceTrees.Label, "Get GameObject resource trees");
|
IpcTester.DrawIntro(GetGameObjectResourceTrees.Label, "Get GameObject resource trees"u8);
|
||||||
if (ImGui.Button("Get##GameObjectResourceTrees"))
|
if (Im.Button("Get##GameObjectResourceTrees"u8))
|
||||||
{
|
{
|
||||||
var gameObjects = GetSelectedGameObjects();
|
var gameObjects = GetSelectedGameObjects();
|
||||||
var subscriber = new GetGameObjectResourceTrees(pi);
|
var subscriber = new GetGameObjectResourceTrees(pi);
|
||||||
|
|
@ -123,11 +119,11 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
.Zip(trees)
|
.Zip(trees)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
ImGui.OpenPopup(nameof(GetGameObjectResourceTrees));
|
Im.Popup.Open("GetGameObjectResourceTrees"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(GetPlayerResourceTrees.Label, "Get local player resource trees");
|
IpcTester.DrawIntro(GetPlayerResourceTrees.Label, "Get local player resource trees"u8);
|
||||||
if (ImGui.Button("Get##PlayerResourceTrees"))
|
if (Im.Button("Get##PlayerResourceTrees"u8))
|
||||||
{
|
{
|
||||||
var subscriber = new GetPlayerResourceTrees(pi);
|
var subscriber = new GetPlayerResourceTrees(pi);
|
||||||
_stopwatch.Restart();
|
_stopwatch.Restart();
|
||||||
|
|
@ -138,27 +134,27 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
.Select(pair => (GameObjectToString(pair.Key), pair.Value))
|
.Select(pair => (GameObjectToString(pair.Key), pair.Value))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
ImGui.OpenPopup(nameof(GetPlayerResourceTrees));
|
Im.Popup.Open("GetPlayerResourceTrees"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawPopup(nameof(GetGameObjectResourcePaths), ref _lastGameObjectResourcePaths, DrawResourcePaths,
|
DrawPopup("GetGameObjectResourcePaths"u8, ref _lastGameObjectResourcePaths, DrawResourcePaths,
|
||||||
_lastCallDuration);
|
_lastCallDuration);
|
||||||
DrawPopup(nameof(GetPlayerResourcePaths), ref _lastPlayerResourcePaths!, DrawResourcePaths, _lastCallDuration);
|
DrawPopup("GetPlayerResourcePaths"u8, ref _lastPlayerResourcePaths!, DrawResourcePaths, _lastCallDuration);
|
||||||
|
|
||||||
DrawPopup(nameof(GetGameObjectResourcesOfType), ref _lastGameObjectResourcesOfType, DrawResourcesOfType,
|
DrawPopup("GetGameObjectResourcesOfType"u8, ref _lastGameObjectResourcesOfType, DrawResourcesOfType,
|
||||||
_lastCallDuration);
|
_lastCallDuration);
|
||||||
DrawPopup(nameof(GetPlayerResourcesOfType), ref _lastPlayerResourcesOfType, DrawResourcesOfType,
|
DrawPopup("GetPlayerResourcesOfType"u8, ref _lastPlayerResourcesOfType, DrawResourcesOfType,
|
||||||
_lastCallDuration);
|
_lastCallDuration);
|
||||||
|
|
||||||
DrawPopup(nameof(GetGameObjectResourceTrees), ref _lastGameObjectResourceTrees, DrawResourceTrees,
|
DrawPopup("GetGameObjectResourceTrees"u8, ref _lastGameObjectResourceTrees, DrawResourceTrees,
|
||||||
_lastCallDuration);
|
_lastCallDuration);
|
||||||
DrawPopup(nameof(GetPlayerResourceTrees), ref _lastPlayerResourceTrees, DrawResourceTrees!, _lastCallDuration);
|
DrawPopup("GetPlayerResourceTrees"u8, ref _lastPlayerResourceTrees, DrawResourceTrees!, _lastCallDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawPopup<T>(string popupId, ref T? result, Action<T> drawResult, TimeSpan duration) where T : class
|
private static void DrawPopup<T>(ReadOnlySpan<byte> popupId, ref T? result, Action<T> drawResult, TimeSpan duration) where T : class
|
||||||
{
|
{
|
||||||
ImGui.SetNextWindowSize(ImGuiHelpers.ScaledVector2(1000, 500));
|
Im.Window.SetNextSize(ImEx.ScaledVector(1000, 500));
|
||||||
using var popup = ImRaii.Popup(popupId);
|
using var popup = Im.Popup.Begin(popupId);
|
||||||
if (!popup)
|
if (!popup)
|
||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
|
|
@ -167,41 +163,41 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
|
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawResult(result);
|
drawResult(result);
|
||||||
|
|
||||||
ImGui.TextUnformatted($"Invoked in {duration.TotalMilliseconds} ms");
|
Im.Text($"Invoked in {duration.TotalMilliseconds} ms");
|
||||||
|
|
||||||
if (ImGui.Button("Close", -Vector2.UnitX) || !ImGui.IsWindowFocused())
|
if (Im.Button("Close"u8, -Vector2.UnitX) || !Im.Window.Focused())
|
||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
ImGui.CloseCurrentPopup();
|
Im.Popup.CloseCurrent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawWithHeaders<T>((string, T?)[] result, Action<T> drawItem) where T : class
|
private static void DrawWithHeaders<T>((StringU8, T?)[] result, Action<T> drawItem) where T : class
|
||||||
{
|
{
|
||||||
var firstSeen = new Dictionary<T, string>();
|
var firstSeen = new Dictionary<T, StringU8>();
|
||||||
foreach (var (label, item) in result)
|
foreach (var (label, item) in result)
|
||||||
{
|
{
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
ImRaii.TreeNode($"{label}: null", ImGuiTreeNodeFlags.Leaf).Dispose();
|
Im.Tree.Node($"{label}: null", TreeNodeFlags.Leaf).Dispose();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstSeen.TryGetValue(item, out var firstLabel))
|
if (firstSeen.TryGetValue(item, out var firstLabel))
|
||||||
{
|
{
|
||||||
ImRaii.TreeNode($"{label}: same as {firstLabel}", ImGuiTreeNodeFlags.Leaf).Dispose();
|
Im.Tree.Node($"{label}: same as {firstLabel}", TreeNodeFlags.Leaf).Dispose();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
firstSeen.Add(item, label);
|
firstSeen.Add(item, label);
|
||||||
|
|
||||||
using var header = ImRaii.TreeNode(label);
|
using var header = Im.Tree.Node(label);
|
||||||
if (!header)
|
if (!header)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -209,141 +205,130 @@ public class ResourceTreeIpcTester(IDalamudPluginInterface pi, ObjectManager obj
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawResourcePaths((string, Dictionary<string, HashSet<string>>?)[] result)
|
private static void DrawResourcePaths((StringU8, Dictionary<string, HashSet<string>>?)[] result)
|
||||||
{
|
{
|
||||||
DrawWithHeaders(result, paths =>
|
DrawWithHeaders(result, paths =>
|
||||||
{
|
{
|
||||||
using var table = ImRaii.Table(string.Empty, 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 2, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.6f);
|
table.SetupColumn("Actual Path"u8, TableColumnFlags.WidthStretch, 0.6f);
|
||||||
ImGui.TableSetupColumn("Game Paths", ImGuiTableColumnFlags.WidthStretch, 0.4f);
|
table.SetupColumn("Game Paths"u8, TableColumnFlags.WidthStretch, 0.4f);
|
||||||
ImGui.TableHeadersRow();
|
table.HeaderRow();
|
||||||
|
|
||||||
foreach (var (actualPath, gamePaths) in paths)
|
foreach (var (actualPath, gamePaths) in paths)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn(actualPath);
|
||||||
ImGui.TextUnformatted(actualPath);
|
table.NextColumn();
|
||||||
ImGui.TableNextColumn();
|
|
||||||
foreach (var gamePath in gamePaths)
|
foreach (var gamePath in gamePaths)
|
||||||
ImGui.TextUnformatted(gamePath);
|
Im.Text(gamePath);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawResourcesOfType((string, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)[] result)
|
private void DrawResourcesOfType((StringU8, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)[] result)
|
||||||
{
|
{
|
||||||
DrawWithHeaders(result, resources =>
|
DrawWithHeaders(result, resources =>
|
||||||
{
|
{
|
||||||
using var table = ImRaii.Table(string.Empty, _withUiData ? 3 : 2, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, _withUiData ? 3 : 2, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("Resource Handle", ImGuiTableColumnFlags.WidthStretch, 0.15f);
|
table.SetupColumn("Resource Handle"u8, TableColumnFlags.WidthStretch, 0.15f);
|
||||||
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, _withUiData ? 0.55f : 0.85f);
|
table.SetupColumn("Actual Path"u8, TableColumnFlags.WidthStretch, _withUiData ? 0.55f : 0.85f);
|
||||||
if (_withUiData)
|
if (_withUiData)
|
||||||
ImGui.TableSetupColumn("Icon & Name", ImGuiTableColumnFlags.WidthStretch, 0.3f);
|
table.SetupColumn("Icon & Name"u8, TableColumnFlags.WidthStretch, 0.3f);
|
||||||
ImGui.TableHeadersRow();
|
table.HeaderRow();
|
||||||
|
|
||||||
foreach (var (resourceHandle, (actualPath, name, icon)) in resources)
|
foreach (var (resourceHandle, (actualPath, name, icon)) in resources)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
TextUnformattedMono($"0x{resourceHandle:X}");
|
Penumbra.Dynamis.DrawPointer(resourceHandle);
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn(actualPath);
|
||||||
ImGui.TextUnformatted(actualPath);
|
|
||||||
if (_withUiData)
|
if (_withUiData)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
TextUnformattedMono(icon.ToString());
|
ImEx.MonoText($"{icon}");
|
||||||
ImGui.SameLine();
|
Im.Line.SameInner();
|
||||||
ImGui.TextUnformatted(name);
|
Im.Text(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawResourceTrees((string, ResourceTreeDto?)[] result)
|
private void DrawResourceTrees((StringU8, ResourceTreeDto?)[] result)
|
||||||
{
|
{
|
||||||
DrawWithHeaders(result, tree =>
|
DrawWithHeaders(result, tree =>
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted($"Name: {tree.Name}\nRaceCode: {(GenderRace)tree.RaceCode}");
|
Im.Text($"Name: {tree.Name}\nRaceCode: {(GenderRace)tree.RaceCode}");
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, _withUiData ? 7 : 5, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.Resizable);
|
using var table = Im.Table.Begin(StringU8.Empty, _withUiData ? 7 : 5, TableFlags.SizingFixedFit | TableFlags.Resizable);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_withUiData)
|
if (_withUiData)
|
||||||
{
|
{
|
||||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
table.SetupColumn("Name"u8, TableColumnFlags.WidthStretch, 0.5f);
|
||||||
ImGui.TableSetupColumn("Type", ImGuiTableColumnFlags.WidthStretch, 0.1f);
|
table.SetupColumn("Type"u8, TableColumnFlags.WidthStretch, 0.1f);
|
||||||
ImGui.TableSetupColumn("Icon", ImGuiTableColumnFlags.WidthStretch, 0.15f);
|
table.SetupColumn("Icon"u8, TableColumnFlags.WidthStretch, 0.15f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.TableSetupColumn("Type", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
table.SetupColumn("Type"u8, TableColumnFlags.WidthStretch, 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableSetupColumn("Game Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
table.SetupColumn("Game Path"u8, TableColumnFlags.WidthStretch, 0.5f);
|
||||||
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
table.SetupColumn("Actual Path"u8, TableColumnFlags.WidthStretch, 0.5f);
|
||||||
ImGui.TableSetupColumn("Object Address", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("Object Address"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableSetupColumn("Resource Handle", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
table.SetupColumn("Resource Handle"u8, TableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableHeadersRow();
|
table.HeaderRow();
|
||||||
|
|
||||||
void DrawNode(ResourceNodeDto node)
|
foreach (var node in tree.Nodes)
|
||||||
|
DrawNode(table, node, _withUiData);
|
||||||
|
return;
|
||||||
|
|
||||||
|
static void DrawNode(in Im.TableDisposable table, ResourceNodeDto node, bool uiData)
|
||||||
{
|
{
|
||||||
ImGui.TableNextRow();
|
table.NextRow();
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
var hasChildren = node.Children.Any();
|
var hasChildren = node.Children.Count > 0;
|
||||||
using var treeNode = ImRaii.TreeNode(
|
using var treeNode = Im.Tree.Node($"{(uiData ? node.Name ?? "Unknown" : node.Type)}##{node.ObjectAddress:X8}",
|
||||||
$"{(_withUiData ? node.Name ?? "Unknown" : node.Type)}##{node.ObjectAddress:X8}",
|
|
||||||
hasChildren
|
hasChildren
|
||||||
? ImGuiTreeNodeFlags.SpanFullWidth
|
? TreeNodeFlags.SpanFullWidth
|
||||||
: ImGuiTreeNodeFlags.SpanFullWidth | ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.NoTreePushOnOpen);
|
: TreeNodeFlags.SpanFullWidth | TreeNodeFlags.Leaf | TreeNodeFlags.NoTreePushOnOpen);
|
||||||
if (_withUiData)
|
if (uiData)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
using var mono = Im.Font.PushMono();
|
||||||
TextUnformattedMono(node.Type.ToString());
|
table.DrawColumn($"{node.Type}");
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn($"{node.Icon}");
|
||||||
TextUnformattedMono(node.Icon.ToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn(node.GamePath ?? "Unknown");
|
||||||
ImGui.TextUnformatted(node.GamePath ?? "Unknown");
|
table.DrawColumn(node.ActualPath);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
ImGui.TextUnformatted(node.ActualPath);
|
Penumbra.Dynamis.DrawPointer(node.ObjectAddress);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
TextUnformattedMono($"0x{node.ObjectAddress:X8}");
|
Penumbra.Dynamis.DrawPointer(node.ResourceHandle);
|
||||||
ImGui.TableNextColumn();
|
|
||||||
TextUnformattedMono($"0x{node.ResourceHandle:X8}");
|
|
||||||
|
|
||||||
if (treeNode)
|
if (treeNode)
|
||||||
foreach (var child in node.Children)
|
foreach (var child in node.Children)
|
||||||
DrawNode(child);
|
DrawNode(table, child, uiData);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var node in tree.Nodes)
|
|
||||||
DrawNode(node);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void TextUnformattedMono(string text)
|
|
||||||
{
|
|
||||||
using var _ = ImRaii.PushFont(UiBuilder.MonoFont);
|
|
||||||
ImGui.TextUnformatted(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ushort[] GetSelectedGameObjects()
|
private ushort[] GetSelectedGameObjects()
|
||||||
=> _gameObjectIndices.Split(',')
|
=> _gameObjectIndices.Split(',')
|
||||||
.SelectWhere(index => (ushort.TryParse(index.Trim(), out var i), i))
|
.SelectWhere(index => (ushort.TryParse(index.Trim(), out var i), i))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
private unsafe string GameObjectToString(ObjectIndex gameObjectIndex)
|
private unsafe StringU8 GameObjectToString(ObjectIndex gameObjectIndex)
|
||||||
{
|
{
|
||||||
var gameObject = objects[gameObjectIndex];
|
var gameObject = objects[gameObjectIndex];
|
||||||
|
|
||||||
return gameObject.Valid
|
return gameObject.Valid
|
||||||
? $"[{gameObjectIndex}] {gameObject.Utf8Name} ({(ObjectKind)gameObject.AsObject->ObjectKind})"
|
? new StringU8($"[{gameObjectIndex}] {gameObject.Utf8Name} ({(ObjectKind)gameObject.AsObject->ObjectKind})")
|
||||||
: $"[{gameObjectIndex}] null";
|
: new StringU8($"[{gameObjectIndex}] null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using OtterGui;
|
using Luna;
|
||||||
using OtterGui.Raii;
|
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Api.Api;
|
using Penumbra.Api.Api;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
|
|
@ -22,87 +19,79 @@ public class TemporaryIpcTester(
|
||||||
TempCollectionManager tempCollections,
|
TempCollectionManager tempCollections,
|
||||||
SaveService saveService,
|
SaveService saveService,
|
||||||
Configuration config)
|
Configuration config)
|
||||||
: Luna.IUiService
|
: IUiService
|
||||||
{
|
{
|
||||||
public Guid LastCreatedCollectionId = Guid.Empty;
|
public Guid LastCreatedCollectionId = Guid.Empty;
|
||||||
|
|
||||||
private readonly bool _debug = Assembly.GetAssembly(typeof(TemporaryIpcTester))?.GetName().Version?.Major >= 9;
|
private readonly bool _debug = Assembly.GetAssembly(typeof(TemporaryIpcTester))?.GetName().Version?.Major >= 9;
|
||||||
|
|
||||||
private Guid? _tempGuid;
|
private Guid? _tempGuid;
|
||||||
private string _tempCollectionName = string.Empty;
|
private string _tempCollectionName = string.Empty;
|
||||||
private string _tempCollectionGuidName = string.Empty;
|
private string _tempModName = string.Empty;
|
||||||
private string _tempModName = string.Empty;
|
private string _modDirectory = string.Empty;
|
||||||
private string _modDirectory = string.Empty;
|
private string _tempGamePath = "test/game/path.mtrl";
|
||||||
private string _tempGamePath = "test/game/path.mtrl";
|
private string _tempFilePath = "test/success.mtrl";
|
||||||
private string _tempFilePath = "test/success.mtrl";
|
private string _tempManipulation = string.Empty;
|
||||||
private string _tempManipulation = string.Empty;
|
private string _identity = string.Empty;
|
||||||
private string _identity = string.Empty;
|
|
||||||
private PenumbraApiEc _lastTempError;
|
private PenumbraApiEc _lastTempError;
|
||||||
private int _tempActorIndex;
|
private int _tempActorIndex;
|
||||||
private bool _forceOverwrite;
|
private bool _forceOverwrite;
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("Temporary");
|
using var _ = Im.Tree.Node("Temporary"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.InputTextWithHint("##identity", "Identity...", ref _identity, 128);
|
Im.Input.Text("##identity"u8, ref _identity, "Identity..."u8);
|
||||||
ImGui.InputTextWithHint("##tempCollection", "Collection Name...", ref _tempCollectionName, 128);
|
Im.Input.Text("##tempCollection"u8, ref _tempCollectionName, "Collection Name..."u8);
|
||||||
ImGuiUtil.GuidInput("##guid", "Collection GUID...", string.Empty, ref _tempGuid, ref _tempCollectionGuidName);
|
ImEx.GuidInput("##guid"u8, ref _tempGuid, "Collection GUID..."u8);
|
||||||
ImGui.InputInt("##tempActorIndex", ref _tempActorIndex, 0, 0);
|
Im.Input.Scalar("##tempActorIndex"u8, ref _tempActorIndex);
|
||||||
ImGui.InputTextWithHint("##tempMod", "Temporary Mod Name...", ref _tempModName, 32);
|
Im.Input.Text("##tempMod"u8, ref _tempModName, "Temporary Mod Name..."u8);
|
||||||
ImGui.InputTextWithHint("##mod", "Existing Mod Name...", ref _modDirectory, 256);
|
Im.Input.Text("##mod"u8, ref _modDirectory, "Existing Mod Name..."u8);
|
||||||
ImGui.InputTextWithHint("##tempGame", "Game Path...", ref _tempGamePath, 256);
|
Im.Input.Text("##tempGame"u8, ref _tempGamePath, "Game Path..."u8);
|
||||||
ImGui.InputTextWithHint("##tempFile", "File Path...", ref _tempFilePath, 256);
|
Im.Input.Text("##tempFile"u8, ref _tempFilePath, "File Path..."u8);
|
||||||
ImUtf8.InputText("##tempManip"u8, ref _tempManipulation, "Manipulation Base64 String..."u8);
|
Im.Input.Text("##tempManip"u8, ref _tempManipulation, "Manipulation Base64 String..."u8);
|
||||||
ImGui.Checkbox("Force Character Collection Overwrite", ref _forceOverwrite);
|
Im.Checkbox("Force Character Collection Overwrite"u8, ref _forceOverwrite);
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro("Last Error", _lastTempError.ToString());
|
IpcTester.DrawIntro("Last Error", $"{_lastTempError}");
|
||||||
ImGuiUtil.DrawTableColumn("Last Created Collection");
|
table.DrawColumn("Last Created Collection"u8);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
LunaStyle.DrawGuid(LastCreatedCollectionId);
|
||||||
{
|
|
||||||
ImGuiUtil.CopyOnClickSelectable(LastCreatedCollectionId.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcTester.DrawIntro(CreateTemporaryCollection.Label, "Create Temporary Collection");
|
IpcTester.DrawIntro(CreateTemporaryCollection.Label, "Create Temporary Collection"u8);
|
||||||
if (ImGui.Button("Create##Collection"))
|
if (Im.Button("Create##Collection"u8))
|
||||||
{
|
{
|
||||||
_lastTempError = new CreateTemporaryCollection(pi).Invoke(_identity, _tempCollectionName, out LastCreatedCollectionId);
|
_lastTempError = new CreateTemporaryCollection(pi).Invoke(_identity, _tempCollectionName, out LastCreatedCollectionId);
|
||||||
if (_tempGuid == null)
|
if (_tempGuid is null)
|
||||||
{
|
_tempGuid = LastCreatedCollectionId;
|
||||||
_tempGuid = LastCreatedCollectionId;
|
|
||||||
_tempCollectionGuidName = LastCreatedCollectionId.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var guid = _tempGuid.GetValueOrDefault(Guid.Empty);
|
var guid = _tempGuid.GetValueOrDefault(Guid.Empty);
|
||||||
|
|
||||||
IpcTester.DrawIntro(DeleteTemporaryCollection.Label, "Delete Temporary Collection");
|
IpcTester.DrawIntro(DeleteTemporaryCollection.Label, "Delete Temporary Collection"u8);
|
||||||
if (ImGui.Button("Delete##Collection"))
|
if (Im.Button("Delete##Collection"u8))
|
||||||
_lastTempError = new DeleteTemporaryCollection(pi).Invoke(guid);
|
_lastTempError = new DeleteTemporaryCollection(pi).Invoke(guid);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Delete Last##Collection"))
|
if (Im.Button("Delete Last##Collection"u8))
|
||||||
_lastTempError = new DeleteTemporaryCollection(pi).Invoke(LastCreatedCollectionId);
|
_lastTempError = new DeleteTemporaryCollection(pi).Invoke(LastCreatedCollectionId);
|
||||||
|
|
||||||
IpcTester.DrawIntro(AssignTemporaryCollection.Label, "Assign Temporary Collection");
|
IpcTester.DrawIntro(AssignTemporaryCollection.Label, "Assign Temporary Collection"u8);
|
||||||
if (ImGui.Button("Assign##NamedCollection"))
|
if (Im.Button("Assign##NamedCollection"u8))
|
||||||
_lastTempError = new AssignTemporaryCollection(pi).Invoke(guid, _tempActorIndex, _forceOverwrite);
|
_lastTempError = new AssignTemporaryCollection(pi).Invoke(guid, _tempActorIndex, _forceOverwrite);
|
||||||
|
|
||||||
IpcTester.DrawIntro(AddTemporaryMod.Label, "Add Temporary Mod to specific Collection");
|
IpcTester.DrawIntro(AddTemporaryMod.Label, "Add Temporary Mod to specific Collection"u8);
|
||||||
if (ImGui.Button("Add##Mod"))
|
if (Im.Button("Add##Mod"u8))
|
||||||
_lastTempError = new AddTemporaryMod(pi).Invoke(_tempModName, guid,
|
_lastTempError = new AddTemporaryMod(pi).Invoke(_tempModName, guid,
|
||||||
new Dictionary<string, string> { { _tempGamePath, _tempFilePath } },
|
new Dictionary<string, string> { { _tempGamePath, _tempFilePath } },
|
||||||
_tempManipulation.Length > 0 ? _tempManipulation : string.Empty, int.MaxValue);
|
_tempManipulation.Length > 0 ? _tempManipulation : string.Empty, int.MaxValue);
|
||||||
|
|
||||||
IpcTester.DrawIntro(CreateTemporaryCollection.Label, "Copy Existing Collection");
|
IpcTester.DrawIntro(CreateTemporaryCollection.Label, "Copy Existing Collection"u8);
|
||||||
if (ImGuiUtil.DrawDisabledButton("Copy##Collection", Vector2.Zero,
|
if (ImEx.Button("Copy##Collection"u8, Vector2.Zero, "Copies the effective list from the collection named in Temporary Mod Name..."u8,
|
||||||
"Copies the effective list from the collection named in Temporary Mod Name...",
|
|
||||||
!collections.Storage.ByName(_tempModName, out var copyCollection))
|
!collections.Storage.ByName(_tempModName, out var copyCollection))
|
||||||
&& copyCollection is { HasCache: true })
|
&& copyCollection is { HasCache: true })
|
||||||
{
|
{
|
||||||
|
|
@ -111,207 +100,199 @@ public class TemporaryIpcTester(
|
||||||
_lastTempError = new AddTemporaryMod(pi).Invoke(_tempModName, guid, files, manips, 999);
|
_lastTempError = new AddTemporaryMod(pi).Invoke(_tempModName, guid, files, manips, 999);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(AddTemporaryModAll.Label, "Add Temporary Mod to all Collections");
|
IpcTester.DrawIntro(AddTemporaryModAll.Label, "Add Temporary Mod to all Collections"u8);
|
||||||
if (ImGui.Button("Add##All"))
|
if (Im.Button("Add##All"u8))
|
||||||
_lastTempError = new AddTemporaryModAll(pi).Invoke(_tempModName,
|
_lastTempError = new AddTemporaryModAll(pi).Invoke(_tempModName,
|
||||||
new Dictionary<string, string> { { _tempGamePath, _tempFilePath } },
|
new Dictionary<string, string> { { _tempGamePath, _tempFilePath } },
|
||||||
_tempManipulation.Length > 0 ? _tempManipulation : string.Empty, int.MaxValue);
|
_tempManipulation.Length > 0 ? _tempManipulation : string.Empty, int.MaxValue);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RemoveTemporaryMod.Label, "Remove Temporary Mod from specific Collection");
|
IpcTester.DrawIntro(RemoveTemporaryMod.Label, "Remove Temporary Mod from specific Collection"u8);
|
||||||
if (ImGui.Button("Remove##Mod"))
|
if (Im.Button("Remove##Mod"u8))
|
||||||
_lastTempError = new RemoveTemporaryMod(pi).Invoke(_tempModName, guid, int.MaxValue);
|
_lastTempError = new RemoveTemporaryMod(pi).Invoke(_tempModName, guid, int.MaxValue);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RemoveTemporaryModAll.Label, "Remove Temporary Mod from all Collections");
|
IpcTester.DrawIntro(RemoveTemporaryModAll.Label, "Remove Temporary Mod from all Collections"u8);
|
||||||
if (ImGui.Button("Remove##ModAll"))
|
if (Im.Button("Remove##ModAll"u8))
|
||||||
_lastTempError = new RemoveTemporaryModAll(pi).Invoke(_tempModName, int.MaxValue);
|
_lastTempError = new RemoveTemporaryModAll(pi).Invoke(_tempModName, int.MaxValue);
|
||||||
|
|
||||||
IpcTester.DrawIntro(SetTemporaryModSettings.Label, "Set Temporary Mod Settings (to default) in specific Collection");
|
IpcTester.DrawIntro(SetTemporaryModSettings.Label, "Set Temporary Mod Settings (to default) in specific Collection"u8);
|
||||||
if (ImUtf8.Button("Set##SetTemporary"u8))
|
if (Im.Button("Set##SetTemporary"u8))
|
||||||
_lastTempError = new SetTemporaryModSettings(pi).Invoke(guid, _modDirectory, false, true, 1337,
|
_lastTempError = new SetTemporaryModSettings(pi).Invoke(guid, _modDirectory, false, true, 1337,
|
||||||
new Dictionary<string, IReadOnlyList<string>>(),
|
new Dictionary<string, IReadOnlyList<string>>(),
|
||||||
"IPC Tester", 1337);
|
"IPC Tester", 1337);
|
||||||
|
|
||||||
IpcTester.DrawIntro(SetTemporaryModSettingsPlayer.Label, "Set Temporary Mod Settings (to default) in game object collection");
|
IpcTester.DrawIntro(SetTemporaryModSettingsPlayer.Label, "Set Temporary Mod Settings (to default) in game object collection"u8);
|
||||||
if (ImUtf8.Button("Set##SetTemporaryPlayer"u8))
|
if (Im.Button("Set##SetTemporaryPlayer"u8))
|
||||||
_lastTempError = new SetTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, false, true, 1337,
|
_lastTempError = new SetTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, false, true, 1337,
|
||||||
new Dictionary<string, IReadOnlyList<string>>(),
|
new Dictionary<string, IReadOnlyList<string>>(),
|
||||||
"IPC Tester", 1337);
|
"IPC Tester", 1337);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RemoveTemporaryModSettings.Label, "Remove Temporary Mod Settings from specific Collection");
|
IpcTester.DrawIntro(RemoveTemporaryModSettings.Label, "Remove Temporary Mod Settings from specific Collection"u8);
|
||||||
if (ImUtf8.Button("Remove##RemoveTemporary"u8))
|
if (Im.Button("Remove##RemoveTemporary"u8))
|
||||||
_lastTempError = new RemoveTemporaryModSettings(pi).Invoke(guid, _modDirectory, 1337);
|
_lastTempError = new RemoveTemporaryModSettings(pi).Invoke(guid, _modDirectory, 1337);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Remove (Wrong Key)##RemoveTemporary"u8))
|
if (Im.Button("Remove (Wrong Key)##RemoveTemporary"u8))
|
||||||
_lastTempError = new RemoveTemporaryModSettings(pi).Invoke(guid, _modDirectory, 1338);
|
_lastTempError = new RemoveTemporaryModSettings(pi).Invoke(guid, _modDirectory, 1338);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RemoveTemporaryModSettingsPlayer.Label, "Remove Temporary Mod Settings from game object Collection");
|
IpcTester.DrawIntro(RemoveTemporaryModSettingsPlayer.Label, "Remove Temporary Mod Settings from game object Collection"u8);
|
||||||
if (ImUtf8.Button("Remove##RemoveTemporaryPlayer"u8))
|
if (Im.Button("Remove##RemoveTemporaryPlayer"u8))
|
||||||
_lastTempError = new RemoveTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, 1337);
|
_lastTempError = new RemoveTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, 1337);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Remove (Wrong Key)##RemoveTemporaryPlayer"u8))
|
if (Im.Button("Remove (Wrong Key)##RemoveTemporaryPlayer"u8))
|
||||||
_lastTempError = new RemoveTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, 1338);
|
_lastTempError = new RemoveTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, 1338);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RemoveAllTemporaryModSettings.Label, "Remove All Temporary Mod Settings from specific Collection");
|
IpcTester.DrawIntro(RemoveAllTemporaryModSettings.Label, "Remove All Temporary Mod Settings from specific Collection"u8);
|
||||||
if (ImUtf8.Button("Remove##RemoveAllTemporary"u8))
|
if (Im.Button("Remove##RemoveAllTemporary"u8))
|
||||||
_lastTempError = new RemoveAllTemporaryModSettings(pi).Invoke(guid, 1337);
|
_lastTempError = new RemoveAllTemporaryModSettings(pi).Invoke(guid, 1337);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Remove (Wrong Key)##RemoveAllTemporary"u8))
|
if (Im.Button("Remove (Wrong Key)##RemoveAllTemporary"u8))
|
||||||
_lastTempError = new RemoveAllTemporaryModSettings(pi).Invoke(guid, 1338);
|
_lastTempError = new RemoveAllTemporaryModSettings(pi).Invoke(guid, 1338);
|
||||||
|
|
||||||
IpcTester.DrawIntro(RemoveAllTemporaryModSettingsPlayer.Label, "Remove All Temporary Mod Settings from game object Collection");
|
IpcTester.DrawIntro(RemoveAllTemporaryModSettingsPlayer.Label, "Remove All Temporary Mod Settings from game object Collection"u8);
|
||||||
if (ImUtf8.Button("Remove##RemoveAllTemporaryPlayer"u8))
|
if (Im.Button("Remove##RemoveAllTemporaryPlayer"u8))
|
||||||
_lastTempError = new RemoveAllTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, 1337);
|
_lastTempError = new RemoveAllTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, 1337);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Remove (Wrong Key)##RemoveAllTemporaryPlayer"u8))
|
if (Im.Button("Remove (Wrong Key)##RemoveAllTemporaryPlayer"u8))
|
||||||
_lastTempError = new RemoveAllTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, 1338);
|
_lastTempError = new RemoveAllTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, 1338);
|
||||||
|
|
||||||
IpcTester.DrawIntro(QueryTemporaryModSettings.Label, "Query Temporary Mod Settings from specific Collection");
|
IpcTester.DrawIntro(QueryTemporaryModSettings.Label, "Query Temporary Mod Settings from specific Collection"u8);
|
||||||
ImUtf8.Button("Query##QueryTemporaryModSettings"u8);
|
Im.Button("Query##QueryTemporaryModSettings"u8);
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
_lastTempError = new QueryTemporaryModSettings(pi).Invoke(guid, _modDirectory, out var settings, out var source, 1337);
|
_lastTempError = new QueryTemporaryModSettings(pi).Invoke(guid, _modDirectory, out var settings, out var source, 1337);
|
||||||
DrawTooltip(settings, source);
|
DrawTooltip(settings, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Button("Query (Wrong Key)##RemoveAllTemporary"u8);
|
Im.Button("Query (Wrong Key)##RemoveAllTemporary"u8);
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
_lastTempError = new QueryTemporaryModSettings(pi).Invoke(guid, _modDirectory, out var settings, out var source, 1338);
|
_lastTempError = new QueryTemporaryModSettings(pi).Invoke(guid, _modDirectory, out var settings, out var source, 1338);
|
||||||
DrawTooltip(settings, source);
|
DrawTooltip(settings, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcTester.DrawIntro(QueryTemporaryModSettingsPlayer.Label, "Query Temporary Mod Settings from game object Collection");
|
IpcTester.DrawIntro(QueryTemporaryModSettingsPlayer.Label, "Query Temporary Mod Settings from game object Collection"u8);
|
||||||
ImUtf8.Button("Query##QueryTemporaryModSettingsPlayer"u8);
|
Im.Button("Query##QueryTemporaryModSettingsPlayer"u8);
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
_lastTempError =
|
_lastTempError =
|
||||||
new QueryTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, out var settings, out var source, 1337);
|
new QueryTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, out var settings, out var source, 1337);
|
||||||
DrawTooltip(settings, source);
|
DrawTooltip(settings, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Button("Query (Wrong Key)##RemoveAllTemporaryPlayer"u8);
|
Im.Button("Query (Wrong Key)##RemoveAllTemporaryPlayer"u8);
|
||||||
if (ImGui.IsItemHovered())
|
if (Im.Item.Hovered())
|
||||||
{
|
{
|
||||||
_lastTempError =
|
_lastTempError =
|
||||||
new QueryTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, out var settings, out var source, 1338);
|
new QueryTemporaryModSettingsPlayer(pi).Invoke(_tempActorIndex, _modDirectory, out var settings, out var source, 1338);
|
||||||
DrawTooltip(settings, source);
|
DrawTooltip(settings, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
void DrawTooltip((bool ForceInherit, bool Enabled, int Priority, Dictionary<string, List<string>> Settings)? settings, string source)
|
void DrawTooltip((bool ForceInherit, bool Enabled, int Priority, Dictionary<string, List<string>> Settings)? settings, string source)
|
||||||
{
|
{
|
||||||
using var tt = ImUtf8.Tooltip();
|
using var tt = Im.Tooltip.Begin();
|
||||||
ImUtf8.Text($"Query returned {_lastTempError}");
|
Im.Text($"Query returned {_lastTempError}");
|
||||||
if (settings != null)
|
if (settings != null)
|
||||||
ImUtf8.Text($"Settings created by {(source.Length == 0 ? "Unknown Source" : source)}:");
|
Im.Text($"Settings created by {(source.Length == 0 ? "Unknown Source" : source)}:");
|
||||||
else
|
else
|
||||||
ImUtf8.Text(source.Length > 0 ? $"Locked by {source}." : "No settings exist.");
|
Im.Text(source.Length > 0 ? $"Locked by {source}." : "No settings exist.");
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
if (settings == null)
|
if (settings == null)
|
||||||
{
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
using (ImUtf8.Group())
|
using (Im.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.Text("Force Inherit"u8);
|
Im.Text("Force Inherit"u8);
|
||||||
ImUtf8.Text("Enabled"u8);
|
Im.Text("Enabled"u8);
|
||||||
ImUtf8.Text("Priority"u8);
|
Im.Text("Priority"u8);
|
||||||
foreach (var group in settings.Value.Settings.Keys)
|
foreach (var group in settings.Value.Settings.Keys)
|
||||||
ImUtf8.Text(group);
|
Im.Text(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (Im.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.Text($"{settings.Value.ForceInherit}");
|
Im.Text($"{settings.Value.ForceInherit}");
|
||||||
ImUtf8.Text($"{settings.Value.Enabled}");
|
Im.Text($"{settings.Value.Enabled}");
|
||||||
ImUtf8.Text($"{settings.Value.Priority}");
|
Im.Text($"{settings.Value.Priority}");
|
||||||
foreach (var group in settings.Value.Settings.Values)
|
foreach (var group in settings.Value.Settings.Values)
|
||||||
ImUtf8.Text(string.Join("; ", group));
|
Im.Text(string.Join("; ", group));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawCollections()
|
public void DrawCollections()
|
||||||
{
|
{
|
||||||
using var collTree = ImUtf8.TreeNode("Temporary Collections##TempCollections"u8);
|
using var collTree = Im.Tree.Node("Temporary Collections##TempCollections"u8);
|
||||||
if (!collTree)
|
if (!collTree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##collTree"u8, 6, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##collTree"u8, 6, TableFlags.SizingFixedFit);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var (idx, collection) in tempCollections.Values.Index())
|
foreach (var (idx, collection) in tempCollections.Values.Index())
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId(idx);
|
using var id = Im.Id.Push(idx);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
var character = tempCollections.Collections.Where(p => p.Collection == collection).Select(p => p.DisplayName)
|
var character = tempCollections.Collections.Where(p => p.Collection == collection).Select(p => p.DisplayName)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault()
|
||||||
?? "Unknown";
|
?? "Unknown";
|
||||||
if (_debug && ImUtf8.Button("Save##Collection"u8))
|
if (_debug && Im.Button("Save##Collection"u8))
|
||||||
TemporaryMod.SaveTempCollection(config, saveService, modManager, collection, character);
|
TemporaryMod.SaveTempCollection(config, saveService, modManager, collection, character);
|
||||||
|
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
table.NextColumn();
|
||||||
{
|
LunaStyle.DrawGuid(collection.Identity.Id);
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn(collection.Identity.Name);
|
||||||
ImGuiUtil.CopyOnClickSelectable(collection.Identity.Identifier);
|
table.DrawColumn($"{collection.ResolvedFiles.Count}");
|
||||||
}
|
table.DrawColumn($"{collection.MetaCache?.Count ?? 0}");
|
||||||
|
table.DrawColumn(string.Join(", ",
|
||||||
ImGuiUtil.DrawTableColumn(collection.Identity.Name);
|
|
||||||
ImGuiUtil.DrawTableColumn(collection.ResolvedFiles.Count.ToString());
|
|
||||||
ImGuiUtil.DrawTableColumn(collection.MetaCache?.Count.ToString() ?? "0");
|
|
||||||
ImGuiUtil.DrawTableColumn(string.Join(", ",
|
|
||||||
tempCollections.Collections.Where(p => p.Collection == collection).Select(c => c.DisplayName)));
|
tempCollections.Collections.Where(p => p.Collection == collection).Select(c => c.DisplayName)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawMods()
|
public void DrawMods()
|
||||||
{
|
{
|
||||||
using var modTree = ImRaii.TreeNode("Temporary Mods##TempMods");
|
using var modTree = Im.Tree.Node("Temporary Mods##TempMods"u8);
|
||||||
if (!modTree)
|
if (!modTree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var table = ImRaii.Table("##modTree", 5, ImGuiTableFlags.SizingFixedFit);
|
using var table = Im.Table.Begin("##modTree"u8, 5, TableFlags.SizingFixedFit);
|
||||||
|
if (!table)
|
||||||
|
return;
|
||||||
|
|
||||||
void PrintList(string collectionName, IReadOnlyList<TemporaryMod> list)
|
PrintList(table, "All"u8, tempMods.ModsForAllCollections);
|
||||||
|
foreach (var (collection, list) in tempMods.Mods)
|
||||||
|
PrintList(table, collection.Identity.Name, list);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
static void PrintList(in Im.TableDisposable table, Utf8StringHandler<TextStringHandlerBuffer> collectionName,
|
||||||
|
IReadOnlyList<TemporaryMod> list)
|
||||||
{
|
{
|
||||||
foreach (var mod in list)
|
foreach (var mod in list)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn(mod.Name);
|
||||||
ImGui.TextUnformatted(mod.Name);
|
table.DrawColumn($"{mod.Priority}");
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn(ref collectionName);
|
||||||
ImGui.TextUnformatted(mod.Priority.ToString());
|
table.DrawColumn($"{mod.Default.Files.Count}");
|
||||||
ImGui.TableNextColumn();
|
if (Im.Item.Hovered())
|
||||||
ImGui.TextUnformatted(collectionName);
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
ImGui.TextUnformatted(mod.Default.Files.Count.ToString());
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
{
|
||||||
using var tt = ImRaii.Tooltip();
|
using var tt = Im.Tooltip.Begin();
|
||||||
foreach (var (path, file) in mod.Default.Files)
|
foreach (var (path, file) in mod.Default.Files)
|
||||||
ImGui.TextUnformatted($"{path} -> {file}");
|
Im.Text($"{path} -> {file}");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
table.DrawColumn($"{mod.TotalManipulations}");
|
||||||
ImGui.TextUnformatted(mod.TotalManipulations.ToString());
|
if (Im.Item.Hovered())
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
{
|
||||||
using var tt = ImRaii.Tooltip();
|
using var tt = Im.Tooltip.Begin();
|
||||||
foreach (var identifier in mod.Default.Manipulations.Identifiers)
|
foreach (var identifier in mod.Default.Manipulations.Identifiers)
|
||||||
ImGui.TextUnformatted(identifier.ToString());
|
Im.Text($"{identifier}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (table)
|
|
||||||
{
|
|
||||||
PrintList("All", tempMods.ModsForAllCollections);
|
|
||||||
foreach (var (collection, list) in tempMods.Mods)
|
|
||||||
PrintList(collection.Identity.Name, list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Api.Helpers;
|
using Penumbra.Api.Helpers;
|
||||||
using Penumbra.Api.IpcSubscribers;
|
using Penumbra.Api.IpcSubscribers;
|
||||||
|
using MouseButton = Penumbra.Api.Enums.MouseButton;
|
||||||
|
|
||||||
namespace Penumbra.Api.IpcTester;
|
namespace Penumbra.Api.IpcTester;
|
||||||
|
|
||||||
public class UiIpcTester : Luna.IUiService, IDisposable
|
public class UiIpcTester : Luna.IUiService, IDisposable
|
||||||
{
|
{
|
||||||
private readonly IDalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
public readonly EventSubscriber<string, float, float> PreSettingsTabBar;
|
public readonly EventSubscriber<string, float, float> PreSettingsTabBar;
|
||||||
public readonly EventSubscriber<string> PreSettingsPanel;
|
public readonly EventSubscriber<string> PreSettingsPanel;
|
||||||
public readonly EventSubscriber<string> PostEnabled;
|
public readonly EventSubscriber<string> PostEnabled;
|
||||||
|
|
@ -17,12 +17,12 @@ public class UiIpcTester : Luna.IUiService, IDisposable
|
||||||
public readonly EventSubscriber<ChangedItemType, uint> ChangedItemTooltip;
|
public readonly EventSubscriber<ChangedItemType, uint> ChangedItemTooltip;
|
||||||
public readonly EventSubscriber<MouseButton, ChangedItemType, uint> ChangedItemClicked;
|
public readonly EventSubscriber<MouseButton, ChangedItemType, uint> ChangedItemClicked;
|
||||||
|
|
||||||
private string _lastDrawnMod = string.Empty;
|
private StringU8 _lastDrawnMod = StringU8.Empty;
|
||||||
private DateTimeOffset _lastDrawnModTime = DateTimeOffset.MinValue;
|
private DateTimeOffset _lastDrawnModTime = DateTimeOffset.MinValue;
|
||||||
private bool _subscribedToTooltip;
|
private bool _subscribedToTooltip;
|
||||||
private bool _subscribedToClick;
|
private bool _subscribedToClick;
|
||||||
private string _lastClicked = string.Empty;
|
private StringU8 _lastClicked = StringU8.Empty;
|
||||||
private string _lastHovered = string.Empty;
|
private StringU8 _lastHovered = StringU8.Empty;
|
||||||
private TabType _selectTab = TabType.None;
|
private TabType _selectTab = TabType.None;
|
||||||
private string _modName = string.Empty;
|
private string _modName = string.Empty;
|
||||||
private PenumbraApiEc _ec = PenumbraApiEc.Success;
|
private PenumbraApiEc _ec = PenumbraApiEc.Success;
|
||||||
|
|
@ -30,10 +30,10 @@ public class UiIpcTester : Luna.IUiService, IDisposable
|
||||||
public UiIpcTester(IDalamudPluginInterface pi)
|
public UiIpcTester(IDalamudPluginInterface pi)
|
||||||
{
|
{
|
||||||
_pi = pi;
|
_pi = pi;
|
||||||
PreSettingsTabBar = IpcSubscribers.PreSettingsTabBarDraw.Subscriber(pi, UpdateLastDrawnMod);
|
PreSettingsTabBar = PreSettingsTabBarDraw.Subscriber(pi, UpdateLastDrawnMod);
|
||||||
PreSettingsPanel = IpcSubscribers.PreSettingsDraw.Subscriber(pi, UpdateLastDrawnMod);
|
PreSettingsPanel = PreSettingsDraw.Subscriber(pi, UpdateLastDrawnMod);
|
||||||
PostEnabled = IpcSubscribers.PostEnabledDraw.Subscriber(pi, UpdateLastDrawnMod);
|
PostEnabled = PostEnabledDraw.Subscriber(pi, UpdateLastDrawnMod);
|
||||||
PostSettingsPanelDraw = IpcSubscribers.PostSettingsDraw.Subscriber(pi, UpdateLastDrawnMod);
|
PostSettingsPanelDraw = PostSettingsDraw.Subscriber(pi, UpdateLastDrawnMod);
|
||||||
ChangedItemTooltip = IpcSubscribers.ChangedItemTooltip.Subscriber(pi, AddedTooltip);
|
ChangedItemTooltip = IpcSubscribers.ChangedItemTooltip.Subscriber(pi, AddedTooltip);
|
||||||
ChangedItemClicked = IpcSubscribers.ChangedItemClicked.Subscriber(pi, AddedClick);
|
ChangedItemClicked = IpcSubscribers.ChangedItemClicked.Subscriber(pi, AddedClick);
|
||||||
PreSettingsTabBar.Disable();
|
PreSettingsTabBar.Disable();
|
||||||
|
|
@ -56,30 +56,21 @@ public class UiIpcTester : Luna.IUiService, IDisposable
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.TreeNode("UI");
|
using var _ = Im.Tree.Node("UI"u8);
|
||||||
if (!_)
|
if (!_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (var combo = ImRaii.Combo("Tab to Open at", _selectTab.ToString()))
|
EnumCombo<TabType>.Instance.Draw("Tab to Open at"u8, ref _selectTab, default, 0);
|
||||||
{
|
Im.Input.Text("##openMod"u8, ref _modName, "Mod to Open at..."u8);
|
||||||
if (combo)
|
using var table = Im.Table.Begin(StringU8.Empty, 3, TableFlags.SizingFixedFit);
|
||||||
foreach (var val in Enum.GetValues<TabType>())
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(val.ToString(), _selectTab == val))
|
|
||||||
_selectTab = val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.InputTextWithHint("##openMod", "Mod to Open at...", ref _modName, 256);
|
|
||||||
using var table = ImRaii.Table(string.Empty, 3, ImGuiTableFlags.SizingFixedFit);
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IpcTester.DrawIntro(IpcSubscribers.PostSettingsDraw.Label, "Last Drawn Mod");
|
IpcTester.DrawIntro(PostSettingsDraw.Label, "Last Drawn Mod"u8);
|
||||||
ImGui.TextUnformatted(_lastDrawnMod.Length > 0 ? $"{_lastDrawnMod} at {_lastDrawnModTime}" : "None");
|
Im.Text(_lastDrawnMod.Length > 0 ? $"{_lastDrawnMod} at {_lastDrawnModTime}" : "None"u8);
|
||||||
|
|
||||||
IpcTester.DrawIntro(IpcSubscribers.ChangedItemTooltip.Label, "Add Tooltip");
|
IpcTester.DrawIntro(IpcSubscribers.ChangedItemTooltip.Label, "Add Tooltip"u8);
|
||||||
if (ImGui.Checkbox("##tooltip", ref _subscribedToTooltip))
|
if (Im.Checkbox("##tooltip"u8, ref _subscribedToTooltip))
|
||||||
{
|
{
|
||||||
if (_subscribedToTooltip)
|
if (_subscribedToTooltip)
|
||||||
ChangedItemTooltip.Enable();
|
ChangedItemTooltip.Enable();
|
||||||
|
|
@ -87,11 +78,11 @@ public class UiIpcTester : Luna.IUiService, IDisposable
|
||||||
ChangedItemTooltip.Disable();
|
ChangedItemTooltip.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastHovered);
|
Im.Text(_lastHovered);
|
||||||
|
|
||||||
IpcTester.DrawIntro(IpcSubscribers.ChangedItemClicked.Label, "Subscribe Click");
|
IpcTester.DrawIntro(IpcSubscribers.ChangedItemClicked.Label, "Subscribe Click"u8);
|
||||||
if (ImGui.Checkbox("##click", ref _subscribedToClick))
|
if (Im.Checkbox("##click"u8, ref _subscribedToClick))
|
||||||
{
|
{
|
||||||
if (_subscribedToClick)
|
if (_subscribedToClick)
|
||||||
ChangedItemClicked.Enable();
|
ChangedItemClicked.Enable();
|
||||||
|
|
@ -99,34 +90,33 @@ public class UiIpcTester : Luna.IUiService, IDisposable
|
||||||
ChangedItemClicked.Disable();
|
ChangedItemClicked.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_lastClicked);
|
Im.Text(_lastClicked);
|
||||||
IpcTester.DrawIntro(OpenMainWindow.Label, "Open Mod Window");
|
IpcTester.DrawIntro(OpenMainWindow.Label, "Open Mod Window"u8);
|
||||||
if (ImGui.Button("Open##window"))
|
if (Im.Button("Open##window"u8))
|
||||||
_ec = new OpenMainWindow(_pi).Invoke(_selectTab, _modName, _modName);
|
_ec = new OpenMainWindow(_pi).Invoke(_selectTab, _modName, _modName);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted(_ec.ToString());
|
Im.Text($"{_ec}");
|
||||||
|
|
||||||
IpcTester.DrawIntro(CloseMainWindow.Label, "Close Mod Window");
|
IpcTester.DrawIntro(CloseMainWindow.Label, "Close Mod Window"u8);
|
||||||
if (ImGui.Button("Close##window"))
|
if (Im.Button("Close##window"u8))
|
||||||
new CloseMainWindow(_pi).Invoke();
|
new CloseMainWindow(_pi).Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateLastDrawnMod(string name)
|
private void UpdateLastDrawnMod(string name)
|
||||||
=> (_lastDrawnMod, _lastDrawnModTime) = (name, DateTimeOffset.Now);
|
=> (_lastDrawnMod, _lastDrawnModTime) = (new StringU8(name), DateTimeOffset.Now);
|
||||||
|
|
||||||
private void UpdateLastDrawnMod(string name, float _1, float _2)
|
private void UpdateLastDrawnMod(string name, float _1, float _2)
|
||||||
=> (_lastDrawnMod, _lastDrawnModTime) = (name, DateTimeOffset.Now);
|
=> (_lastDrawnMod, _lastDrawnModTime) = (new StringU8(name), DateTimeOffset.Now);
|
||||||
|
|
||||||
private void AddedTooltip(ChangedItemType type, uint id)
|
private void AddedTooltip(ChangedItemType type, uint id)
|
||||||
{
|
{
|
||||||
_lastHovered = $"{type} {id} at {DateTime.UtcNow.ToLocalTime().ToString(CultureInfo.CurrentCulture)}";
|
_lastHovered = new StringU8($"{type} {id} at {DateTime.UtcNow.ToLocalTime().ToString(CultureInfo.CurrentCulture)}");
|
||||||
ImGui.TextUnformatted("IPC Test Successful");
|
Im.Text("IPC Test Successful"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddedClick(MouseButton button, ChangedItemType type, uint id)
|
private void AddedClick(MouseButton button, ChangedItemType type, uint id)
|
||||||
{
|
=> _lastClicked =
|
||||||
_lastClicked = $"{button}-click on {type} {id} at {DateTime.UtcNow.ToLocalTime().ToString(CultureInfo.CurrentCulture)}";
|
new StringU8($"{button}-click on {type} {id} at {DateTime.UtcNow.ToLocalTime().ToString(CultureInfo.CurrentCulture)}");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ using Dalamud.Bindings.ImGui;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
||||||
namespace Penumbra;
|
namespace Penumbra;
|
||||||
|
|
||||||
public enum ChangedItemMode
|
public enum ChangedItemMode
|
||||||
{
|
{
|
||||||
GroupedCollapsed,
|
GroupedCollapsed,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using SixLabors.ImageSharp.PixelFormats;
|
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
|
using ImSharp;
|
||||||
using Penumbra.UI;
|
using Penumbra.UI;
|
||||||
|
using Rgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32;
|
||||||
|
|
||||||
namespace Penumbra.Import.Textures;
|
namespace Penumbra.Import.Textures;
|
||||||
|
|
||||||
|
|
@ -237,7 +238,7 @@ public partial class CombinedTexture
|
||||||
ImGui.SetNextItemWidth(75.0f * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(75.0f * UiHelpers.Scale);
|
||||||
ImGui.DragInt("##XOffset", ref _offsetX, 0.5f);
|
ImGui.DragInt("##XOffset", ref _offsetX, 0.5f);
|
||||||
ret |= ImGui.IsItemDeactivatedAfterEdit();
|
ret |= ImGui.IsItemDeactivatedAfterEdit();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(75.0f * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(75.0f * UiHelpers.Scale);
|
||||||
ImGui.DragInt("Offsets##YOffset", ref _offsetY, 0.5f);
|
ImGui.DragInt("Offsets##YOffset", ref _offsetY, 0.5f);
|
||||||
ret |= ImGui.IsItemDeactivatedAfterEdit();
|
ret |= ImGui.IsItemDeactivatedAfterEdit();
|
||||||
|
|
@ -273,7 +274,7 @@ public partial class CombinedTexture
|
||||||
ImGui.TextUnformatted("Copy");
|
ImGui.TextUnformatted("Copy");
|
||||||
foreach (var channel in Enum.GetValues<Channels>())
|
foreach (var channel in Enum.GetValues<Channels>())
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var copy = (_copyChannels & channel) != 0;
|
var copy = (_copyChannels & channel) != 0;
|
||||||
if (ImGui.Checkbox(channel.ToString(), ref copy))
|
if (ImGui.Checkbox(channel.ToString(), ref copy))
|
||||||
{
|
{
|
||||||
|
|
@ -352,28 +353,28 @@ public partial class CombinedTexture
|
||||||
private static bool DrawMatrixTools(ref Matrix4x4 multiplier, ref Vector4 constant)
|
private static bool DrawMatrixTools(ref Matrix4x4 multiplier, ref Vector4 constant)
|
||||||
{
|
{
|
||||||
var changes = PresetCombo(ref multiplier, ref constant);
|
var changes = PresetCombo(ref multiplier, ref constant);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.Dummy(ImGuiHelpers.ScaledVector2(20, 0));
|
ImGui.Dummy(ImGuiHelpers.ScaledVector2(20, 0));
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted("Invert");
|
ImGui.TextUnformatted("Invert");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
Channels channels = 0;
|
Channels channels = 0;
|
||||||
if (ImGui.Button("Colors"))
|
if (ImGui.Button("Colors"))
|
||||||
channels |= Channels.Red | Channels.Green | Channels.Blue;
|
channels |= Channels.Red | Channels.Green | Channels.Blue;
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("R"))
|
if (ImGui.Button("R"))
|
||||||
channels |= Channels.Red;
|
channels |= Channels.Red;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("G"))
|
if (ImGui.Button("G"))
|
||||||
channels |= Channels.Green;
|
channels |= Channels.Green;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("B"))
|
if (ImGui.Button("B"))
|
||||||
channels |= Channels.Blue;
|
channels |= Channels.Blue;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("A"))
|
if (ImGui.Button("A"))
|
||||||
channels |= Channels.Alpha;
|
channels |= Channels.Alpha;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public partial class CombinedTexture : IDisposable
|
||||||
break;
|
break;
|
||||||
case TextureType.Png:
|
case TextureType.Png:
|
||||||
SaveAsPng(textures, path);
|
SaveAsPng(textures, path);
|
||||||
break;
|
break;
|
||||||
case TextureType.Targa:
|
case TextureType.Targa:
|
||||||
SaveAsTarga(textures, path);
|
SaveAsTarga(textures, path);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using ImSharp;
|
||||||
using Lumina.Data.Files;
|
using Lumina.Data.Files;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -9,6 +10,7 @@ using Penumbra.Mods.Editor;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
using Penumbra.UI;
|
using Penumbra.UI;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||||
|
|
||||||
namespace Penumbra.Import.Textures;
|
namespace Penumbra.Import.Textures;
|
||||||
|
|
||||||
|
|
@ -53,7 +55,7 @@ public static class TextureDrawer
|
||||||
current.Load(textures, tmpPath);
|
current.Load(textures, tmpPath);
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(tooltip);
|
ImGuiUtil.HoverTooltip(tooltip);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Folder.ToIconString(), new Vector2(ImGui.GetFrameHeight()), string.Empty, false,
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Folder.ToIconString(), new Vector2(ImGui.GetFrameHeight()), string.Empty, false,
|
||||||
true))
|
true))
|
||||||
{
|
{
|
||||||
|
|
@ -69,7 +71,7 @@ public static class TextureDrawer
|
||||||
fileDialog.OpenFilePicker("Open Image...", "Textures{.png,.dds,.tex,.tga}", UpdatePath, 1, startPath, false);
|
fileDialog.OpenFilePicker("Open Image...", "Textures{.png,.dds,.tex,.tga}", UpdatePath, 1, startPath, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Recycle.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Recycle.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
||||||
"Reload the currently selected path.", false,
|
"Reload the currently selected path.", false,
|
||||||
true))
|
true))
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using System.Collections.Frozen;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Mods.Manager;
|
using Penumbra.Mods.Manager;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
|
@ -78,18 +79,18 @@ public static class FeatureChecker
|
||||||
editor.ChangeRequiredFeatures(mod, mod.RequiredFeatures | flag);
|
editor.ChangeRequiredFeatures(mod, mod.RequiredFeatures | flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImUtf8.ButtonEx("Compute"u8, "Compute the required features automatically from the used features."u8, size))
|
if (ImUtf8.ButtonEx("Compute"u8, "Compute the required features automatically from the used features."u8, size))
|
||||||
editor.ChangeRequiredFeatures(mod, mod.ComputeRequiredFeatures());
|
editor.ChangeRequiredFeatures(mod, mod.ComputeRequiredFeatures());
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Clear"u8, "Clear all required features."u8, size))
|
if (ImUtf8.ButtonEx("Clear"u8, "Clear all required features."u8, size))
|
||||||
editor.ChangeRequiredFeatures(mod, FeatureFlags.None);
|
editor.ChangeRequiredFeatures(mod, FeatureFlags.None);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Text("Required Features"u8);
|
ImUtf8.Text("Required Features"u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
using Penumbra.GameData.DataContainers;
|
using Penumbra.GameData.DataContainers;
|
||||||
using Penumbra.GameData.Files;
|
using Penumbra.GameData.Files;
|
||||||
|
|
@ -9,6 +10,7 @@ using Penumbra.GameData.Files.StainMapStructs;
|
||||||
using Penumbra.Interop.Services;
|
using Penumbra.Interop.Services;
|
||||||
using Penumbra.Interop.Structs;
|
using Penumbra.Interop.Structs;
|
||||||
using Penumbra.UI.AdvancedWindow.Materials;
|
using Penumbra.UI.AdvancedWindow.Materials;
|
||||||
|
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||||
|
|
||||||
namespace Penumbra.Services;
|
namespace Penumbra.Services;
|
||||||
|
|
||||||
|
|
@ -57,12 +59,12 @@ public class StainService : Luna.IService
|
||||||
if (selection == 0 || !stmFile.TryGetValue(Items[globalIdx], selection, out var colors))
|
if (selection == 0 || !stmFile.TryGetValue(Items[globalIdx], selection, out var colors))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var frame = new Vector2(ImGui.GetTextLineHeight());
|
var frame = new Vector2(ImGui.GetTextLineHeight());
|
||||||
ImGui.ColorButton("D", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)colors.DiffuseColor), 1), 0, frame);
|
ImGui.ColorButton("D", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)colors.DiffuseColor), 1), 0, frame);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.ColorButton("S", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)colors.SpecularColor), 1), 0, frame);
|
ImGui.ColorButton("S", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)colors.SpecularColor), 1), 0, frame);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.ColorButton("E", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)colors.EmissiveColor), 1), 0, frame);
|
ImGui.ColorButton("E", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)colors.EmissiveColor), 1), 0, frame);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Classes;
|
using OtterGui.Classes;
|
||||||
|
|
@ -15,6 +16,7 @@ using Penumbra.Mods.Editor;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||||
|
|
||||||
namespace Penumbra.UI.AdvancedWindow;
|
namespace Penumbra.UI.AdvancedWindow;
|
||||||
|
|
||||||
|
|
@ -46,11 +48,11 @@ public class FileEditor<T>(
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
DrawFileSelectCombo();
|
DrawFileSelectCombo();
|
||||||
SaveButton();
|
SaveButton();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ResetButton();
|
ResetButton();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
RedrawOnSaveBox();
|
RedrawOnSaveBox();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DefaultInput();
|
DefaultInput();
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
||||||
|
|
||||||
|
|
@ -127,7 +129,7 @@ public class FileEditor<T>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Save.ToIconString(), new Vector2(ImGui.GetFrameHeight()), "Export this file.",
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Save.ToIconString(), new Vector2(ImGui.GetFrameHeight()), "Export this file.",
|
||||||
_defaultFile == null, true))
|
_defaultFile == null, true))
|
||||||
fileDialog.OpenSavePicker($"Export {_defaultPath} to...", fileType, Path.GetFileNameWithoutExtension(_defaultPath), fileType,
|
fileDialog.OpenSavePicker($"Export {_defaultPath} to...", fileType, Path.GetFileNameWithoutExtension(_defaultPath), fileType,
|
||||||
|
|
@ -148,7 +150,7 @@ public class FileEditor<T>(
|
||||||
|
|
||||||
_quickImport ??=
|
_quickImport ??=
|
||||||
ModEditWindow.QuickImportAction.Prepare(owner, _isDefaultPathUtf8Valid ? _defaultPathUtf8 : Utf8GamePath.Empty, _defaultFile);
|
ModEditWindow.QuickImportAction.Prepare(owner, _isDefaultPathUtf8Valid ? _defaultPathUtf8 : Utf8GamePath.Empty, _defaultFile);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.FileImport.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.FileImport.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
||||||
$"Add a copy of this file to {_quickImport.OptionName}.", !_quickImport.CanExecute, true))
|
$"Add a copy of this file to {_quickImport.OptionName}.", !_quickImport.CanExecute, true))
|
||||||
{
|
{
|
||||||
|
|
@ -318,7 +320,7 @@ public class FileEditor<T>(
|
||||||
|
|
||||||
if (file.SubModUsage.Count > 0)
|
if (file.SubModUsage.Count > 0)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
|
using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
|
||||||
ImGuiUtil.RightAlign(file.SubModUsage[0].Item2.Path.ToString());
|
ImGuiUtil.RightAlign(file.SubModUsage[0].Item2.Path.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -24,6 +25,7 @@ using Penumbra.Mods.SubMods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
using Penumbra.UI.ModsTab;
|
using Penumbra.UI.ModsTab;
|
||||||
|
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||||
|
|
||||||
namespace Penumbra.UI.AdvancedWindow;
|
namespace Penumbra.UI.AdvancedWindow;
|
||||||
|
|
||||||
|
|
@ -421,7 +423,7 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
if (ImGui.InputTextWithHint("##newModName", "New Mod Name...", ref _newModName, 64))
|
if (ImGui.InputTextWithHint("##newModName", "New Mod Name...", ref _newModName, 64))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var tt = !newModAvailable
|
var tt = !newModAvailable
|
||||||
? "No swap is currently loaded."
|
? "No swap is currently loaded."
|
||||||
: _newModName.Length == 0
|
: _newModName.Length == 0
|
||||||
|
|
@ -430,7 +432,7 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
if (ImGuiUtil.DrawDisabledButton("Create New Mod", new Vector2(width / 2, 0), tt, !newModAvailable || _newModName.Length == 0))
|
if (ImGuiUtil.DrawDisabledButton("Create New Mod", new Vector2(width / 2, 0), tt, !newModAvailable || _newModName.Length == 0))
|
||||||
CreateMod();
|
CreateMod();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * UiHelpers.Scale);
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * UiHelpers.Scale);
|
||||||
ImGui.Checkbox("Use File Swaps", ref _useFileSwaps);
|
ImGui.Checkbox("Use File Swaps", ref _useFileSwaps);
|
||||||
ImGuiUtil.HoverTooltip("Instead of writing every single non-default file to the newly created mod or option,\n"
|
ImGuiUtil.HoverTooltip("Instead of writing every single non-default file to the newly created mod or option,\n"
|
||||||
|
|
@ -440,12 +442,12 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
if (ImGui.InputTextWithHint("##groupName", "Group Name...", ref _newGroupName, 32))
|
if (ImGui.InputTextWithHint("##groupName", "Group Name...", ref _newGroupName, 32))
|
||||||
UpdateOption();
|
UpdateOption();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth((width - ImGui.GetStyle().ItemSpacing.X) / 2);
|
ImGui.SetNextItemWidth((width - ImGui.GetStyle().ItemSpacing.X) / 2);
|
||||||
if (ImGui.InputTextWithHint("##optionName", "New Option Name...", ref _newOptionName, 32))
|
if (ImGui.InputTextWithHint("##optionName", "New Option Name...", ref _newOptionName, 32))
|
||||||
UpdateOption();
|
UpdateOption();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
tt = !_subModValid
|
tt = !_subModValid
|
||||||
? "An option with that name already exists in that group, or no name is specified."
|
? "An option with that name already exists in that group, or no name is specified."
|
||||||
: !newModAvailable
|
: !newModAvailable
|
||||||
|
|
@ -454,7 +456,7 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
if (ImGuiUtil.DrawDisabledButton("Create New Option", new Vector2(width / 2, 0), tt, !newModAvailable || !_subModValid))
|
if (ImGuiUtil.DrawDisabledButton("Create New Option", new Vector2(width / 2, 0), tt, !newModAvailable || !_subModValid))
|
||||||
CreateOption();
|
CreateOption();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * UiHelpers.Scale);
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * UiHelpers.Scale);
|
||||||
_dirty |= ImGui.Checkbox("Use Entire Collection", ref _useCurrentCollection);
|
_dirty |= ImGui.Checkbox("Use Entire Collection", ref _useCurrentCollection);
|
||||||
ImGuiUtil.HoverTooltip(
|
ImGuiUtil.HoverTooltip(
|
||||||
|
|
@ -561,7 +563,7 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
if (_affectedItems is not { Count: > 1 })
|
if (_affectedItems is not { Count: > 1 })
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
||||||
Colors.PressEnterWarningBg);
|
Colors.PressEnterWarningBg);
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
|
|
@ -603,7 +605,7 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
|
|
||||||
if (type == SwapType.Ring)
|
if (type == SwapType.Ring)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
_dirty |= ImGui.Checkbox("Swap Right Ring", ref _useRightRing);
|
_dirty |= ImGui.Checkbox("Swap Right Ring", ref _useRightRing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -615,14 +617,14 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
ImGui.GetTextLineHeightWithSpacing());
|
ImGui.GetTextLineHeightWithSpacing());
|
||||||
if (type == SwapType.Ring)
|
if (type == SwapType.Ring)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
_dirty |= ImGui.Checkbox("Swap Left Ring", ref _useLeftRing);
|
_dirty |= ImGui.Checkbox("Swap Left Ring", ref _useLeftRing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_affectedItems is not { Count: > 1 })
|
if (_affectedItems is not { Count: > 1 })
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
ImGuiUtil.DrawTextButton($"which will also affect {_affectedItems.Count - 1} other Items.", Vector2.Zero,
|
||||||
Colors.PressEnterWarningBg);
|
Colors.PressEnterWarningBg);
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
|
|
@ -707,12 +709,12 @@ public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||||
_dirty |= Combos.Gender("##Gender", _currentGender, out _currentGender);
|
_dirty |= Combos.Gender("##Gender", _currentGender, out _currentGender);
|
||||||
if (drawRace == 1)
|
if (drawRace == 1)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
_dirty |= Combos.Race("##Race", _currentRace, out _currentRace, InputWidth);
|
_dirty |= Combos.Race("##Race", _currentRace, out _currentRace, InputWidth);
|
||||||
}
|
}
|
||||||
else if (drawRace == 2)
|
else if (drawRace == 2)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (_currentRace is not ModelRace.Miqote and not ModelRace.AuRa and not ModelRace.Hrothgar)
|
if (_currentRace is not ModelRace.Miqote and not ModelRace.AuRa and not ModelRace.Hrothgar)
|
||||||
_currentRace = ModelRace.Miqote;
|
_currentRace = ModelRace.Miqote;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -70,7 +71,7 @@ public partial class MtrlTab
|
||||||
ImGuiUtil.ColorConvertFloat3ToU32(PseudoSqrtRgb((Vector3)table[(pairIndex << 1) | 1].EmissiveColor))
|
ImGuiUtil.ColorConvertFloat3ToU32(PseudoSqrtRgb((Vector3)table[(pairIndex << 1) | 1].EmissiveColor))
|
||||||
);
|
);
|
||||||
if (j < 7)
|
if (j < 7)
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
var cursor = ImGui.GetCursorScreenPos();
|
var cursor = ImGui.GetCursorScreenPos();
|
||||||
ImGui.SetCursorScreenPos(rcMin with { Y = float.Lerp(rcMin.Y, rcMax.Y, 0.5f) - highlighterSize.Y * 0.5f });
|
ImGui.SetCursorScreenPos(rcMin with { Y = float.Lerp(rcMin.Y, rcMax.Y, 0.5f) - highlighterSize.Y * 0.5f });
|
||||||
|
|
@ -244,7 +245,7 @@ public partial class MtrlTab
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
ColorTableRowHighlightButton(rowIdx, disabled);
|
ColorTableRowHighlightButton(rowIdx, disabled);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
CenteredTextInRest($"Row {(rowIdx >> 1) + 1}{"AB"[rowIdx & 1]}");
|
CenteredTextInRest($"Row {(rowIdx >> 1) + 1}{"AB"[rowIdx & 1]}");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -370,7 +371,7 @@ public partial class MtrlTab
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(64.0f, 0.0f));
|
ImGui.Dummy(new Vector2(64.0f, 0.0f));
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(scalarSize);
|
ImGui.SetNextItemWidth(scalarSize);
|
||||||
ret |= CtDragScalar("Sphere Map Intensity"u8, default, (float)row.SphereMapMask * 100.0f, "%.0f%%"u8, HalfMinValue * 100.0f,
|
ret |= CtDragScalar("Sphere Map Intensity"u8, default, (float)row.SphereMapMask * 100.0f, "%.0f%%"u8, HalfMinValue * 100.0f,
|
||||||
HalfMaxValue * 100.0f, 1.0f,
|
HalfMaxValue * 100.0f, 1.0f,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
|
using ImSharp;
|
||||||
using Penumbra.GameData.Files.MaterialStructs;
|
using Penumbra.GameData.Files.MaterialStructs;
|
||||||
using Penumbra.GameData.Files;
|
using Penumbra.GameData.Files;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -30,21 +31,21 @@ public partial class MtrlTab
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ColorTableCopyAllClipboardButton();
|
ColorTableCopyAllClipboardButton();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var ret = ColorTablePasteAllClipboardButton(disabled);
|
var ret = ColorTablePasteAllClipboardButton(disabled);
|
||||||
if (!disabled)
|
if (!disabled)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.IconDummy();
|
ImUtf8.IconDummy();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ret |= ColorTableDyeableCheckbox();
|
ret |= ColorTableDyeableCheckbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Mtrl.DyeTable != null)
|
if (Mtrl.DyeTable != null)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.IconDummy();
|
ImUtf8.IconDummy();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ret |= DrawPreviewDye(disabled);
|
ret |= DrawPreviewDye(disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,11 +108,11 @@ public partial class MtrlTab
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var label = dyeId1 == 0 ? "Preview Dye 1###previewDye1" : $"{name1} (Preview 1)###previewDye1";
|
var label = dyeId1 == 0 ? "Preview Dye 1###previewDye1" : $"{name1} (Preview 1)###previewDye1";
|
||||||
if (_stainService.StainCombo1.Draw(label, dyeColor1, string.Empty, true, gloss1))
|
if (_stainService.StainCombo1.Draw(label, dyeColor1, string.Empty, true, gloss1))
|
||||||
UpdateColorTablePreview();
|
UpdateColorTablePreview();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
label = dyeId2 == 0 ? "Preview Dye 2###previewDye2" : $"{name2} (Preview 2)###previewDye2";
|
label = dyeId2 == 0 ? "Preview Dye 2###previewDye2" : $"{name2} (Preview 2)###previewDye2";
|
||||||
if (_stainService.StainCombo2.Draw(label, dyeColor2, string.Empty, true, gloss2))
|
if (_stainService.StainCombo2.Draw(label, dyeColor2, string.Empty, true, gloss2))
|
||||||
UpdateColorTablePreview();
|
UpdateColorTablePreview();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -198,7 +199,7 @@ public partial class MtrlTab
|
||||||
SetMaterialParameter(constant.Id, slice.Start, buffer[slice]);
|
SetMaterialParameter(constant.Id, slice.Start, buffer[slice]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using var font = ImRaii.PushFont(UiBuilder.MonoFont, monoFont);
|
using var font = ImRaii.PushFont(UiBuilder.MonoFont, monoFont);
|
||||||
if (description.Length > 0)
|
if (description.Length > 0)
|
||||||
ImGuiUtil.LabeledHelpMarker(label, description);
|
ImGuiUtil.LabeledHelpMarker(label, description);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Files.MaterialStructs;
|
using Penumbra.GameData.Files.MaterialStructs;
|
||||||
|
|
@ -133,7 +134,7 @@ public partial class MtrlTab
|
||||||
b => dyeTable[rowIdx].SpecularColor = b);
|
b => dyeTable[rowIdx].SpecularColor = b);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(pctSize);
|
ImGui.SetNextItemWidth(pctSize);
|
||||||
ret |= CtDragScalar("##SpecularMask"u8, "Specular Strength"u8, (float)row.SpecularMask * 100.0f, "%.0f%%"u8, 0f, HalfMaxValue * 100.0f,
|
ret |= CtDragScalar("##SpecularMask"u8, "Specular Strength"u8, (float)row.SpecularMask * 100.0f, "%.0f%%"u8, 0f, HalfMaxValue * 100.0f,
|
||||||
1.0f,
|
1.0f,
|
||||||
|
|
@ -240,7 +241,7 @@ public partial class MtrlTab
|
||||||
b => dyeTable[rowIdx].SpecularColor = b);
|
b => dyeTable[rowIdx].SpecularColor = b);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(pctSize);
|
ImGui.SetNextItemWidth(pctSize);
|
||||||
ret |= CtDragScalar("##SpecularMask"u8, "Specular Strength"u8, (float)row.Scalar7 * 100.0f, "%.0f%%"u8, 0f, HalfMaxValue * 100.0f, 1.0f,
|
ret |= CtDragScalar("##SpecularMask"u8, "Specular Strength"u8, (float)row.Scalar7 * 100.0f, "%.0f%%"u8, 0f, HalfMaxValue * 100.0f, 1.0f,
|
||||||
v => table[rowIdx].Scalar7 = (Half)(v * 0.01f));
|
v => table[rowIdx].Scalar7 = (Half)(v * 0.01f));
|
||||||
|
|
@ -325,7 +326,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
ret = ret && Mtrl.ApplyDyeToRow(_stainService.LegacyStmFile, [stain], rowIdx);
|
ret = ret && Mtrl.ApplyDyeToRow(_stainService.LegacyStmFile, [stain], rowIdx);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawLegacyDyePreview(values, floatSize);
|
DrawLegacyDyePreview(values, floatSize);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -348,7 +349,7 @@ public partial class MtrlTab
|
||||||
_stainService.StainCombo2.CurrentSelection.Key,
|
_stainService.StainCombo2.CurrentSelection.Key,
|
||||||
], rowIdx);
|
], rowIdx);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawLegacyDyePreview(values, floatSize);
|
DrawLegacyDyePreview(values, floatSize);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Files.MaterialStructs;
|
using Penumbra.GameData.Files.MaterialStructs;
|
||||||
|
|
@ -29,7 +30,7 @@ public partial class MtrlTab
|
||||||
if (_materialPreviewers.Count != 0 || _colorTablePreviewers.Count != 0)
|
if (_materialPreviewers.Count != 0 || _colorTablePreviewers.Count != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using var c = ImRaii.PushColor(ImGuiCol.Text, Colors.RegexWarningBorder);
|
using var c = ImRaii.PushColor(ImGuiCol.Text, Colors.RegexWarningBorder);
|
||||||
ImUtf8.Text(
|
ImUtf8.Text(
|
||||||
"The current material has not been found on your character. Please check the Import from Screen tab for more information."u8);
|
"The current material has not been found on your character. Please check the Import from Screen tab for more information."u8);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
|
|
@ -422,14 +423,14 @@ public partial class MtrlTab
|
||||||
}, 1, _edit.Mod!.ModPath.FullName, false);
|
}, 1, _edit.Mod!.ModPath.FullName, false);
|
||||||
|
|
||||||
var moddedPath = FindAssociatedShpk(out var defaultPath, out var gamePath);
|
var moddedPath = FindAssociatedShpk(out var defaultPath, out var gamePath);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Associate Default .shpk File"u8, moddedPath.ToPath(), Vector2.Zero,
|
if (ImUtf8.ButtonEx("Associate Default .shpk File"u8, moddedPath.ToPath(), Vector2.Zero,
|
||||||
moddedPath.Equals(_loadedShpkPath)))
|
moddedPath.Equals(_loadedShpkPath)))
|
||||||
LoadShpk(moddedPath);
|
LoadShpk(moddedPath);
|
||||||
|
|
||||||
if (!gamePath.Path.Equals(moddedPath.InternalName))
|
if (!gamePath.Path.Equals(moddedPath.InternalName))
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Associate Unmodded .shpk File", defaultPath, Vector2.Zero,
|
if (ImUtf8.ButtonEx("Associate Unmodded .shpk File", defaultPath, Vector2.Zero,
|
||||||
gamePath.Path.Equals(_loadedShpkPath.InternalName)))
|
gamePath.Path.Equals(_loadedShpkPath.InternalName)))
|
||||||
LoadShpk(new FullPath(gamePath));
|
LoadShpk(new FullPath(gamePath));
|
||||||
|
|
@ -474,7 +475,7 @@ public partial class MtrlTab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (description.Length > 0)
|
if (description.Length > 0)
|
||||||
ImGuiUtil.LabeledHelpMarker(label, description);
|
ImGuiUtil.LabeledHelpMarker(label, description);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -161,13 +162,13 @@ public partial class MtrlTab
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont, monoFont))
|
using (ImRaii.PushFont(UiBuilder.MonoFont, monoFont))
|
||||||
{
|
{
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
if (description.Length > 0)
|
if (description.Length > 0)
|
||||||
ImGuiUtil.LabeledHelpMarker(label, description);
|
ImGuiUtil.LabeledHelpMarker(label, description);
|
||||||
else
|
else
|
||||||
ImGui.TextUnformatted(label);
|
ImGui.TextUnformatted(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unfolded)
|
if (unfolded)
|
||||||
|
|
@ -229,7 +230,7 @@ public partial class MtrlTab
|
||||||
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.LabeledHelpMarker("U Address Mode"u8,
|
ImUtf8.LabeledHelpMarker("U Address Mode"u8,
|
||||||
"Method to use for resolving a U texture coordinate that is outside the 0 to 1 range.");
|
"Method to use for resolving a U texture coordinate that is outside the 0 to 1 range.");
|
||||||
|
|
||||||
|
|
@ -242,7 +243,7 @@ public partial class MtrlTab
|
||||||
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.LabeledHelpMarker("V Address Mode"u8,
|
ImUtf8.LabeledHelpMarker("V Address Mode"u8,
|
||||||
"Method to use for resolving a V texture coordinate that is outside the 0 to 1 range.");
|
"Method to use for resolving a V texture coordinate that is outside the 0 to 1 range.");
|
||||||
|
|
||||||
|
|
@ -255,7 +256,7 @@ public partial class MtrlTab
|
||||||
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.LabeledHelpMarker("Level of Detail Bias"u8,
|
ImUtf8.LabeledHelpMarker("Level of Detail Bias"u8,
|
||||||
"Offset from the calculated mipmap level.\n\nHigher means that the texture will start to lose detail nearer.\nLower means that the texture will keep its detail until farther.");
|
"Offset from the calculated mipmap level.\n\nHigher means that the texture will start to lose detail nearer.\nLower means that the texture will keep its detail until farther.");
|
||||||
|
|
||||||
|
|
@ -268,7 +269,7 @@ public partial class MtrlTab
|
||||||
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
SetSamplerFlags(sampler.SamplerId, sampler.Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.LabeledHelpMarker("Minimum Level of Detail"u8,
|
ImUtf8.LabeledHelpMarker("Minimum Level of Detail"u8,
|
||||||
"Most detailed mipmap level to use.\n\n0 is the full-sized texture, 1 is the half-sized texture, 2 is the quarter-sized texture, and so on.\n15 will forcibly reduce the texture to its smallest mipmap.");
|
"Most detailed mipmap level to use.\n\n0 is the full-sized texture, 1 is the half-sized texture, 2 is the quarter-sized texture, and so on.\n15 will forcibly reduce the texture to its smallest mipmap.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
@ -115,7 +116,7 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (Checkmark("Model##eqdp"u8, "\0"u8, entry.Model, defaultEntry.Model, out var newModel))
|
if (Checkmark("Model##eqdp"u8, "\0"u8, entry.Model, defaultEntry.Model, out var newModel))
|
||||||
{
|
{
|
||||||
entry = entry with { Model = newModel };
|
entry = entry with { Model = newModel };
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Data;
|
using Penumbra.GameData.Data;
|
||||||
|
|
@ -20,9 +21,9 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
_pbdData.Update(tab.File);
|
_pbdData.Update(tab.File);
|
||||||
DrawGenderRaceSelector(tab);
|
DrawGenderRaceSelector(tab);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawBoneSelector();
|
DrawBoneSelector();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
return DrawBoneData(tab, disabled);
|
return DrawBoneData(tab, disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +60,7 @@ public partial class ModEditWindow
|
||||||
_pbdData.SelectedDeformer = deformer.RacialDeformer;
|
_pbdData.SelectedDeformer = deformer.RacialDeformer;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
color.Push(ImGuiCol.Text, metaColor);
|
color.Push(ImGuiCol.Text, metaColor);
|
||||||
ImUtf8.TextRightAligned(raceCode);
|
ImUtf8.TextRightAligned(raceCode);
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +206,7 @@ public partial class ModEditWindow
|
||||||
_pbdData.SelectedDeformer!.DeformMatrices[_pbdData.SelectedBone!] = matrix.ChangeValue(i, j, tmp);
|
_pbdData.SelectedDeformer!.DeformMatrices[_pbdData.SelectedBone!] = matrix.ChangeValue(i, j, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
@ -220,7 +221,7 @@ public partial class ModEditWindow
|
||||||
if (ImUtf8.Button("Copy Values"u8, size))
|
if (ImUtf8.Button("Copy Values"u8, size))
|
||||||
_pbdData.CopiedMatrix = matrix;
|
_pbdData.CopiedMatrix = matrix;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
if (ImUtf8.ButtonEx("Paste Values"u8, ""u8, size, disabled || !_pbdData.CopiedMatrix.HasValue))
|
if (ImUtf8.ButtonEx("Paste Values"u8, ""u8, size, disabled || !_pbdData.CopiedMatrix.HasValue))
|
||||||
|
|
@ -230,7 +231,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
var modifier = _config.DeleteModModifier.IsActive();
|
var modifier = _config.DeleteModModifier.IsActive();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (modifier)
|
if (modifier)
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Delete"u8, "Delete this bone entry."u8, size, disabled))
|
if (ImUtf8.ButtonEx("Delete"u8, "Delete this bone entry."u8, size, disabled))
|
||||||
|
|
@ -263,11 +264,11 @@ public partial class ModEditWindow
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##ScaleX"u8, ref scale.X, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##ScaleX"u8, ref scale.X, "% 12.8f"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##ScaleY"u8, ref scale.Y, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##ScaleY"u8, ref scale.Y, "% 12.8f"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##ScaleZ"u8, ref scale.Z, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##ScaleZ"u8, ref scale.Z, "% 12.8f"u8);
|
||||||
|
|
||||||
|
|
@ -275,11 +276,11 @@ public partial class ModEditWindow
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##TranslationX"u8, ref translation.X, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##TranslationX"u8, ref translation.X, "% 12.8f"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##TranslationY"u8, ref translation.Y, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##TranslationY"u8, ref translation.Y, "% 12.8f"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##TranslationZ"u8, ref translation.Z, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##TranslationZ"u8, ref translation.Z, "% 12.8f"u8);
|
||||||
|
|
||||||
|
|
@ -287,19 +288,19 @@ public partial class ModEditWindow
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##RotationR"u8, ref rotation.W, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##RotationR"u8, ref rotation.W, "% 12.8f"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##RotationI"u8, ref rotation.X, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##RotationI"u8, ref rotation.X, "% 12.8f"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##RotationJ"u8, ref rotation.Y, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##RotationJ"u8, ref rotation.Y, "% 12.8f"u8);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width);
|
ImGui.SetNextItemWidth(width);
|
||||||
ret |= ImUtf8.InputScalar("##RotationK"u8, ref rotation.Z, "% 12.8f"u8);
|
ret |= ImUtf8.InputScalar("##RotationK"u8, ref rotation.Z, "% 12.8f"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.TextFrameAligned("Scale"u8);
|
ImUtf8.TextFrameAligned("Scale"u8);
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
var rightText = DrawFileTooltip(registry, color);
|
var rightText = DrawFileTooltip(registry, color);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.RightAlign(rightText);
|
ImGuiUtil.RightAlign(rightText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -281,14 +281,14 @@ public partial class ModEditWindow
|
||||||
&& (!Utf8GamePath.FromString(_gamePathEdit, out var path)
|
&& (!Utf8GamePath.FromString(_gamePathEdit, out var path)
|
||||||
|| !path.IsEmpty && !path.Equals(gamePath) && !_editor.FileEditor.CanAddGamePath(path)))
|
|| !path.IsEmpty && !path.Equals(gamePath) && !_editor.FileEditor.CanAddGamePath(path)))
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(pos);
|
ImGui.SetCursorPosX(pos);
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
ImGuiUtil.TextColored(0xFF0000FF, FontAwesomeIcon.TimesCircle.ToIconString());
|
ImGuiUtil.TextColored(0xFF0000FF, FontAwesomeIcon.TimesCircle.ToIconString());
|
||||||
}
|
}
|
||||||
else if (tmp.Length > 0 && Path.GetExtension(tmp) != registry.File.Extension)
|
else if (tmp.Length > 0 && Path.GetExtension(tmp) != registry.File.Extension)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(pos);
|
ImGui.SetCursorPosX(pos);
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
|
|
@ -324,14 +324,14 @@ public partial class ModEditWindow
|
||||||
&& (!Utf8GamePath.FromString(_gamePathEdit, out var path)
|
&& (!Utf8GamePath.FromString(_gamePathEdit, out var path)
|
||||||
|| !path.IsEmpty && !_editor.FileEditor.CanAddGamePath(path)))
|
|| !path.IsEmpty && !_editor.FileEditor.CanAddGamePath(path)))
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(pos);
|
ImGui.SetCursorPosX(pos);
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
ImGuiUtil.TextColored(0xFF0000FF, FontAwesomeIcon.TimesCircle.ToIconString());
|
ImGuiUtil.TextColored(0xFF0000FF, FontAwesomeIcon.TimesCircle.ToIconString());
|
||||||
}
|
}
|
||||||
else if (tmp.Length > 0 && Path.GetExtension(tmp) != registry.File.Extension)
|
else if (tmp.Length > 0 && Path.GetExtension(tmp) != registry.File.Extension)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(pos);
|
ImGui.SetCursorPosX(pos);
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
|
|
@ -350,7 +350,7 @@ public partial class ModEditWindow
|
||||||
ImGui.SetNextItemWidth(30 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(30 * UiHelpers.Scale);
|
||||||
ImGui.DragInt("##skippedFolders", ref _folderSkip, 0.01f, 0, 10);
|
ImGui.DragInt("##skippedFolders", ref _folderSkip, 0.01f, 0, 10);
|
||||||
ImGuiUtil.HoverTooltip("Skip the first N folders when automatically constructing the game path from the file path.");
|
ImGuiUtil.HoverTooltip("Skip the first N folders when automatically constructing the game path from the file path.");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
spacing.Pop();
|
spacing.Pop();
|
||||||
if (ImGui.Button("Add Paths"))
|
if (ImGui.Button("Add Paths"))
|
||||||
_editor.FileEditor.AddPathsToSelected(_editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains), _folderSkip);
|
_editor.FileEditor.AddPathsToSelected(_editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains), _folderSkip);
|
||||||
|
|
@ -359,14 +359,14 @@ public partial class ModEditWindow
|
||||||
"Add the file path converted to a game path to all selected files for the current option, optionally skipping the first N folders.");
|
"Add the file path converted to a game path to all selected files for the current option, optionally skipping the first N folders.");
|
||||||
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Remove Paths"))
|
if (ImGui.Button("Remove Paths"))
|
||||||
_editor.FileEditor.RemovePathsFromSelected(_editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains));
|
_editor.FileEditor.RemovePathsFromSelected(_editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains));
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip("Remove all game paths associated with the selected files in the current option.");
|
ImGuiUtil.HoverTooltip("Remove all game paths associated with the selected files in the current option.");
|
||||||
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var active = _config.DeleteModModifier.IsActive();
|
var active = _config.DeleteModModifier.IsActive();
|
||||||
var tt =
|
var tt =
|
||||||
"Delete all selected files entirely from your filesystem, but not their file associations in the mod.\n!!!This can not be reverted!!!";
|
"Delete all selected files entirely from your filesystem, but not their file associations in the mod.\n!!!This can not be reverted!!!";
|
||||||
|
|
@ -378,7 +378,7 @@ public partial class ModEditWindow
|
||||||
if (ImGuiUtil.DrawDisabledButton("Delete Selected Files", Vector2.Zero, tt, _selectedFiles.Count == 0 || !active))
|
if (ImGuiUtil.DrawDisabledButton("Delete Selected Files", Vector2.Zero, tt, _selectedFiles.Count == 0 || !active))
|
||||||
_editor.FileEditor.DeleteFiles(_editor.Mod!, _editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains));
|
_editor.FileEditor.DeleteFiles(_editor.Mod!, _editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains));
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var changes = _editor.FileEditor.Changes;
|
var changes = _editor.FileEditor.Changes;
|
||||||
tt = changes ? "Apply the current file setup to the currently selected option." : "No changes made.";
|
tt = changes ? "Apply the current file setup to the currently selected option." : "No changes made.";
|
||||||
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, !changes))
|
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, !changes))
|
||||||
|
|
@ -389,7 +389,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var label = changes ? "Revert Changes" : "Reload Files";
|
var label = changes ? "Revert Changes" : "Reload Files";
|
||||||
var length = new Vector2(ImGui.CalcTextSize("Revert Changes").X, 0);
|
var length = new Vector2(ImGui.CalcTextSize("Revert Changes").X, 0);
|
||||||
if (ImGui.Button(label, length))
|
if (ImGui.Button(label, length))
|
||||||
|
|
@ -397,7 +397,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip("Revert all revertible changes since the last file or option reload or data refresh.");
|
ImGuiUtil.HoverTooltip("Revert all revertible changes since the last file or option reload or data refresh.");
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.Checkbox("Overview Mode", ref _overviewMode);
|
ImGui.Checkbox("Overview Mode", ref _overviewMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -405,25 +405,25 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(250 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(250 * UiHelpers.Scale);
|
||||||
Im.Input.Text("##filter"u8, ref _fileFilter, "Filter paths..."u8);
|
Im.Input.Text("##filter"u8, ref _fileFilter, "Filter paths..."u8);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.Checkbox("Show Game Paths", ref _showGamePaths);
|
ImGui.Checkbox("Show Game Paths", ref _showGamePaths);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Unselect All"))
|
if (ImGui.Button("Unselect All"))
|
||||||
_selectedFiles.Clear();
|
_selectedFiles.Clear();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Select Visible"))
|
if (ImGui.Button("Select Visible"))
|
||||||
_selectedFiles.UnionWith(_editor.Files.Available.Where(CheckFilter));
|
_selectedFiles.UnionWith(_editor.Files.Available.Where(CheckFilter));
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Select Unused"))
|
if (ImGui.Button("Select Unused"))
|
||||||
_selectedFiles.UnionWith(_editor.Files.Available.Where(f => f.SubModUsage.Count == 0));
|
_selectedFiles.UnionWith(_editor.Files.Available.Where(f => f.SubModUsage.Count == 0));
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Select Used Here"))
|
if (ImGui.Button("Select Used Here"))
|
||||||
_selectedFiles.UnionWith(_editor.Files.Available.Where(f => f.CurrentUsage > 0));
|
_selectedFiles.UnionWith(_editor.Files.Available.Where(f => f.CurrentUsage > 0));
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
ImGuiUtil.RightAlign($"{_selectedFiles.Count} / {_editor.Files.Available.Count} Files Selected");
|
ImGuiUtil.RightAlign($"{_selectedFiles.Count} / {_editor.Files.Available.Count} Files Selected");
|
||||||
}
|
}
|
||||||
|
|
@ -438,10 +438,10 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(width * 3);
|
ImGui.SetNextItemWidth(width * 3);
|
||||||
Im.Input.Text("##fileFilter"u8, ref _fileOverviewFilter1, "Filter file..."u8);
|
Im.Input.Text("##fileFilter"u8, ref _fileOverviewFilter1, "Filter file..."u8);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width * 3);
|
ImGui.SetNextItemWidth(width * 3);
|
||||||
Im.Input.Text("##pathFilter"u8, ref _fileOverviewFilter2, "Filter path..."u8);
|
Im.Input.Text("##pathFilter"u8, ref _fileOverviewFilter2, "Filter path..."u8);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(width * 2);
|
ImGui.SetNextItemWidth(width * 2);
|
||||||
Im.Input.Text("##optionFilter"u8, ref _fileOverviewFilter3, "Filter option..."u8);
|
Im.Input.Text("##optionFilter"u8, ref _fileOverviewFilter3, "Filter option..."u8);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -30,24 +31,24 @@ public partial class ModEditWindow
|
||||||
if (ImUtf8.ButtonEx("Apply Changes"u8, tt, Vector2.Zero, setsEqual))
|
if (ImUtf8.ButtonEx("Apply Changes"u8, tt, Vector2.Zero, setsEqual))
|
||||||
_editor.MetaEditor.Apply(_editor.Option!);
|
_editor.MetaEditor.Apply(_editor.Option!);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
tt = setsEqual ? "No changes staged."u8 : "Revert all currently staged changes."u8;
|
tt = setsEqual ? "No changes staged."u8 : "Revert all currently staged changes."u8;
|
||||||
if (ImUtf8.ButtonEx("Revert Changes"u8, tt, Vector2.Zero, setsEqual))
|
if (ImUtf8.ButtonEx("Revert Changes"u8, tt, Vector2.Zero, setsEqual))
|
||||||
_editor.MetaEditor.Load(_editor.Mod!, _editor.Option!);
|
_editor.MetaEditor.Load(_editor.Mod!, _editor.Option!);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
AddFromClipboardButton();
|
AddFromClipboardButton();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
SetFromClipboardButton();
|
SetFromClipboardButton();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
CopyToClipboardButton("Copy all current manipulations to clipboard.", _iconSize, _editor.MetaEditor);
|
CopyToClipboardButton("Copy all current manipulations to clipboard.", _iconSize, _editor.MetaEditor);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Write as TexTools Files"u8))
|
if (ImUtf8.Button("Write as TexTools Files"u8))
|
||||||
_metaFileManager.WriteAllTexToolsMeta(Mod!);
|
_metaFileManager.WriteAllTexToolsMeta(Mod!);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Remove All Default-Values"u8, "Delete any entries from all lists that set the value to its default value."u8))
|
if (ImUtf8.ButtonEx("Remove All Default-Values"u8, "Delete any entries from all lists that set the value to its default value."u8))
|
||||||
_editor.MetaEditor.DeleteDefaultValues();
|
_editor.MetaEditor.DeleteDefaultValues();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawAtchDragDrop();
|
DrawAtchDragDrop();
|
||||||
|
|
||||||
using var child = ImRaii.Child("##meta", -Vector2.One, true);
|
using var child = ImRaii.Child("##meta", -Vector2.One, true);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using ImSharp;
|
||||||
using Lumina.Data.Parsing;
|
using Lumina.Data.Parsing;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
|
|
@ -105,7 +106,7 @@ public partial class ModEditWindow
|
||||||
var childSize = new Vector2((ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X) / 2, 0);
|
var childSize = new Vector2((ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X) / 2, 0);
|
||||||
|
|
||||||
DrawImport(tab, childSize, disabled);
|
DrawImport(tab, childSize, disabled);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawExport(tab, childSize, disabled);
|
DrawExport(tab, childSize, disabled);
|
||||||
|
|
||||||
DrawIoExceptions(tab);
|
DrawIoExceptions(tab);
|
||||||
|
|
@ -139,7 +140,7 @@ public partial class ModEditWindow
|
||||||
tab.Import(paths[0]);
|
tab.Import(paths[0]);
|
||||||
}, 1, Mod!.ModPath.FullName, false);
|
}, 1, Mod!.ModPath.FullName, false);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawDocumentationLink(MdlImportDocumentation);
|
DrawDocumentationLink(MdlImportDocumentation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -162,7 +163,7 @@ public partial class ModEditWindow
|
||||||
DrawGamePathCombo(tab);
|
DrawGamePathCombo(tab);
|
||||||
|
|
||||||
ImGui.Checkbox("##exportGeneratedMissingBones", ref tab.ExportConfig.GenerateMissingBones);
|
ImGui.Checkbox("##exportGeneratedMissingBones", ref tab.ExportConfig.GenerateMissingBones);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.LabeledHelpMarker("Generate missing bones",
|
ImGuiUtil.LabeledHelpMarker("Generate missing bones",
|
||||||
"WARNING: Enabling this option can result in unusable exported meshes.\n"
|
"WARNING: Enabling this option can result in unusable exported meshes.\n"
|
||||||
+ "It is primarily intended to allow exporting models weighted to bones that do not exist.\n"
|
+ "It is primarily intended to allow exporting models weighted to bones that do not exist.\n"
|
||||||
|
|
@ -186,7 +187,7 @@ public partial class ModEditWindow
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawDocumentationLink(MdlExportDocumentation);
|
DrawDocumentationLink(MdlExportDocumentation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Lumina.Data;
|
using Lumina.Data;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
|
|
@ -60,7 +61,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void DrawQuickImportActions(ResourceNode resourceNode, IWritable? writable, Vector2 buttonSize)
|
private void DrawQuickImportActions(ResourceNode resourceNode, IWritable? writable, Vector2 buttonSize)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (!_quickImportActions!.TryGetValue((resourceNode.GamePath, writable), out var quickImport))
|
if (!_quickImportActions!.TryGetValue((resourceNode.GamePath, writable), out var quickImport))
|
||||||
{
|
{
|
||||||
quickImport = QuickImportAction.Prepare(this, resourceNode.GamePath, writable);
|
quickImport = QuickImportAction.Prepare(this, resourceNode.GamePath, writable);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
|
|
@ -265,7 +266,7 @@ public partial class ModEditWindow
|
||||||
DrawShaderExportButton(tab, objectName, shader, idx);
|
DrawShaderExportButton(tab, objectName, shader, idx);
|
||||||
if (!disabled && tab.Shpk.Disassembled)
|
if (!disabled && tab.Shpk.Disassembled)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawShaderImportButton(tab, objectName, shaders, idx);
|
DrawShaderImportButton(tab, objectName, shaders, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -503,7 +504,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Text("Start"u8);
|
ImUtf8.Text("Start"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -529,7 +530,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Text("End"u8);
|
ImUtf8.Text("End"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -604,7 +605,7 @@ public partial class ModEditWindow
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawKeyArray(ShpkTab tab, string arrayName, bool withId, IReadOnlyCollection<Key> keys)
|
private static void DrawKeyArray(ShpkTab tab, string arrayName, bool withId, IReadOnlyCollection<ShpkFile.Key> keys)
|
||||||
{
|
{
|
||||||
if (keys.Count == 0)
|
if (keys.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -51,20 +52,20 @@ public partial class ModEditWindow
|
||||||
ImGuiUtil.DrawTextButton(label, new Vector2(-1, 0), ImGui.GetColorU32(ImGuiCol.FrameBg));
|
ImGuiUtil.DrawTextButton(label, new Vector2(-1, 0), ImGui.GetColorU32(ImGuiCol.FrameBg));
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
||||||
using (ImRaii.Disabled(!_center.SaveTask.IsCompleted))
|
using (ImRaii.Disabled(!_center.SaveTask.IsCompleted))
|
||||||
{
|
{
|
||||||
TextureDrawer.PathInputBox(_textures, tex, ref tex.TmpPath, "##input", "Import Image...",
|
TextureDrawer.PathInputBox(_textures, tex, ref tex.TmpPath, "##input", "Import Image...",
|
||||||
"Can import game paths as well as your own files.", Mod!.ModPath.FullName, _fileDialog, _config.DefaultModImportPath);
|
"Can import game paths as well as your own files.", Mod!.ModPath.FullName, _fileDialog, _config.DefaultModImportPath);
|
||||||
if (_textureSelectCombo.Draw("##combo",
|
if (_textureSelectCombo.Draw("##combo",
|
||||||
"Select the textures included in this mod on your drive or the ones they replace from the game files.", tex.Path,
|
"Select the textures included in this mod on your drive or the ones they replace from the game files.", tex.Path,
|
||||||
Mod.ModPath.FullName.Length + 1, out var newPath)
|
Mod.ModPath.FullName.Length + 1, out var newPath)
|
||||||
&& newPath != tex.Path)
|
&& newPath != tex.Path)
|
||||||
tex.Load(_textures, newPath);
|
tex.Load(_textures, newPath);
|
||||||
|
|
||||||
if (tex == _left)
|
if (tex == _left)
|
||||||
_center.DrawMatrixInputLeft(size.X);
|
_center.DrawMatrixInputLeft(size.X);
|
||||||
else
|
else
|
||||||
_center.DrawMatrixInputRight(size.X);
|
_center.DrawMatrixInputRight(size.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
@ -125,9 +126,9 @@ public partial class ModEditWindow
|
||||||
if (_center.IsLoaded)
|
if (_center.IsLoaded)
|
||||||
{
|
{
|
||||||
RedrawOnSaveBox();
|
RedrawOnSaveBox();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
SaveAsCombo();
|
SaveAsCombo();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
MipMapInput();
|
MipMapInput();
|
||||||
|
|
||||||
var canSaveInPlace = Path.IsPathRooted(_left.Path) && _left.Type is TextureType.Tex or TextureType.Dds or TextureType.Png;
|
var canSaveInPlace = Path.IsPathRooted(_left.Path) && _left.Type is TextureType.Tex or TextureType.Dds or TextureType.Png;
|
||||||
|
|
@ -146,16 +147,16 @@ public partial class ModEditWindow
|
||||||
AddReloadTask(_left.Path, false);
|
AddReloadTask(_left.Path, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Save as TEX", buttonSize2))
|
if (ImGui.Button("Save as TEX", buttonSize2))
|
||||||
OpenSaveAsDialog(".tex");
|
OpenSaveAsDialog(".tex");
|
||||||
|
|
||||||
if (ImGui.Button("Export as TGA", buttonSize3))
|
if (ImGui.Button("Export as TGA", buttonSize3))
|
||||||
OpenSaveAsDialog(".tga");
|
OpenSaveAsDialog(".tga");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Export as PNG", buttonSize3))
|
if (ImGui.Button("Export as PNG", buttonSize3))
|
||||||
OpenSaveAsDialog(".png");
|
OpenSaveAsDialog(".png");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Export as DDS", buttonSize3))
|
if (ImGui.Button("Export as DDS", buttonSize3))
|
||||||
OpenSaveAsDialog(".dds");
|
OpenSaveAsDialog(".dds");
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
@ -171,7 +172,7 @@ public partial class ModEditWindow
|
||||||
AddReloadTask(_left.Path, false);
|
AddReloadTask(_left.Path, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Convert to BC3", buttonSize3,
|
if (ImGuiUtil.DrawDisabledButton("Convert to BC3", buttonSize3,
|
||||||
"This converts the texture to BC3 format in place. This is not revertible.",
|
"This converts the texture to BC3 format in place. This is not revertible.",
|
||||||
!canConvertInPlace || _left.Format is DXGIFormat.BC3Typeless or DXGIFormat.BC3UNorm or DXGIFormat.BC3UNormSRGB))
|
!canConvertInPlace || _left.Format is DXGIFormat.BC3Typeless or DXGIFormat.BC3UNorm or DXGIFormat.BC3UNormSRGB))
|
||||||
|
|
@ -181,7 +182,7 @@ public partial class ModEditWindow
|
||||||
AddReloadTask(_left.Path, false);
|
AddReloadTask(_left.Path, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Convert to RGBA", buttonSize3,
|
if (ImGuiUtil.DrawDisabledButton("Convert to RGBA", buttonSize3,
|
||||||
"This converts the texture to RGBA format in place. This is not revertible.",
|
"This converts the texture to RGBA format in place. This is not revertible.",
|
||||||
!canConvertInPlace
|
!canConvertInPlace
|
||||||
|
|
@ -312,15 +313,15 @@ public partial class ModEditWindow
|
||||||
var childWidth = GetChildWidth();
|
var childWidth = GetChildWidth();
|
||||||
var imageSize = new Vector2(childWidth.X - ImGui.GetStyle().FramePadding.X * 2);
|
var imageSize = new Vector2(childWidth.X - ImGui.GetStyle().FramePadding.X * 2);
|
||||||
DrawInputChild("Input Texture", _left, childWidth, imageSize);
|
DrawInputChild("Input Texture", _left, childWidth, imageSize);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawOutputChild(childWidth, imageSize);
|
DrawOutputChild(childWidth, imageSize);
|
||||||
if (!_overlayCollapsed)
|
if (!_overlayCollapsed)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawInputChild("Overlay Texture", _right, childWidth, imageSize);
|
DrawInputChild("Overlay Texture", _right, childWidth, imageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawOverlayCollapseButton();
|
DrawOverlayCollapseButton();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Dalamud.Interface.DragDrop;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -268,13 +269,13 @@ public partial class ModEditWindow : Window, IDisposable, Luna.IUiService
|
||||||
public static void Draw(ModEditor editor, Vector2 buttonSize)
|
public static void Draw(ModEditor editor, Vector2 buttonSize)
|
||||||
{
|
{
|
||||||
DrawRaceCodeCombo(buttonSize);
|
DrawRaceCodeCombo(buttonSize);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(buttonSize.X);
|
ImGui.SetNextItemWidth(buttonSize.X);
|
||||||
ImGui.InputTextWithHint("##suffixFrom", "From...", ref _materialSuffixFrom, 32);
|
ImGui.InputTextWithHint("##suffixFrom", "From...", ref _materialSuffixFrom, 32);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(buttonSize.X);
|
ImGui.SetNextItemWidth(buttonSize.X);
|
||||||
ImGui.InputTextWithHint("##suffixTo", "To...", ref _materialSuffixTo, 32);
|
ImGui.InputTextWithHint("##suffixTo", "To...", ref _materialSuffixTo, 32);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var disabled = !MdlMaterialEditor.ValidString(_materialSuffixTo);
|
var disabled = !MdlMaterialEditor.ValidString(_materialSuffixTo);
|
||||||
var tt = _materialSuffixTo.Length == 0
|
var tt = _materialSuffixTo.Length == 0
|
||||||
? "Please enter a target suffix."
|
? "Please enter a target suffix."
|
||||||
|
|
@ -297,12 +298,12 @@ public partial class ModEditWindow : Window, IDisposable, Luna.IUiService
|
||||||
anyChanges ? "Irreversibly rewrites all currently applied changes to model files." : "No changes made yet.", !anyChanges))
|
anyChanges ? "Irreversibly rewrites all currently applied changes to model files." : "No changes made yet.", !anyChanges))
|
||||||
editor.MdlMaterialEditor.SaveAllModels(editor.Compactor);
|
editor.MdlMaterialEditor.SaveAllModels(editor.Compactor);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Revert All Changes", buttonSize,
|
if (ImGuiUtil.DrawDisabledButton("Revert All Changes", buttonSize,
|
||||||
anyChanges ? "Revert all currently made and unsaved changes." : "No changes made yet.", !anyChanges))
|
anyChanges ? "Revert all currently made and unsaved changes." : "No changes made yet.", !anyChanges))
|
||||||
editor.MdlMaterialEditor.RestoreAllModels();
|
editor.MdlMaterialEditor.RestoreAllModels();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiComponents.HelpMarker(
|
ImGuiComponents.HelpMarker(
|
||||||
"Model files refer to the skin material they should use. This skin material is always the same, but modders have started using different suffices to differentiate between body types.\n"
|
"Model files refer to the skin material they should use. This skin material is always the same, but modders have started using different suffices to differentiate between body types.\n"
|
||||||
+ "This option allows you to switch the suffix of all model files to another. This changes the files, so you do this on your own risk.\n"
|
+ "This option allows you to switch the suffix of all model files to another. This changes the files, so you do this on your own risk.\n"
|
||||||
|
|
@ -393,7 +394,7 @@ public partial class ModEditWindow : Window, IDisposable, Luna.IUiService
|
||||||
|
|
||||||
if (_editor.Duplicates.SavedSpace > 0)
|
if (_editor.Duplicates.SavedSpace > 0)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted($"Frees up {Functions.HumanReadableSize(_editor.Duplicates.SavedSpace)} from your hard drive.");
|
ImGui.TextUnformatted($"Frees up {Functions.HumanReadableSize(_editor.Duplicates.SavedSpace)} from your hard drive.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -455,14 +456,14 @@ public partial class ModEditWindow : Window, IDisposable, Luna.IUiService
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Refresh Data"u8, "Refresh data for the current option.\nThis resets unsaved changes."u8, width))
|
if (ImUtf8.ButtonEx("Refresh Data"u8, "Refresh data for the current option.\nThis resets unsaved changes."u8, width))
|
||||||
{
|
{
|
||||||
_editor.LoadMod(_editor.Mod!, _editor.GroupIdx, _editor.DataIdx).Wait();
|
_editor.LoadMod(_editor.Mod!, _editor.GroupIdx, _editor.DataIdx).Wait();
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (_optionSelect.Draw(width.X))
|
if (_optionSelect.Draw(width.X))
|
||||||
{
|
{
|
||||||
var (groupIdx, dataIdx) = _optionSelect.CurrentSelection.Index;
|
var (groupIdx, dataIdx) = _optionSelect.CurrentSelection.Index;
|
||||||
|
|
@ -490,7 +491,7 @@ public partial class ModEditWindow : Window, IDisposable, Luna.IUiService
|
||||||
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, setsEqual))
|
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, setsEqual))
|
||||||
_editor.SwapEditor.Apply(_editor.Option!);
|
_editor.SwapEditor.Apply(_editor.Option!);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
tt = setsEqual ? "No changes staged." : "Revert all currently staged changes.";
|
tt = setsEqual ? "No changes staged." : "Revert all currently staged changes.";
|
||||||
if (ImGuiUtil.DrawDisabledButton("Revert Changes", Vector2.Zero, tt, setsEqual))
|
if (ImGuiUtil.DrawDisabledButton("Revert Changes", Vector2.Zero, tt, setsEqual))
|
||||||
_editor.SwapEditor.Revert(_editor.Option!);
|
_editor.SwapEditor.Revert(_editor.Option!);
|
||||||
|
|
@ -498,7 +499,7 @@ public partial class ModEditWindow : Window, IDisposable, Luna.IUiService
|
||||||
var otherSwaps = _editor.Mod!.TotalSwapCount - _editor.Option!.FileSwaps.Count;
|
var otherSwaps = _editor.Mod!.TotalSwapCount - _editor.Option!.FileSwaps.Count;
|
||||||
if (otherSwaps > 0)
|
if (otherSwaps > 0)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton($"There are {otherSwaps} file swaps configured in other options.", Vector2.Zero,
|
ImGuiUtil.DrawTextButton($"There are {otherSwaps} file swaps configured in other options.", Vector2.Zero,
|
||||||
ColorId.RedundantAssignment.Value());
|
ColorId.RedundantAssignment.Value());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -27,7 +28,7 @@ public class ModMergeTab(ModMerger modMerger) : Luna.IUiService
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
var size = 550 * ImGuiHelpers.GlobalScale;
|
var size = 550 * ImGuiHelpers.GlobalScale;
|
||||||
DrawMergeInto(size);
|
DrawMergeInto(size);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawMergeIntoDesc();
|
DrawMergeIntoDesc();
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
|
|
@ -35,7 +36,7 @@ public class ModMergeTab(ModMerger modMerger) : Luna.IUiService
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
|
|
||||||
DrawSplitOff(size);
|
DrawSplitOff(size);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawSplitOffDesc();
|
DrawSplitOffDesc();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -69,7 +70,7 @@ public class ModMergeTab(ModMerger modMerger) : Luna.IUiService
|
||||||
ImUtf8.Text(" into"u8);
|
ImUtf8.Text(" into"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawCombo(size - ImGui.GetItemRectSize().X - ImGui.GetStyle().ItemSpacing.X);
|
DrawCombo(size - ImGui.GetItemRectSize().X - ImGui.GetStyle().ItemSpacing.X);
|
||||||
|
|
||||||
using (ImRaii.Group())
|
using (ImRaii.Group())
|
||||||
|
|
@ -87,7 +88,7 @@ public class ModMergeTab(ModMerger modMerger) : Luna.IUiService
|
||||||
ImGuiUtil.HoverTooltip(
|
ImGuiUtil.HoverTooltip(
|
||||||
"The name of the new or existing option group to find or create the option in. Leave both group and option name blank for the default option.\n"
|
"The name of the new or existing option group to find or create the option in. Leave both group and option name blank for the default option.\n"
|
||||||
+ "A red border indicates an existing option group, a blue border indicates a new one.");
|
+ "A red border indicates an existing option group, a blue border indicates a new one.");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
|
|
||||||
color = color == Colors.DiscordColor
|
color = color == Colors.DiscordColor
|
||||||
|
|
@ -146,10 +147,10 @@ public class ModMergeTab(ModMerger modMerger) : Luna.IUiService
|
||||||
var buttonSize = new Vector2((size - 2 * ImGui.GetStyle().ItemSpacing.X) / 3, 0);
|
var buttonSize = new Vector2((size - 2 * ImGui.GetStyle().ItemSpacing.X) / 3, 0);
|
||||||
if (ImGui.Button("Select All", buttonSize))
|
if (ImGui.Button("Select All", buttonSize))
|
||||||
modMerger.SelectedOptions.UnionWith(modMerger.MergeFromMod!.AllDataContainers);
|
modMerger.SelectedOptions.UnionWith(modMerger.MergeFromMod!.AllDataContainers);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Unselect All", buttonSize))
|
if (ImGui.Button("Unselect All", buttonSize))
|
||||||
modMerger.SelectedOptions.Clear();
|
modMerger.SelectedOptions.Clear();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Invert Selection", buttonSize))
|
if (ImGui.Button("Invert Selection", buttonSize))
|
||||||
modMerger.SelectedOptions.SymmetricExceptWith(modMerger.MergeFromMod!.AllDataContainers);
|
modMerger.SelectedOptions.SymmetricExceptWith(modMerger.MergeFromMod!.AllDataContainers);
|
||||||
DrawOptionTable(size);
|
DrawOptionTable(size);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using ImSharp;
|
||||||
using Lumina.Data;
|
using Lumina.Data;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
|
|
@ -99,7 +100,7 @@ public class ResourceTreeViewer(
|
||||||
using var id = ImRaii.PushId(index);
|
using var id = ImRaii.PushId(index);
|
||||||
|
|
||||||
ImUtf8.TextFrameAligned($"Collection: {(incognito.IncognitoMode ? tree.AnonymizedCollectionName : tree.CollectionName)}");
|
ImUtf8.TextFrameAligned($"Collection: {(incognito.IncognitoMode ? tree.AnonymizedCollectionName : tree.CollectionName)}");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Export Character Pack"u8,
|
if (ImUtf8.ButtonEx("Export Character Pack"u8,
|
||||||
"Note that this recomputes the current data of the actor if it still exists, and does not use the cached data."u8))
|
"Note that this recomputes the current data of the actor if it still exists, and does not use the cached data."u8))
|
||||||
{
|
{
|
||||||
|
|
@ -340,7 +341,7 @@ public class ResourceTreeViewer(
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(textPos);
|
ImGui.SetCursorPosX(textPos);
|
||||||
ImUtf8.Text(resourceNode.ModRelativePath);
|
ImUtf8.Text(resourceNode.ModRelativePath);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,16 @@ using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Lumina.Data.Files;
|
using Lumina.Data.Files;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Api.Enums;
|
|
||||||
using Penumbra.Communication;
|
using Penumbra.Communication;
|
||||||
using Penumbra.GameData.Data;
|
using Penumbra.GameData.Data;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
using MouseButton = Penumbra.Api.Enums.MouseButton;
|
||||||
|
|
||||||
namespace Penumbra.UI;
|
namespace Penumbra.UI;
|
||||||
|
|
||||||
|
|
@ -111,7 +112,7 @@ public class ChangedItemDrawer : IDisposable, Luna.IUiService
|
||||||
{
|
{
|
||||||
using var tt = ImRaii.Tooltip();
|
using var tt = ImRaii.Tooltip();
|
||||||
ImGui.Image(icon.Handle, new Vector2(_smallestIconWidth));
|
ImGui.Image(icon.Handle, new Vector2(_smallestIconWidth));
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton(iconFlagType.ToDescription(), new Vector2(0, _smallestIconWidth), 0);
|
ImGuiUtil.DrawTextButton(iconFlagType.ToDescription(), new Vector2(0, _smallestIconWidth), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -144,7 +145,7 @@ public class ChangedItemDrawer : IDisposable, Luna.IUiService
|
||||||
if (additionalData.Length == 0)
|
if (additionalData.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
|
using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
|
||||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (height - ImGui.GetTextLineHeight()) / 2);
|
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (height - ImGui.GetTextLineHeight()) / 2);
|
||||||
ImUtf8.TextRightAligned(additionalData, ImGui.GetStyle().ItemInnerSpacing.X);
|
ImUtf8.TextRightAligned(additionalData, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
|
|
@ -156,7 +157,7 @@ public class ChangedItemDrawer : IDisposable, Luna.IUiService
|
||||||
if (text.Length == 0)
|
if (text.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
|
using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
|
||||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (height - ImGui.GetTextLineHeight()) / 2);
|
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (height - ImGui.GetTextLineHeight()) / 2);
|
||||||
ImUtf8.TextRightAligned(text, ImGui.GetStyle().ItemInnerSpacing.X);
|
ImUtf8.TextRightAligned(text, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
|
|
@ -188,7 +189,7 @@ public class ChangedItemDrawer : IDisposable, Luna.IUiService
|
||||||
foreach (var iconType in ChangedItemFlagExtensions.Order)
|
foreach (var iconType in ChangedItemFlagExtensions.Order)
|
||||||
{
|
{
|
||||||
ret |= DrawIcon(iconType, ref typeFilter);
|
ret |= DrawIcon(iconType, ref typeFilter);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SetCursorPosX(ImGui.GetContentRegionMax().X - size.X);
|
ImGui.SetCursorPosX(ImGui.GetContentRegionMax().X - size.X);
|
||||||
|
|
@ -232,7 +233,7 @@ public class ChangedItemDrawer : IDisposable, Luna.IUiService
|
||||||
{
|
{
|
||||||
using var tt = ImRaii.Tooltip();
|
using var tt = ImRaii.Tooltip();
|
||||||
ImGui.Image(icon.Handle, new Vector2(_smallestIconWidth));
|
ImGui.Image(icon.Handle, new Vector2(_smallestIconWidth));
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.DrawTextButton(type.ToDescription(), new Vector2(0, _smallestIconWidth), 0);
|
ImGuiUtil.DrawTextButton(type.ToDescription(), new Vector2(0, _smallestIconWidth), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class CollectionSelectHeader(
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameRounding, 0)
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameRounding, 0)
|
||||||
.Push(ImGuiStyleVar.ItemSpacing, new Vector2(0, spacing ? ImGui.GetStyle().ItemSpacing.Y : 0));
|
.Push(ImGuiStyleVar.ItemSpacing, new Vector2(0, spacing ? ImGui.GetStyle().ItemSpacing.Y : 0));
|
||||||
DrawTemporaryCheckbox();
|
DrawTemporaryCheckbox();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var comboWidth = ImGui.GetContentRegionAvail().X / 4f;
|
var comboWidth = ImGui.GetContentRegionAvail().X / 4f;
|
||||||
var buttonSize = new Vector2(comboWidth * 3f / 4f, 0f);
|
var buttonSize = new Vector2(comboWidth * 3f / 4f, 0f);
|
||||||
using (var _ = ImRaii.Group())
|
using (var _ = ImRaii.Group())
|
||||||
|
|
@ -155,6 +155,6 @@ public class CollectionSelectHeader(
|
||||||
using var _ = ImRaii.PushId(id);
|
using var _ = ImRaii.PushId(id);
|
||||||
if (ImGuiUtil.DrawDisabledButton(name, buttonWidth, tooltip, disabled))
|
if (ImGuiUtil.DrawDisabledButton(name, buttonWidth, tooltip, disabled))
|
||||||
_activeCollections.SetCollection(collection!, CollectionType.Current);
|
_activeCollections.SetCollection(collection!, CollectionType.Current);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
|
|
@ -134,7 +135,7 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.Spinner("Spinner"u8, ImGui.GetTextLineHeight() / 2, 2, ImGui.GetColorU32(ImGuiCol.Text));
|
ImUtf8.Spinner("Spinner"u8, ImGui.GetTextLineHeight() / 2, 2, ImGui.GetColorU32(ImGuiCol.Text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using Dalamud.Interface.ManagedFontAtlas;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -55,16 +56,16 @@ public sealed class CollectionPanel(
|
||||||
/// <summary> Draw the panel containing beginners information and simple assignments. </summary>
|
/// <summary> Draw the panel containing beginners information and simple assignments. </summary>
|
||||||
public void DrawSimple()
|
public void DrawSimple()
|
||||||
{
|
{
|
||||||
ImGuiUtil.TextWrapped("A collection is a set of mod configurations. You can have as many collections as you desire.\n"
|
Im.TextWrapped("A collection is a set of mod configurations. You can have as many collections as you desire.\n"u8
|
||||||
+ "The collection you are currently editing in the mod tab can be selected here and is highlighted.\n");
|
+ "The collection you are currently editing in the mod tab can be selected here and is highlighted.\n"u8);
|
||||||
ImGuiUtil.TextWrapped(
|
Im.TextWrapped(
|
||||||
"There are functions you can assign these collections to, so different mod configurations apply for different things.\n"
|
"There are functions you can assign these collections to, so different mod configurations apply for different things.\n"u8
|
||||||
+ "You can assign an existing collection to such a function by clicking the function or dragging the collection over.");
|
+ "You can assign an existing collection to such a function by clicking the function or dragging the collection over."u8);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var buttonWidth = new Vector2(200 * ImGuiHelpers.GlobalScale, 2 * ImGui.GetTextLineHeightWithSpacing());
|
var buttonWidth = new Vector2(200 * Im.Style.GlobalScale, 2 * Im.Style.FrameHeightWithSpacing);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, Vector2.Zero)
|
using var style = Im.Style.Push(ImStyleDouble.ButtonTextAlign, Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale);
|
.Push(ImStyleSingle.FrameBorderThickness, Im.Style.GlobalScale);
|
||||||
DrawSimpleCollectionButton(CollectionType.Default, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.Default, buttonWidth);
|
||||||
DrawSimpleCollectionButton(CollectionType.Interface, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.Interface, buttonWidth);
|
||||||
DrawSimpleCollectionButton(CollectionType.Yourself, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.Yourself, buttonWidth);
|
||||||
|
|
@ -72,14 +73,14 @@ public sealed class CollectionPanel(
|
||||||
DrawSimpleCollectionButton(CollectionType.FemalePlayerCharacter, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.FemalePlayerCharacter, buttonWidth);
|
||||||
DrawSimpleCollectionButton(CollectionType.MaleNonPlayerCharacter, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.MaleNonPlayerCharacter, buttonWidth);
|
||||||
DrawSimpleCollectionButton(CollectionType.FemaleNonPlayerCharacter, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.FemaleNonPlayerCharacter, buttonWidth);
|
||||||
|
|
||||||
ImGuiUtil.DrawColoredText(("Individual ", ColorId.NewMod.Value()),
|
ImGuiUtil.DrawColoredText(("Individual ", ColorId.NewMod.Value()),
|
||||||
("Assignments take precedence before anything else and only apply to one specific character or monster.", 0));
|
("Assignments take precedence before anything else and only apply to one specific character or monster.", 0));
|
||||||
ImGui.Dummy(Vector2.UnitX);
|
ImGui.Dummy(Vector2.UnitX);
|
||||||
|
|
||||||
var specialWidth = buttonWidth with { X = 275 * ImGuiHelpers.GlobalScale };
|
var specialWidth = buttonWidth with { X = 275 * ImGuiHelpers.GlobalScale };
|
||||||
DrawCurrentCharacter(specialWidth);
|
DrawCurrentCharacter(specialWidth);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawCurrentTarget(specialWidth);
|
DrawCurrentTarget(specialWidth);
|
||||||
DrawIndividualCollections(buttonWidth);
|
DrawIndividualCollections(buttonWidth);
|
||||||
|
|
||||||
|
|
@ -112,7 +113,7 @@ public sealed class CollectionPanel(
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawButton(name, type, buttonWidth, border, ActorIdentifier.Invalid, 's', collection);
|
DrawButton(name, type, buttonWidth, border, ActorIdentifier.Invalid, 's', collection);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.GetContentRegionAvail().X < buttonWidth.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X)
|
if (ImGui.GetContentRegionAvail().X < buttonWidth.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X)
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
}
|
}
|
||||||
|
|
@ -127,19 +128,19 @@ public sealed class CollectionPanel(
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
DrawCurrentCharacter(width);
|
DrawCurrentCharacter(width);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawCurrentTarget(width);
|
DrawCurrentTarget(width);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
style.Pop();
|
style.Pop();
|
||||||
_individualAssignmentUi.DrawWorldCombo(width.X / 2);
|
_individualAssignmentUi.DrawWorldCombo(width.X / 2);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
_individualAssignmentUi.DrawNewPlayerCollection(width.X);
|
_individualAssignmentUi.DrawNewPlayerCollection(width.X);
|
||||||
|
|
||||||
_individualAssignmentUi.DrawObjectKindCombo(width.X / 2);
|
_individualAssignmentUi.DrawObjectKindCombo(width.X / 2);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
_individualAssignmentUi.DrawNewNpcCollection(width.X);
|
_individualAssignmentUi.DrawNewNpcCollection(width.X);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiComponents.HelpMarker(
|
ImGuiComponents.HelpMarker(
|
||||||
"Battle- and Event NPCs may apply to more than one ID if they share the same name. This is language dependent. If you change your clients language, verify that your collections are still correctly assigned.");
|
"Battle- and Event NPCs may apply to more than one ID if they share the same name. This is language dependent. If you change your clients language, verify that your collections are still correctly assigned.");
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
|
|
@ -147,22 +148,22 @@ public sealed class CollectionPanel(
|
||||||
style.Push(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale);
|
style.Push(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale);
|
||||||
|
|
||||||
DrawNewPlayer(width);
|
DrawNewPlayer(width);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Also check General Settings for UI characters and inheritance through ownership.");
|
ImGuiUtil.TextWrapped("Also check General Settings for UI characters and inheritance through ownership.");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
DrawNewRetainer(width);
|
DrawNewRetainer(width);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Bell Retainers apply to Mannequins, but not to outdoor retainers, since those only carry their owners name.");
|
ImGuiUtil.TextWrapped("Bell Retainers apply to Mannequins, but not to outdoor retainers, since those only carry their owners name.");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
DrawNewNpc(width);
|
DrawNewNpc(width);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Some NPCs are available as Battle - and Event NPCs and need to be setup for both if desired.");
|
ImGuiUtil.TextWrapped("Some NPCs are available as Battle - and Event NPCs and need to be setup for both if desired.");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
DrawNewOwned(width);
|
DrawNewOwned(width);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Owned NPCs take precedence before unowned NPCs of the same type.");
|
ImGuiUtil.TextWrapped("Owned NPCs take precedence before unowned NPCs of the same type.");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
|
|
@ -219,7 +220,7 @@ public sealed class CollectionPanel(
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted("Identifier");
|
ImGui.TextUnformatted("Identifier");
|
||||||
ImGui.EndGroup();
|
ImGui.EndGroup();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.BeginGroup();
|
ImGui.BeginGroup();
|
||||||
var width = ImGui.GetContentRegionAvail().X;
|
var width = ImGui.GetContentRegionAvail().X;
|
||||||
using (ImRaii.Disabled(_collections.DefaultNamed == collection))
|
using (ImRaii.Disabled(_collections.DefaultNamed == collection))
|
||||||
|
|
@ -373,7 +374,7 @@ public sealed class CollectionPanel(
|
||||||
private void DrawSimpleCollectionButton(CollectionType type, Vector2 width)
|
private void DrawSimpleCollectionButton(CollectionType type, Vector2 width)
|
||||||
{
|
{
|
||||||
DrawButton(type.ToName(), type, width, 0, ActorIdentifier.Invalid, 's');
|
DrawButton(type.ToName(), type, width, 0, ActorIdentifier.Invalid, 's');
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (var group = ImRaii.Group())
|
using (var group = ImRaii.Group())
|
||||||
{
|
{
|
||||||
ImGuiUtil.TextWrapped(type.ToDescription());
|
ImGuiUtil.TextWrapped(type.ToDescription());
|
||||||
|
|
@ -470,7 +471,7 @@ public sealed class CollectionPanel(
|
||||||
var (name, ids, coll) = _active.Individuals.Assignments[i];
|
var (name, ids, coll) = _active.Individuals.Assignments[i];
|
||||||
DrawButton(Name(ids[0], name), CollectionType.Individual, width, 0, ids[0], 'i', coll);
|
DrawButton(Name(ids[0], name), CollectionType.Individual, width, 0, ids[0], 'i', coll);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.GetContentRegionAvail().X < width.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X
|
if (ImGui.GetContentRegionAvail().X < width.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X
|
||||||
&& i < _active.Individuals.Count - 1)
|
&& i < _active.Individuals.Count - 1)
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
@ -550,7 +551,7 @@ public sealed class CollectionPanel(
|
||||||
var name = type == CollectionType.Individual ? Name(id, null) : Buttons[type].Name;
|
var name = type == CollectionType.Individual ? Name(id, null) : Buttons[type].Name;
|
||||||
var color = Buttons.TryGetValue(type, out var p) ? p.Border : 0;
|
var color = Buttons.TryGetValue(type, out var p) ? p.Border : 0;
|
||||||
DrawButton(name, type, buttonWidth, color, id, 's', collection);
|
DrawButton(name, type, buttonWidth, color, id, 's', collection);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.GetContentRegionAvail().X < buttonWidth.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X
|
if (ImGui.GetContentRegionAvail().X < buttonWidth.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X
|
||||||
&& idx != _inUseCache.Count - 1)
|
&& idx != _inUseCache.Count - 1)
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
@ -582,7 +583,7 @@ public sealed class CollectionPanel(
|
||||||
{
|
{
|
||||||
var name = Name(parent);
|
var name = Name(parent);
|
||||||
var size = ImGui.CalcTextSize(name).X;
|
var size = ImGui.CalcTextSize(name).X;
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (constOffset + size >= ImGui.GetContentRegionAvail().X)
|
if (constOffset + size >= ImGui.GetContentRegionAvail().X)
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
ImGuiUtil.DrawTextButton(name, Vector2.Zero, 0);
|
ImGuiUtil.DrawTextButton(name, Vector2.Zero, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -27,13 +28,13 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
|
|
||||||
DrawCurrentCollectionInheritance();
|
DrawCurrentCollectionInheritance();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawInheritanceTrashButton();
|
DrawInheritanceTrashButton();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawRightText();
|
DrawRightText();
|
||||||
|
|
||||||
DrawNewInheritanceSelection();
|
DrawNewInheritanceSelection();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("More Information about Inheritance", new Vector2(ImGui.GetContentRegionAvail().X, 0)))
|
if (ImGui.Button("More Information about Inheritance", new Vector2(ImGui.GetContentRegionAvail().X, 0)))
|
||||||
ImGui.OpenPopup("InheritanceHelp");
|
ImGui.OpenPopup("InheritanceHelp");
|
||||||
|
|
||||||
|
|
@ -216,7 +217,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
private void DrawNewInheritanceSelection()
|
private void DrawNewInheritanceSelection()
|
||||||
{
|
{
|
||||||
DrawNewInheritanceCombo();
|
DrawNewInheritanceCombo();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var inheritance = InheritanceManager.CheckValidInheritance(_active.Current, _newInheritance);
|
var inheritance = InheritanceManager.CheckValidInheritance(_active.Current, _newInheritance);
|
||||||
var tt = inheritance switch
|
var tt = inheritance switch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -148,7 +149,7 @@ public sealed class ConfigWindow : Window, Luna.IUiService
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
SupportButton.Discord(Penumbra.Messager, 0);
|
SupportButton.Discord(Penumbra.Messager, 0);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
UiHelpers.DrawSupportButton(_penumbra!);
|
UiHelpers.DrawSupportButton(_penumbra!);
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
||||||
|
|
@ -31,7 +32,7 @@ public sealed class RaceCodeTab() : IKnowledgeTab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
using (var table = ImUtf8.Table("children"u8, 4, ImGuiTableFlags.BordersOuter, size))
|
using (var table = ImUtf8.Table("children"u8, 4, ImGuiTableFlags.BordersOuter, size))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
|
|
@ -74,7 +75,7 @@ public class DescriptionEditPopup(ModManager modManager) : Luna.IUiService
|
||||||
|
|
||||||
ImGui.SetCursorPosX((inputSize.X - width) / 2);
|
ImGui.SetCursorPosX((inputSize.X - width) / 2);
|
||||||
DrawSaveButton(buttonSize);
|
DrawSaveButton(buttonSize);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawCancelButton(buttonSize);
|
DrawCancelButton(buttonSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using OtterGui.Text.Widget;
|
|
||||||
using OtterGuiInternal.Utility;
|
using OtterGuiInternal.Utility;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Meta;
|
using Penumbra.Meta;
|
||||||
|
|
@ -31,7 +31,7 @@ public readonly struct ImcModGroupEditDrawer(ModGroupEditDrawer editor, ImcModGr
|
||||||
editor.ModManager.OptionEditor.ImcEditor.ChangeAllVariants(group, allVariants);
|
editor.ModManager.OptionEditor.ImcEditor.ChangeAllVariants(group, allVariants);
|
||||||
ImUtf8.HoverTooltip("Make this group overwrite all corresponding variants for this identifier, not just the one specified."u8);
|
ImUtf8.HoverTooltip("Make this group overwrite all corresponding variants for this identifier, not just the one specified."u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var onlyAttributes = group.OnlyAttributes;
|
var onlyAttributes = group.OnlyAttributes;
|
||||||
if (ImUtf8.Checkbox("Only Attributes"u8, ref onlyAttributes))
|
if (ImUtf8.Checkbox("Only Attributes"u8, ref onlyAttributes))
|
||||||
editor.ModManager.OptionEditor.ImcEditor.ChangeOnlyAttributes(group, onlyAttributes);
|
editor.ModManager.OptionEditor.ImcEditor.ChangeOnlyAttributes(group, onlyAttributes);
|
||||||
|
|
@ -44,7 +44,7 @@ public readonly struct ImcModGroupEditDrawer(ModGroupEditDrawer editor, ImcModGr
|
||||||
ImUtf8.TextFrameAligned("Decal ID"u8);
|
ImUtf8.TextFrameAligned("Decal ID"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
changes |= ImcMetaDrawer.DrawMaterialId(defaultEntry, ref entry, true);
|
changes |= ImcMetaDrawer.DrawMaterialId(defaultEntry, ref entry, true);
|
||||||
|
|
@ -60,7 +60,7 @@ public readonly struct ImcModGroupEditDrawer(ModGroupEditDrawer editor, ImcModGr
|
||||||
ImUtf8.TextFrameAligned("Can Be Disabled"u8);
|
ImUtf8.TextFrameAligned("Can Be Disabled"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
|
|
@ -168,7 +168,7 @@ public readonly struct ImcModGroupEditDrawer(ModGroupEditDrawer editor, ImcModGr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class NegativeCheckbox : MultiStateCheckbox<bool>
|
private sealed class NegativeCheckbox : OtterGui.Text.Widget.MultiStateCheckbox<bool>
|
||||||
{
|
{
|
||||||
public static readonly NegativeCheckbox Instance = new();
|
public static readonly NegativeCheckbox Instance = new();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -10,6 +11,7 @@ using Penumbra.Mods;
|
||||||
using Penumbra.Mods.Groups;
|
using Penumbra.Mods.Groups;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
using Penumbra.Mods.SubMods;
|
using Penumbra.Mods.SubMods;
|
||||||
|
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||||
|
|
||||||
namespace Penumbra.UI.ModsTab.Groups;
|
namespace Penumbra.UI.ModsTab.Groups;
|
||||||
|
|
||||||
|
|
@ -117,7 +119,7 @@ public sealed class ModGroupDrawer : Luna.IUiService
|
||||||
var selectedOption = setting.AsIndex;
|
var selectedOption = setting.AsIndex;
|
||||||
using var disabled = ImRaii.Disabled(_locked);
|
using var disabled = ImRaii.Disabled(_locked);
|
||||||
_combo.Draw(group, groupIdx, selectedOption);
|
_combo.Draw(group, groupIdx, selectedOption);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (group.Description.Length > 0)
|
if (group.Description.Length > 0)
|
||||||
ImUtf8.LabeledHelpMarker(group.Name, group.Description);
|
ImUtf8.LabeledHelpMarker(group.Name, group.Description);
|
||||||
else
|
else
|
||||||
|
|
@ -152,7 +154,7 @@ public sealed class ModGroupDrawer : Luna.IUiService
|
||||||
if (option.Description.Length <= 0)
|
if (option.Description.Length <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiComponents.HelpMarker(option.Description);
|
ImGuiComponents.HelpMarker(option.Description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +193,7 @@ public sealed class ModGroupDrawer : Luna.IUiService
|
||||||
|
|
||||||
if (option.Description.Length > 0)
|
if (option.Description.Length > 0)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiComponents.HelpMarker(option.Description);
|
ImGuiComponents.HelpMarker(option.Description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -141,7 +142,7 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
var expanded = DrawExpandedFiles(conflict);
|
var expanded = DrawExpandedFiles(conflict);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var conflictPriority = DrawPriorityInput(conflict, priorityWidth);
|
var conflictPriority = DrawPriorityInput(conflict, priorityWidth);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var selectedPriority = collectionManager.Active.Current.GetActualSettings(selector.Selected!.Index).Settings!.Priority.Value;
|
var selectedPriority = collectionManager.Active.Current.GetActualSettings(selector.Selected!.Index).Settings!.Priority.Value;
|
||||||
DrawPriorityButtons(conflict.Mod2 as Mod, conflictPriority, selectedPriority, buttonSize);
|
DrawPriorityButtons(conflict.Mod2 as Mod, conflictPriority, selectedPriority, buttonSize);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
@ -196,7 +197,7 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
selectedPriority > conflictPriority, true))
|
selectedPriority > conflictPriority, true))
|
||||||
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, selector.Selected!,
|
collectionManager.Editor.SetModPriority(collectionManager.Active.Current, selector.Selected!,
|
||||||
new ModPriority(conflictPriority + 1));
|
new ModPriority(conflictPriority + 1));
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.SortNumericDownAlt.ToIconString(), buttonSize,
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.SortNumericDownAlt.ToIconString(), buttonSize,
|
||||||
$"Set the priority of this mod to the currently selected mods priority minus one. ({conflictPriority} -> {selectedPriority - 1})",
|
$"Set the priority of this mod to the currently selected mods priority minus one. ({conflictPriority} -> {selectedPriority - 1})",
|
||||||
selectedPriority > conflictPriority || conflict == null, true))
|
selectedPriority > conflictPriority || conflict == null, true))
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -105,7 +106,7 @@ public class ModPanelEditTab(
|
||||||
if (ImGuiUtil.DrawDisabledButton("Open Mod Directory", buttonSize, tt, !folderExists))
|
if (ImGuiUtil.DrawDisabledButton("Open Mod Directory", buttonSize, tt, !folderExists))
|
||||||
Process.Start(new ProcessStartInfo(_mod.ModPath.FullName) { UseShellExecute = true });
|
Process.Start(new ProcessStartInfo(_mod.ModPath.FullName) { UseShellExecute = true });
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Reload Mod", buttonSize, "Reload the current mod from its files.\n"
|
if (ImGuiUtil.DrawDisabledButton("Reload Mod", buttonSize, "Reload the current mod from its files.\n"
|
||||||
+ "If the mod directory or meta file do not exist anymore or if the new mod name is empty, the mod is deleted instead.",
|
+ "If the mod directory or meta file do not exist anymore or if the new mod name is empty, the mod is deleted instead.",
|
||||||
false))
|
false))
|
||||||
|
|
@ -131,7 +132,7 @@ public class ModPanelEditTab(
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||||
ImUtf8.OpenPopup("context"u8);
|
ImUtf8.OpenPopup("context"u8);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
tt = backup.Exists
|
tt = backup.Exists
|
||||||
? $"Delete existing mod export \"{backup.Name}\" (hold {config.DeleteModModifier} while clicking)."
|
? $"Delete existing mod export \"{backup.Name}\" (hold {config.DeleteModModifier} while clicking)."
|
||||||
: $"Exported mod \"{backup.Name}\" does not exist.";
|
: $"Exported mod \"{backup.Name}\" does not exist.";
|
||||||
|
|
@ -141,12 +142,12 @@ public class ModPanelEditTab(
|
||||||
tt = backup.Exists
|
tt = backup.Exists
|
||||||
? $"Restore mod from exported file \"{backup.Name}\" (hold {config.DeleteModModifier} while clicking)."
|
? $"Restore mod from exported file \"{backup.Name}\" (hold {config.DeleteModModifier} while clicking)."
|
||||||
: $"Exported mod \"{backup.Name}\" does not exist.";
|
: $"Exported mod \"{backup.Name}\" does not exist.";
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Restore From Export"u8, tt, buttonSize, !backup.Exists || !config.DeleteModModifier.IsActive()))
|
if (ImUtf8.ButtonEx("Restore From Export"u8, tt, buttonSize, !backup.Exists || !config.DeleteModModifier.IsActive()))
|
||||||
backup.Restore(modManager);
|
backup.Restore(modManager);
|
||||||
if (backup.Exists)
|
if (backup.Exists)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
ImUtf8.Text(FontAwesomeIcon.CheckCircle.ToIconString());
|
ImUtf8.Text(FontAwesomeIcon.CheckCircle.ToIconString());
|
||||||
|
|
@ -187,7 +188,7 @@ public class ModPanelEditTab(
|
||||||
descriptionPopup.Open(_mod);
|
descriptionPopup.Open(_mod);
|
||||||
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var fileExists = File.Exists(filenames.ModMetaPath(_mod));
|
var fileExists = File.Exists(filenames.ModMetaPath(_mod));
|
||||||
var tt = fileExists
|
var tt = fileExists
|
||||||
? "Open the metadata json file in the text editor of your choice."
|
? "Open the metadata json file in the text editor of your choice."
|
||||||
|
|
@ -279,14 +280,14 @@ public class ModPanelEditTab(
|
||||||
$"{_currentModDirectory} contains invalid symbols for FFXIV."),
|
$"{_currentModDirectory} contains invalid symbols for FFXIV."),
|
||||||
_ => (true, "Unknown error."),
|
_ => (true, "Unknown error."),
|
||||||
};
|
};
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Rename Mod Directory", buttonSize, tt, disabled) && _currentModDirectory != null)
|
if (ImGuiUtil.DrawDisabledButton("Rename Mod Directory", buttonSize, tt, disabled) && _currentModDirectory != null)
|
||||||
{
|
{
|
||||||
modManager.MoveModDirectory(mod, _currentModDirectory);
|
modManager.MoveModDirectory(mod, _currentModDirectory);
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiComponents.HelpMarker(
|
ImGuiComponents.HelpMarker(
|
||||||
"The mod directory name is used to correspond stored settings and sort orders, otherwise it has no influence on anything that is displayed.\n"
|
"The mod directory name is used to correspond stored settings and sort orders, otherwise it has no influence on anything that is displayed.\n"
|
||||||
+ "This can currently not be used on pre-existing folders and does not support merges or overwriting.");
|
+ "This can currently not be used on pre-existing folders and does not support merges or overwriting.");
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.GameFonts;
|
using Dalamud.Interface.GameFonts;
|
||||||
using Dalamud.Interface.ManagedFontAtlas;
|
using Dalamud.Interface.ManagedFontAtlas;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using Penumbra.Communication;
|
using Penumbra.Communication;
|
||||||
|
|
@ -208,7 +209,7 @@ public class ModPanelHeader : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawAuthor();
|
DrawAuthor();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawWebsite();
|
DrawWebsite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -218,7 +219,7 @@ public class ModPanelHeader : IDisposable
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
||||||
ImGuiUtil.TextColored(Colors.MetaInfoText, "by ");
|
ImGuiUtil.TextColored(Colors.MetaInfoText, "by ");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
style.Pop();
|
style.Pop();
|
||||||
ImGui.TextUnformatted(_modAuthor);
|
ImGui.TextUnformatted(_modAuthor);
|
||||||
}
|
}
|
||||||
|
|
@ -253,7 +254,7 @@ public class ModPanelHeader : IDisposable
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
||||||
ImGuiUtil.TextColored(Colors.MetaInfoText, "from ");
|
ImGuiUtil.TextColored(Colors.MetaInfoText, "from ");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
style.Pop();
|
style.Pop();
|
||||||
ImGui.TextUnformatted(_modWebsite);
|
ImGui.TextUnformatted(_modWebsite);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
|
|
@ -55,7 +56,7 @@ public class ModPanelSettingsTab(
|
||||||
communicator.PreSettingsPanelDraw.Invoke(new PreSettingsPanelDraw.Arguments(selection.Mod!));
|
communicator.PreSettingsPanelDraw.Invoke(new PreSettingsPanelDraw.Arguments(selection.Mod!));
|
||||||
DrawEnabledInput();
|
DrawEnabledInput();
|
||||||
tutorial.OpenTutorial(BasicTutorialSteps.EnablingMods);
|
tutorial.OpenTutorial(BasicTutorialSteps.EnablingMods);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawPriorityInput();
|
DrawPriorityInput();
|
||||||
tutorial.OpenTutorial(BasicTutorialSteps.Priority);
|
tutorial.OpenTutorial(BasicTutorialSteps.Priority);
|
||||||
DrawRemoveSettings();
|
DrawRemoveSettings();
|
||||||
|
|
@ -219,7 +220,7 @@ public class ModPanelSettingsTab(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_temporary)
|
if (_temporary)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -95,7 +96,7 @@ public class MultiModPanel(ModFileSystemSelector selector, ModDataEditor editor,
|
||||||
{
|
{
|
||||||
var width = ImGuiHelpers.ScaledVector2(150, 0);
|
var width = ImGuiHelpers.ScaledVector2(150, 0);
|
||||||
ImUtf8.TextFrameAligned("Multi Tagger:"u8);
|
ImUtf8.TextFrameAligned("Multi Tagger:"u8);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
var predefinedTagsEnabled = tagManager.Enabled;
|
var predefinedTagsEnabled = tagManager.Enabled;
|
||||||
var inputWidth = predefinedTagsEnabled
|
var inputWidth = predefinedTagsEnabled
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
@ -155,7 +156,7 @@ public sealed class PredefinedTagManager : ISavable, IReadOnlyList<string>, ISer
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
@ -250,7 +251,7 @@ public sealed class PredefinedTagManager : ISavable, IReadOnlyList<string>, ISer
|
||||||
_modManager.DataEditor.ChangeLocalTag(mod, localIdx, string.Empty);
|
_modManager.DataEditor.ChangeLocalTag(mod, localIdx, string.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
color.Pop();
|
color.Pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ public sealed class ResourceWatcher : IDisposable, ITab, Luna.IUiService
|
||||||
if (Im.Button("Clear"u8))
|
if (Im.Button("Clear"u8))
|
||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var onlyMatching = _ephemeral.OnlyAddMatchingResources;
|
var onlyMatching = _ephemeral.OnlyAddMatchingResources;
|
||||||
if (Im.Checkbox("Store Only Matching"u8, ref onlyMatching))
|
if (Im.Checkbox("Store Only Matching"u8, ref onlyMatching))
|
||||||
{
|
{
|
||||||
|
|
@ -181,7 +181,7 @@ public sealed class ResourceWatcher : IDisposable, ITab, Luna.IUiService
|
||||||
|
|
||||||
private void DrawMaxEntries()
|
private void DrawMaxEntries()
|
||||||
{
|
{
|
||||||
Im.Item.SetNextWidth(80 * Im.Style.GlobalScale);
|
Im.Item.SetNextWidthScaled(80);
|
||||||
Im.Input.Scalar("Max. Entries"u8, ref _newMaxEntries);
|
Im.Input.Scalar("Max. Entries"u8, ref _newMaxEntries);
|
||||||
var change = ImGui.IsItemDeactivatedAfterEdit();
|
var change = ImGui.IsItemDeactivatedAfterEdit();
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right) && ImGui.GetIO().KeyCtrl)
|
if (ImGui.IsItemClicked(ImGuiMouseButton.Right) && ImGui.GetIO().KeyCtrl)
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class ChangedItemsTab(
|
||||||
- ImGui.GetStyle().ItemSpacing.X;
|
- ImGui.GetStyle().ItemSpacing.X;
|
||||||
ImGui.SetNextItemWidth(450 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(450 * UiHelpers.Scale);
|
||||||
Im.Input.Text("##changedItemsFilter"u8, ref _changedItemFilter, "Filter Item..."u8);
|
Im.Input.Text("##changedItemsFilter"u8, ref _changedItemFilter, "Filter Item..."u8);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(varWidth);
|
ImGui.SetNextItemWidth(varWidth);
|
||||||
Im.Input.Text("##changedItemsModFilter"u8, ref _changedItemModFilter, "Filter Mods..."u8);
|
Im.Input.Text("##changedItemsModFilter"u8, ref _changedItemModFilter, "Filter Mods..."u8);
|
||||||
return varWidth;
|
return varWidth;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
|
|
@ -66,7 +67,7 @@ public sealed class CollectionsTab : IDisposable, ITab, Luna.IUiService
|
||||||
|
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.EditingCollections);
|
_tutorial.OpenTutorial(BasicTutorialSteps.EditingCollections);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (var group = ImRaii.Group())
|
using (var group = ImRaii.Group())
|
||||||
{
|
{
|
||||||
DrawHeaderLine();
|
DrawHeaderLine();
|
||||||
|
|
@ -91,28 +92,28 @@ public sealed class CollectionsTab : IDisposable, ITab, Luna.IUiService
|
||||||
Mode = PanelMode.SimpleAssignment;
|
Mode = PanelMode.SimpleAssignment;
|
||||||
color.Pop();
|
color.Pop();
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.SimpleAssignments);
|
_tutorial.OpenTutorial(BasicTutorialSteps.SimpleAssignments);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
color.Push(ImGuiCol.Button, ImGui.GetColorU32(ImGuiCol.TabActive), Mode is PanelMode.IndividualAssignment);
|
color.Push(ImGuiCol.Button, ImGui.GetColorU32(ImGuiCol.TabActive), Mode is PanelMode.IndividualAssignment);
|
||||||
if (ImGui.Button("Individual Assignments", buttonSize))
|
if (ImGui.Button("Individual Assignments", buttonSize))
|
||||||
Mode = PanelMode.IndividualAssignment;
|
Mode = PanelMode.IndividualAssignment;
|
||||||
color.Pop();
|
color.Pop();
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.IndividualAssignments);
|
_tutorial.OpenTutorial(BasicTutorialSteps.IndividualAssignments);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
color.Push(ImGuiCol.Button, ImGui.GetColorU32(ImGuiCol.TabActive), Mode is PanelMode.GroupAssignment);
|
color.Push(ImGuiCol.Button, ImGui.GetColorU32(ImGuiCol.TabActive), Mode is PanelMode.GroupAssignment);
|
||||||
if (ImGui.Button("Group Assignments", buttonSize))
|
if (ImGui.Button("Group Assignments", buttonSize))
|
||||||
Mode = PanelMode.GroupAssignment;
|
Mode = PanelMode.GroupAssignment;
|
||||||
color.Pop();
|
color.Pop();
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.GroupAssignments);
|
_tutorial.OpenTutorial(BasicTutorialSteps.GroupAssignments);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
color.Push(ImGuiCol.Button, ImGui.GetColorU32(ImGuiCol.TabActive), Mode is PanelMode.Details);
|
color.Push(ImGuiCol.Button, ImGui.GetColorU32(ImGuiCol.TabActive), Mode is PanelMode.Details);
|
||||||
if (ImGui.Button("Collection Details", buttonSize))
|
if (ImGui.Button("Collection Details", buttonSize))
|
||||||
Mode = PanelMode.Details;
|
Mode = PanelMode.Details;
|
||||||
color.Pop();
|
color.Pop();
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.CollectionDetails);
|
_tutorial.OpenTutorial(BasicTutorialSteps.CollectionDetails);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
_incognito.DrawToggle(withSpacing);
|
_incognito.DrawToggle(withSpacing);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Files;
|
using Penumbra.GameData.Files;
|
||||||
using Penumbra.GameData.Files.AtchStructs;
|
using Penumbra.GameData.Files.AtchStructs;
|
||||||
|
|
||||||
namespace Penumbra.UI.Tabs.Debug;
|
namespace Penumbra.UI.Tabs.Debug;
|
||||||
|
|
@ -15,7 +16,7 @@ public static class AtchDrawer
|
||||||
ImUtf8.Text("States: "u8);
|
ImUtf8.Text("States: "u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.Text($"{file.Points.Count}");
|
ImUtf8.Text($"{file.Points.Count}");
|
||||||
|
|
@ -53,4 +54,4 @@ public static class AtchDrawer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using Penumbra.CrashHandler;
|
using Penumbra.CrashHandler;
|
||||||
|
|
@ -23,7 +24,7 @@ public static class CrashDataExtensions
|
||||||
ImGui.TextUnformatted(nameof(data.TotalVFXFuncsInvoked));
|
ImGui.TextUnformatted(nameof(data.TotalVFXFuncsInvoked));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImRaii.Group())
|
using (ImRaii.Group())
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(data.Mode);
|
ImGui.TextUnformatted(data.Mode);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.DragDrop;
|
using Dalamud.Interface.DragDrop;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using Penumbra.CrashHandler;
|
using Penumbra.CrashHandler;
|
||||||
|
|
@ -60,13 +61,13 @@ public class CrashHandlerPanel(CrashHandlerService service, Configuration config
|
||||||
if (ImGui.Button("Enable"))
|
if (ImGui.Button("Enable"))
|
||||||
service.Enable();
|
service.Enable();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Disable"))
|
if (ImGui.Button("Disable"))
|
||||||
service.Disable();
|
service.Disable();
|
||||||
|
|
||||||
if (ImGui.Button("Shutdown Crash Handler"))
|
if (ImGui.Button("Shutdown Crash Handler"))
|
||||||
service.CloseCrashHandler();
|
service.CloseCrashHandler();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Relaunch Crash Handler"))
|
if (ImGui.Button("Relaunch Crash Handler"))
|
||||||
service.LaunchCrashHandler();
|
service.LaunchCrashHandler();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ public class DebugTab : Window, ITab, IUiService
|
||||||
ImUtf8.Text("Free'd Allocated Bytes"u8);
|
ImUtf8.Text("Free'd Allocated Bytes"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.Text($"{PenumbraStringMemory.CurrentStrings}");
|
ImUtf8.Text($"{PenumbraStringMemory.CurrentStrings}");
|
||||||
|
|
@ -948,7 +948,7 @@ public class DebugTab : Window, ITab, IUiService
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var frame = new Vector2(ImGui.GetTextLineHeight());
|
var frame = new Vector2(ImGui.GetTextLineHeight());
|
||||||
ImGui.ColorButton("###color", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)color), 1), 0, frame);
|
ImGui.ColorButton("###color", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)color), 1), 0, frame);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted($"{color.Red:F6} | {color.Green:F6} | {color.Blue:F6}");
|
ImGui.TextUnformatted($"{color.Red:F6} | {color.Green:F6} | {color.Blue:F6}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ using Dalamud.Bindings.ImGui;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||||
using FFXIVClientStructs.FFXIV.Client.System.Scheduler;
|
using FFXIVClientStructs.FFXIV.Client.System.Scheduler;
|
||||||
using FFXIVClientStructs.FFXIV.Client.System.Scheduler.Resource;
|
using FFXIVClientStructs.FFXIV.Client.System.Scheduler.Resource;
|
||||||
using FFXIVClientStructs.Interop;
|
|
||||||
using FFXIVClientStructs.STD;
|
using FFXIVClientStructs.STD;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Interop.Services;
|
using Penumbra.Interop.Services;
|
||||||
using Penumbra.Interop.Structs;
|
using Penumbra.Interop.Structs;
|
||||||
|
|
@ -38,7 +38,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
Penumbra.Dynamis.DrawPointer(Device.Instance());
|
Penumbra.Dynamis.DrawPointer(Device.Instance());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.Text("CharacterUtility"u8);
|
ImUtf8.Text("CharacterUtility"u8);
|
||||||
|
|
@ -168,7 +168,7 @@ public unsafe class GlobalVariablesDrawer(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO Remove cast when it'll have the right type in CS.
|
// TODO Remove cast when it'll have the right type in CS.
|
||||||
var map = (StdMap<int, Pointer<SchedulerResource>>*)&scheduler.Scheduler->Resources;
|
var map = (StdMap<int, FFXIVClientStructs.Interop.Pointer<SchedulerResource>>*)&scheduler.Scheduler->Resources;
|
||||||
var total = 0;
|
var total = 0;
|
||||||
_shownResourcesMap = 0;
|
_shownResourcesMap = 0;
|
||||||
foreach (var (key, resourcePtr) in *map)
|
foreach (var (key, resourcePtr) in *map)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Interop.Hooks;
|
using Penumbra.Interop.Hooks;
|
||||||
|
|
||||||
|
|
@ -20,7 +21,7 @@ public class HookOverrideDrawer(IDalamudPluginInterface pluginInterface) : Luna.
|
||||||
if (ImUtf8.Button("Save"u8))
|
if (ImUtf8.Button("Save"u8))
|
||||||
_overrides.Write(pluginInterface);
|
_overrides.Write(pluginInterface);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var path = Path.Combine(pluginInterface.GetPluginConfigDirectory(), HookOverrides.FileName);
|
var path = Path.Combine(pluginInterface.GetPluginConfigDirectory(), HookOverrides.FileName);
|
||||||
var exists = File.Exists(path);
|
var exists = File.Exists(path);
|
||||||
if (ImUtf8.ButtonEx("Delete"u8, disabled: !exists, tooltip: exists ? ""u8 : "File does not exist."u8))
|
if (ImUtf8.ButtonEx("Delete"u8, disabled: !exists, tooltip: exists ? ""u8 : "File does not exist."u8))
|
||||||
|
|
@ -34,18 +35,18 @@ public class HookOverrideDrawer(IDalamudPluginInterface pluginInterface) : Luna.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool? allVisible = null;
|
bool? allVisible = null;
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Disable All Visible Hooks"u8))
|
if (ImUtf8.Button("Disable All Visible Hooks"u8))
|
||||||
allVisible = true;
|
allVisible = true;
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Enable All VisibleHooks"u8))
|
if (ImUtf8.Button("Enable All VisibleHooks"u8))
|
||||||
allVisible = false;
|
allVisible = false;
|
||||||
|
|
||||||
bool? all = null;
|
bool? all = null;
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Disable All Hooks"))
|
if (ImUtf8.Button("Disable All Hooks"))
|
||||||
all = true;
|
all = true;
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Enable All Hooks"))
|
if (ImUtf8.Button("Enable All Hooks"))
|
||||||
all = false;
|
all = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
|
|
@ -29,7 +30,7 @@ public class ModMigratorDebug(ModMigrator migrator) : Luna.IUiService
|
||||||
|
|
||||||
if (_indexTask is not null)
|
if (_indexTask is not null)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.TextFrameAligned($"{_indexTask.Status}");
|
ImUtf8.TextFrameAligned($"{_indexTask.Status}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,7 +48,7 @@ public class ModMigratorDebug(ModMigrator migrator) : Luna.IUiService
|
||||||
|
|
||||||
if (_mdlTask is not null)
|
if (_mdlTask is not null)
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.TextFrameAligned($"{_mdlTask.Status}");
|
ImUtf8.TextFrameAligned($"{_mdlTask.Status}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Render;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Render;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.Interop.Hooks;
|
using Penumbra.Interop.Hooks;
|
||||||
|
|
@ -27,7 +28,7 @@ public class RenderTargetDrawer(RenderTargetHdrEnabler renderTargetHdrEnabler, D
|
||||||
ImUtf8.Text("HDR Detour Called");
|
ImUtf8.Text("HDR Detour Called");
|
||||||
ImUtf8.Text("Penumbra Reload Count");
|
ImUtf8.Text("Penumbra Reload Count");
|
||||||
}
|
}
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
using (ImUtf8.Group())
|
using (ImUtf8.Group())
|
||||||
{
|
{
|
||||||
ImUtf8.Text($"{(dalamudConfig.GetDalamudConfig(DalamudConfigService.WaitingForPluginsOption, out bool w) ? w.ToString() : "Unknown")}");
|
ImUtf8.Text($"{(dalamudConfig.GetDalamudConfig(DalamudConfigService.WaitingForPluginsOption, out bool w) ? w.ToString() : "Unknown")}");
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using Penumbra.UI.Classes;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Interop.Services;
|
using Penumbra.Interop.Services;
|
||||||
|
|
@ -53,7 +54,7 @@ public class ModsTab(
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
selector.Draw();
|
selector.Draw();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(MathF.Round(ImGui.GetCursorPosX()));
|
ImGui.SetCursorPosX(MathF.Round(ImGui.GetCursorPosX()));
|
||||||
using var group = ImRaii.Group();
|
using var group = ImRaii.Group();
|
||||||
collectionHeader.Draw(false);
|
collectionHeader.Draw(false);
|
||||||
|
|
@ -100,7 +101,7 @@ public class ModsTab(
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
ImGuiUtil.DrawTextButton(FontAwesomeIcon.InfoCircle.ToIconString(), frameHeight, frameColor);
|
ImGuiUtil.DrawTextButton(FontAwesomeIcon.InfoCircle.ToIconString(), frameHeight, frameColor);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiUtil.DrawTextButton("Redraw: ", frameHeight, frameColor);
|
ImGuiUtil.DrawTextButton("Redraw: ", frameHeight, frameColor);
|
||||||
|
|
@ -113,27 +114,27 @@ public class ModsTab(
|
||||||
|
|
||||||
using var id = ImRaii.PushId("Redraw");
|
using var id = ImRaii.PushId("Redraw");
|
||||||
using var disabled = ImRaii.Disabled(clientState.LocalPlayer == null);
|
using var disabled = ImRaii.Disabled(clientState.LocalPlayer == null);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var buttonWidth = frameHeight with { X = ImGui.GetContentRegionAvail().X / 5 };
|
var buttonWidth = frameHeight with { X = ImGui.GetContentRegionAvail().X / 5 };
|
||||||
var tt = !objects[0].Valid
|
var tt = !objects[0].Valid
|
||||||
? "\nCan only be used when you are logged in and your character is available."
|
? "\nCan only be used when you are logged in and your character is available."
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
DrawButton(buttonWidth, "All", string.Empty, tt);
|
DrawButton(buttonWidth, "All", string.Empty, tt);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawButton(buttonWidth, "Self", "self", tt);
|
DrawButton(buttonWidth, "Self", "self", tt);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
tt = targets.Target == null && targets.GPoseTarget == null
|
tt = targets.Target == null && targets.GPoseTarget == null
|
||||||
? "\nCan only be used when you have a target."
|
? "\nCan only be used when you have a target."
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
DrawButton(buttonWidth, "Target", "target", tt);
|
DrawButton(buttonWidth, "Target", "target", tt);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
tt = targets.FocusTarget == null
|
tt = targets.FocusTarget == null
|
||||||
? "\nCan only be used when you have a focus target."
|
? "\nCan only be used when you have a focus target."
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
DrawButton(buttonWidth, "Focus", "focus", tt);
|
DrawButton(buttonWidth, "Focus", "focus", tt);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
tt = !IsIndoors()
|
tt = !IsIndoors()
|
||||||
? "\nCan currently only be used for indoor furniture."
|
? "\nCan currently only be used for indoor furniture."
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.Save();
|
_config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.LabeledHelpMarker(label, tooltip);
|
ImGuiUtil.LabeledHelpMarker(label, tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -230,7 +230,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.Ephemeral.Save();
|
_config.Ephemeral.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.LabeledHelpMarker(label, tooltip);
|
ImGuiUtil.LabeledHelpMarker(label, tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -349,10 +349,10 @@ public class SettingsTab : ITab, IUiService
|
||||||
|
|
||||||
selected = ImGui.IsItemActive();
|
selected = ImGui.IsItemActive();
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(UiHelpers.ScaleX3, 0));
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(UiHelpers.ScaleX3, 0));
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
DrawDirectoryPickerButton();
|
DrawDirectoryPickerButton();
|
||||||
style.Pop();
|
style.Pop();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
|
|
||||||
const string tt = "This is where Penumbra will store your extracted mod files.\n"
|
const string tt = "This is where Penumbra will store your extracted mod files.\n"
|
||||||
+ "TTMP files are not copied, just extracted.\n"
|
+ "TTMP files are not copied, just extracted.\n"
|
||||||
|
|
@ -362,13 +362,13 @@ public class SettingsTab : ITab, IUiService
|
||||||
+ "Definitely do not place it in your Dalamud directory or any sub-directory thereof.";
|
+ "Definitely do not place it in your Dalamud directory or any sub-directory thereof.";
|
||||||
ImGuiComponents.HelpMarker(tt);
|
ImGuiComponents.HelpMarker(tt);
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.GeneralTooltips);
|
_tutorial.OpenTutorial(BasicTutorialSteps.GeneralTooltips);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted("Root Directory");
|
ImGui.TextUnformatted("Root Directory");
|
||||||
ImGuiUtil.HoverTooltip(tt);
|
ImGuiUtil.HoverTooltip(tt);
|
||||||
}
|
}
|
||||||
|
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.ModDirectory);
|
_tutorial.OpenTutorial(BasicTutorialSteps.ModDirectory);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var pos = ImGui.GetCursorPosX();
|
var pos = ImGui.GetCursorPosX();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
||||||
|
|
@ -382,7 +382,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
private void DrawDirectoryButtons()
|
private void DrawDirectoryButtons()
|
||||||
{
|
{
|
||||||
UiHelpers.DrawOpenDirectoryButton(0, _modManager.BasePath, _modManager.Valid);
|
UiHelpers.DrawOpenDirectoryButton(0, _modManager.BasePath, _modManager.Valid);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
var tt = _modManager.Valid
|
var tt = _modManager.Valid
|
||||||
? "Force Penumbra to completely re-scan your root directory as if it was restarted."
|
? "Force Penumbra to completely re-scan your root directory as if it was restarted."
|
||||||
: "The currently selected folder is not valid. Please select a different folder.";
|
: "The currently selected folder is not valid. Please select a different folder.";
|
||||||
|
|
@ -636,11 +636,11 @@ public class SettingsTab : ITab, IUiService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
const string tt =
|
const string tt =
|
||||||
"Select which of the two renaming input fields are visible when opening the right-click context menu of a mod in the mod selector.";
|
"Select which of the two renaming input fields are visible when opening the right-click context menu of a mod in the mod selector.";
|
||||||
ImGuiComponents.HelpMarker(tt);
|
ImGuiComponents.HelpMarker(tt);
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.TextUnformatted("Rename Fields in Mod Context Menu");
|
ImGui.TextUnformatted("Rename Fields in Mod Context Menu");
|
||||||
ImGuiUtil.HoverTooltip(tt);
|
ImGuiUtil.HoverTooltip(tt);
|
||||||
}
|
}
|
||||||
|
|
@ -693,13 +693,13 @@ public class SettingsTab : ITab, IUiService
|
||||||
!_config.PcpSettings.DisableHandling, v => _config.PcpSettings.DisableHandling = !v);
|
!_config.PcpSettings.DisableHandling, v => _config.PcpSettings.DisableHandling = !v);
|
||||||
|
|
||||||
var active = _config.DeleteModModifier.IsActive();
|
var active = _config.DeleteModModifier.IsActive();
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Delete all PCP Mods"u8, "Deletes all mods tagged with 'PCP' from the mod list."u8, disabled: !active))
|
if (ImUtf8.ButtonEx("Delete all PCP Mods"u8, "Deletes all mods tagged with 'PCP' from the mod list."u8, disabled: !active))
|
||||||
_pcpService.CleanPcpMods();
|
_pcpService.CleanPcpMods();
|
||||||
if (!active)
|
if (!active)
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking.");
|
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, $"Hold {_config.DeleteModModifier} while clicking.");
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.ButtonEx("Delete all PCP Collections"u8, "Deletes all collections whose name starts with 'PCP/' from the collection list."u8,
|
if (ImUtf8.ButtonEx("Delete all PCP Collections"u8, "Deletes all collections whose name starts with 'PCP/' from the collection list."u8,
|
||||||
disabled: !active))
|
disabled: !active))
|
||||||
_pcpService.CleanPcpCollections();
|
_pcpService.CleanPcpCollections();
|
||||||
|
|
@ -740,7 +740,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (ImGui.IsItemDeactivatedAfterEdit())
|
if (ImGui.IsItemDeactivatedAfterEdit())
|
||||||
_config.Save();
|
_config.Save();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton($"{FontAwesomeIcon.Folder.ToIconString()}##import", UiHelpers.IconButtonSize,
|
if (ImGuiUtil.DrawDisabledButton($"{FontAwesomeIcon.Folder.ToIconString()}##import", UiHelpers.IconButtonSize,
|
||||||
"Select a directory via dialog.", false, true))
|
"Select a directory via dialog.", false, true))
|
||||||
{
|
{
|
||||||
|
|
@ -780,7 +780,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (ImGui.IsItemDeactivatedAfterEdit())
|
if (ImGui.IsItemDeactivatedAfterEdit())
|
||||||
_modExportManager.UpdateExportDirectory(_tempExportDirectory);
|
_modExportManager.UpdateExportDirectory(_tempExportDirectory);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton($"{FontAwesomeIcon.Folder.ToIconString()}##export", UiHelpers.IconButtonSize,
|
if (ImGuiUtil.DrawDisabledButton($"{FontAwesomeIcon.Folder.ToIconString()}##export", UiHelpers.IconButtonSize,
|
||||||
"Select a directory via dialog.", false, true))
|
"Select a directory via dialog.", false, true))
|
||||||
{
|
{
|
||||||
|
|
@ -961,14 +961,14 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.UseFileSystemCompression = v;
|
_config.UseFileSystemCompression = v;
|
||||||
_compactor.Enabled = v;
|
_compactor.Enabled = v;
|
||||||
});
|
});
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Compress Existing Files", Vector2.Zero,
|
if (ImGuiUtil.DrawDisabledButton("Compress Existing Files", Vector2.Zero,
|
||||||
"Try to compress all files in your root directory. This will take a while.",
|
"Try to compress all files in your root directory. This will take a while.",
|
||||||
_compactor.MassCompactRunning || !_modManager.Valid))
|
_compactor.MassCompactRunning || !_modManager.Valid))
|
||||||
_compactor.StartMassCompact(_modManager.BasePath.EnumerateFiles("*.*", SearchOption.AllDirectories), CompressionAlgorithm.Xpress8K,
|
_compactor.StartMassCompact(_modManager.BasePath.EnumerateFiles("*.*", SearchOption.AllDirectories), CompressionAlgorithm.Xpress8K,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Decompress Existing Files", Vector2.Zero,
|
if (ImGuiUtil.DrawDisabledButton("Decompress Existing Files", Vector2.Zero,
|
||||||
"Try to decompress all files in your root directory. This will take a while.",
|
"Try to decompress all files in your root directory. This will take a while.",
|
||||||
_compactor.MassCompactRunning || !_modManager.Valid))
|
_compactor.MassCompactRunning || !_modManager.Valid))
|
||||||
|
|
@ -981,7 +981,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - UiHelpers.IconButtonSize.X,
|
new Vector2(ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - UiHelpers.IconButtonSize.X,
|
||||||
ImGui.GetFrameHeight()),
|
ImGui.GetFrameHeight()),
|
||||||
_compactor.CurrentFile?.FullName[(_modManager.BasePath.FullName.Length + 1)..] ?? "Gathering Files...");
|
_compactor.CurrentFile?.FullName[(_modManager.BasePath.FullName.Length + 1)..] ?? "Gathering Files...");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Ban.ToIconString(), UiHelpers.IconButtonSize, "Cancel the mass action.",
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Ban.ToIconString(), UiHelpers.IconButtonSize, "Cancel the mass action.",
|
||||||
!_compactor.MassCompactRunning, true))
|
!_compactor.MassCompactRunning, true))
|
||||||
_compactor.CancelMassCompact();
|
_compactor.CancelMassCompact();
|
||||||
|
|
@ -1011,13 +1011,13 @@ public class SettingsTab : ITab, IUiService
|
||||||
_minimumX = x;
|
_minimumX = x;
|
||||||
var edited = ImGui.IsItemDeactivatedAfterEdit();
|
var edited = ImGui.IsItemDeactivatedAfterEdit();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(buttonWidth);
|
ImGui.SetNextItemWidth(buttonWidth);
|
||||||
if (ImGui.DragInt("##yMinSize", ref y, 0.1f, 300, 1500))
|
if (ImGui.DragInt("##yMinSize", ref y, 0.1f, 300, 1500))
|
||||||
_minimumY = y;
|
_minimumY = y;
|
||||||
edited |= ImGui.IsItemDeactivatedAfterEdit();
|
edited |= ImGui.IsItemDeactivatedAfterEdit();
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton("Reset##resetMinSize", new Vector2(buttonWidth / 2 - ImGui.GetStyle().ItemSpacing.X * 2, 0),
|
if (ImGuiUtil.DrawDisabledButton("Reset##resetMinSize", new Vector2(buttonWidth / 2 - ImGui.GetStyle().ItemSpacing.X * 2, 0),
|
||||||
$"Reset minimum dimensions to ({Configuration.Constants.MinimumSizeX}, {Configuration.Constants.MinimumSizeY}).",
|
$"Reset minimum dimensions to ({Configuration.Constants.MinimumSizeX}, {Configuration.Constants.MinimumSizeY}).",
|
||||||
x == Configuration.Constants.MinimumSizeX && y == Configuration.Constants.MinimumSizeY))
|
x == Configuration.Constants.MinimumSizeX && y == Configuration.Constants.MinimumSizeY))
|
||||||
|
|
@ -1065,7 +1065,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImUtf8.LabeledHelpMarker("Diffuse Dynamic Range"u8,
|
ImUtf8.LabeledHelpMarker("Diffuse Dynamic Range"u8,
|
||||||
"Set the dynamic range that can be used for diffuse colors in materials without causing visual artifacts.\n"u8
|
"Set the dynamic range that can be used for diffuse colors in materials without causing visual artifacts.\n"u8
|
||||||
+ "Changing this setting requires a game restart. It also only works if Wait for Plugins on Startup is enabled."u8);
|
+ "Changing this setting requires a game restart. It also only works if Wait for Plugins on Startup is enabled."u8);
|
||||||
|
|
@ -1086,7 +1086,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.Save();
|
_config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.LabeledHelpMarker("Enable HTTP API",
|
ImGuiUtil.LabeledHelpMarker("Enable HTTP API",
|
||||||
"Enables other applications, e.g. Anamnesis, to use some Penumbra functions, like requesting redraws.");
|
"Enables other applications, e.g. Anamnesis, to use some Penumbra functions, like requesting redraws.");
|
||||||
}
|
}
|
||||||
|
|
@ -1101,7 +1101,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.Save();
|
_config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
ImGuiUtil.LabeledHelpMarker("Enable Debug Mode",
|
ImGuiUtil.LabeledHelpMarker("Enable Debug Mode",
|
||||||
"[DEBUG] Enable the Debug Tab and Resource Manager Tab as well as some additional data collection. Also open the config window on plugin load.");
|
"[DEBUG] Enable the Debug Tab and Resource Manager Tab as well as some additional data collection. Also open the config window on plugin load.");
|
||||||
}
|
}
|
||||||
|
|
@ -1129,7 +1129,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
{
|
{
|
||||||
ImUtf8.ProgressBar((float)_cleanupService.Progress, new Vector2(200 * ImUtf8.GlobalScale, ImGui.GetFrameHeight()),
|
ImUtf8.ProgressBar((float)_cleanupService.Progress, new Vector2(200 * ImUtf8.GlobalScale, ImGui.GetFrameHeight()),
|
||||||
$"{_cleanupService.Progress * 100}%");
|
$"{_cleanupService.Progress * 100}%");
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Cancel##FileCleanup"u8))
|
if (ImUtf8.Button("Cancel##FileCleanup"u8))
|
||||||
_cleanupService.Cancel();
|
_cleanupService.Cancel();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue