mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Implement start of new file system and saving, update a lot of things to ImSharp.
This commit is contained in:
parent
6b475ee229
commit
c098fbdfe8
71 changed files with 1115 additions and 986 deletions
2
Luna
2
Luna
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2870892f30f7b92bd74110c7da366779eae85ce7
|
Subproject commit e69b638efaf89468517fe3741a300c8d3a7c6860
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3a5a03ff24e24151f80584cd4a8d45b36d94db36
|
Subproject commit 0901f2b7075c280c5216198921a3c09209b667d8
|
||||||
|
|
@ -14,7 +14,7 @@ public static class ActiveCollectionMigration
|
||||||
if (!ActiveCollections.Load(fileNames, out var jObject))
|
if (!ActiveCollections.Load(fileNames, out var jObject))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var (type, _, _) in CollectionTypeExtensions.Special.Where(t => t.Item2.StartsWith("Male ")))
|
foreach (var (type, _, _) in CollectionTypeExtensions.Special.Where(t => t.Item2.StartsWith("Male "u8)))
|
||||||
{
|
{
|
||||||
var oldName = type.ToString()[4..];
|
var oldName = type.ToString()[4..];
|
||||||
var value = jObject[oldName];
|
var value = jObject[oldName];
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using ImSharp;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
||||||
namespace Penumbra.Collections.Manager;
|
namespace Penumbra.Collections.Manager;
|
||||||
|
|
@ -110,9 +111,9 @@ public static class CollectionTypeExtensions
|
||||||
public static bool CanBeRemoved(this CollectionType collectionType)
|
public static bool CanBeRemoved(this CollectionType collectionType)
|
||||||
=> collectionType.IsSpecial() || collectionType is CollectionType.Individual;
|
=> collectionType.IsSpecial() || collectionType is CollectionType.Individual;
|
||||||
|
|
||||||
public static readonly (CollectionType, string, string)[] Special = Enum.GetValues<CollectionType>()
|
public static readonly (CollectionType, StringU8, StringU8)[] Special = Enum.GetValues<CollectionType>()
|
||||||
.Where(IsSpecial)
|
.Where(IsSpecial)
|
||||||
.Select(s => (s, s.ToName(), s.ToDescription()))
|
.Select(s => (s, new StringU8(s.ToName()), new StringU8(s.ToDescription())))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
public static CollectionType FromParts(Gender gender, bool npc)
|
public static CollectionType FromParts(Gender gender, bool npc)
|
||||||
|
|
@ -427,16 +428,16 @@ public static class CollectionTypeExtensions
|
||||||
_ => string.Empty,
|
_ => string.Empty,
|
||||||
};
|
};
|
||||||
|
|
||||||
public static string ToDescription(this CollectionType collectionType)
|
public static ReadOnlySpan<byte> ToDescription(this CollectionType collectionType)
|
||||||
=> collectionType switch
|
=> collectionType switch
|
||||||
{
|
{
|
||||||
CollectionType.Default => "World, Music, Furniture, baseline for characters and monsters not specialized.",
|
CollectionType.Default => "World, Music, Furniture, baseline for characters and monsters not specialized."u8,
|
||||||
CollectionType.Interface => "User Interface, Icons, Maps, Styles.",
|
CollectionType.Interface => "User Interface, Icons, Maps, Styles."u8,
|
||||||
CollectionType.Yourself => "Your characters, regardless of name, race or gender. Applies in the login screen.",
|
CollectionType.Yourself => "Your characters, regardless of name, race or gender. Applies in the login screen."u8,
|
||||||
CollectionType.MalePlayerCharacter => "Baseline for male player characters.",
|
CollectionType.MalePlayerCharacter => "Baseline for male player characters."u8,
|
||||||
CollectionType.FemalePlayerCharacter => "Baseline for female player characters.",
|
CollectionType.FemalePlayerCharacter => "Baseline for female player characters."u8,
|
||||||
CollectionType.MaleNonPlayerCharacter => "Baseline for humanoid male non-player characters.",
|
CollectionType.MaleNonPlayerCharacter => "Baseline for humanoid male non-player characters."u8,
|
||||||
CollectionType.FemaleNonPlayerCharacter => "Baseline for humanoid female non-player characters.",
|
CollectionType.FemaleNonPlayerCharacter => "Baseline for humanoid female non-player characters."u8,
|
||||||
_ => string.Empty,
|
_ => StringU8.Empty,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using Penumbra.Api.Api;
|
using Penumbra.Api.Api;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
|
|
@ -211,12 +211,12 @@ public class CommandHandler : IDisposable, IApiService
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
Print("Penumbra UI locked in place.");
|
Print("Penumbra UI locked in place.");
|
||||||
_configWindow.Flags |= ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize;
|
_configWindow.Flags |= WindowFlags.NoMove | WindowFlags.NoResize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Print("Penumbra UI unlocked.");
|
Print("Penumbra UI unlocked.");
|
||||||
_configWindow.Flags &= ~(ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize);
|
_configWindow.Flags &= ~(WindowFlags.NoMove | WindowFlags.NoResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
_config.Ephemeral.FixMainWindow = value;
|
_config.Ephemeral.FixMainWindow = value;
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ public class Configuration : IPluginConfiguration, ISavable, IService
|
||||||
/// <summary> Contains some default values or boundaries for config values. </summary>
|
/// <summary> Contains some default values or boundaries for config values. </summary>
|
||||||
public static class Constants
|
public static class Constants
|
||||||
{
|
{
|
||||||
public const int CurrentVersion = 9;
|
public const int CurrentVersion = 10;
|
||||||
public const float MaxAbsoluteSize = 600;
|
public const float MaxAbsoluteSize = 600;
|
||||||
public const int DefaultAbsoluteSize = 250;
|
public const int DefaultAbsoluteSize = 250;
|
||||||
public const float MinAbsoluteSize = 50;
|
public const float MinAbsoluteSize = 50;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public static class TextureDrawer
|
||||||
string startPath, FileDialogService fileDialog, string defaultModImportPath)
|
string startPath, FileDialogService fileDialog, string defaultModImportPath)
|
||||||
{
|
{
|
||||||
tmpPath ??= current.Path;
|
tmpPath ??= current.Path;
|
||||||
using var spacing = ImStyleDouble.ItemSpacing.PushX(UiHelpers.ScaleX3);
|
using var spacing = ImStyleDouble.ItemSpacing.PushX(Im.Style.GlobalScale * 3);
|
||||||
Im.Item.SetNextWidth(-2 * Im.Style.FrameHeight - 7 * Im.Style.GlobalScale);
|
Im.Item.SetNextWidth(-2 * Im.Style.FrameHeight - 7 * Im.Style.GlobalScale);
|
||||||
if (ImEx.InputOnDeactivation.Text(label, tmpPath, out tmpPath, hint))
|
if (ImEx.InputOnDeactivation.Text(label, tmpPath, out tmpPath, hint))
|
||||||
current.Load(textures, tmpPath);
|
current.Load(textures, tmpPath);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||||
|
using ImSharp;
|
||||||
using SharpDX.Direct3D;
|
using SharpDX.Direct3D;
|
||||||
using SharpDX.Direct3D11;
|
using SharpDX.Direct3D11;
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ public sealed unsafe class TextureArraySlicer : Luna.IUiService, IDisposable
|
||||||
private readonly HashSet<(nint XivTexture, byte SliceIndex)> _expiredKeys = [];
|
private readonly HashSet<(nint XivTexture, byte SliceIndex)> _expiredKeys = [];
|
||||||
|
|
||||||
/// <remarks> Caching this across frames will cause a crash to desktop. </remarks>
|
/// <remarks> Caching this across frames will cause a crash to desktop. </remarks>
|
||||||
public ImTextureID GetImGuiHandle(Texture* texture, byte sliceIndex)
|
public ImTextureId GetImGuiHandle(Texture* texture, byte sliceIndex)
|
||||||
{
|
{
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
throw new ArgumentNullException(nameof(texture));
|
throw new ArgumentNullException(nameof(texture));
|
||||||
|
|
@ -25,7 +25,7 @@ public sealed unsafe class TextureArraySlicer : Luna.IUiService, IDisposable
|
||||||
if (_activeSlices.TryGetValue(((nint)texture, sliceIndex), out var state))
|
if (_activeSlices.TryGetValue(((nint)texture, sliceIndex), out var state))
|
||||||
{
|
{
|
||||||
state.Refresh();
|
state.Refresh();
|
||||||
return new ImTextureID((nint)state.ShaderResourceView);
|
return new ImTextureId((nint)state.ShaderResourceView);
|
||||||
}
|
}
|
||||||
var srv = (ShaderResourceView)(nint)texture->D3D11ShaderResourceView;
|
var srv = (ShaderResourceView)(nint)texture->D3D11ShaderResourceView;
|
||||||
var description = srv.Description;
|
var description = srv.Description;
|
||||||
|
|
@ -60,7 +60,7 @@ public sealed unsafe class TextureArraySlicer : Luna.IUiService, IDisposable
|
||||||
}
|
}
|
||||||
state = new SliceState(new ShaderResourceView(srv.Device, srv.Resource, description));
|
state = new SliceState(new ShaderResourceView(srv.Device, srv.Resource, description));
|
||||||
_activeSlices.Add(((nint)texture, sliceIndex), state);
|
_activeSlices.Add(((nint)texture, sliceIndex), state);
|
||||||
return new ImTextureID((nint)state.ShaderResourceView);
|
return new ImTextureId((nint)state.ShaderResourceView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick()
|
public void Tick()
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,27 @@ using Penumbra.Services;
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager;
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum ModDataChangeType : ushort
|
public enum ModDataChangeType : uint
|
||||||
{
|
{
|
||||||
None = 0x0000,
|
None = 0x000000,
|
||||||
Name = 0x0001,
|
Name = 0x000001,
|
||||||
Author = 0x0002,
|
Author = 0x000002,
|
||||||
Description = 0x0004,
|
Description = 0x000004,
|
||||||
Version = 0x0008,
|
Version = 0x000008,
|
||||||
Website = 0x0010,
|
Website = 0x000010,
|
||||||
Deletion = 0x0020,
|
Deletion = 0x000020,
|
||||||
Migration = 0x0040,
|
Migration = 0x000040,
|
||||||
ModTags = 0x0080,
|
ModTags = 0x000080,
|
||||||
ImportDate = 0x0100,
|
ImportDate = 0x000100,
|
||||||
Favorite = 0x0200,
|
Favorite = 0x000200,
|
||||||
LocalTags = 0x0400,
|
LocalTags = 0x000400,
|
||||||
Note = 0x0800,
|
Note = 0x000800,
|
||||||
Image = 0x1000,
|
Image = 0x001000,
|
||||||
DefaultChangedItems = 0x2000,
|
DefaultChangedItems = 0x002000,
|
||||||
PreferredChangedItems = 0x4000,
|
PreferredChangedItems = 0x004000,
|
||||||
RequiredFeatures = 0x8000,
|
RequiredFeatures = 0x008000,
|
||||||
|
FileSystemFolder = 0x010000,
|
||||||
|
FileSystemSortOrder = 0x020000,
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ModDataEditor(SaveService saveService, CommunicatorService communicatorService, ItemData itemData) : Luna.IService
|
public class ModDataEditor(SaveService saveService, CommunicatorService communicatorService, ItemData itemData) : Luna.IService
|
||||||
|
|
|
||||||
|
|
@ -7,102 +7,73 @@ using FileSystemChangeType = OtterGui.Filesystem.FileSystemChangeType;
|
||||||
|
|
||||||
namespace Penumbra.Mods.Manager;
|
namespace Penumbra.Mods.Manager;
|
||||||
|
|
||||||
//public sealed class ModFileSystem2 : BaseFileSystem
|
public sealed class ModFileSystem2 : BaseFileSystem, IDisposable, IRequiredService
|
||||||
//{
|
{
|
||||||
// private readonly Configuration _config;
|
private readonly Configuration _config;
|
||||||
// private readonly SaveService _saveService;
|
private readonly CommunicatorService _communicator;
|
||||||
// public ModFileSystem2(FileSystemChanged @event, DataNodePathChange dataChangeEvent, Configuration config, SaveService saveService, IComparer<ReadOnlySpan<char>>? comparer = null)
|
private readonly ModFileSystemSaver _saver;
|
||||||
// : base(@event, dataChangeEvent, comparer)
|
|
||||||
// {
|
public ModFileSystem2(Configuration config, CommunicatorService communicator, SaveService saveService, Logger log, ModStorage modStorage)
|
||||||
// _config = config;
|
: base("ModFileSystem", log)
|
||||||
// _saveService = saveService;
|
{
|
||||||
// }
|
_config = config;
|
||||||
//
|
_communicator = communicator;
|
||||||
// public void Dispose()
|
_saver = new ModFileSystemSaver(log, this, saveService, modStorage);
|
||||||
// {
|
_communicator.ModPathChanged.Subscribe(OnModPathChange, ModPathChanged.Priority.ModFileSystem);
|
||||||
// _communicator.ModPathChanged.Unsubscribe(OnModPathChange);
|
_communicator.ModDiscoveryFinished.Subscribe(_saver.Load, ModDiscoveryFinished.Priority.ModFileSystem);
|
||||||
// _communicator.ModDiscoveryFinished.Unsubscribe(Reload);
|
_communicator.ModDataChanged.Subscribe(OnModDataChange, ModDataChanged.Priority.ModFileSystem);
|
||||||
// _communicator.ModDataChanged.Unsubscribe(OnModDataChange);
|
_saver.Load();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// // Save the filesystem on every filesystem change except full reloading.
|
public void Dispose()
|
||||||
// private void OnChange(FileSystemChangeType type, IPath _1, IPath? _2, IPath? _3)
|
{
|
||||||
// {
|
_communicator.ModPathChanged.Unsubscribe(OnModPathChange);
|
||||||
// if (type != FileSystemChangeType.Reload)
|
_communicator.ModDiscoveryFinished.Unsubscribe(_saver.Load);
|
||||||
// _saveService.DelaySave(this);
|
_communicator.ModDataChanged.Unsubscribe(OnModDataChange);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// // Update sort order when defaulted mod names change.
|
// Update sort order when defaulted mod names change.
|
||||||
// private void OnModDataChange(in ModDataChanged.Arguments arguments)
|
private void OnModDataChange(in ModDataChanged.Arguments arguments)
|
||||||
// {
|
{
|
||||||
// if (!arguments.Type.HasFlag(ModDataChangeType.Name) || arguments.OldName == null || !TryGetValue(arguments.Mod, out var leaf))
|
if (arguments.Type.HasFlag(ModDataChangeType.FileSystemFolder))
|
||||||
// return;
|
RenameAndMoveWithDuplicates(arguments.Mod.Node!, arguments.Mod.Path.GetIntendedPath(arguments.Mod.Name));
|
||||||
//
|
else if (arguments.Type.HasFlag(ModDataChangeType.Name) && arguments.Mod.Path.SortName is null
|
||||||
// var old = Extensions.FixName(arguments.OldName);
|
|| arguments.Type.HasFlag(ModDataChangeType.FileSystemSortOrder))
|
||||||
// if (old == leaf.Name || Extensions.IsDuplicateName(leaf.Name, out var baseName, out _) && baseName == old)
|
RenameWithDuplicates(arguments.Mod.Node!, arguments.Mod.Path.GetIntendedName(arguments.Mod.Name));
|
||||||
// RenameWithDuplicates(leaf, arguments.Mod.Name);
|
}
|
||||||
// }
|
|
||||||
//
|
// Update the filesystem if a mod has been added or removed.
|
||||||
// // Update the filesystem if a mod has been added or removed.
|
// Save it, if the mod directory has been moved, since this will change the save format.
|
||||||
// // Save it, if the mod directory has been moved, since this will change the save format.
|
private void OnModPathChange(in ModPathChanged.Arguments arguments)
|
||||||
// private void OnModPathChange(in ModPathChanged.Arguments arguments)
|
{
|
||||||
// {
|
switch (arguments.Type)
|
||||||
// switch (arguments.Type)
|
{
|
||||||
// {
|
case ModPathChangeType.Added:
|
||||||
// case ModPathChangeType.Added:
|
var parent = Root;
|
||||||
// var parent = Root;
|
if (_config.DefaultImportFolder.Length is not 0)
|
||||||
// if (_config.DefaultImportFolder.Length != 0)
|
try
|
||||||
// try
|
{
|
||||||
// {
|
parent = FindOrCreateAllFolders(_config.DefaultImportFolder);
|
||||||
// parent = FindOrCreateAllFolders(_config.DefaultImportFolder);
|
}
|
||||||
// }
|
catch (Exception e)
|
||||||
// catch (Exception e)
|
{
|
||||||
// {
|
Penumbra.Messager.NotificationMessage(e,
|
||||||
// Penumbra.Messager.NotificationMessage(e,
|
$"Could not move newly imported mod {arguments.Mod.Name} to default import folder {_config.DefaultImportFolder}.",
|
||||||
// $"Could not move newly imported mod {arguments.Mod.Name} to default import folder {_config.DefaultImportFolder}.",
|
NotificationType.Warning);
|
||||||
// NotificationType.Warning);
|
}
|
||||||
// }
|
|
||||||
//
|
CreateDuplicateDataNode(parent, arguments.Mod.Name, arguments.Mod);
|
||||||
// CreateDuplicateLeaf(parent, arguments.Mod.Name, arguments.Mod);
|
break;
|
||||||
// break;
|
case ModPathChangeType.Deleted:
|
||||||
// case ModPathChangeType.Deleted:
|
if (arguments.Mod.Node is not null)
|
||||||
// if (arguments.Mod.Node is not null)
|
Delete(arguments.Mod.Node);
|
||||||
// Delete(arguments.Mod.Node);
|
break;
|
||||||
// break;
|
case ModPathChangeType.Reloaded:
|
||||||
// case ModPathChangeType.Moved:
|
// Nothing
|
||||||
// _saveService.DelaySave(this);
|
break;
|
||||||
// break;
|
}
|
||||||
// case ModPathChangeType.Reloaded:
|
}
|
||||||
// // Nothing
|
}
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public struct ImportDate : ISortMode
|
|
||||||
// {
|
|
||||||
// public ReadOnlySpan<byte> Name
|
|
||||||
// => "Import Date (Older First)"u8;
|
|
||||||
//
|
|
||||||
// public ReadOnlySpan<byte> Description
|
|
||||||
// => "In each folder, sort all subfolders lexicographically, then sort all leaves using their import date."u8;
|
|
||||||
//
|
|
||||||
// public IEnumerable<IFileSystemNode> GetChildren(IFileSystemFolder f)
|
|
||||||
// => f.GetSubFolders().Cast<IFileSystemNode>().Concat(f.GetLeaves().OfType<IFileSystemData<Mod>>().OrderBy(l => l.Value.ImportDate));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public struct InverseImportDate : ISortMode
|
|
||||||
// {
|
|
||||||
// public ReadOnlySpan<byte> Name
|
|
||||||
// => "Import Date (Newer First)"u8;
|
|
||||||
//
|
|
||||||
// public ReadOnlySpan<byte> Description
|
|
||||||
// => "In each folder, sort all subfolders lexicographically, then sort all leaves using their inverse import date."u8;
|
|
||||||
//
|
|
||||||
// public IEnumerable<IFileSystemNode> GetChildren(IFileSystemFolder f)
|
|
||||||
// => f.GetSubFolders().Cast<IFileSystemNode>().Concat(f.GetLeaves().OfType<IFileSystemData<Mod>>().OrderByDescending(l => l.Value.ImportDate));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
||||||
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, IService
|
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, IService
|
||||||
{
|
{
|
||||||
|
|
@ -160,7 +131,7 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, ISer
|
||||||
// Used on construction and on mod rediscoveries.
|
// Used on construction and on mod rediscoveries.
|
||||||
private void Reload()
|
private void Reload()
|
||||||
{
|
{
|
||||||
var jObj = BackupService.GetJObjectForFile(_saveService.FileNames, _saveService.FileNames.FilesystemFile);
|
var jObj = BackupService.GetJObjectForFile(_saveService.FileNames, _saveService.FileNames.OldFilesystemFile);
|
||||||
if (Load(jObj, _modManager, ModToIdentifier, ModToName))
|
if (Load(jObj, _modManager, ModToIdentifier, ModToName))
|
||||||
_saveService.ImmediateSave(this);
|
_saveService.ImmediateSave(this);
|
||||||
|
|
||||||
|
|
@ -212,9 +183,7 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, ISer
|
||||||
Delete(leaf);
|
Delete(leaf);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ModPathChangeType.Moved:
|
case ModPathChangeType.Moved: _saveService.DelaySave(this); break;
|
||||||
_saveService.DelaySave(this);
|
|
||||||
break;
|
|
||||||
case ModPathChangeType.Reloaded:
|
case ModPathChangeType.Reloaded:
|
||||||
// Nothing
|
// Nothing
|
||||||
break;
|
break;
|
||||||
|
|
@ -232,7 +201,7 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, ISer
|
||||||
public static bool ModHasDefaultPath(Mod mod, string fullPath)
|
public static bool ModHasDefaultPath(Mod mod, string fullPath)
|
||||||
{
|
{
|
||||||
var regex = new Regex($@"^{Regex.Escape(ModToName(mod))}( \(\d+\))?$");
|
var regex = new Regex($@"^{Regex.Escape(ModToName(mod))}( \(\d+\))?$");
|
||||||
return regex.IsMatch(fullPath);
|
return regex.IsMatch(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static (string, bool) SaveMod(Mod mod, string fullPath)
|
private static (string, bool) SaveMod(Mod mod, string fullPath)
|
||||||
|
|
@ -242,7 +211,7 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, ISer
|
||||||
: (ModToIdentifier(mod), true);
|
: (ModToIdentifier(mod), true);
|
||||||
|
|
||||||
public string ToFilePath(FilenameService fileNames)
|
public string ToFilePath(FilenameService fileNames)
|
||||||
=> fileNames.FilesystemFile;
|
=> fileNames.OldFilesystemFile;
|
||||||
|
|
||||||
public void Save(StreamWriter writer)
|
public void Save(StreamWriter writer)
|
||||||
=> SaveToFile(writer, SaveMod, true);
|
=> SaveToFile(writer, SaveMod, true);
|
||||||
|
|
|
||||||
54
Penumbra/Mods/Manager/ModFileSystemSaver.cs
Normal file
54
Penumbra/Mods/Manager/ModFileSystemSaver.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
using Luna;
|
||||||
|
using Penumbra.Services;
|
||||||
|
|
||||||
|
namespace Penumbra.Mods.Manager;
|
||||||
|
|
||||||
|
public sealed class ModFileSystemSaver(Logger log, BaseFileSystem fileSystem, SaveService saveService, ModStorage mods)
|
||||||
|
: FileSystemSaver<SaveService, FilenameService>(log, fileSystem, saveService)
|
||||||
|
{
|
||||||
|
protected override string LockedFile(FilenameService provider)
|
||||||
|
=> provider.FileSystemLockedNodes;
|
||||||
|
|
||||||
|
protected override string ExpandedFile(FilenameService provider)
|
||||||
|
=> provider.FileSystemExpandedFolders;
|
||||||
|
|
||||||
|
protected override string EmptyFoldersFile(FilenameService provider)
|
||||||
|
=> provider.FileSystemEmptyFolders;
|
||||||
|
|
||||||
|
protected override string MigrationFile(FilenameService provider)
|
||||||
|
=> provider.OldFilesystemFile;
|
||||||
|
|
||||||
|
protected override bool GetValueFromIdentifier(ReadOnlySpan<char> identifier, [NotNullWhen(true)] out IFileSystemValue? value)
|
||||||
|
{
|
||||||
|
if (mods.TryGetMod(identifier, out var mod))
|
||||||
|
{
|
||||||
|
value = mod;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CreateDataNodes()
|
||||||
|
{
|
||||||
|
foreach (var mod in mods)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var folder = mod.Path.Folder.Length is 0 ? FileSystem.Root : FileSystem.FindOrCreateAllFolders(mod.Path.Folder);
|
||||||
|
FileSystem.CreateDuplicateDataNode(folder, mod.Path.SortName ?? mod.Name, mod);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Error($"Could not create folder structure for mod {mod.Name} at path {mod.Path.Folder}: {e}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void SaveDataValue(IFileSystemValue value)
|
||||||
|
{
|
||||||
|
if (value is Mod mod)
|
||||||
|
SaveService.QueueSave(new ModLocalData(mod));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -20,20 +20,27 @@ public class ModStorage : IReadOnlyList<Mod>
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
=> GetEnumerator();
|
=> GetEnumerator();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary> Try to obtain a mod by its directory name (unique identifier). </summary>
|
||||||
/// Try to obtain a mod by its directory name (unique identifier).
|
public bool TryGetMod(ReadOnlySpan<char> identifier, [NotNullWhen(true)] out Mod? mod)
|
||||||
/// </summary>
|
|
||||||
public bool TryGetMod(string identifier, [NotNullWhen(true)] out Mod? mod)
|
|
||||||
{
|
{
|
||||||
mod = this.FirstOrDefault(m => string.Equals(m.Identifier, identifier, StringComparison.OrdinalIgnoreCase));
|
foreach (var m in Mods)
|
||||||
return mod is not null;
|
{
|
||||||
|
if (!identifier.Equals(m.Identifier, StringComparison.OrdinalIgnoreCase))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
mod = m;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
mod = null;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to obtain a mod by its directory name (unique identifier, preferred),
|
/// Try to obtain a mod by its directory name (unique identifier, preferred),
|
||||||
/// or the first mod of the given name if no directory fits.
|
/// or the first mod of the given name if no directory fits.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryGetMod(string identifier, string modName, [NotNullWhen(true)] out Mod? mod)
|
public bool TryGetMod(ReadOnlySpan<char> identifier, ReadOnlySpan<char> modName, [NotNullWhen(true)] out Mod? mod)
|
||||||
{
|
{
|
||||||
if (modName.Length is 0)
|
if (modName.Length is 0)
|
||||||
return TryGetMod(identifier, out mod);
|
return TryGetMod(identifier, out mod);
|
||||||
|
|
@ -41,13 +48,13 @@ public class ModStorage : IReadOnlyList<Mod>
|
||||||
mod = null;
|
mod = null;
|
||||||
foreach (var m in Mods)
|
foreach (var m in Mods)
|
||||||
{
|
{
|
||||||
if (string.Equals(m.Identifier, identifier, StringComparison.OrdinalIgnoreCase))
|
if (identifier.Equals(m.Identifier, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
mod = m;
|
mod = m;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.Name == modName)
|
if (m.Name.SequenceEqual(modName))
|
||||||
mod ??= m;
|
mod ??= m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
28
Penumbra/Mods/Manager/SortModes.cs
Normal file
28
Penumbra/Mods/Manager/SortModes.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
using Luna;
|
||||||
|
|
||||||
|
namespace Penumbra.Mods.Manager;
|
||||||
|
|
||||||
|
public readonly struct ImportDate : ISortMode
|
||||||
|
{
|
||||||
|
public ReadOnlySpan<byte> Name
|
||||||
|
=> "Import Date (Older First)"u8;
|
||||||
|
|
||||||
|
public ReadOnlySpan<byte> Description
|
||||||
|
=> "In each folder, sort all subfolders lexicographically, then sort all leaves using their import date."u8;
|
||||||
|
|
||||||
|
public IEnumerable<IFileSystemNode> GetChildren(IFileSystemFolder f)
|
||||||
|
=> f.GetSubFolders().Cast<IFileSystemNode>().Concat(f.GetLeaves().OfType<IFileSystemData<Mod>>().OrderBy(l => l.Value.ImportDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
public readonly struct InverseImportDate : ISortMode
|
||||||
|
{
|
||||||
|
public ReadOnlySpan<byte> Name
|
||||||
|
=> "Import Date (Newer First)"u8;
|
||||||
|
|
||||||
|
public ReadOnlySpan<byte> Description
|
||||||
|
=> "In each folder, sort all subfolders lexicographically, then sort all leaves using their inverse import date."u8;
|
||||||
|
|
||||||
|
public IEnumerable<IFileSystemNode> GetChildren(IFileSystemFolder f)
|
||||||
|
=> f.GetSubFolders().Cast<IFileSystemNode>()
|
||||||
|
.Concat(f.GetLeaves().OfType<IFileSystemData<Mod>>().OrderByDescending(l => l.Value.ImportDate));
|
||||||
|
}
|
||||||
|
|
@ -69,7 +69,7 @@ public sealed class Mod : IMod, IFileSystemValue<Mod>
|
||||||
|
|
||||||
|
|
||||||
// Local Data
|
// Local Data
|
||||||
public string FullPath { get; set; } = string.Empty;
|
public DataPath Path { get; } = new();
|
||||||
public long ImportDate { get; internal set; } = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds();
|
public long ImportDate { get; internal set; } = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds();
|
||||||
public IReadOnlyList<string> LocalTags { get; internal set; } = [];
|
public IReadOnlyList<string> LocalTags { get; internal set; } = [];
|
||||||
public string Note { get; internal set; } = string.Empty;
|
public string Note { get; internal set; } = string.Empty;
|
||||||
|
|
@ -137,9 +137,12 @@ public sealed class Mod : IMod, IFileSystemValue<Mod>
|
||||||
public string LowerChangedItemsString { get; internal set; } = string.Empty;
|
public string LowerChangedItemsString { get; internal set; } = string.Empty;
|
||||||
public string AllTagsLower { get; internal set; } = string.Empty;
|
public string AllTagsLower { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
public int TotalFileCount { get; internal set; }
|
public int TotalFileCount { get; internal set; }
|
||||||
public int TotalSwapCount { get; internal set; }
|
public int TotalSwapCount { get; internal set; }
|
||||||
public int TotalManipulations { get; internal set; }
|
public int TotalManipulations { get; internal set; }
|
||||||
public ushort LastChangedItemsUpdate { get; internal set; }
|
public ushort LastChangedItemsUpdate { get; internal set; }
|
||||||
public bool HasOptions { get; internal set; }
|
public bool HasOptions { get; internal set; }
|
||||||
|
|
||||||
|
string IFileSystemValue.DisplayName
|
||||||
|
=> Name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,10 @@ public readonly struct ModLocalData(Mod mod) : ISavable
|
||||||
{ nameof(Mod.PreferredChangedItems), JToken.FromObject(mod.PreferredChangedItems) },
|
{ nameof(Mod.PreferredChangedItems), JToken.FromObject(mod.PreferredChangedItems) },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (mod.FullPath.Length > 0)
|
if (mod.Path.Folder.Length > 0)
|
||||||
{
|
jObject["FileSystemFolder"] = mod.Path.Folder;
|
||||||
var baseName = mod.FullPath.GetBaseName(mod.Name, out var folder);
|
if (mod.Path.SortName is not null)
|
||||||
jObject[nameof(Mod.FullPath)] = folder.Length > 0 ? $"{folder}/{baseName}" : baseName.ToString();
|
jObject["SortOrderName"] = mod.Path.SortName;
|
||||||
}
|
|
||||||
|
|
||||||
using var jWriter = new JsonTextWriter(writer);
|
using var jWriter = new JsonTextWriter(writer);
|
||||||
jWriter.Formatting = Formatting.Indented;
|
jWriter.Formatting = Formatting.Indented;
|
||||||
|
|
@ -41,10 +40,12 @@ public readonly struct ModLocalData(Mod mod) : ISavable
|
||||||
{
|
{
|
||||||
var dataFile = editor.SaveService.FileNames.LocalDataFile(mod);
|
var dataFile = editor.SaveService.FileNames.LocalDataFile(mod);
|
||||||
|
|
||||||
var importDate = 0L;
|
var importDate = 0L;
|
||||||
var localTags = Enumerable.Empty<string>();
|
var localTags = Enumerable.Empty<string>();
|
||||||
var favorite = false;
|
var favorite = false;
|
||||||
var note = string.Empty;
|
var note = string.Empty;
|
||||||
|
var fileSystemFolder = string.Empty;
|
||||||
|
string? sortOrderName = null;
|
||||||
|
|
||||||
HashSet<CustomItemId> preferredChangedItems = [];
|
HashSet<CustomItemId> preferredChangedItems = [];
|
||||||
|
|
||||||
|
|
@ -62,7 +63,9 @@ public readonly struct ModLocalData(Mod mod) : ISavable
|
||||||
preferredChangedItems =
|
preferredChangedItems =
|
||||||
(json[nameof(Mod.PreferredChangedItems)] as JArray)?.Values<ulong>().Select(i => (CustomItemId)i).ToHashSet()
|
(json[nameof(Mod.PreferredChangedItems)] as JArray)?.Values<ulong>().Select(i => (CustomItemId)i).ToHashSet()
|
||||||
?? mod.DefaultPreferredItems;
|
?? mod.DefaultPreferredItems;
|
||||||
save = false;
|
fileSystemFolder = json["FileSystemFolder"]?.Value<string>() ?? string.Empty;
|
||||||
|
sortOrderName = json["SortOrderName"]?.Value<string>()?.FixName();
|
||||||
|
save = false;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
@ -101,6 +104,18 @@ public readonly struct ModLocalData(Mod mod) : ISavable
|
||||||
changes |= ModDataChangeType.PreferredChangedItems;
|
changes |= ModDataChangeType.PreferredChangedItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mod.Path.Folder.Equals(fileSystemFolder, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
mod.Path.Folder = fileSystemFolder;
|
||||||
|
changes |= ModDataChangeType.FileSystemFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mod.Path.SortName != sortOrderName)
|
||||||
|
{
|
||||||
|
mod.Path.SortName = sortOrderName;
|
||||||
|
changes |= ModDataChangeType.FileSystemSortOrder;
|
||||||
|
}
|
||||||
|
|
||||||
if (save)
|
if (save)
|
||||||
editor.SaveService.QueueSave(new ModLocalData(mod));
|
editor.SaveService.QueueSave(new ModLocalData(mod));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,22 @@ public class ConfigMigrationService(SaveService saveService, BackupService backu
|
||||||
Version6To7();
|
Version6To7();
|
||||||
Version7To8();
|
Version7To8();
|
||||||
Version8To9();
|
Version8To9();
|
||||||
|
Version9To10();
|
||||||
AddColors(config, true);
|
AddColors(config, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Version9To10()
|
||||||
|
{
|
||||||
|
if (_config.Version != 9)
|
||||||
|
return;
|
||||||
|
|
||||||
|
backupService.CreateMigrationBackup("pre_filesystem_update", saveService.FileNames.OldFilesystemFile);
|
||||||
|
_config.Version = 10;
|
||||||
|
_config.Ephemeral.Version = 10;
|
||||||
|
_config.Save();
|
||||||
|
_config.Ephemeral.Save();
|
||||||
|
}
|
||||||
|
|
||||||
// Migrate to ephemeral config.
|
// Migrate to ephemeral config.
|
||||||
private void Version8To9()
|
private void Version8To9()
|
||||||
{
|
{
|
||||||
|
|
@ -254,7 +267,7 @@ public class ConfigMigrationService(SaveService saveService, BackupService backu
|
||||||
private void ResettleSortOrder()
|
private void ResettleSortOrder()
|
||||||
{
|
{
|
||||||
ModSortOrder = _data[nameof(ModSortOrder)]?.ToObject<Dictionary<string, string>>() ?? ModSortOrder;
|
ModSortOrder = _data[nameof(ModSortOrder)]?.ToObject<Dictionary<string, string>>() ?? ModSortOrder;
|
||||||
var file = saveService.FileNames.FilesystemFile;
|
var file = saveService.FileNames.OldFilesystemFile;
|
||||||
using var stream = File.Open(file, File.Exists(file) ? FileMode.Truncate : FileMode.CreateNew);
|
using var stream = File.Open(file, File.Exists(file) ? FileMode.Truncate : FileMode.CreateNew);
|
||||||
using var writer = new StreamWriter(stream);
|
using var writer = new StreamWriter(stream);
|
||||||
using var j = new JsonTextWriter(writer);
|
using var j = new JsonTextWriter(writer);
|
||||||
|
|
|
||||||
|
|
@ -1,95 +1,101 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Luna;
|
using Luna;
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
|
|
||||||
namespace Penumbra.Services;
|
namespace Penumbra.Services;
|
||||||
|
|
||||||
public sealed class FilenameService(IDalamudPluginInterface pi) : BaseFilePathProvider(pi)
|
public sealed class FilenameService(IDalamudPluginInterface pi) : BaseFilePathProvider(pi)
|
||||||
{
|
{
|
||||||
public readonly string CollectionDirectory = Path.Combine(pi.ConfigDirectory.FullName, "collections");
|
public readonly string CollectionDirectory = Path.Combine(pi.ConfigDirectory.FullName, "collections");
|
||||||
public readonly string LocalDataDirectory = Path.Combine(pi.ConfigDirectory.FullName, "mod_data");
|
public readonly string LocalDataDirectory = Path.Combine(pi.ConfigDirectory.FullName, "mod_data");
|
||||||
public readonly string EphemeralConfigFile = Path.Combine(pi.ConfigDirectory.FullName, "ephemeral_config.json");
|
public readonly string EphemeralConfigFile = Path.Combine(pi.ConfigDirectory.FullName, "ephemeral_config.json");
|
||||||
public readonly string FilesystemFile = Path.Combine(pi.ConfigDirectory.FullName, "sort_order.json");
|
public readonly string OldFilesystemFile = Path.Combine(pi.ConfigDirectory.FullName, "sort_order.json");
|
||||||
public readonly string ActiveCollectionsFile = Path.Combine(pi.ConfigDirectory.FullName, "active_collections.json");
|
public readonly string ActiveCollectionsFile = Path.Combine(pi.ConfigDirectory.FullName, "active_collections.json");
|
||||||
public readonly string PredefinedTagFile = Path.Combine(pi.ConfigDirectory.FullName, "predefined_tags.json");
|
public readonly string PredefinedTagFile = Path.Combine(pi.ConfigDirectory.FullName, "predefined_tags.json");
|
||||||
|
public readonly string FileSystemFolder = Path.Combine(pi.ConfigDirectory.FullName, "mod_filesystem");
|
||||||
public readonly string CrashHandlerExe =
|
public readonly string FileSystemEmptyFolders = Path.Combine(pi.ConfigDirectory.FullName, "mod_filesystem", "empty_folders.json");
|
||||||
Path.Combine(pi.AssemblyLocation.DirectoryName!, "Penumbra.CrashHandler.exe");
|
public readonly string FileSystemExpandedFolders = Path.Combine(pi.ConfigDirectory.FullName, "mod_filesystem", "expanded_folders.json");
|
||||||
|
public readonly string FileSystemLockedNodes = Path.Combine(pi.ConfigDirectory.FullName, "mod_filesystem", "locked_nodes.json");
|
||||||
public readonly string LogFileName =
|
|
||||||
Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(pi.ConfigDirectory.FullName)!)!, "Penumbra.log");
|
public readonly string CrashHandlerExe =
|
||||||
|
Path.Combine(pi.AssemblyLocation.DirectoryName!, "Penumbra.CrashHandler.exe");
|
||||||
/// <summary> Obtain the path of a collection file given its name.</summary>
|
|
||||||
public string CollectionFile(ModCollection collection)
|
public readonly string LogFileName =
|
||||||
=> CollectionFile(collection.Identity.Identifier);
|
Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(pi.ConfigDirectory.FullName)!)!, "Penumbra.log");
|
||||||
|
|
||||||
/// <summary> Obtain the path of a collection file given its name. </summary>
|
/// <summary> Obtain the path of a collection file given its name.</summary>
|
||||||
public string CollectionFile(string collectionName)
|
public string CollectionFile(ModCollection collection)
|
||||||
=> Path.Combine(CollectionDirectory, $"{collectionName}.json");
|
=> CollectionFile(collection.Identity.Identifier);
|
||||||
|
|
||||||
/// <summary> Obtain the path of the local data file given a mod directory. Returns an empty string if the mod is temporary. </summary>
|
/// <summary> Obtain the path of a collection file given its name. </summary>
|
||||||
public string LocalDataFile(Mod mod)
|
public string CollectionFile(string collectionName)
|
||||||
=> LocalDataFile(mod.ModPath.FullName);
|
=> Path.Combine(CollectionDirectory, $"{collectionName}.json");
|
||||||
|
|
||||||
/// <summary> Obtain the path of the local data file given a mod directory. </summary>
|
/// <summary> Obtain the path of the local data file given a mod directory. Returns an empty string if the mod is temporary. </summary>
|
||||||
public string LocalDataFile(string modDirectory)
|
public string LocalDataFile(Mod mod)
|
||||||
=> Path.Combine(LocalDataDirectory, $"{Path.GetFileName(modDirectory)}.json");
|
=> LocalDataFile(mod.ModPath.FullName);
|
||||||
|
|
||||||
/// <summary> Enumerate all collection files. </summary>
|
/// <summary> Obtain the path of the local data file given a mod directory. </summary>
|
||||||
public IEnumerable<FileInfo> CollectionFiles
|
public string LocalDataFile(string modDirectory)
|
||||||
{
|
=> Path.Combine(LocalDataDirectory, $"{Path.GetFileName(modDirectory)}.json");
|
||||||
get
|
|
||||||
{
|
/// <summary> Enumerate all collection files. </summary>
|
||||||
var directory = new DirectoryInfo(CollectionDirectory);
|
public IEnumerable<FileInfo> CollectionFiles
|
||||||
return directory.Exists ? directory.EnumerateFiles("*.json") : [];
|
{
|
||||||
}
|
get
|
||||||
}
|
{
|
||||||
|
var directory = new DirectoryInfo(CollectionDirectory);
|
||||||
/// <summary> Enumerate all local data files. </summary>
|
return directory.Exists ? directory.EnumerateFiles("*.json") : [];
|
||||||
public IEnumerable<FileInfo> LocalDataFiles
|
}
|
||||||
{
|
}
|
||||||
get
|
|
||||||
{
|
/// <summary> Enumerate all local data files. </summary>
|
||||||
var directory = new DirectoryInfo(LocalDataDirectory);
|
public IEnumerable<FileInfo> LocalDataFiles
|
||||||
return directory.Exists ? directory.EnumerateFiles("*.json") : [];
|
{
|
||||||
}
|
get
|
||||||
}
|
{
|
||||||
|
var directory = new DirectoryInfo(LocalDataDirectory);
|
||||||
/// <summary> Obtain the path of the meta file for a given mod. Returns an empty string if the mod is temporary. </summary>
|
return directory.Exists ? directory.EnumerateFiles("*.json") : [];
|
||||||
public string ModMetaPath(Mod mod)
|
}
|
||||||
=> ModMetaPath(mod.ModPath.FullName);
|
}
|
||||||
|
|
||||||
/// <summary> Obtain the path of the meta file given a mod directory. </summary>
|
/// <summary> Obtain the path of the meta file for a given mod. Returns an empty string if the mod is temporary. </summary>
|
||||||
public string ModMetaPath(string modDirectory)
|
public string ModMetaPath(Mod mod)
|
||||||
=> Path.Combine(modDirectory, "meta.json");
|
=> ModMetaPath(mod.ModPath.FullName);
|
||||||
|
|
||||||
/// <summary> Obtain the path of the file describing a given option group by its index and the mod. If the index is less than 0, return the path for the default mod file. </summary>
|
/// <summary> Obtain the path of the meta file given a mod directory. </summary>
|
||||||
public string OptionGroupFile(Mod mod, int index, bool onlyAscii)
|
public string ModMetaPath(string modDirectory)
|
||||||
=> OptionGroupFile(mod.ModPath.FullName, index, index >= 0 ? mod.Groups[index].Name : string.Empty, onlyAscii);
|
=> Path.Combine(modDirectory, "meta.json");
|
||||||
|
|
||||||
/// <summary> Obtain the path of the file describing a given option group by its index, name and basepath. If the index is less than 0, return the path for the default mod file. </summary>
|
/// <summary> Obtain the path of the file describing a given option group by its index and the mod. If the index is less than 0, return the path for the default mod file. </summary>
|
||||||
public string OptionGroupFile(string basePath, int index, string name, bool onlyAscii)
|
public string OptionGroupFile(Mod mod, int index, bool onlyAscii)
|
||||||
{
|
=> OptionGroupFile(mod.ModPath.FullName, index, index >= 0 ? mod.Groups[index].Name : string.Empty, onlyAscii);
|
||||||
var fileName = index >= 0
|
|
||||||
? $"group_{index + 1:D3}_{name.ToLowerInvariant().ReplaceBadXivSymbols(onlyAscii)}.json"
|
/// <summary> Obtain the path of the file describing a given option group by its index, name and basepath. If the index is less than 0, return the path for the default mod file. </summary>
|
||||||
: "default_mod.json";
|
public string OptionGroupFile(string basePath, int index, string name, bool onlyAscii)
|
||||||
return Path.Combine(basePath, fileName);
|
{
|
||||||
}
|
var fileName = index >= 0
|
||||||
|
? $"group_{index + 1:D3}_{name.ToLowerInvariant().ReplaceBadXivSymbols(onlyAscii)}.json"
|
||||||
/// <summary> Enumerate all group files for a given mod. </summary>
|
: "default_mod.json";
|
||||||
public IEnumerable<FileInfo> GetOptionGroupFiles(Mod mod)
|
return Path.Combine(basePath, fileName);
|
||||||
=> mod.ModPath.EnumerateFiles("group_*.json");
|
}
|
||||||
|
|
||||||
/// <summary> Collect all relevant files for penumbra configuration. </summary>
|
/// <summary> Enumerate all group files for a given mod. </summary>
|
||||||
public override List<FileInfo> GetBackupFiles()
|
public IEnumerable<FileInfo> GetOptionGroupFiles(Mod mod)
|
||||||
{
|
=> mod.ModPath.EnumerateFiles("group_*.json");
|
||||||
var list = CollectionFiles.ToList();
|
|
||||||
list.AddRange(LocalDataFiles);
|
/// <summary> Collect all relevant files for penumbra configuration. </summary>
|
||||||
list.Add(new FileInfo(ConfigurationFile));
|
public override List<FileInfo> GetBackupFiles()
|
||||||
list.Add(new FileInfo(FilesystemFile));
|
{
|
||||||
list.Add(new FileInfo(ActiveCollectionsFile));
|
var list = CollectionFiles.ToList();
|
||||||
list.Add(new FileInfo(PredefinedTagFile));
|
list.AddRange(LocalDataFiles);
|
||||||
return list;
|
list.Add(new FileInfo(ConfigurationFile));
|
||||||
}
|
list.Add(new FileInfo(ActiveCollectionsFile));
|
||||||
}
|
list.Add(new FileInfo(PredefinedTagFile));
|
||||||
|
list.Add(new FileInfo(FileSystemLockedNodes));
|
||||||
|
list.Add(new FileInfo(FileSystemEmptyFolders));
|
||||||
|
// Do not back up expanded folders, as they are not critical and change often.
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.ImGuiNotification.EventArgs;
|
using Dalamud.Interface.ImGuiNotification.EventArgs;
|
||||||
|
|
@ -42,7 +41,7 @@ public class InstallNotification(ModImportManager modImportManager, string fileP
|
||||||
args.Notification.DismissNow();
|
args.Notification.DismissNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
Im.Line.Same();
|
||||||
if (Im.Button("Ignore"u8, buttonSize))
|
if (Im.Button("Ignore"u8, buttonSize))
|
||||||
args.Notification.DismissNow();
|
args.Notification.DismissNow();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class FileEditor<T>(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
DrawFileSelectCombo();
|
DrawFileSelectCombo();
|
||||||
SaveButton();
|
SaveButton();
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -55,7 +55,7 @@ public class FileEditor<T>(
|
||||||
RedrawOnSaveBox();
|
RedrawOnSaveBox();
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
DefaultInput();
|
DefaultInput();
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
|
|
||||||
DrawFilePanel();
|
DrawFilePanel();
|
||||||
}
|
}
|
||||||
|
|
@ -98,8 +98,8 @@ public class FileEditor<T>(
|
||||||
|
|
||||||
private void DefaultInput()
|
private void DefaultInput()
|
||||||
{
|
{
|
||||||
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = UiHelpers.ScaleX3 });
|
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = Im.Style.GlobalScale * 3 });
|
||||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 2 * (UiHelpers.ScaleX3 + ImGui.GetFrameHeight()));
|
ImGui.SetNextItemWidth(Im.ContentRegion.Available.X - 2 * (Im.Style.GlobalScale * 3 + Im.Style.FrameHeight));
|
||||||
ImGui.InputTextWithHint("##defaultInput", "Input game path to compare...", ref _defaultPath, Utf8GamePath.MaxGamePathLength);
|
ImGui.InputTextWithHint("##defaultInput", "Input game path to compare...", ref _defaultPath, Utf8GamePath.MaxGamePathLength);
|
||||||
_inInput = ImGui.IsItemActive();
|
_inInput = ImGui.IsItemActive();
|
||||||
if (ImGui.IsItemDeactivatedAfterEdit() && _defaultPath.Length > 0)
|
if (ImGui.IsItemDeactivatedAfterEdit() && _defaultPath.Length > 0)
|
||||||
|
|
@ -131,7 +131,7 @@ public class FileEditor<T>(
|
||||||
}
|
}
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Save.ToIconString(), new Vector2(ImGui.GetFrameHeight()), "Export this file.",
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Save.ToIconString(), new Vector2(Im.Style.FrameHeight), "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,
|
||||||
(success, name) =>
|
(success, name) =>
|
||||||
|
|
@ -152,7 +152,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);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.FileImport.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.FileImport.ToIconString(), new Vector2(Im.Style.FrameHeight),
|
||||||
$"Add a copy of this file to {_quickImport.OptionName}.", !_quickImport.CanExecute, true))
|
$"Add a copy of this file to {_quickImport.OptionName}.", !_quickImport.CanExecute, true))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -180,7 +180,7 @@ public class FileEditor<T>(
|
||||||
private void DrawFileSelectCombo()
|
private void DrawFileSelectCombo()
|
||||||
{
|
{
|
||||||
if (_combo.Draw("##fileSelect", _currentPath?.RelPath.ToString() ?? $"Select {fileType} File...", string.Empty,
|
if (_combo.Draw("##fileSelect", _currentPath?.RelPath.ToString() ?? $"Select {fileType} File...", string.Empty,
|
||||||
ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight())
|
Im.ContentRegion.Available.X, Im.Style.TextHeight)
|
||||||
&& _combo.CurrentSelection != null)
|
&& _combo.CurrentSelection != null)
|
||||||
UpdateCurrentFile(_combo.CurrentSelection);
|
UpdateCurrentFile(_combo.CurrentSelection);
|
||||||
}
|
}
|
||||||
|
|
@ -263,8 +263,8 @@ public class FileEditor<T>(
|
||||||
{
|
{
|
||||||
if (_currentPath != null)
|
if (_currentPath != null)
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.TextUnformatted($"Preview of {_defaultPath}:");
|
ImGui.TextUnformatted($"Preview of {_defaultPath}:");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,9 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
|
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
DrawHeaderLine(300 * UiHelpers.Scale);
|
DrawHeaderLine(300 * Im.Style.GlobalScale);
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
DrawSwapBar();
|
DrawSwapBar();
|
||||||
|
|
||||||
|
|
@ -433,7 +433,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
CreateMod();
|
CreateMod();
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * UiHelpers.Scale);
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * Im.Style.GlobalScale);
|
||||||
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"
|
||||||
+ "even those available from game files, use File Swaps to default game files where possible.");
|
+ "even those available from game files, use File Swaps to default game files where possible.");
|
||||||
|
|
@ -457,7 +457,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
CreateOption();
|
CreateOption();
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * UiHelpers.Scale);
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 20 * Im.Style.GlobalScale);
|
||||||
_dirty |= ImGui.Checkbox("Use Entire Collection", ref _useCurrentCollection);
|
_dirty |= ImGui.Checkbox("Use Entire Collection", ref _useCurrentCollection);
|
||||||
ImGuiUtil.HoverTooltip(
|
ImGuiUtil.HoverTooltip(
|
||||||
"Use all applied mods from the Selected Collection with their current settings and respecting the enabled state of mods and inheritance,\n"
|
"Use all applied mods from the Selected Collection with their current settings and respecting the enabled state of mods and inheritance,\n"
|
||||||
|
|
@ -515,7 +515,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
ImGui.TextUnformatted($"Take {article1}");
|
ImGui.TextUnformatted($"Take {article1}");
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(100 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(100 * Im.Style.GlobalScale);
|
||||||
using (var combo = ImRaii.Combo("##fromType", ToName(_slotFrom)))
|
using (var combo = ImRaii.Combo("##fromType", ToName(_slotFrom)))
|
||||||
{
|
{
|
||||||
if (combo)
|
if (combo)
|
||||||
|
|
@ -533,8 +533,8 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
_dirty |= selector.Draw("##itemSource", selector.CurrentSelection.Item.Name, string.Empty,
|
_dirty |= selector.Draw("##itemSource", selector.CurrentSelection.Item.Name, string.Empty,
|
||||||
InputWidth * 2 * UiHelpers.Scale,
|
InputWidth * 2 * Im.Style.GlobalScale,
|
||||||
ImGui.GetTextLineHeightWithSpacing());
|
Im.Style.TextHeightWithSpacing);
|
||||||
|
|
||||||
(article1, _, selector) = GetAccessorySelector(_slotTo, false);
|
(article1, _, selector) = GetAccessorySelector(_slotTo, false);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
@ -542,7 +542,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
ImGui.TextUnformatted($"and put {article2} on {article1}");
|
ImGui.TextUnformatted($"and put {article2} on {article1}");
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(100 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(100 * Im.Style.GlobalScale);
|
||||||
using (var combo = ImRaii.Combo("##toType", ToName(_slotTo)))
|
using (var combo = ImRaii.Combo("##toType", ToName(_slotTo)))
|
||||||
{
|
{
|
||||||
if (combo)
|
if (combo)
|
||||||
|
|
@ -558,8 +558,8 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
_dirty |= selector.Draw("##itemTarget", selector.CurrentSelection.Item.Name, string.Empty, InputWidth * 2 * UiHelpers.Scale,
|
_dirty |= selector.Draw("##itemTarget", selector.CurrentSelection.Item.Name, string.Empty, InputWidth * 2 * Im.Style.GlobalScale,
|
||||||
ImGui.GetTextLineHeightWithSpacing());
|
Im.Style.TextHeightWithSpacing);
|
||||||
if (_affectedItems is not { Count: > 1 })
|
if (_affectedItems is not { Count: > 1 })
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -600,8 +600,8 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted(text1);
|
ImGui.TextUnformatted(text1);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
_dirty |= sourceSelector.Draw("##itemSource", sourceSelector.CurrentSelection.Item.Name, string.Empty, InputWidth * 2 * UiHelpers.Scale,
|
_dirty |= sourceSelector.Draw("##itemSource", sourceSelector.CurrentSelection.Item.Name, string.Empty, InputWidth * 2 * Im.Style.GlobalScale,
|
||||||
ImGui.GetTextLineHeightWithSpacing());
|
Im.Style.TextHeightWithSpacing);
|
||||||
|
|
||||||
if (type == SwapType.Ring)
|
if (type == SwapType.Ring)
|
||||||
{
|
{
|
||||||
|
|
@ -613,8 +613,8 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextUnformatted(text2);
|
ImGui.TextUnformatted(text2);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
_dirty |= targetSelector.Draw("##itemTarget", targetSelector.CurrentSelection.Item.Name, string.Empty, InputWidth * 2 * UiHelpers.Scale,
|
_dirty |= targetSelector.Draw("##itemTarget", targetSelector.CurrentSelection.Item.Name, string.Empty, InputWidth * 2 * Im.Style.GlobalScale,
|
||||||
ImGui.GetTextLineHeightWithSpacing());
|
Im.Style.TextHeightWithSpacing);
|
||||||
if (type == SwapType.Ring)
|
if (type == SwapType.Ring)
|
||||||
{
|
{
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -678,7 +678,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
ImGui.TextUnformatted(text);
|
ImGui.TextUnformatted(text);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(InputWidth * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(InputWidth * Im.Style.GlobalScale);
|
||||||
if (ImGui.InputInt("##targetId", ref _targetId))
|
if (ImGui.InputInt("##targetId", ref _targetId))
|
||||||
_targetId = Math.Clamp(_targetId, 0, byte.MaxValue);
|
_targetId = Math.Clamp(_targetId, 0, byte.MaxValue);
|
||||||
|
|
||||||
|
|
@ -692,7 +692,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
ImGui.TextUnformatted(text);
|
ImGui.TextUnformatted(text);
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(InputWidth * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(InputWidth * Im.Style.GlobalScale);
|
||||||
if (ImGui.InputInt("##sourceId", ref _sourceId))
|
if (ImGui.InputInt("##sourceId", ref _sourceId))
|
||||||
_sourceId = Math.Clamp(_sourceId, 0, byte.MaxValue);
|
_sourceId = Math.Clamp(_sourceId, 0, byte.MaxValue);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using FFXIVClientStructs.Interop;
|
|
||||||
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;
|
||||||
|
|
@ -31,18 +31,19 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
|
|
||||||
public bool DrawTileIndexPicker(ReadOnlySpan<byte> label, ReadOnlySpan<byte> description, ref ushort value, bool compact)
|
public bool DrawTileIndexPicker(ReadOnlySpan<byte> label, ReadOnlySpan<byte> description, ref ushort value, bool compact)
|
||||||
=> _characterUtility.Address != null
|
=> _characterUtility.Address != null
|
||||||
&& DrawTextureArrayIndexPicker(label, description, ref value, compact, [
|
&& DrawTextureArrayIndexPicker(label, description, ref value, compact, [
|
||||||
_characterUtility.Address->TileOrbArrayTexResource,
|
_characterUtility.Address->TileOrbArrayTexResource,
|
||||||
_characterUtility.Address->TileNormArrayTexResource,
|
_characterUtility.Address->TileNormArrayTexResource,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
public bool DrawSphereMapIndexPicker(ReadOnlySpan<byte> label, ReadOnlySpan<byte> description, ref ushort value, bool compact)
|
public bool DrawSphereMapIndexPicker(ReadOnlySpan<byte> label, ReadOnlySpan<byte> description, ref ushort value, bool compact)
|
||||||
=> _characterUtility.Address != null
|
=> _characterUtility.Address != null
|
||||||
&& DrawTextureArrayIndexPicker(label, description, ref value, compact, [
|
&& DrawTextureArrayIndexPicker(label, description, ref value, compact, [
|
||||||
_characterUtility.Address->SphereDArrayTexResource,
|
_characterUtility.Address->SphereDArrayTexResource,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
public bool DrawTextureArrayIndexPicker(ReadOnlySpan<byte> label, ReadOnlySpan<byte> description, ref ushort value, bool compact, ReadOnlySpan<Pointer<TextureResourceHandle>> textureRHs)
|
public bool DrawTextureArrayIndexPicker(ReadOnlySpan<byte> label, ReadOnlySpan<byte> description, ref ushort value, bool compact,
|
||||||
|
ReadOnlySpan<FFXIVClientStructs.Interop.Pointer<TextureResourceHandle>> textureRHs)
|
||||||
{
|
{
|
||||||
TextureResourceHandle* firstNonNullTextureRH = null;
|
TextureResourceHandle* firstNonNullTextureRH = null;
|
||||||
foreach (var texture in textureRHs)
|
foreach (var texture in textureRHs)
|
||||||
|
|
@ -53,10 +54,13 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var firstNonNullTexture = firstNonNullTextureRH != null ? firstNonNullTextureRH->CsHandle.Texture : null;
|
var firstNonNullTexture = firstNonNullTextureRH != null ? firstNonNullTextureRH->CsHandle.Texture : null;
|
||||||
|
|
||||||
var textureSize = firstNonNullTexture != null ? new Vector2(firstNonNullTexture->ActualWidth, firstNonNullTexture->ActualHeight).Contain(new Vector2(MaximumTextureSize)) : Vector2.Zero;
|
var textureSize = firstNonNullTexture != null
|
||||||
var count = firstNonNullTexture != null ? firstNonNullTexture->ArraySize : 0;
|
? new Vector2(firstNonNullTexture->ActualWidth, firstNonNullTexture->ActualHeight).Contain(new Vector2(MaximumTextureSize))
|
||||||
|
: Vector2.Zero;
|
||||||
|
var count = firstNonNullTexture != null ? firstNonNullTexture->ArraySize : 0;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
||||||
|
|
@ -64,25 +68,32 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
var itemSpacing = ImGui.GetStyle().ItemSpacing;
|
var itemSpacing = ImGui.GetStyle().ItemSpacing;
|
||||||
using (var font = ImRaii.PushFont(UiBuilder.MonoFont))
|
using (var font = ImRaii.PushFont(UiBuilder.MonoFont))
|
||||||
{
|
{
|
||||||
var spaceSize = ImUtf8.CalcTextSize(" "u8).X;
|
var spaceSize = ImUtf8.CalcTextSize(" "u8).X;
|
||||||
var spaces = (int)((ImGui.CalcItemWidth() - framePadding.X * 2.0f - (compact ? 0.0f : (textureSize.X + itemSpacing.X) * textureRHs.Length)) / spaceSize);
|
var spaces = (int)((ImGui.CalcItemWidth()
|
||||||
using var padding = ImRaii.PushStyle(ImGuiStyleVar.FramePadding, framePadding + new Vector2(0.0f, Math.Max(textureSize.Y - ImGui.GetFrameHeight() + itemSpacing.Y, 0.0f) * 0.5f), !compact);
|
- framePadding.X * 2.0f
|
||||||
using var combo = ImUtf8.Combo(label, (value == ushort.MaxValue ? "-" : value.ToString()).PadLeft(spaces), ImGuiComboFlags.NoArrowButton | ImGuiComboFlags.HeightLarge);
|
- (compact ? 0.0f : (textureSize.X + itemSpacing.X) * textureRHs.Length))
|
||||||
|
/ spaceSize);
|
||||||
|
using var padding = ImRaii.PushStyle(ImGuiStyleVar.FramePadding,
|
||||||
|
framePadding + new Vector2(0.0f, Math.Max(textureSize.Y - Im.Style.FrameHeight + itemSpacing.Y, 0.0f) * 0.5f), !compact);
|
||||||
|
using var combo = ImUtf8.Combo(label, (value == ushort.MaxValue ? "-" : value.ToString()).PadLeft(spaces),
|
||||||
|
ImGuiComboFlags.NoArrowButton | ImGuiComboFlags.HeightLarge);
|
||||||
if (combo.Success && firstNonNullTextureRH != null)
|
if (combo.Success && firstNonNullTextureRH != null)
|
||||||
{
|
{
|
||||||
var lineHeight = Math.Max(ImGui.GetTextLineHeightWithSpacing(), framePadding.Y * 2.0f + textureSize.Y);
|
var lineHeight = Math.Max(Im.Style.TextHeightWithSpacing, framePadding.Y * 2.0f + textureSize.Y);
|
||||||
var itemWidth = Math.Max(ImGui.GetContentRegionAvail().X, ImUtf8.CalcTextSize("MMM"u8).X + (itemSpacing.X + textureSize.X) * textureRHs.Length + framePadding.X * 2.0f);
|
var itemWidth = Math.Max(Im.ContentRegion.Available.X,
|
||||||
|
ImUtf8.CalcTextSize("MMM"u8).X + (itemSpacing.X + textureSize.X) * textureRHs.Length + framePadding.X * 2.0f);
|
||||||
using var center = ImRaii.PushStyle(ImGuiStyleVar.SelectableTextAlign, new Vector2(0, 0.5f));
|
using var center = ImRaii.PushStyle(ImGuiStyleVar.SelectableTextAlign, new Vector2(0, 0.5f));
|
||||||
using var clipper = ImUtf8.ListClipper(count, lineHeight);
|
using var clipper = ImUtf8.ListClipper(count, lineHeight);
|
||||||
while (clipper.Step())
|
while (clipper.Step())
|
||||||
{
|
{
|
||||||
for (var i = clipper.DisplayStart; i < clipper.DisplayEnd && i < count; i++)
|
for (var i = clipper.DisplayStart; i < clipper.DisplayEnd && i < count; i++)
|
||||||
{
|
{
|
||||||
if (ImUtf8.Selectable($"{i,3}", i == value, size: new(itemWidth, lineHeight)))
|
if (ImUtf8.Selectable($"{i,3}", i == value, size: new Vector2(itemWidth, lineHeight)))
|
||||||
{
|
{
|
||||||
ret = value != i;
|
ret = value != i;
|
||||||
value = (ushort)i;
|
value = (ushort)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
var rectMin = ImGui.GetItemRectMin();
|
var rectMin = ImGui.GetItemRectMin();
|
||||||
var rectMax = ImGui.GetItemRectMax();
|
var rectMax = ImGui.GetItemRectMax();
|
||||||
var textureRegionStart = new Vector2(
|
var textureRegionStart = new Vector2(
|
||||||
|
|
@ -94,14 +105,18 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!compact && value != ushort.MaxValue)
|
if (!compact && value != ushort.MaxValue)
|
||||||
{
|
{
|
||||||
var cbRectMin = ImGui.GetItemRectMin();
|
var cbRectMin = ImGui.GetItemRectMin();
|
||||||
var cbRectMax = ImGui.GetItemRectMax();
|
var cbRectMax = ImGui.GetItemRectMax();
|
||||||
var cbTextureRegionStart = new Vector2(cbRectMax.X - framePadding.X - textureSize.X * textureRHs.Length - itemSpacing.X * (textureRHs.Length - 1), cbRectMin.Y + framePadding.Y);
|
var cbTextureRegionStart =
|
||||||
var cbMaxSize = new Vector2(textureSize.X, cbRectMax.Y - framePadding.Y - cbTextureRegionStart.Y);
|
new Vector2(cbRectMax.X - framePadding.X - textureSize.X * textureRHs.Length - itemSpacing.X * (textureRHs.Length - 1),
|
||||||
|
cbRectMin.Y + framePadding.Y);
|
||||||
|
var cbMaxSize = new Vector2(textureSize.X, cbRectMax.Y - framePadding.Y - cbTextureRegionStart.Y);
|
||||||
DrawTextureSlices(cbTextureRegionStart, cbMaxSize, itemSpacing.X, textureRHs, (byte)value);
|
DrawTextureSlices(cbTextureRegionStart, cbMaxSize, itemSpacing.X, textureRHs, (byte)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled) && (description.Length > 0 || compact && value != ushort.MaxValue))
|
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled) && (description.Length > 0 || compact && value != ushort.MaxValue))
|
||||||
{
|
{
|
||||||
using var disabled = ImRaii.Enabled();
|
using var disabled = ImRaii.Enabled();
|
||||||
|
|
@ -120,24 +135,28 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTextureSlices(Vector2 regionStart, Vector2 itemSize, float itemSpacing, ReadOnlySpan<Pointer<TextureResourceHandle>> textureRHs, byte sliceIndex)
|
public void DrawTextureSlices(Vector2 regionStart, Vector2 itemSize, float itemSpacing,
|
||||||
|
ReadOnlySpan<FFXIVClientStructs.Interop.Pointer<TextureResourceHandle>> textureRHs, byte sliceIndex)
|
||||||
{
|
{
|
||||||
for (var j = 0; j < textureRHs.Length; ++j)
|
for (var j = 0; j < textureRHs.Length; ++j)
|
||||||
{
|
{
|
||||||
if (textureRHs[j].Value == null)
|
if (textureRHs[j].Value == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var texture = textureRHs[j].Value->CsHandle.Texture;
|
var texture = textureRHs[j].Value->CsHandle.Texture;
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var handle = _textureArraySlicer.GetImGuiHandle(texture, sliceIndex);
|
var handle = _textureArraySlicer.GetImGuiHandle(texture, sliceIndex);
|
||||||
if (handle.IsNull)
|
if (handle.IsNull)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var position = regionStart with { X = regionStart.X + (itemSize.X + itemSpacing) * j };
|
var position = regionStart with { X = regionStart.X + (itemSize.X + itemSpacing) * j };
|
||||||
var size = new Vector2(texture->ActualWidth, texture->ActualHeight).Contain(itemSize);
|
var size = new Vector2(texture->ActualWidth, texture->ActualHeight).Contain(itemSize);
|
||||||
position += (itemSize - size) * 0.5f;
|
position += (itemSize - size) * 0.5f;
|
||||||
ImGui.GetWindowDrawList().AddImage(handle, position, position + size, Vector2.Zero,
|
var uvSize = Rectangle.FromSize(texture->ActualWidth / (float)texture->AllocatedWidth,
|
||||||
new Vector2(texture->ActualWidth / (float)texture->AllocatedWidth, texture->ActualHeight / (float)texture->AllocatedHeight));
|
texture->ActualHeight / (float)texture->AllocatedHeight);
|
||||||
|
Im.Window.DrawList.Image(handle, Rectangle.FromSize(position, size), uvSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,7 +167,7 @@ public sealed unsafe class MaterialTemplatePickers : Luna.IUiService
|
||||||
public bool Draw(Span<float> values, bool disabled)
|
public bool Draw(Span<float> values, bool disabled)
|
||||||
{
|
{
|
||||||
var helper = Editors.PrepareMultiComponent(values.Length);
|
var helper = Editors.PrepareMultiComponent(values.Length);
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
||||||
for (var valueIdx = 0; valueIdx < values.Length; ++valueIdx)
|
for (var valueIdx = 0; valueIdx < values.Length; ++valueIdx)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ public partial class MtrlTab
|
||||||
var itemSpacing = style.ItemSpacing.X;
|
var itemSpacing = style.ItemSpacing.X;
|
||||||
var itemInnerSpacing = style.ItemInnerSpacing.X;
|
var itemInnerSpacing = style.ItemInnerSpacing.X;
|
||||||
var framePadding = style.FramePadding;
|
var framePadding = style.FramePadding;
|
||||||
var buttonWidth = (ImGui.GetContentRegionAvail().X - itemSpacing * 7.0f) * 0.125f;
|
var buttonWidth = (Im.ContentRegion.Available.X - itemSpacing * 7.0f) * 0.125f;
|
||||||
var frameHeight = ImGui.GetFrameHeight();
|
var frameHeight = Im.Style.FrameHeight;
|
||||||
var highlighterSize = ImUtf8.CalcIconSize(FontAwesomeIcon.Crosshairs) + framePadding * 2.0f;
|
var highlighterSize = ImUtf8.CalcIconSize(FontAwesomeIcon.Crosshairs) + framePadding * 2.0f;
|
||||||
|
|
||||||
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
||||||
|
|
@ -47,7 +47,7 @@ public partial class MtrlTab
|
||||||
using (ImGuiColor.Button.Push(Im.Style[ImGuiColor.ButtonActive], pairIndex == _colorTableSelectedPair))
|
using (ImGuiColor.Button.Push(Im.Style[ImGuiColor.ButtonActive], pairIndex == _colorTableSelectedPair))
|
||||||
{
|
{
|
||||||
if (ImUtf8.Button($"#{pairIndex + 1}".PadLeft(3 + spacePadding),
|
if (ImUtf8.Button($"#{pairIndex + 1}".PadLeft(3 + spacePadding),
|
||||||
new Vector2(buttonWidth, ImGui.GetFrameHeightWithSpacing() + frameHeight)))
|
new Vector2(buttonWidth, Im.Style.FrameHeightWithSpacing + frameHeight)))
|
||||||
_colorTableSelectedPair = pairIndex;
|
_colorTableSelectedPair = pairIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,10 +254,10 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private static bool DrawColors(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
private static bool DrawColors(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var dyeOffset = ImGui.GetContentRegionAvail().X
|
var dyeOffset = Im.ContentRegion.Available.X
|
||||||
+ ImGui.GetStyle().ItemSpacing.X
|
+ ImGui.GetStyle().ItemSpacing.X
|
||||||
- ImGui.GetStyle().ItemInnerSpacing.X
|
- ImGui.GetStyle().ItemInnerSpacing.X
|
||||||
- ImGui.GetFrameHeight() * 2.0f;
|
- Im.Style.FrameHeight * 2.0f;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ref var row = ref table[rowIdx];
|
ref var row = ref table[rowIdx];
|
||||||
|
|
@ -301,11 +301,11 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private static bool DrawBlending(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
private static bool DrawBlending(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var scalarSize = ColorTableScalarSize * UiHelpers.Scale;
|
var scalarSize = ColorTableScalarSize * Im.Style.GlobalScale;
|
||||||
var dyeOffset = ImGui.GetContentRegionAvail().X
|
var dyeOffset = Im.ContentRegion.Available.X
|
||||||
+ ImGui.GetStyle().ItemSpacing.X
|
+ ImGui.GetStyle().ItemSpacing.X
|
||||||
- ImGui.GetStyle().ItemInnerSpacing.X
|
- ImGui.GetStyle().ItemInnerSpacing.X
|
||||||
- ImGui.GetFrameHeight()
|
- Im.Style.FrameHeight
|
||||||
- scalarSize;
|
- scalarSize;
|
||||||
|
|
||||||
var isRowB = (rowIdx & 1) != 0;
|
var isRowB = (rowIdx & 1) != 0;
|
||||||
|
|
@ -334,9 +334,9 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private bool DrawTemplate(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
private bool DrawTemplate(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var scalarSize = ColorTableScalarSize * UiHelpers.Scale;
|
var scalarSize = ColorTableScalarSize * Im.Style.GlobalScale;
|
||||||
var itemSpacing = ImGui.GetStyle().ItemSpacing.X;
|
var itemSpacing = ImGui.GetStyle().ItemSpacing.X;
|
||||||
var dyeOffset = ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemInnerSpacing.X - ImGui.GetFrameHeight() - scalarSize - 64.0f;
|
var dyeOffset = Im.ContentRegion.Available.X - ImGui.GetStyle().ItemInnerSpacing.X - Im.Style.FrameHeight - scalarSize - 64.0f;
|
||||||
var subColWidth = CalculateSubColumnWidth(2);
|
var subColWidth = CalculateSubColumnWidth(2);
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
@ -347,7 +347,7 @@ public partial class MtrlTab
|
||||||
ret |= CtDragScalar("Shader ID"u8, default, row.ShaderId, "%d"u8, (ushort)0, (ushort)255, 0.25f,
|
ret |= CtDragScalar("Shader ID"u8, default, row.ShaderId, "%d"u8, (ushort)0, (ushort)255, 0.25f,
|
||||||
v => table[rowIdx].ShaderId = v);
|
v => table[rowIdx].ShaderId = v);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(scalarSize + itemSpacing + 64.0f);
|
ImGui.SetNextItemWidth(scalarSize + itemSpacing + 64.0f);
|
||||||
ret |= CtSphereMapIndexPicker("###SphereMapIndex"u8, default, row.SphereMapIndex, false,
|
ret |= CtSphereMapIndexPicker("###SphereMapIndex"u8, default, row.SphereMapIndex, false,
|
||||||
|
|
@ -360,7 +360,7 @@ public partial class MtrlTab
|
||||||
var textRectMax = ImGui.GetItemRectMax();
|
var textRectMax = ImGui.GetItemRectMax();
|
||||||
ImGui.SameLine(dyeOffset);
|
ImGui.SameLine(dyeOffset);
|
||||||
var cursor = ImGui.GetCursorScreenPos();
|
var cursor = ImGui.GetCursorScreenPos();
|
||||||
ImGui.SetCursorScreenPos(cursor with { Y = float.Lerp(textRectMin.Y, textRectMax.Y, 0.5f) - ImGui.GetFrameHeight() * 0.5f });
|
ImGui.SetCursorScreenPos(cursor with { Y = float.Lerp(textRectMin.Y, textRectMax.Y, 0.5f) - Im.Style.FrameHeight * 0.5f });
|
||||||
ret |= CtApplyStainCheckbox("##dyeSphereMapIndex"u8, "Apply Sphere Map on Dye"u8, dye.SphereMapIndex,
|
ret |= CtApplyStainCheckbox("##dyeSphereMapIndex"u8, "Apply Sphere Map on Dye"u8, dye.SphereMapIndex,
|
||||||
b => dyeTable[rowIdx].SphereMapIndex = b);
|
b => dyeTable[rowIdx].SphereMapIndex = b);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
|
|
@ -387,10 +387,10 @@ public partial class MtrlTab
|
||||||
CtDragScalar("##dyeSphereMapMask"u8, "Dye Preview for Sphere Map Intensity"u8, (float?)dyePack?.SphereMapMask * 100.0f, "%.0f%%"u8);
|
CtDragScalar("##dyeSphereMapMask"u8, "Dye Preview for Sphere Map Intensity"u8, (float?)dyePack?.SphereMapMask * 100.0f, "%.0f%%"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
|
|
||||||
var leftLineHeight = 64.0f + ImGui.GetStyle().FramePadding.Y * 2.0f;
|
var leftLineHeight = 64.0f + ImGui.GetStyle().FramePadding.Y * 2.0f;
|
||||||
var rightLineHeight = 3.0f * ImGui.GetFrameHeight() + 2.0f * ImGui.GetStyle().ItemSpacing.Y;
|
var rightLineHeight = 3.0f * Im.Style.FrameHeight + 2.0f * ImGui.GetStyle().ItemSpacing.Y;
|
||||||
var lineHeight = Math.Max(leftLineHeight, rightLineHeight);
|
var lineHeight = Math.Max(leftLineHeight, rightLineHeight);
|
||||||
var cursorPos = ImGui.GetCursorScreenPos();
|
var cursorPos = ImGui.GetCursorScreenPos();
|
||||||
ImGui.SetCursorScreenPos(cursorPos + new Vector2(0.0f, (lineHeight - leftLineHeight) * 0.5f));
|
ImGui.SetCursorScreenPos(cursorPos + new Vector2(0.0f, (lineHeight - leftLineHeight) * 0.5f));
|
||||||
|
|
@ -403,7 +403,7 @@ public partial class MtrlTab
|
||||||
ImGui.SameLine(subColWidth);
|
ImGui.SameLine(subColWidth);
|
||||||
ImGui.SetCursorScreenPos(ImGui.GetCursorScreenPos() with { Y = cursorPos.Y + (lineHeight - rightLineHeight) * 0.5f });
|
ImGui.SetCursorScreenPos(ImGui.GetCursorScreenPos() with { Y = cursorPos.Y + (lineHeight - rightLineHeight) * 0.5f });
|
||||||
using (ImUtf8.Child("###TileProperties"u8,
|
using (ImUtf8.Child("###TileProperties"u8,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, float.Lerp(rightLineHeight, lineHeight, 0.5f))))
|
new Vector2(Im.ContentRegion.Available.X, float.Lerp(rightLineHeight, lineHeight, 0.5f))))
|
||||||
{
|
{
|
||||||
ImGui.Dummy(new Vector2(scalarSize, 0.0f));
|
ImGui.Dummy(new Vector2(scalarSize, 0.0f));
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
|
|
@ -415,7 +415,7 @@ public partial class MtrlTab
|
||||||
m => table[rowIdx].TileTransform = m);
|
m => table[rowIdx].TileTransform = m);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
ImGui.SetCursorScreenPos(ImGui.GetCursorScreenPos()
|
ImGui.SetCursorScreenPos(ImGui.GetCursorScreenPos()
|
||||||
- new Vector2(0.0f, (ImGui.GetFrameHeight() + ImGui.GetStyle().ItemSpacing.Y) * 0.5f));
|
- new Vector2(0.0f, (Im.Style.FrameHeight + ImGui.GetStyle().ItemSpacing.Y) * 0.5f));
|
||||||
ImUtf8.Text("Tile Transform"u8);
|
ImUtf8.Text("Tile Transform"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -424,12 +424,12 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private static bool DrawPbr(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
private static bool DrawPbr(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var scalarSize = ColorTableScalarSize * UiHelpers.Scale;
|
var scalarSize = ColorTableScalarSize * Im.Style.GlobalScale;
|
||||||
var subColWidth = CalculateSubColumnWidth(2) + ImGui.GetStyle().ItemSpacing.X;
|
var subColWidth = CalculateSubColumnWidth(2) + ImGui.GetStyle().ItemSpacing.X;
|
||||||
var dyeOffset = subColWidth
|
var dyeOffset = subColWidth
|
||||||
- ImGui.GetStyle().ItemSpacing.X * 2.0f
|
- ImGui.GetStyle().ItemSpacing.X * 2.0f
|
||||||
- ImGui.GetStyle().ItemInnerSpacing.X
|
- ImGui.GetStyle().ItemInnerSpacing.X
|
||||||
- ImGui.GetFrameHeight()
|
- Im.Style.FrameHeight
|
||||||
- scalarSize;
|
- scalarSize;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
@ -470,12 +470,12 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private static bool DrawSheen(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
private static bool DrawSheen(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var scalarSize = ColorTableScalarSize * UiHelpers.Scale;
|
var scalarSize = ColorTableScalarSize * Im.Style.GlobalScale;
|
||||||
var subColWidth = CalculateSubColumnWidth(2) + ImGui.GetStyle().ItemSpacing.X;
|
var subColWidth = CalculateSubColumnWidth(2) + ImGui.GetStyle().ItemSpacing.X;
|
||||||
var dyeOffset = subColWidth
|
var dyeOffset = subColWidth
|
||||||
- ImGui.GetStyle().ItemSpacing.X * 2.0f
|
- ImGui.GetStyle().ItemSpacing.X * 2.0f
|
||||||
- ImGui.GetStyle().ItemInnerSpacing.X
|
- ImGui.GetStyle().ItemInnerSpacing.X
|
||||||
- ImGui.GetFrameHeight()
|
- Im.Style.FrameHeight
|
||||||
- scalarSize;
|
- scalarSize;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
@ -530,12 +530,12 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private static bool DrawFurther(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
private static bool DrawFurther(ColorTable table, ColorDyeTable? dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var scalarSize = ColorTableScalarSize * UiHelpers.Scale;
|
var scalarSize = ColorTableScalarSize * Im.Style.GlobalScale;
|
||||||
var subColWidth = CalculateSubColumnWidth(2) + ImGui.GetStyle().ItemSpacing.X;
|
var subColWidth = CalculateSubColumnWidth(2) + ImGui.GetStyle().ItemSpacing.X;
|
||||||
var dyeOffset = subColWidth
|
var dyeOffset = subColWidth
|
||||||
- ImGui.GetStyle().ItemSpacing.X * 2.0f
|
- ImGui.GetStyle().ItemSpacing.X * 2.0f
|
||||||
- ImGui.GetStyle().ItemInnerSpacing.X
|
- ImGui.GetStyle().ItemInnerSpacing.X
|
||||||
- ImGui.GetFrameHeight()
|
- Im.Style.FrameHeight
|
||||||
- scalarSize;
|
- scalarSize;
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
@ -555,7 +555,7 @@ public partial class MtrlTab
|
||||||
CtDragHalf("##dyePreviewScalar11"u8, "Dye Preview for Field #11"u8, dyePack?.Scalar3, "%.2f"u8);
|
CtDragHalf("##dyePreviewScalar11"u8, "Dye Preview for Field #11"u8, dyePack?.Scalar3, "%.2f"u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(scalarSize);
|
ImGui.SetNextItemWidth(scalarSize);
|
||||||
ret |= CtDragHalf("Field #3"u8, default, row.Scalar3, "%.2f"u8, HalfMinValue, HalfMaxValue, 0.1f,
|
ret |= CtDragHalf("Field #3"u8, default, row.Scalar3, "%.2f"u8, HalfMinValue, HalfMaxValue, 0.1f,
|
||||||
|
|
@ -593,7 +593,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private bool DrawDye(ColorDyeTable dyeTable, DyePack? dyePack, int rowIdx)
|
private bool DrawDye(ColorDyeTable dyeTable, DyePack? dyePack, int rowIdx)
|
||||||
{
|
{
|
||||||
var scalarSize = ColorTableScalarSize * UiHelpers.Scale;
|
var scalarSize = ColorTableScalarSize * Im.Style.GlobalScale;
|
||||||
var applyButtonWidth = ImUtf8.CalcTextSize("Apply Preview Dye"u8).X + ImGui.GetStyle().FramePadding.X * 2.0f;
|
var applyButtonWidth = ImUtf8.CalcTextSize("Apply Preview Dye"u8).X + ImGui.GetStyle().FramePadding.X * 2.0f;
|
||||||
var subColWidth = CalculateSubColumnWidth(2, applyButtonWidth);
|
var subColWidth = CalculateSubColumnWidth(2, applyButtonWidth);
|
||||||
|
|
||||||
|
|
@ -607,7 +607,7 @@ public partial class MtrlTab
|
||||||
ImGui.SetNextItemWidth(scalarSize);
|
ImGui.SetNextItemWidth(scalarSize);
|
||||||
_stainService.GudTemplateCombo.CurrentDyeChannel = dye.Channel;
|
_stainService.GudTemplateCombo.CurrentDyeChannel = dye.Channel;
|
||||||
if (_stainService.GudTemplateCombo.Draw("##dyeTemplate", dye.Template.ToString(), string.Empty,
|
if (_stainService.GudTemplateCombo.Draw("##dyeTemplate", dye.Template.ToString(), string.Empty,
|
||||||
scalarSize + ImGui.GetStyle().ScrollbarSize / 2, ImGui.GetTextLineHeightWithSpacing(), ImGuiComboFlags.NoArrowButton))
|
scalarSize + ImGui.GetStyle().ScrollbarSize / 2, Im.Style.TextHeightWithSpacing, ImGuiComboFlags.NoArrowButton))
|
||||||
{
|
{
|
||||||
dye.Template = _stainService.GudTemplateCombo.CurrentSelection.UShort;
|
dye.Template = _stainService.GudTemplateCombo.CurrentSelection.UShort;
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
@ -615,7 +615,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
ImUtf8.Text("Dye Template"u8);
|
ImUtf8.Text("Dye Template"u8);
|
||||||
ImGui.SameLine(ImGui.GetContentRegionAvail().X - applyButtonWidth + ImGui.GetStyle().ItemSpacing.X);
|
ImGui.SameLine(Im.ContentRegion.Available.X - applyButtonWidth + ImGui.GetStyle().ItemSpacing.X);
|
||||||
using var dis = ImRaii.Disabled(!dyePack.HasValue);
|
using var dis = ImRaii.Disabled(!dyePack.HasValue);
|
||||||
if (ImUtf8.Button("Apply Preview Dye"u8))
|
if (ImUtf8.Button("Apply Preview Dye"u8))
|
||||||
ret |= Mtrl.ApplyDyeToRow(_stainService.GudStmFile, [
|
ret |= Mtrl.ApplyDyeToRow(_stainService.GudStmFile, [
|
||||||
|
|
@ -632,13 +632,13 @@ public partial class MtrlTab
|
||||||
private static void AlignedTextInRest(string text, float alignment)
|
private static void AlignedTextInRest(string text, float alignment)
|
||||||
{
|
{
|
||||||
var width = ImGui.CalcTextSize(text).X;
|
var width = ImGui.CalcTextSize(text).X;
|
||||||
ImGui.SetCursorScreenPos(ImGui.GetCursorScreenPos() + new Vector2((ImGui.GetContentRegionAvail().X - width) * alignment, 0.0f));
|
ImGui.SetCursorScreenPos(ImGui.GetCursorScreenPos() + new Vector2((Im.ContentRegion.Available.X - width) * alignment, 0.0f));
|
||||||
ImGui.TextUnformatted(text);
|
ImGui.TextUnformatted(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static float CalculateSubColumnWidth(int numSubColumns, float reservedSpace = 0.0f)
|
private static float CalculateSubColumnWidth(int numSubColumns, float reservedSpace = 0.0f)
|
||||||
{
|
{
|
||||||
var itemSpacing = ImGui.GetStyle().ItemSpacing.X;
|
var itemSpacing = ImGui.GetStyle().ItemSpacing.X;
|
||||||
return (ImGui.GetContentRegionAvail().X - reservedSpace - itemSpacing * (numSubColumns - 1)) / numSubColumns + itemSpacing;
|
return (Im.ContentRegion.Available.X - reservedSpace - itemSpacing * (numSubColumns - 1)) / numSubColumns + itemSpacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public partial class MtrlTab
|
||||||
if (!_shpkLoading && !TextureIds.Contains(ShpkFile.TableSamplerId) || Mtrl.Table == null)
|
if (!_shpkLoading && !TextureIds.Contains(ShpkFile.TableSamplerId) || Mtrl.Table == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
if (!ImUtf8.CollapsingHeader("Color Table"u8, ImGuiTreeNodeFlags.DefaultOpen))
|
if (!ImUtf8.CollapsingHeader("Color Table"u8, ImGuiTreeNodeFlags.DefaultOpen))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ public partial class MtrlTab
|
||||||
if (Mtrl.Table == null)
|
if (Mtrl.Table == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ImUtf8.Button("Export All Rows to Clipboard"u8, ImGuiHelpers.ScaledVector2(200, 0)))
|
if (!ImUtf8.Button("Export All Rows to Clipboard"u8, ImEx.ScaledVector(200, 0)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -124,7 +124,7 @@ public partial class MtrlTab
|
||||||
if (Mtrl.Table == null)
|
if (Mtrl.Table == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!ImUtf8.ButtonEx("Import All Rows from Clipboard"u8, ImGuiHelpers.ScaledVector2(200, 0), disabled))
|
if (!ImUtf8.ButtonEx("Import All Rows from Clipboard"u8, ImEx.ScaledVector(200, 0), disabled))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -156,7 +156,7 @@ public partial class MtrlTab
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ImUtf8.IconButton(FontAwesomeIcon.Clipboard, "Export this row to your clipboard."u8,
|
if (!ImUtf8.IconButton(FontAwesomeIcon.Clipboard, "Export this row to your clipboard."u8,
|
||||||
ImGui.GetFrameHeight() * Vector2.One))
|
Im.Style.FrameHeight * Vector2.One))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -205,7 +205,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
if (ImUtf8.IconButton(FontAwesomeIcon.Paste,
|
if (ImUtf8.IconButton(FontAwesomeIcon.Paste,
|
||||||
"Import an exported row from your clipboard onto this row.\n\nRight-Click for more options."u8,
|
"Import an exported row from your clipboard onto this row.\n\nRight-Click for more options."u8,
|
||||||
ImGui.GetFrameHeight() * Vector2.One, disabled))
|
Im.Style.FrameHeight * Vector2.One, disabled))
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var text = ImGui.GetClipboardText();
|
var text = ImGui.GetClipboardText();
|
||||||
|
|
@ -232,7 +232,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
private unsafe bool ColorTablePasteFromClipboardContext(int rowIdx, bool disabled)
|
private unsafe bool ColorTablePasteFromClipboardContext(int rowIdx, bool disabled)
|
||||||
{
|
{
|
||||||
if (!disabled && ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (!disabled && Im.Item.RightClicked())
|
||||||
ImUtf8.OpenPopup("context"u8);
|
ImUtf8.OpenPopup("context"u8);
|
||||||
|
|
||||||
using var context = ImUtf8.Popup("context"u8);
|
using var context = ImUtf8.Popup("context"u8);
|
||||||
|
|
@ -283,7 +283,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
ImUtf8.IconButton(FontAwesomeIcon.Crosshairs,
|
ImUtf8.IconButton(FontAwesomeIcon.Crosshairs,
|
||||||
"Highlight this pair of rows on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
"Highlight this pair of rows on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
||||||
ImGui.GetFrameHeight() * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
Im.Style.FrameHeight * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
HighlightColorTablePair(pairIdx);
|
HighlightColorTablePair(pairIdx);
|
||||||
|
|
@ -295,7 +295,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
ImUtf8.IconButton(FontAwesomeIcon.Crosshairs,
|
ImUtf8.IconButton(FontAwesomeIcon.Crosshairs,
|
||||||
"Highlight this row on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
"Highlight this row on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
|
||||||
ImGui.GetFrameHeight() * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
Im.Style.FrameHeight * Vector2.One, disabled || _colorTablePreviewers.Count == 0);
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
HighlightColorTableRow(rowIdx);
|
HighlightColorTableRow(rowIdx);
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ public partial class MtrlTab
|
||||||
if (Constants.Count == 0)
|
if (Constants.Count == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
if (!ImGui.CollapsingHeader("Material Constants"))
|
if (!ImGui.CollapsingHeader("Material Constants"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -173,7 +173,7 @@ public partial class MtrlTab
|
||||||
if (buffer.Length > 0)
|
if (buffer.Length > 0)
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId($"##{constant.Id:X8}:{slice.Start}");
|
using var id = ImRaii.PushId($"##{constant.Id:X8}:{slice.Start}");
|
||||||
ImGui.SetNextItemWidth(MaterialConstantSize * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(MaterialConstantSize * Im.Style.GlobalScale);
|
||||||
if (editor.Draw(buffer[slice], disabled))
|
if (editor.Draw(buffer[slice], disabled))
|
||||||
{
|
{
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
@ -187,7 +187,7 @@ public partial class MtrlTab
|
||||||
? defaultValue.Length > 0 && !defaultValue.SequenceEqual(buffer[slice])
|
? defaultValue.Length > 0 && !defaultValue.SequenceEqual(buffer[slice])
|
||||||
: buffer[slice].ContainsAnyExcept((byte)0);
|
: buffer[slice].ContainsAnyExcept((byte)0);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Backspace.ToIconString(), ImGui.GetFrameHeight() * Vector2.One,
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Backspace.ToIconString(), Im.Style.FrameHeight * Vector2.One,
|
||||||
"Reset this constant to its default value.\n\nHold Ctrl to unlock.", !ImGui.GetIO().KeyCtrl || !canReset, true))
|
"Reset this constant to its default value.\n\nHold Ctrl to unlock.", !ImGui.GetIO().KeyCtrl || !canReset, true))
|
||||||
{
|
{
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
|
||||||
|
|
@ -97,9 +97,9 @@ public partial class MtrlTab
|
||||||
using var id = ImRaii.PushId(rowIdx);
|
using var id = ImRaii.PushId(rowIdx);
|
||||||
ref var row = ref table[rowIdx];
|
ref var row = ref table[rowIdx];
|
||||||
var dye = dyeTable != null ? dyeTable[rowIdx] : default;
|
var dye = dyeTable != null ? dyeTable[rowIdx] : default;
|
||||||
var floatSize = LegacyColorTableFloatSize * UiHelpers.Scale;
|
var floatSize = LegacyColorTableFloatSize * Im.Style.GlobalScale;
|
||||||
var pctSize = LegacyColorTablePercentageSize * UiHelpers.Scale;
|
var pctSize = LegacyColorTablePercentageSize * Im.Style.GlobalScale;
|
||||||
var intSize = LegacyColorTableIntegerSize * UiHelpers.Scale;
|
var intSize = LegacyColorTableIntegerSize * Im.Style.GlobalScale;
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ColorTableCopyClipboardButton(rowIdx);
|
ColorTableCopyClipboardButton(rowIdx);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
|
|
@ -183,7 +183,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (_stainService.LegacyTemplateCombo.Draw("##dyeTemplate", dye.Template.ToString(), string.Empty, intSize
|
if (_stainService.LegacyTemplateCombo.Draw("##dyeTemplate", dye.Template.ToString(), string.Empty, intSize
|
||||||
+ ImGui.GetStyle().ScrollbarSize / 2, ImGui.GetTextLineHeightWithSpacing(), ImGuiComboFlags.NoArrowButton))
|
+ ImGui.GetStyle().ScrollbarSize / 2, Im.Style.TextHeightWithSpacing, ImGuiComboFlags.NoArrowButton))
|
||||||
{
|
{
|
||||||
dyeTable[rowIdx].Template = _stainService.LegacyTemplateCombo.CurrentSelection.UShort;
|
dyeTable[rowIdx].Template = _stainService.LegacyTemplateCombo.CurrentSelection.UShort;
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
@ -203,10 +203,10 @@ public partial class MtrlTab
|
||||||
using var id = ImRaii.PushId(rowIdx);
|
using var id = ImRaii.PushId(rowIdx);
|
||||||
ref var row = ref table[rowIdx];
|
ref var row = ref table[rowIdx];
|
||||||
var dye = dyeTable?[rowIdx] ?? default;
|
var dye = dyeTable?[rowIdx] ?? default;
|
||||||
var floatSize = LegacyColorTableFloatSize * UiHelpers.Scale;
|
var floatSize = LegacyColorTableFloatSize * Im.Style.GlobalScale;
|
||||||
var pctSize = LegacyColorTablePercentageSize * UiHelpers.Scale;
|
var pctSize = LegacyColorTablePercentageSize * Im.Style.GlobalScale;
|
||||||
var intSize = LegacyColorTableIntegerSize * UiHelpers.Scale;
|
var intSize = LegacyColorTableIntegerSize * Im.Style.GlobalScale;
|
||||||
var byteSize = LegacyColorTableByteSize * UiHelpers.Scale;
|
var byteSize = LegacyColorTableByteSize * Im.Style.GlobalScale;
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ColorTableCopyClipboardButton(rowIdx);
|
ColorTableCopyClipboardButton(rowIdx);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
|
|
@ -298,7 +298,7 @@ public partial class MtrlTab
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
_stainService.LegacyTemplateCombo.CurrentDyeChannel = dye.Channel;
|
_stainService.LegacyTemplateCombo.CurrentDyeChannel = dye.Channel;
|
||||||
if (_stainService.LegacyTemplateCombo.Draw("##dyeTemplate", dye.Template.ToString(), string.Empty, intSize
|
if (_stainService.LegacyTemplateCombo.Draw("##dyeTemplate", dye.Template.ToString(), string.Empty, intSize
|
||||||
+ ImGui.GetStyle().ScrollbarSize / 2, ImGui.GetTextLineHeightWithSpacing(), ImGuiComboFlags.NoArrowButton))
|
+ ImGui.GetStyle().ScrollbarSize / 2, Im.Style.TextHeightWithSpacing, ImGuiComboFlags.NoArrowButton))
|
||||||
{
|
{
|
||||||
dyeTable[rowIdx].Template = _stainService.LegacyTemplateCombo.CurrentSelection.UShort;
|
dyeTable[rowIdx].Template = _stainService.LegacyTemplateCombo.CurrentSelection.UShort;
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
@ -321,7 +321,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing / 2);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing / 2);
|
||||||
|
|
||||||
var ret = ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.PaintBrush.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
var ret = ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.PaintBrush.ToIconString(), new Vector2(Im.Style.FrameHeight),
|
||||||
"Apply the selected dye to this row.", disabled, true);
|
"Apply the selected dye to this row.", disabled, true);
|
||||||
|
|
||||||
ret = ret && Mtrl.ApplyDyeToRow(_stainService.LegacyStmFile, [stain], rowIdx);
|
ret = ret && Mtrl.ApplyDyeToRow(_stainService.LegacyStmFile, [stain], rowIdx);
|
||||||
|
|
@ -340,7 +340,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing / 2);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing / 2);
|
||||||
|
|
||||||
var ret = ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.PaintBrush.ToIconString(), new Vector2(ImGui.GetFrameHeight()),
|
var ret = ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.PaintBrush.ToIconString(), new Vector2(Im.Style.FrameHeight),
|
||||||
"Apply the selected dye to this row.", disabled, true);
|
"Apply the selected dye to this row.", disabled, true);
|
||||||
|
|
||||||
ret = ret
|
ret = ret
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
if (!_shpkLoading && (_associatedShpk == null || _associatedShpkDevkit == null))
|
if (!_shpkLoading && (_associatedShpk == null || _associatedShpkDevkit == null))
|
||||||
{
|
{
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
|
|
||||||
if (_associatedShpk == null)
|
if (_associatedShpk == null)
|
||||||
ImUtf8.Text("Unable to find a suitable shader (.shpk) file for cross-references. Some functionality will be missing."u8,
|
ImUtf8.Text("Unable to find a suitable shader (.shpk) file for cross-references. Some functionality will be missing."u8,
|
||||||
|
|
@ -360,7 +360,7 @@ public partial class MtrlTab
|
||||||
}
|
}
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 250.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 250.0f);
|
||||||
using var c = ImRaii.Combo("Shader Package", Mtrl.ShaderPackage.Name);
|
using var c = ImRaii.Combo("Shader Package", Mtrl.ShaderPackage.Name);
|
||||||
if (c)
|
if (c)
|
||||||
foreach (var value in GetShpkNames())
|
foreach (var value in GetShpkNames())
|
||||||
|
|
@ -382,7 +382,7 @@ public partial class MtrlTab
|
||||||
private bool DrawShaderFlagsInput(bool disabled)
|
private bool DrawShaderFlagsInput(bool disabled)
|
||||||
{
|
{
|
||||||
var shpkFlags = (int)Mtrl.ShaderPackage.Flags;
|
var shpkFlags = (int)Mtrl.ShaderPackage.Flags;
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 250.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 250.0f);
|
||||||
if (!ImGui.InputInt("Shader Flags", ref shpkFlags, 0, 0,
|
if (!ImGui.InputInt("Shader Flags", ref shpkFlags, 0, 0,
|
||||||
flags: ImGuiInputTextFlags.CharsHexadecimal | (disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None)))
|
flags: ImGuiInputTextFlags.CharsHexadecimal | (disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None)))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -409,7 +409,7 @@ public partial class MtrlTab
|
||||||
? "Base dev-kit file: None"
|
? "Base dev-kit file: None"
|
||||||
: $"Base dev-kit file: {_loadedBaseDevkitPathName}";
|
: $"Base dev-kit file: {_loadedBaseDevkitPathName}";
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
|
|
||||||
ImUtf8.CopyOnClickSelectable(text, _loadedShpkPathName, tooltip);
|
ImUtf8.CopyOnClickSelectable(text, _loadedShpkPathName, tooltip);
|
||||||
ImUtf8.CopyOnClickSelectable(devkitText, _loadedShpkDevkitPathName, tooltip);
|
ImUtf8.CopyOnClickSelectable(devkitText, _loadedShpkDevkitPathName, tooltip);
|
||||||
|
|
@ -436,7 +436,7 @@ public partial class MtrlTab
|
||||||
LoadShpk(new FullPath(gamePath));
|
LoadShpk(new FullPath(gamePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawMaterialShaderKeys(bool disabled)
|
private bool DrawMaterialShaderKeys(bool disabled)
|
||||||
|
|
@ -456,7 +456,7 @@ public partial class MtrlTab
|
||||||
values.FirstOrNull(v => v.Value == currentValue) ?? ($"0x{currentValue:X8}", currentValue, string.Empty);
|
values.FirstOrNull(v => v.Value == currentValue) ?? ($"0x{currentValue:X8}", currentValue, string.Empty);
|
||||||
if (!disabled && shpkKey.HasValue)
|
if (!disabled && shpkKey.HasValue)
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 250.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 250.0f);
|
||||||
using (var c = ImUtf8.Combo(""u8, currentLabel))
|
using (var c = ImUtf8.Combo(""u8, currentLabel))
|
||||||
{
|
{
|
||||||
if (c)
|
if (c)
|
||||||
|
|
@ -508,7 +508,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
if (_shaderComment.Length > 0)
|
if (_shaderComment.Length > 0)
|
||||||
{
|
{
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
ImUtf8.Text(_shaderComment);
|
ImUtf8.Text(_shaderComment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ public partial class MtrlTab
|
||||||
|
|
||||||
Textures.Sort((x, y) => string.CompareOrdinal(x.Label, y.Label));
|
Textures.Sort((x, y) => string.CompareOrdinal(x.Label, y.Label));
|
||||||
|
|
||||||
TextureLabelWidth = 50f * UiHelpers.Scale;
|
TextureLabelWidth = 50f * Im.Style.GlobalScale;
|
||||||
|
|
||||||
float helpWidth;
|
float helpWidth;
|
||||||
using (var _ = ImRaii.PushFont(UiBuilder.IconFont))
|
using (var _ = ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
|
|
@ -101,7 +101,7 @@ public partial class MtrlTab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureLabelWidth = TextureLabelWidth / UiHelpers.Scale + 4;
|
TextureLabelWidth = TextureLabelWidth / Im.Style.GlobalScale + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlySpan<byte> TextureAddressModeTooltip(TextureAddressMode addressMode)
|
private static ReadOnlySpan<byte> TextureAddressModeTooltip(TextureAddressMode addressMode)
|
||||||
|
|
@ -122,17 +122,17 @@ public partial class MtrlTab
|
||||||
if (Textures.Count == 0)
|
if (Textures.Count == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
if (!ImGui.CollapsingHeader("Textures and Samplers", ImGuiTreeNodeFlags.DefaultOpen))
|
if (!ImGui.CollapsingHeader("Textures and Samplers", ImGuiTreeNodeFlags.DefaultOpen))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var frameHeight = ImGui.GetFrameHeight();
|
var frameHeight = Im.Style.FrameHeight;
|
||||||
var ret = false;
|
var ret = false;
|
||||||
using var table = ImRaii.Table("##Textures", 3);
|
using var table = ImRaii.Table("##Textures", 3);
|
||||||
|
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, frameHeight);
|
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, frameHeight);
|
||||||
ImGui.TableSetupColumn("Path", ImGuiTableColumnFlags.WidthStretch);
|
ImGui.TableSetupColumn("Path", ImGuiTableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, TextureLabelWidth * UiHelpers.Scale);
|
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, TextureLabelWidth * Im.Style.GlobalScale);
|
||||||
foreach (var (label, textureI, samplerI, description, monoFont) in Textures)
|
foreach (var (label, textureI, samplerI, description, monoFont) in Textures)
|
||||||
{
|
{
|
||||||
using var _ = ImRaii.PushId(samplerI);
|
using var _ = ImRaii.PushId(samplerI);
|
||||||
|
|
@ -151,7 +151,7 @@ public partial class MtrlTab
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
ImGui.SetNextItemWidth(Im.ContentRegion.Available.X);
|
||||||
if (ImGui.InputText(string.Empty, ref tmp, Utf8GamePath.MaxGamePathLength,
|
if (ImGui.InputText(string.Empty, ref tmp, Utf8GamePath.MaxGamePathLength,
|
||||||
disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None)
|
disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None)
|
||||||
&& tmp.Length > 0
|
&& tmp.Length > 0
|
||||||
|
|
@ -221,7 +221,7 @@ public partial class MtrlTab
|
||||||
{
|
{
|
||||||
ref var samplerFlags = ref Wrap(ref sampler.Flags);
|
ref var samplerFlags = ref Wrap(ref sampler.Flags);
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 100.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 100.0f);
|
||||||
var addressMode = samplerFlags.UAddressMode;
|
var addressMode = samplerFlags.UAddressMode;
|
||||||
if (ComboTextureAddressMode("##UAddressMode"u8, ref addressMode))
|
if (ComboTextureAddressMode("##UAddressMode"u8, ref addressMode))
|
||||||
{
|
{
|
||||||
|
|
@ -234,7 +234,7 @@ public partial class MtrlTab
|
||||||
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.");
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 100.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 100.0f);
|
||||||
addressMode = samplerFlags.VAddressMode;
|
addressMode = samplerFlags.VAddressMode;
|
||||||
if (ComboTextureAddressMode("##VAddressMode"u8, ref addressMode))
|
if (ComboTextureAddressMode("##VAddressMode"u8, ref addressMode))
|
||||||
{
|
{
|
||||||
|
|
@ -248,7 +248,7 @@ public partial class MtrlTab
|
||||||
"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.");
|
||||||
|
|
||||||
var lodBias = samplerFlags.LodBias;
|
var lodBias = samplerFlags.LodBias;
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 100.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 100.0f);
|
||||||
if (ImUtf8.DragScalar("##LoDBias"u8, ref lodBias, -8.0f, 7.984375f, 0.1f))
|
if (ImUtf8.DragScalar("##LoDBias"u8, ref lodBias, -8.0f, 7.984375f, 0.1f))
|
||||||
{
|
{
|
||||||
samplerFlags.LodBias = lodBias;
|
samplerFlags.LodBias = lodBias;
|
||||||
|
|
@ -261,7 +261,7 @@ public partial class MtrlTab
|
||||||
"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.");
|
||||||
|
|
||||||
var minLod = samplerFlags.MinLod;
|
var minLod = samplerFlags.MinLod;
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 100.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 100.0f);
|
||||||
if (ImUtf8.DragScalar("##MinLoD"u8, ref minLod, 0, 15, 0.1f))
|
if (ImUtf8.DragScalar("##MinLoD"u8, ref minLod, 0, 15, 0.1f))
|
||||||
{
|
{
|
||||||
samplerFlags.MinLod = minLod;
|
samplerFlags.MinLod = minLod;
|
||||||
|
|
@ -282,12 +282,12 @@ public partial class MtrlTab
|
||||||
if (!t)
|
if (!t)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 100.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 100.0f);
|
||||||
if (ImUtf8.InputScalar("Texture Flags"u8, ref texture.Flags, "%04X"u8,
|
if (ImUtf8.InputScalar("Texture Flags"u8, ref texture.Flags, "%04X"u8,
|
||||||
flags: disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None))
|
flags: disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None))
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 100.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 100.0f);
|
||||||
if (ImUtf8.InputScalar("Sampler Flags"u8, ref sampler.Flags, "%08X"u8,
|
if (ImUtf8.InputScalar("Sampler Flags"u8, ref sampler.Flags, "%08X"u8,
|
||||||
flags: ImGuiInputTextFlags.CharsHexadecimal | (disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None)))
|
flags: ImGuiInputTextFlags.CharsHexadecimal | (disabled ? ImGuiInputTextFlags.ReadOnly : ImGuiInputTextFlags.None)))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
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;
|
||||||
|
|
@ -95,17 +96,17 @@ public sealed partial class MtrlTab : IWritable, IDisposable
|
||||||
|
|
||||||
DrawMaterialLivePreviewRebind(disabled);
|
DrawMaterialLivePreviewRebind(disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
var ret = DrawBackFaceAndTransparency(disabled);
|
var ret = DrawBackFaceAndTransparency(disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
ret |= DrawShaderSection(disabled);
|
ret |= DrawShaderSection(disabled);
|
||||||
|
|
||||||
ret |= DrawTextureSection(disabled);
|
ret |= DrawTextureSection(disabled);
|
||||||
ret |= DrawColorTableSection(disabled);
|
ret |= DrawColorTableSection(disabled);
|
||||||
ret |= DrawConstantsSection(disabled);
|
ret |= DrawConstantsSection(disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
DrawOtherMaterialDetails(disabled);
|
DrawOtherMaterialDetails(disabled);
|
||||||
|
|
||||||
return !disabled && ret;
|
return !disabled && ret;
|
||||||
|
|
@ -138,7 +139,7 @@ public sealed partial class MtrlTab : IWritable, IDisposable
|
||||||
ImGuiComponents.HelpMarker("Enabling transparency for shader package characterstockings.shpk will crash the game.");
|
ImGuiComponents.HelpMarker("Enabling transparency for shader package characterstockings.shpk will crash the game.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine(200 * UiHelpers.Scale + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X);
|
ImGui.SameLine(200 * Im.Style.GlobalScale + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X);
|
||||||
tmp = shaderFlags.HideBackfaces;
|
tmp = shaderFlags.HideBackfaces;
|
||||||
if (ImUtf8.Checkbox("Hide Backfaces"u8, ref tmp))
|
if (ImUtf8.Checkbox("Hide Backfaces"u8, ref tmp))
|
||||||
{
|
{
|
||||||
|
|
@ -149,7 +150,7 @@ public sealed partial class MtrlTab : IWritable, IDisposable
|
||||||
|
|
||||||
if (_shpkLoading)
|
if (_shpkLoading)
|
||||||
{
|
{
|
||||||
ImGui.SameLine(400 * UiHelpers.Scale + 2 * ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X);
|
ImGui.SameLine(400 * Im.Style.GlobalScale + 2 * ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X);
|
||||||
|
|
||||||
ImUtf8.Text("Loading shader (.shpk) file. Some functionality will only be available after this is done."u8,
|
ImUtf8.Text("Loading shader (.shpk) file. Some functionality will only be available after this is done."u8,
|
||||||
ImGuiUtil.HalfBlendText(0x808000u)); // Half cyan
|
ImGuiUtil.HalfBlendText(0x808000u)); // Half cyan
|
||||||
|
|
|
||||||
|
|
@ -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 Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -14,6 +15,7 @@ using Penumbra.Meta;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
using Penumbra.Mods.Editor;
|
using Penumbra.Mods.Editor;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||||
using Notification = Luna.Notification;
|
using Notification = Luna.Notification;
|
||||||
|
|
||||||
namespace Penumbra.UI.AdvancedWindow.Meta;
|
namespace Penumbra.UI.AdvancedWindow.Meta;
|
||||||
|
|
@ -268,7 +270,7 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>
|
||||||
private static bool DrawPointInput(ref AtchIdentifier identifier, AtchPointCombo combo)
|
private static bool DrawPointInput(ref AtchIdentifier identifier, AtchPointCombo combo)
|
||||||
{
|
{
|
||||||
if (!combo.Draw("##AtchPoint", identifier.Type.ToName(), "Attachment Point Type", 160 * ImUtf8.GlobalScale,
|
if (!combo.Draw("##AtchPoint", identifier.Type.ToName(), "Attachment Point Type", 160 * ImUtf8.GlobalScale,
|
||||||
ImGui.GetTextLineHeightWithSpacing()))
|
Im.Style.TextHeightWithSpacing))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
identifier = identifier with { Type = combo.CurrentSelection };
|
identifier = identifier with { Type = combo.CurrentSelection };
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
using var child = ImUtf8.Child("GenderRace"u8,
|
using var child = ImUtf8.Child("GenderRace"u8,
|
||||||
new Vector2(width, ImGui.GetContentRegionMax().Y - ImGui.GetFrameHeight() - ImGui.GetStyle().WindowPadding.Y), true);
|
new Vector2(width, ImGui.GetContentRegionMax().Y - Im.Style.FrameHeight - ImGui.GetStyle().WindowPadding.Y), true);
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
using var child = ImUtf8.Child("Bone"u8,
|
using var child = ImUtf8.Child("Bone"u8,
|
||||||
new Vector2(width, ImGui.GetContentRegionMax().Y - ImGui.GetFrameHeight() - ImGui.GetStyle().WindowPadding.Y), true);
|
new Vector2(width, ImGui.GetContentRegionMax().Y - Im.Style.FrameHeight - ImGui.GetStyle().WindowPadding.Y), true);
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var height = ImGui.GetTextLineHeightWithSpacing();
|
var height = Im.Style.TextHeightWithSpacing;
|
||||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||||
var remainder = ImGuiClip.FilteredClippedDraw(_pbdData.SelectedDeformer.DeformMatrices.Keys, skips,
|
var remainder = ImGuiClip.FilteredClippedDraw(_pbdData.SelectedDeformer.DeformMatrices.Keys, skips,
|
||||||
b => b.Contains(_pbdData.BoneFilter), bone
|
b => b.Contains(_pbdData.BoneFilter), bone
|
||||||
|
|
@ -107,7 +107,7 @@ public partial class ModEditWindow
|
||||||
private bool DrawBoneData(PbdTab tab, bool disabled)
|
private bool DrawBoneData(PbdTab tab, bool disabled)
|
||||||
{
|
{
|
||||||
using var child = ImUtf8.Child("Data"u8,
|
using var child = ImUtf8.Child("Data"u8,
|
||||||
ImGui.GetContentRegionAvail() with { Y = ImGui.GetContentRegionMax().Y - ImGui.GetStyle().WindowPadding.Y }, true);
|
Im.ContentRegion.Available with { Y = ImGui.GetContentRegionMax().Y - ImGui.GetStyle().WindowPadding.Y }, true);
|
||||||
if (!child)
|
if (!child)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -118,7 +118,7 @@ public partial class ModEditWindow
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var width = UiBuilder.MonoFont.GetCharAdvance('0') * 12 + ImGui.GetStyle().FramePadding.X * 2;
|
var width = UiBuilder.MonoFont.GetCharAdvance('0') * 12 + ImGui.GetStyle().FramePadding.X * 2;
|
||||||
var dummyHeight = ImGui.GetTextLineHeight() / 2;
|
var dummyHeight = Im.Style.TextHeight / 2;
|
||||||
var ret = DrawAddNewBone(tab, disabled, matrix, width);
|
var ret = DrawAddNewBone(tab, disabled, matrix, width);
|
||||||
|
|
||||||
ImUtf8.Dummy(0, dummyHeight);
|
ImUtf8.Dummy(0, dummyHeight);
|
||||||
|
|
@ -209,7 +209,7 @@ public partial class ModEditWindow
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void DrawFilesOverviewMode()
|
private void DrawFilesOverviewMode()
|
||||||
{
|
{
|
||||||
var height = ImGui.GetTextLineHeightWithSpacing() + 2 * ImGui.GetStyle().CellPadding.Y;
|
var height = Im.Style.TextHeightWithSpacing + 2 * ImGui.GetStyle().CellPadding.Y;
|
||||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||||
|
|
||||||
using var list = ImRaii.Table("##table", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV, -Vector2.One);
|
using var list = ImRaii.Table("##table", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV, -Vector2.One);
|
||||||
|
|
@ -67,7 +67,7 @@ public partial class ModEditWindow
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var width = ImGui.GetContentRegionAvail().X / 8;
|
var width = Im.ContentRegion.Available.X / 8;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("##file", ImGuiTableColumnFlags.WidthFixed, width * 3);
|
ImGui.TableSetupColumn("##file", ImGuiTableColumnFlags.WidthFixed, width * 3);
|
||||||
ImGui.TableSetupColumn("##path", ImGuiTableColumnFlags.WidthFixed, width * 3 + ImGui.GetStyle().FrameBorderSize);
|
ImGui.TableSetupColumn("##path", ImGuiTableColumnFlags.WidthFixed, width * 3 + ImGui.GetStyle().FrameBorderSize);
|
||||||
|
|
@ -192,7 +192,7 @@ public partial class ModEditWindow
|
||||||
_selectedFiles.Add(registry);
|
_selectedFiles.Add(registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (Im.Item.RightClicked())
|
||||||
ImUtf8.OpenPopup("context"u8);
|
ImUtf8.OpenPopup("context"u8);
|
||||||
|
|
||||||
var rightText = DrawFileTooltip(registry, color);
|
var rightText = DrawFileTooltip(registry, color);
|
||||||
|
|
@ -257,7 +257,7 @@ public partial class ModEditWindow
|
||||||
using var id = ImRaii.PushId(j);
|
using var id = ImRaii.PushId(j);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var tmp = _fileIdx == i && _pathIdx == j ? _gamePathEdit : gamePath.ToString();
|
var tmp = _fileIdx == i && _pathIdx == j ? _gamePathEdit : gamePath.ToString();
|
||||||
var pos = ImGui.GetCursorPosX() - ImGui.GetFrameHeight();
|
var pos = ImGui.GetCursorPosX() - Im.Style.FrameHeight;
|
||||||
ImGui.SetNextItemWidth(-1);
|
ImGui.SetNextItemWidth(-1);
|
||||||
if (ImGui.InputText(string.Empty, ref tmp, Utf8GamePath.MaxGamePathLength))
|
if (ImGui.InputText(string.Empty, ref tmp, Utf8GamePath.MaxGamePathLength))
|
||||||
{
|
{
|
||||||
|
|
@ -302,7 +302,7 @@ public partial class ModEditWindow
|
||||||
private void PrintNewGamePath(int i, FileRegistry registry, IModDataContainer _)
|
private void PrintNewGamePath(int i, FileRegistry registry, IModDataContainer _)
|
||||||
{
|
{
|
||||||
var tmp = _fileIdx == i && _pathIdx == -1 ? _gamePathEdit : string.Empty;
|
var tmp = _fileIdx == i && _pathIdx == -1 ? _gamePathEdit : string.Empty;
|
||||||
var pos = ImGui.GetCursorPosX() - ImGui.GetFrameHeight();
|
var pos = ImGui.GetCursorPosX() - Im.Style.FrameHeight;
|
||||||
ImGui.SetNextItemWidth(-1);
|
ImGui.SetNextItemWidth(-1);
|
||||||
if (ImGui.InputTextWithHint("##new", "Add New Path...", ref tmp, Utf8GamePath.MaxGamePathLength))
|
if (ImGui.InputTextWithHint("##new", "Add New Path...", ref tmp, Utf8GamePath.MaxGamePathLength))
|
||||||
{
|
{
|
||||||
|
|
@ -344,10 +344,10 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void DrawButtonHeader()
|
private void DrawButtonHeader()
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(3 * UiHelpers.Scale, 0));
|
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(3 * Im.Style.GlobalScale, 0));
|
||||||
ImGui.SetNextItemWidth(30 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(30 * Im.Style.GlobalScale);
|
||||||
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.");
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -403,7 +403,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void DrawFileManagementNormal()
|
private void DrawFileManagementNormal()
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(250 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(250 * Im.Style.GlobalScale);
|
||||||
Im.Input.Text("##filter"u8, ref _fileFilter, "Filter paths..."u8);
|
Im.Input.Text("##filter"u8, ref _fileFilter, "Filter paths..."u8);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGui.Checkbox("Show Game Paths", ref _showGamePaths);
|
ImGui.Checkbox("Show Game Paths", ref _showGamePaths);
|
||||||
|
|
@ -434,7 +434,7 @@ public partial class ModEditWindow
|
||||||
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.FrameBorderSize, ImGui.GetStyle().ChildBorderSize);
|
.Push(ImGuiStyleVar.FrameBorderSize, ImGui.GetStyle().ChildBorderSize);
|
||||||
|
|
||||||
var width = ImGui.GetContentRegionAvail().X / 8;
|
var width = Im.ContentRegion.Available.X / 8;
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.UI.AdvancedWindow.Materials;
|
using Penumbra.UI.AdvancedWindow.Materials;
|
||||||
|
|
@ -28,10 +28,10 @@ public partial class ModEditWindow
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
MaterialSuffix.Draw(_editor, ImGuiHelpers.ScaledVector2(175, 0));
|
MaterialSuffix.Draw(_editor, ImEx.ScaledVector(175, 0));
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
using var child = ImUtf8.Child("##mdlFiles"u8, -Vector2.One, true);
|
using var child = ImUtf8.Child("##mdlFiles"u8, -Vector2.One, true);
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
@ -54,7 +54,7 @@ public partial class ModEditWindow
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.Text(info.Path.InternalName.Span[(Mod!.ModPath.FullName.Length + 1)..]);
|
ImUtf8.Text(info.Path.InternalName.Span[(Mod!.ModPath.FullName.Length + 1)..]);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(400 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(400 * Im.Style.GlobalScale);
|
||||||
var tmp = info.CurrentMaterials[0];
|
var tmp = info.CurrentMaterials[0];
|
||||||
if (ImUtf8.InputText("##0"u8, ref tmp))
|
if (ImUtf8.InputText("##0"u8, ref tmp))
|
||||||
info.SetMaterial(tmp, 0);
|
info.SetMaterial(tmp, 0);
|
||||||
|
|
@ -66,7 +66,7 @@ public partial class ModEditWindow
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.SetNextItemWidth(400 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(400 * Im.Style.GlobalScale);
|
||||||
tmp = info.CurrentMaterials[i];
|
tmp = info.CurrentMaterials[i];
|
||||||
if (ImUtf8.InputText(""u8, ref tmp))
|
if (ImUtf8.InputText(""u8, ref tmp))
|
||||||
info.SetMaterial(tmp, i);
|
info.SetMaterial(tmp, i);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
var setsEqual = !_editor.MetaEditor.Changes;
|
var setsEqual = !_editor.MetaEditor.Changes;
|
||||||
var tt = setsEqual ? "No changes staged."u8 : "Apply the currently staged changes to the option."u8;
|
var tt = setsEqual ? "No changes staged."u8 : "Apply the currently staged changes to the option."u8;
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
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!);
|
||||||
|
|
||||||
|
|
@ -131,7 +131,7 @@ public partial class ModEditWindow
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drawer.Draw();
|
drawer.Draw();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawOtherOptionData(MetaManipulationType type, float oldPos, Vector2 newPos)
|
private void DrawOtherOptionData(MetaManipulationType type, float oldPos, Vector2 newPos)
|
||||||
|
|
@ -142,7 +142,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
var text = $"{otherOptionData.TotalCount} Edits in other Options";
|
var text = $"{otherOptionData.TotalCount} Edits in other Options";
|
||||||
var size = ImGui.CalcTextSize(text).X;
|
var size = ImGui.CalcTextSize(text).X;
|
||||||
ImGui.SetCursorPos(new Vector2(ImGui.GetContentRegionAvail().X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
ImGui.SetCursorPos(new Vector2(Im.ContentRegion.Available.X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
||||||
Im.Text(text, ColorId.RedundantAssignment.Value().FullAlpha());
|
Im.Text(text, ColorId.RedundantAssignment.Value().FullAlpha());
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public partial class ModEditWindow
|
||||||
if (!ImGui.CollapsingHeader("Import / Export"))
|
if (!ImGui.CollapsingHeader("Import / Export"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var childSize = new Vector2((ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X) / 2, 0);
|
var childSize = new Vector2((Im.ContentRegion.Available.X - ImGui.GetStyle().ItemSpacing.X) / 2, 0);
|
||||||
|
|
||||||
DrawImport(tab, childSize, disabled);
|
DrawImport(tab, childSize, disabled);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -196,11 +196,11 @@ public partial class ModEditWindow
|
||||||
if (tab.IoExceptions.Count == 0)
|
if (tab.IoExceptions.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var size = new Vector2(ImGui.GetContentRegionAvail().X, 0);
|
var size = new Vector2(Im.ContentRegion.Available.X, 0);
|
||||||
using var frame = ImRaii.FramedGroup("Exceptions", size, headerPreIcon: FontAwesomeIcon.TimesCircle,
|
using var frame = ImRaii.FramedGroup("Exceptions", size, headerPreIcon: FontAwesomeIcon.TimesCircle,
|
||||||
borderColor: Colors.RegexWarningBorder);
|
borderColor: Colors.RegexWarningBorder);
|
||||||
|
|
||||||
var spaceAvail = ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - 100;
|
var spaceAvail = Im.ContentRegion.Available.X - ImGui.GetStyle().ItemSpacing.X - 100;
|
||||||
foreach (var (index, exception) in tab.IoExceptions.Index())
|
foreach (var (index, exception) in tab.IoExceptions.Index())
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId(index);
|
using var id = ImRaii.PushId(index);
|
||||||
|
|
@ -223,10 +223,10 @@ public partial class ModEditWindow
|
||||||
if (tab.IoWarnings.Count == 0)
|
if (tab.IoWarnings.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var size = new Vector2(ImGui.GetContentRegionAvail().X, 0);
|
var size = new Vector2(Im.ContentRegion.Available.X, 0);
|
||||||
using var frame = ImRaii.FramedGroup("Warnings", size, headerPreIcon: FontAwesomeIcon.ExclamationCircle, borderColor: 0xFF40FFFF);
|
using var frame = ImRaii.FramedGroup("Warnings", size, headerPreIcon: FontAwesomeIcon.ExclamationCircle, borderColor: 0xFF40FFFF);
|
||||||
|
|
||||||
var spaceAvail = ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - 100;
|
var spaceAvail = Im.ContentRegion.Available.X - ImGui.GetStyle().ItemSpacing.X - 100;
|
||||||
foreach (var (index, warning) in tab.IoWarnings.Index())
|
foreach (var (index, warning) in tab.IoWarnings.Index())
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId(index);
|
using var id = ImRaii.PushId(index);
|
||||||
|
|
@ -271,7 +271,7 @@ public partial class ModEditWindow
|
||||||
const string label = "Game Path";
|
const string label = "Game Path";
|
||||||
var preview = tab.GamePaths![tab.GamePathIndex].ToString();
|
var preview = tab.GamePaths![tab.GamePathIndex].ToString();
|
||||||
var labelWidth = ImGui.CalcTextSize(label).X + ImGui.GetStyle().ItemInnerSpacing.X;
|
var labelWidth = ImGui.CalcTextSize(label).X + ImGui.GetStyle().ItemInnerSpacing.X;
|
||||||
var buttonWidth = ImGui.GetContentRegionAvail().X - labelWidth - ImGui.GetStyle().ItemSpacing.X;
|
var buttonWidth = Im.ContentRegion.Available.X - labelWidth - ImGui.GetStyle().ItemSpacing.X;
|
||||||
if (tab.GamePaths!.Count == 1)
|
if (tab.GamePaths!.Count == 1)
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f));
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f));
|
||||||
|
|
@ -297,7 +297,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (Im.Item.RightClicked())
|
||||||
ImGui.SetClipboardText(preview);
|
ImGui.SetClipboardText(preview);
|
||||||
ImGuiUtil.HoverTooltip("Right-Click to copy to clipboard.", ImGuiHoveredFlags.AllowWhenDisabled);
|
ImGuiUtil.HoverTooltip("Right-Click to copy to clipboard.", ImGuiHoveredFlags.AllowWhenDisabled);
|
||||||
}
|
}
|
||||||
|
|
@ -331,7 +331,7 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
var text = $"{invalidMaterialCount} invalid material{(invalidMaterialCount > 1 ? "s" : "")}";
|
var text = $"{invalidMaterialCount} invalid material{(invalidMaterialCount > 1 ? "s" : "")}";
|
||||||
var size = ImGui.CalcTextSize(text).X;
|
var size = ImGui.CalcTextSize(text).X;
|
||||||
ImGui.SetCursorPos(new Vector2(ImGui.GetContentRegionAvail().X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
ImGui.SetCursorPos(new Vector2(Im.ContentRegion.Available.X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
||||||
ImGuiUtil.TextColored(0xFF0000FF, text);
|
ImGuiUtil.TextColored(0xFF0000FF, text);
|
||||||
ImGui.SetCursorPos(newPos);
|
ImGui.SetCursorPos(newPos);
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +346,7 @@ public partial class ModEditWindow
|
||||||
var ret = false;
|
var ret = false;
|
||||||
var materials = tab.Mdl.Materials;
|
var materials = tab.Mdl.Materials;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("index", ImGuiTableColumnFlags.WidthFixed, 80 * UiHelpers.Scale);
|
ImGui.TableSetupColumn("index", ImGuiTableColumnFlags.WidthFixed, 80 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("path", ImGuiTableColumnFlags.WidthStretch, 1);
|
ImGui.TableSetupColumn("path", ImGuiTableColumnFlags.WidthStretch, 1);
|
||||||
if (!disabled)
|
if (!disabled)
|
||||||
{
|
{
|
||||||
|
|
@ -468,7 +468,7 @@ public partial class ModEditWindow
|
||||||
if (!table)
|
if (!table)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("name", ImGuiTableColumnFlags.WidthFixed, 100 * UiHelpers.Scale);
|
ImGui.TableSetupColumn("name", ImGuiTableColumnFlags.WidthFixed, 100 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("field", ImGuiTableColumnFlags.WidthStretch, 1);
|
ImGui.TableSetupColumn("field", ImGuiTableColumnFlags.WidthStretch, 1);
|
||||||
|
|
||||||
var file = tab.Mdl;
|
var file = tab.Mdl;
|
||||||
|
|
|
||||||
|
|
@ -26,26 +26,26 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
DrawShaderPackageSummary(file);
|
DrawShaderPackageSummary(file);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
DrawShaderPackageFilterSection(file);
|
DrawShaderPackageFilterSection(file);
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
ret |= DrawShaderPackageShaderArray(file, "Vertex Shader", file.Shpk.VertexShaders, disabled);
|
ret |= DrawShaderPackageShaderArray(file, "Vertex Shader", file.Shpk.VertexShaders, disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
ret |= DrawShaderPackageShaderArray(file, "Pixel Shader", file.Shpk.PixelShaders, disabled);
|
ret |= DrawShaderPackageShaderArray(file, "Pixel Shader", file.Shpk.PixelShaders, disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
ret |= DrawShaderPackageMaterialParamLayout(file, disabled);
|
ret |= DrawShaderPackageMaterialParamLayout(file, disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
ret |= DrawShaderPackageResources(file, disabled);
|
ret |= DrawShaderPackageResources(file, disabled);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
DrawShaderPackageSelection(file);
|
DrawShaderPackageSelection(file);
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetTextLineHeight() / 2));
|
ImGui.Dummy(new Vector2(Im.Style.TextHeight / 2));
|
||||||
DrawOtherShaderPackageDetails(file);
|
DrawOtherShaderPackageDetails(file);
|
||||||
|
|
||||||
ret |= file.Shpk.IsChanged();
|
ret |= file.Shpk.IsChanged();
|
||||||
|
|
@ -146,7 +146,7 @@ public partial class ModEditWindow
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
||||||
var size = new Vector2(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 20);
|
var size = new Vector2(Im.ContentRegion.Available.X, Im.Style.TextHeight * 20);
|
||||||
ImGuiNative.InputTextMultiline(DisassemblyLabel.Path, shader.Disassembly!.RawDisassembly.Path,
|
ImGuiNative.InputTextMultiline(DisassemblyLabel.Path, shader.Disassembly!.RawDisassembly.Path,
|
||||||
(uint)shader.Disassembly!.RawDisassembly.Length + 1, size,
|
(uint)shader.Disassembly!.RawDisassembly.Length + 1, size,
|
||||||
ImGuiInputTextFlags.ReadOnly, null, null);
|
ImGuiInputTextFlags.ReadOnly, null, null);
|
||||||
|
|
@ -302,7 +302,7 @@ public partial class ModEditWindow
|
||||||
var ret = false;
|
var ret = false;
|
||||||
if (!disabled)
|
if (!disabled)
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 150.0f);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 150.0f);
|
||||||
if (ImGuiUtil.InputUInt16($"{char.ToUpper(slotLabel[0])}{slotLabel[1..].ToLower()}", ref resource.Slot, ImGuiInputTextFlags.None))
|
if (ImGuiUtil.InputUInt16($"{char.ToUpper(slotLabel[0])}{slotLabel[1..].ToLower()}", ref resource.Slot, ImGuiInputTextFlags.None))
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
@ -363,7 +363,7 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
||||||
var pos = ImGui.GetCursorScreenPos()
|
var pos = ImGui.GetCursorScreenPos()
|
||||||
+ new Vector2(ImGui.CalcTextSize(label).X + 3 * ImGui.GetStyle().ItemInnerSpacing.X + ImGui.GetFrameHeight(),
|
+ new Vector2(ImGui.CalcTextSize(label).X + 3 * ImGui.GetStyle().ItemInnerSpacing.X + Im.Style.FrameHeight,
|
||||||
ImGui.GetStyle().FramePadding.Y);
|
ImGui.GetStyle().FramePadding.Y);
|
||||||
|
|
||||||
var ret = ImUtf8.CollapsingHeader(label);
|
var ret = ImUtf8.CollapsingHeader(label);
|
||||||
|
|
@ -396,11 +396,11 @@ public partial class ModEditWindow
|
||||||
if (!table)
|
if (!table)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, 40 * UiHelpers.Scale);
|
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, 40 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("x", ImGuiTableColumnFlags.WidthFixed, 250 * UiHelpers.Scale);
|
ImGui.TableSetupColumn("x", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("y", ImGuiTableColumnFlags.WidthFixed, 250 * UiHelpers.Scale);
|
ImGui.TableSetupColumn("y", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("z", ImGuiTableColumnFlags.WidthFixed, 250 * UiHelpers.Scale);
|
ImGui.TableSetupColumn("z", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("w", ImGuiTableColumnFlags.WidthFixed, 250 * UiHelpers.Scale);
|
ImGui.TableSetupColumn("w", ImGuiTableColumnFlags.WidthFixed, 250 * Im.Style.GlobalScale);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
var textColorStart = ImGuiColor.Text.Get().Color;
|
var textColorStart = ImGuiColor.Text.Get().Color;
|
||||||
|
|
@ -428,7 +428,7 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.Selectable(name);
|
ImUtf8.Selectable(name);
|
||||||
if (deletable && ImGui.IsItemClicked(ImGuiMouseButton.Right) && ImGui.GetIO().KeyCtrl)
|
if (deletable && Im.Item.RightClicked() && ImGui.GetIO().KeyCtrl)
|
||||||
{
|
{
|
||||||
tab.Shpk.MaterialParams = tab.Shpk.MaterialParams.RemoveItems(idx);
|
tab.Shpk.MaterialParams = tab.Shpk.MaterialParams.RemoveItems(idx);
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
@ -494,7 +494,7 @@ public partial class ModEditWindow
|
||||||
using var s = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemInnerSpacing);
|
using var s = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemInnerSpacing);
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 400);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 400);
|
||||||
using var c = ImUtf8.Combo("##Start", tab.Orphans[tab.NewMaterialParamStart].Name);
|
using var c = ImUtf8.Combo("##Start", tab.Orphans[tab.NewMaterialParamStart].Name);
|
||||||
if (c)
|
if (c)
|
||||||
foreach (var(idx, start) in tab.Orphans.Index())
|
foreach (var(idx, start) in tab.Orphans.Index())
|
||||||
|
|
@ -513,7 +513,7 @@ public partial class ModEditWindow
|
||||||
using var s = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemInnerSpacing);
|
using var s = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemInnerSpacing);
|
||||||
using (var _ = ImRaii.PushFont(UiBuilder.MonoFont))
|
using (var _ = ImRaii.PushFont(UiBuilder.MonoFont))
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 400);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 400);
|
||||||
using var c = ImUtf8.Combo("##End", tab.Orphans[tab.NewMaterialParamEnd].Name);
|
using var c = ImUtf8.Combo("##End", tab.Orphans[tab.NewMaterialParamEnd].Name);
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
|
|
@ -542,7 +542,7 @@ public partial class ModEditWindow
|
||||||
DrawShaderPackageStartCombo(tab);
|
DrawShaderPackageStartCombo(tab);
|
||||||
DrawShaderPackageEndCombo(tab);
|
DrawShaderPackageEndCombo(tab);
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(UiHelpers.Scale * 400);
|
ImGui.SetNextItemWidth(Im.Style.GlobalScale * 400);
|
||||||
var newName = tab.NewMaterialParamName.Value!;
|
var newName = tab.NewMaterialParamName.Value!;
|
||||||
if (ImUtf8.InputText("Name", ref newName))
|
if (ImUtf8.InputText("Name", ref newName))
|
||||||
tab.NewMaterialParamName = newName;
|
tab.NewMaterialParamName = newName;
|
||||||
|
|
@ -551,7 +551,7 @@ public partial class ModEditWindow
|
||||||
? "The ID is already in use. Please choose a different name."u8
|
? "The ID is already in use. Please choose a different name."u8
|
||||||
: ""u8;
|
: ""u8;
|
||||||
if (!ImUtf8.ButtonEx($"Add {tab.NewMaterialParamName} (0x{tab.NewMaterialParamName.Crc32:X8})", tooltip,
|
if (!ImUtf8.ButtonEx($"Add {tab.NewMaterialParamName} (0x{tab.NewMaterialParamName.Crc32:X8})", tooltip,
|
||||||
new Vector2(400 * UiHelpers.Scale, ImGui.GetFrameHeight()), tooltip.Length > 0))
|
new Vector2(400 * Im.Style.GlobalScale, Im.Style.FrameHeight), tooltip.Length > 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
tab.Shpk.MaterialParams = tab.Shpk.MaterialParams.AddItem(new MaterialParam
|
tab.Shpk.MaterialParams = tab.Shpk.MaterialParams.AddItem(new MaterialParam
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
using var id = ImRaii.PushId(label);
|
using var id = ImRaii.PushId(label);
|
||||||
ImEx.TextFramed(label, Im.ContentRegion.Available with { Y = 0 }, ImGuiColor.FrameBackground.Get());
|
ImEx.TextFramed(label, Im.ContentRegion.Available with { Y = 0 }, ImGuiColor.FrameBackground.Get());
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
using (ImRaii.Disabled(!_center.SaveTask.IsCompleted))
|
using (ImRaii.Disabled(!_center.SaveTask.IsCompleted))
|
||||||
{
|
{
|
||||||
|
|
@ -68,7 +68,7 @@ public partial class ModEditWindow
|
||||||
_center.DrawMatrixInputRight(size.X);
|
_center.DrawMatrixInputRight(size.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
using var child2 = ImRaii.Child("image");
|
using var child2 = ImRaii.Child("image");
|
||||||
if (child2)
|
if (child2)
|
||||||
TextureDrawer.Draw(tex, imageSize);
|
TextureDrawer.Draw(tex, imageSize);
|
||||||
|
|
@ -81,7 +81,7 @@ public partial class ModEditWindow
|
||||||
private void SaveAsCombo()
|
private void SaveAsCombo()
|
||||||
{
|
{
|
||||||
var (text, desc) = SaveAsStrings[_currentSaveAs];
|
var (text, desc) = SaveAsStrings[_currentSaveAs];
|
||||||
ImGui.SetNextItemWidth(-ImGui.GetFrameHeight() - ImGui.GetStyle().ItemSpacing.X);
|
ImGui.SetNextItemWidth(-Im.Style.FrameHeight - ImGui.GetStyle().ItemSpacing.X);
|
||||||
using var combo = ImRaii.Combo("##format", text);
|
using var combo = ImRaii.Combo("##format", text);
|
||||||
ImGuiUtil.HoverTooltip(desc);
|
ImGuiUtil.HoverTooltip(desc);
|
||||||
if (!combo)
|
if (!combo)
|
||||||
|
|
@ -137,8 +137,8 @@ public partial class ModEditWindow
|
||||||
? "This saves the texture in place. This is not revertible."
|
? "This saves the texture in place. This is not revertible."
|
||||||
: $"This saves the texture in place. This is not revertible. Hold {_config.DeleteModModifier} to save.";
|
: $"This saves the texture in place. This is not revertible. Hold {_config.DeleteModModifier} to save.";
|
||||||
|
|
||||||
var buttonSize2 = new Vector2((ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X) / 2, 0);
|
var buttonSize2 = new Vector2((Im.ContentRegion.Available.X - ImGui.GetStyle().ItemSpacing.X) / 2, 0);
|
||||||
var buttonSize3 = new Vector2((ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X * 2) / 3, 0);
|
var buttonSize3 = new Vector2((Im.ContentRegion.Available.X - ImGui.GetStyle().ItemSpacing.X * 2) / 3, 0);
|
||||||
if (ImGuiUtil.DrawDisabledButton("Save in place", buttonSize2,
|
if (ImGuiUtil.DrawDisabledButton("Save in place", buttonSize2,
|
||||||
tt, !isActive || !canSaveInPlace || _center.IsLeftCopy && _currentSaveAs == (int)CombinedTexture.TextureSaveType.AsIs))
|
tt, !isActive || !canSaveInPlace || _center.IsLeftCopy && _currentSaveAs == (int)CombinedTexture.TextureSaveType.AsIs))
|
||||||
{
|
{
|
||||||
|
|
@ -159,7 +159,7 @@ public partial class ModEditWindow
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGui.Button("Export as DDS", buttonSize3))
|
if (ImGui.Button("Export as DDS", buttonSize3))
|
||||||
OpenSaveAsDialog(".dds");
|
OpenSaveAsDialog(".dds");
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
var canConvertInPlace = canSaveInPlace && _left.Type is TextureType.Tex && _center.IsLeftCopy;
|
var canConvertInPlace = canSaveInPlace && _left.Type is TextureType.Tex && _center.IsLeftCopy;
|
||||||
|
|
||||||
|
|
@ -209,10 +209,10 @@ public partial class ModEditWindow
|
||||||
ImGuiUtil.TextWrapped(_center.SaveTask.Exception?.ToString() ?? "Unknown Error");
|
ImGuiUtil.TextWrapped(_center.SaveTask.Exception?.ToString() ?? "Unknown Error");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: ImGui.Dummy(new Vector2(1, ImGui.GetFrameHeight())); break;
|
default: ImGui.Dummy(new Vector2(1, Im.Style.FrameHeight)); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
using var child2 = ImRaii.Child("image");
|
using var child2 = ImRaii.Child("image");
|
||||||
if (child2)
|
if (child2)
|
||||||
|
|
@ -280,7 +280,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private Vector2 GetChildWidth()
|
private Vector2 GetChildWidth()
|
||||||
{
|
{
|
||||||
var windowWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - ImGui.GetTextLineHeight();
|
var windowWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - Im.Style.TextHeight;
|
||||||
if (_overlayCollapsed)
|
if (_overlayCollapsed)
|
||||||
{
|
{
|
||||||
var width = windowWidth - ImGui.GetStyle().FramePadding.X * 3;
|
var width = windowWidth - ImGui.GetStyle().FramePadding.X * 3;
|
||||||
|
|
@ -332,7 +332,7 @@ public partial class ModEditWindow
|
||||||
var (label, tooltip) = _overlayCollapsed
|
var (label, tooltip) = _overlayCollapsed
|
||||||
? (">", "Show a third panel in which you can import an additional texture as an overlay for the primary texture.")
|
? (">", "Show a third panel in which you can import an additional texture as an overlay for the primary texture.")
|
||||||
: ("<", "Hide the overlay texture panel and clear the currently loaded overlay texture, if any.");
|
: ("<", "Hide the overlay texture panel and clear the currently loaded overlay texture, if any.");
|
||||||
if (ImGui.Button(label, new Vector2(ImGui.GetTextLineHeight(), ImGui.GetContentRegionAvail().Y)))
|
if (ImGui.Button(label, new Vector2(Im.Style.TextHeight, Im.ContentRegion.Available.Y)))
|
||||||
_overlayCollapsed = !_overlayCollapsed;
|
_overlayCollapsed = !_overlayCollapsed;
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(tooltip);
|
ImGuiUtil.HoverTooltip(tooltip);
|
||||||
|
|
|
||||||
|
|
@ -201,8 +201,8 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
{
|
{
|
||||||
var radius = 100 * ImUtf8.GlobalScale;
|
var radius = 100 * ImUtf8.GlobalScale;
|
||||||
var thickness = (int)(20 * ImUtf8.GlobalScale);
|
var thickness = (int)(20 * ImUtf8.GlobalScale);
|
||||||
var offsetX = ImGui.GetContentRegionAvail().X / 2 - radius;
|
var offsetX = Im.ContentRegion.Available.X / 2 - radius;
|
||||||
var offsetY = ImGui.GetContentRegionAvail().Y / 2 - radius;
|
var offsetY = Im.ContentRegion.Available.Y / 2 - radius;
|
||||||
ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(offsetX, offsetY));
|
ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(offsetX, offsetY));
|
||||||
ImEx.Spinner("##spinner"u8, radius, thickness, ImGuiColor.Text.Get());
|
ImEx.Spinner("##spinner"u8, radius, thickness, ImGuiColor.Text.Get());
|
||||||
return;
|
return;
|
||||||
|
|
@ -212,7 +212,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
if (!tabBar)
|
if (!tabBar)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_iconSize = new Vector2(ImGui.GetFrameHeight());
|
_iconSize = new Vector2(Im.Style.FrameHeight);
|
||||||
DrawFileTab();
|
DrawFileTab();
|
||||||
DrawMetaTab();
|
DrawMetaTab();
|
||||||
DrawSwapTab();
|
DrawSwapTab();
|
||||||
|
|
@ -319,7 +319,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
if (ImGui.Button("Remove Missing Files from Mod"))
|
if (ImGui.Button("Remove Missing Files from Mod"))
|
||||||
_editor.FileEditor.RemoveMissingPaths(Mod!, _editor.Option!);
|
_editor.FileEditor.RemoveMissingPaths(Mod!, _editor.Option!);
|
||||||
|
|
||||||
|
|
@ -369,7 +369,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
if (_editor.ModNormalizer.Running)
|
if (_editor.ModNormalizer.Running)
|
||||||
{
|
{
|
||||||
ImGui.ProgressBar((float)_editor.ModNormalizer.Step / _editor.ModNormalizer.TotalSteps,
|
ImGui.ProgressBar((float)_editor.ModNormalizer.Step / _editor.ModNormalizer.TotalSteps,
|
||||||
new Vector2(300 * UiHelpers.Scale, ImGui.GetFrameHeight()),
|
new Vector2(300 * Im.Style.GlobalScale, Im.Style.FrameHeight),
|
||||||
$"{_editor.ModNormalizer.Step} / {_editor.ModNormalizer.TotalSteps}");
|
$"{_editor.ModNormalizer.Step} / {_editor.ModNormalizer.TotalSteps}");
|
||||||
}
|
}
|
||||||
else if (ImGuiUtil.DrawDisabledButton("Re-Duplicate and Normalize Mod", Vector2.Zero, tt, !_allowReduplicate && !modifier))
|
else if (ImGuiUtil.DrawDisabledButton("Re-Duplicate and Normalize Mod", Vector2.Zero, tt, !_allowReduplicate && !modifier))
|
||||||
|
|
@ -383,7 +383,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
|
|
||||||
if (_editor.Duplicates.Duplicates.Count == 0)
|
if (_editor.Duplicates.Duplicates.Count == 0)
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.TextUnformatted("No duplicates found.");
|
ImGui.TextUnformatted("No duplicates found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -446,7 +446,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
private bool DrawOptionSelectHeader()
|
private bool DrawOptionSelectHeader()
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero).Push(ImGuiStyleVar.FrameRounding, 0);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero).Push(ImGuiStyleVar.FrameRounding, 0);
|
||||||
var width = new Vector2(ImGui.GetContentRegionAvail().X / 3, 0);
|
var width = new Vector2(Im.ContentRegion.Available.X / 3, 0);
|
||||||
var ret = false;
|
var ret = false;
|
||||||
if (ImUtf8.ButtonEx("Default Option"u8, "Switch to the default option for the mod.\nThis resets unsaved changes."u8, width,
|
if (ImUtf8.ButtonEx("Default Option"u8, "Switch to the default option for the mod.\nThis resets unsaved changes."u8, width,
|
||||||
_editor.Option is DefaultSubMod))
|
_editor.Option is DefaultSubMod))
|
||||||
|
|
@ -486,7 +486,7 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
|
|
||||||
var setsEqual = !_editor.SwapEditor.Changes;
|
var setsEqual = !_editor.SwapEditor.Changes;
|
||||||
var tt = setsEqual ? "No changes staged." : "Apply the currently staged changes to the option.";
|
var tt = setsEqual ? "No changes staged." : "Apply the currently staged changes to the option.";
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
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!);
|
||||||
|
|
||||||
|
|
@ -512,8 +512,8 @@ public partial class ModEditWindow : IndexedWindow, IDisposable
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
var iconSize = ImGui.GetFrameHeight() * Vector2.One;
|
var iconSize = Im.Style.FrameHeight * Vector2.One;
|
||||||
var pathSize = ImGui.GetContentRegionAvail().X / 2 - iconSize.X;
|
var pathSize = Im.ContentRegion.Available.X / 2 - iconSize.X;
|
||||||
ImGui.TableSetupColumn("button", ImGuiTableColumnFlags.WidthFixed, iconSize.X);
|
ImGui.TableSetupColumn("button", ImGuiTableColumnFlags.WidthFixed, iconSize.X);
|
||||||
ImGui.TableSetupColumn("source", ImGuiTableColumnFlags.WidthFixed, pathSize);
|
ImGui.TableSetupColumn("source", ImGuiTableColumnFlags.WidthFixed, pathSize);
|
||||||
ImGui.TableSetupColumn("value", ImGuiTableColumnFlags.WidthFixed, pathSize);
|
ImGui.TableSetupColumn("value", ImGuiTableColumnFlags.WidthFixed, pathSize);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
ImGui.Dummy(Vector2.One);
|
||||||
var size = 550 * ImGuiHelpers.GlobalScale;
|
var size = 550 * Im.Style.GlobalScale;
|
||||||
DrawMergeInto(size);
|
DrawMergeInto(size);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
DrawMergeIntoDesc();
|
DrawMergeIntoDesc();
|
||||||
|
|
@ -46,7 +46,7 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
private void DrawMergeInto(float size)
|
private void DrawMergeInto(float size)
|
||||||
{
|
{
|
||||||
using var bigGroup = ImRaii.Group();
|
using var bigGroup = ImRaii.Group();
|
||||||
var minComboSize = 300 * ImGuiHelpers.GlobalScale;
|
var minComboSize = 300 * Im.Style.GlobalScale;
|
||||||
var textSize = ImUtf8.CalcTextSize($"Merge {modMerger.MergeFromMod!.Name} into ").X;
|
var textSize = ImUtf8.CalcTextSize($"Merge {modMerger.MergeFromMod!.Name} into ").X;
|
||||||
|
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
@ -167,9 +167,9 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
{
|
{
|
||||||
var options = modMerger.MergeFromMod!.AllDataContainers.ToList();
|
var options = modMerger.MergeFromMod!.AllDataContainers.ToList();
|
||||||
var height = modMerger.Warnings.Count == 0 && modMerger.Error == null
|
var height = modMerger.Warnings.Count == 0 && modMerger.Error == null
|
||||||
? ImGui.GetContentRegionAvail().Y - 3 * ImGui.GetFrameHeightWithSpacing()
|
? Im.ContentRegion.Available.Y - 3 * Im.Style.FrameHeightWithSpacing
|
||||||
: 8 * ImGui.GetFrameHeightWithSpacing();
|
: 8 * Im.Style.FrameHeightWithSpacing;
|
||||||
height = Math.Min(height, (options.Count + 1) * ImGui.GetFrameHeightWithSpacing());
|
height = Math.Min(height, (options.Count + 1) * Im.Style.FrameHeightWithSpacing);
|
||||||
var tableSize = new Vector2(size, height);
|
var tableSize = new Vector2(size, height);
|
||||||
using var table = ImRaii.Table("##options", 6,
|
using var table = ImRaii.Table("##options", 6,
|
||||||
ImGuiTableFlags.RowBg
|
ImGuiTableFlags.RowBg
|
||||||
|
|
@ -181,12 +181,12 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupColumn("##Selected", ImGuiTableColumnFlags.WidthFixed, ImGui.GetFrameHeight());
|
ImGui.TableSetupColumn("##Selected", ImGuiTableColumnFlags.WidthFixed, Im.Style.FrameHeight);
|
||||||
ImGui.TableSetupColumn("Option", ImGuiTableColumnFlags.WidthStretch);
|
ImGui.TableSetupColumn("Option", ImGuiTableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Option Group", ImGuiTableColumnFlags.WidthFixed, 120 * ImGuiHelpers.GlobalScale);
|
ImGui.TableSetupColumn("Option Group", ImGuiTableColumnFlags.WidthFixed, 120 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("#Files", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale);
|
ImGui.TableSetupColumn("#Files", ImGuiTableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("#Swaps", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale);
|
ImGui.TableSetupColumn("#Swaps", ImGuiTableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
||||||
ImGui.TableSetupColumn("#Manips", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale);
|
ImGui.TableSetupColumn("#Manips", ImGuiTableColumnFlags.WidthFixed, 50 * Im.Style.GlobalScale);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
foreach (var (idx, option) in options.Index())
|
foreach (var (idx, option) in options.Index())
|
||||||
{
|
{
|
||||||
|
|
@ -224,11 +224,11 @@ public class ModMergeTab(ModMerger modMerger, ModComboWithoutCurrent combo) : Lu
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGuiUtil.RightAlign(option.Files.Count.ToString(), 3 * ImGuiHelpers.GlobalScale);
|
ImGuiUtil.RightAlign(option.Files.Count.ToString(), 3 * Im.Style.GlobalScale);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGuiUtil.RightAlign(option.FileSwaps.Count.ToString(), 3 * ImGuiHelpers.GlobalScale);
|
ImGuiUtil.RightAlign(option.FileSwaps.Count.ToString(), 3 * Im.Style.GlobalScale);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGuiUtil.RightAlign(option.Manipulations.Count.ToString(), 3 * ImGuiHelpers.GlobalScale);
|
ImGuiUtil.RightAlign(option.Manipulations.Count.ToString(), 3 * Im.Style.GlobalScale);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
void Handle(IModDataContainer option2, bool selected2)
|
void Handle(IModDataContainer option2, bool selected2)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public sealed class OptionSelectCombo(ModEditor editor, ModEditWindow window)
|
||||||
> 8 => ImGuiComboFlags.HeightLargest,
|
> 8 => ImGuiComboFlags.HeightLargest,
|
||||||
_ => ImGuiComboFlags.None,
|
_ => ImGuiComboFlags.None,
|
||||||
};
|
};
|
||||||
return Draw("##optionSelector", editor.Option!.GetFullName(), string.Empty, width, ImGui.GetTextLineHeight(), flags);
|
return Draw("##optionSelector", editor.Option!.GetFullName(), string.Empty, width, Im.Style.TextHeight, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool DrawSelectable(int globalIdx, bool selected)
|
protected override bool DrawSelectable(int globalIdx, bool selected)
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,12 @@ public class ResourceTreeViewer(
|
||||||
|
|
||||||
if (!_task.IsCompleted)
|
if (!_task.IsCompleted)
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.TextUnformatted("Calculating character list...");
|
ImGui.TextUnformatted("Calculating character list...");
|
||||||
}
|
}
|
||||||
else if (_task.Exception != null)
|
else if (_task.Exception != null)
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
using var color = ImGuiColor.Text.Push(Colors.RegexWarningBorder);
|
using var color = ImGuiColor.Text.Push(Colors.RegexWarningBorder);
|
||||||
ImGui.TextUnformatted($"Error during calculation of character list:\n\n{_task.Exception}");
|
ImGui.TextUnformatted($"Error during calculation of character list:\n\n{_task.Exception}");
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +138,7 @@ public class ResourceTreeViewer(
|
||||||
_note = string.Empty;
|
_note = string.Empty;
|
||||||
}, config.ExportDirectory, false);
|
}, config.ExportDirectory, false);
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
ImGui.SetNextItemWidth(Im.ContentRegion.Available.X);
|
||||||
ImUtf8.InputText("##note"u8, ref _note, "Export note..."u8);
|
ImUtf8.InputText("##note"u8, ref _note, "Export note..."u8);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -151,7 +151,7 @@ public class ResourceTreeViewer(
|
||||||
ImGui.TableSetupColumn("Game Path", ImGuiTableColumnFlags.WidthStretch, 0.3f);
|
ImGui.TableSetupColumn("Game Path", ImGuiTableColumnFlags.WidthStretch, 0.3f);
|
||||||
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed,
|
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed,
|
||||||
actionCapacity * 3 * ImGuiHelpers.GlobalScale + (actionCapacity + 1) * ImGui.GetFrameHeight());
|
actionCapacity * 3 * Im.Style.GlobalScale + (actionCapacity + 1) * Im.Style.FrameHeight);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
DrawNodes(tree.Nodes, 0, unchecked(tree.DrawObjectAddress * 31), 0);
|
DrawNodes(tree.Nodes, 0, unchecked(tree.DrawObjectAddress * 31), 0);
|
||||||
|
|
@ -179,47 +179,47 @@ public class ResourceTreeViewer(
|
||||||
|
|
||||||
private void DrawControls()
|
private void DrawControls()
|
||||||
{
|
{
|
||||||
var yOffset = (ChangedItemDrawer.TypeFilterIconSize.Y - ImGui.GetFrameHeight()) / 2f;
|
var yOffset = (ChangedItemDrawer.TypeFilterIconSize.Y - Im.Style.FrameHeight) / 2f;
|
||||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + yOffset);
|
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + yOffset);
|
||||||
|
|
||||||
if (ImGui.Button("Refresh Character List"))
|
if (ImGui.Button("Refresh Character List"))
|
||||||
_task = RefreshCharacterList();
|
_task = RefreshCharacterList();
|
||||||
|
|
||||||
var checkSpacing = ImGui.GetStyle().ItemInnerSpacing.X;
|
var checkSpacing = ImGui.GetStyle().ItemInnerSpacing.X;
|
||||||
var checkPadding = 10 * ImGuiHelpers.GlobalScale + ImGui.GetStyle().ItemSpacing.X;
|
var checkPadding = 10 * Im.Style.GlobalScale + ImGui.GetStyle().ItemSpacing.X;
|
||||||
ImGui.SameLine(0, checkPadding);
|
ImGui.SameLine(0, checkPadding);
|
||||||
|
|
||||||
using (ImRaii.PushId("TreeCategoryFilter"))
|
using (ImRaii.PushId("TreeCategoryFilter"))
|
||||||
{
|
{
|
||||||
var categoryFilter = (uint)_categoryFilter;
|
var categoryFilter = (uint)_categoryFilter;
|
||||||
foreach (var category in Enum.GetValues<TreeCategory>())
|
foreach (var category in Enum.GetValues<TreeCategory>())
|
||||||
{
|
{
|
||||||
using var c = ImGuiColor.CheckMark.Push(CategoryColor(category).Value());
|
using var c = ImGuiColor.CheckMark.Push(CategoryColor(category).Value());
|
||||||
ImGui.CheckboxFlags($"##{category}", ref categoryFilter, (uint)category);
|
ImGui.CheckboxFlags($"##{category}", ref categoryFilter, (uint)category);
|
||||||
ImGuiUtil.HoverTooltip(CategoryFilterDescription(category));
|
ImGuiUtil.HoverTooltip(CategoryFilterDescription(category));
|
||||||
ImGui.SameLine(0.0f, checkSpacing);
|
ImGui.SameLine(0.0f, checkSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
_categoryFilter = (TreeCategory)categoryFilter;
|
_categoryFilter = (TreeCategory)categoryFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine(0, checkPadding);
|
ImGui.SameLine(0, checkPadding);
|
||||||
|
|
||||||
var filterChanged = false;
|
var filterChanged = false;
|
||||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - yOffset);
|
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - yOffset);
|
||||||
using (ImRaii.Child("##typeFilter", new Vector2(ImGui.GetContentRegionAvail().X, ChangedItemDrawer.TypeFilterIconSize.Y)))
|
using (ImRaii.Child("##typeFilter", new Vector2(Im.ContentRegion.Available.X, ChangedItemDrawer.TypeFilterIconSize.Y)))
|
||||||
{
|
{
|
||||||
filterChanged |= changedItemDrawer.DrawTypeFilter(ref _typeFilter);
|
filterChanged |= changedItemDrawer.DrawTypeFilter(ref _typeFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
var fieldWidth = (ImGui.GetContentRegionAvail().X - checkSpacing * 2.0f - ImGui.GetFrameHeightWithSpacing()) / 2.0f;
|
var fieldWidth = (Im.ContentRegion.Available.X - checkSpacing * 2.0f - Im.Style.FrameHeightWithSpacing) / 2.0f;
|
||||||
ImGui.SetNextItemWidth(fieldWidth);
|
ImGui.SetNextItemWidth(fieldWidth);
|
||||||
filterChanged |= ImGui.InputTextWithHint("##TreeNameFilter", "Filter by Character/Entity Name...", ref _nameFilter, 128);
|
filterChanged |= ImGui.InputTextWithHint("##TreeNameFilter", "Filter by Character/Entity Name...", ref _nameFilter, 128);
|
||||||
ImGui.SameLine(0, checkSpacing);
|
ImGui.SameLine(0, checkSpacing);
|
||||||
ImGui.SetNextItemWidth(fieldWidth);
|
ImGui.SetNextItemWidth(fieldWidth);
|
||||||
filterChanged |= ImGui.InputTextWithHint("##NodeFilter", "Filter by Item/Part Name or Path...", ref _nodeFilter, 128);
|
filterChanged |= ImGui.InputTextWithHint("##NodeFilter", "Filter by Item/Part Name or Path...", ref _nodeFilter, 128);
|
||||||
ImGui.SameLine(0, checkSpacing);
|
ImGui.SameLine(0, checkSpacing);
|
||||||
incognito.DrawToggle(ImGui.GetFrameHeightWithSpacing());
|
incognito.DrawToggle(Im.Style.FrameHeightWithSpacing);
|
||||||
|
|
||||||
if (filterChanged)
|
if (filterChanged)
|
||||||
_filterCache.Clear();
|
_filterCache.Clear();
|
||||||
|
|
@ -247,7 +247,7 @@ public class ResourceTreeViewer(
|
||||||
ChangedItemIconFlag parentFilterIconFlag)
|
ChangedItemIconFlag parentFilterIconFlag)
|
||||||
{
|
{
|
||||||
var debugMode = config.DebugMode;
|
var debugMode = config.DebugMode;
|
||||||
var frameHeight = ImGui.GetFrameHeight();
|
var frameHeight = Im.Style.FrameHeight;
|
||||||
|
|
||||||
foreach (var (index, resourceNode) in resourceNodes.Index())
|
foreach (var (index, resourceNode) in resourceNodes.Index())
|
||||||
{
|
{
|
||||||
|
|
@ -273,7 +273,7 @@ public class ResourceTreeViewer(
|
||||||
{
|
{
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
var icon = (unfolded ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight).ToIconString();
|
var icon = (unfolded ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight).ToIconString();
|
||||||
var offset = (ImGui.GetFrameHeight() - ImGui.CalcTextSize(icon).X) / 2;
|
var offset = (Im.Style.FrameHeight - ImGui.CalcTextSize(icon).X) / 2;
|
||||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + offset);
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + offset);
|
||||||
ImGui.TextUnformatted(icon);
|
ImGui.TextUnformatted(icon);
|
||||||
ImGui.SameLine(0f, offset + ImGui.GetStyle().ItemInnerSpacing.X);
|
ImGui.SameLine(0f, offset + ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
|
|
@ -286,7 +286,7 @@ public class ResourceTreeViewer(
|
||||||
unfolded = true;
|
unfolded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(ImGui.GetFrameHeight()));
|
ImGui.Dummy(new Vector2(Im.Style.FrameHeight));
|
||||||
ImGui.SameLine(0f, ImGui.GetStyle().ItemInnerSpacing.X);
|
ImGui.SameLine(0f, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,7 +317,7 @@ public class ResourceTreeViewer(
|
||||||
0 => "(none)",
|
0 => "(none)",
|
||||||
1 => resourceNode.GamePath.ToString(),
|
1 => resourceNode.GamePath.ToString(),
|
||||||
_ => "(multiple)",
|
_ => "(multiple)",
|
||||||
}, false, hasGamePaths ? 0 : ImGuiSelectableFlags.Disabled, new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
}, false, hasGamePaths ? 0 : ImGuiSelectableFlags.Disabled, new Vector2(Im.ContentRegion.Available.X, frameHeight));
|
||||||
if (hasGamePaths)
|
if (hasGamePaths)
|
||||||
{
|
{
|
||||||
var allPaths = string.Join('\n', resourceNode.PossibleGamePaths);
|
var allPaths = string.Join('\n', resourceNode.PossibleGamePaths);
|
||||||
|
|
@ -338,7 +338,7 @@ public class ResourceTreeViewer(
|
||||||
using (ImGuiColor.Text.Push((hasMod ? ColorId.NewMod : ColorId.DisabledMod).Value()))
|
using (ImGuiColor.Text.Push((hasMod ? ColorId.NewMod : ColorId.DisabledMod).Value()))
|
||||||
{
|
{
|
||||||
ImUtf8.Selectable(modName, false, ImGuiSelectableFlags.AllowItemOverlap,
|
ImUtf8.Selectable(modName, false, ImGuiSelectableFlags.AllowItemOverlap,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
new Vector2(Im.ContentRegion.Available.X, frameHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -355,17 +355,17 @@ public class ResourceTreeViewer(
|
||||||
if (secondLastDirectorySeparator >= 0)
|
if (secondLastDirectorySeparator >= 0)
|
||||||
path = $"…{path.AsSpan(secondLastDirectorySeparator)}";
|
path = $"…{path.AsSpan(secondLastDirectorySeparator)}";
|
||||||
ImGui.Selectable(path.AsSpan(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
ImGui.Selectable(path.AsSpan(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
new Vector2(Im.ContentRegion.Available.X, frameHeight));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.Selectable(resourceNode.FullPath.ToPath(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
ImGui.Selectable(resourceNode.FullPath.ToPath(), false, ImGuiSelectableFlags.AllowItemOverlap,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
new Vector2(Im.ContentRegion.Available.X, frameHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemClicked())
|
if (ImGui.IsItemClicked())
|
||||||
ImGui.SetClipboardText(resourceNode.FullPath.ToPath());
|
ImGui.SetClipboardText(resourceNode.FullPath.ToPath());
|
||||||
if (hasMod && ImGui.IsItemClicked(ImGuiMouseButton.Right) && ImGui.GetIO().KeyCtrl)
|
if (hasMod && Im.Item.RightClicked() && ImGui.GetIO().KeyCtrl)
|
||||||
communicator.SelectTab.Invoke(new SelectTab.Arguments(TabType.Mods, mod));
|
communicator.SelectTab.Invoke(new SelectTab.Arguments(TabType.Mods, mod));
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(
|
ImGuiUtil.HoverTooltip(
|
||||||
|
|
@ -374,7 +374,7 @@ public class ResourceTreeViewer(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImUtf8.Selectable(GetPathStatusLabel(resourceNode.FullPathStatus), false, ImGuiSelectableFlags.Disabled,
|
ImUtf8.Selectable(GetPathStatusLabel(resourceNode.FullPathStatus), false, ImGuiSelectableFlags.Disabled,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, frameHeight));
|
new Vector2(Im.ContentRegion.Available.X, frameHeight));
|
||||||
ImGuiUtil.HoverTooltip(
|
ImGuiUtil.HoverTooltip(
|
||||||
$"{GetPathStatusDescription(resourceNode.FullPathStatus)}{GetAdditionalDataSuffix(resourceNode.AdditionalData)}");
|
$"{GetPathStatusDescription(resourceNode.FullPathStatus)}{GetAdditionalDataSuffix(resourceNode.AdditionalData)}");
|
||||||
}
|
}
|
||||||
|
|
@ -383,7 +383,7 @@ public class ResourceTreeViewer(
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing,
|
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing,
|
||||||
ImGui.GetStyle().ItemSpacing with { X = 3 * ImGuiHelpers.GlobalScale });
|
ImGui.GetStyle().ItemSpacing with { X = 3 * Im.Style.GlobalScale });
|
||||||
DrawActions(resourceNode, new Vector2(frameHeight));
|
DrawActions(resourceNode, new Vector2(frameHeight));
|
||||||
|
|
||||||
if (unfolded)
|
if (unfolded)
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,8 @@ public class ChangedItemDrawer : IDisposable, IUiService
|
||||||
public void ChangedItemHandling(IIdentifiedObjectData data, bool leftClicked)
|
public void ChangedItemHandling(IIdentifiedObjectData data, bool leftClicked)
|
||||||
{
|
{
|
||||||
var ret = leftClicked ? MouseButton.Left : MouseButton.None;
|
var ret = leftClicked ? MouseButton.Left : MouseButton.None;
|
||||||
ret = Im.Item.Clicked(ImSharp.MouseButton.Right) ? MouseButton.Right : ret;
|
ret = Im.Item.RightClicked() ? MouseButton.Right : ret;
|
||||||
ret = Im.Item.Clicked(ImSharp.MouseButton.Middle) ? MouseButton.Middle : ret;
|
ret = Im.Item.MiddleClicked() ? MouseButton.Middle : ret;
|
||||||
if (ret != MouseButton.None)
|
if (ret != MouseButton.None)
|
||||||
_communicator.ChangedItemClick.Invoke(new ChangedItemClick.Arguments(ret, data));
|
_communicator.ChangedItemClick.Invoke(new ChangedItemClick.Arguments(ret, data));
|
||||||
if (!Im.Item.Hovered())
|
if (!Im.Item.Hovered())
|
||||||
|
|
@ -199,7 +199,7 @@ public class ChangedItemDrawer : IDisposable, IUiService
|
||||||
});
|
});
|
||||||
if (Im.Item.Clicked())
|
if (Im.Item.Clicked())
|
||||||
{
|
{
|
||||||
typeFilter = typeFilter == ChangedItemFlagExtensions.AllFlags ? 0 : ChangedItemFlagExtensions.AllFlags;
|
typeFilter = typeFilter is ChangedItemFlagExtensions.AllFlags ? 0 : ChangedItemFlagExtensions.AllFlags;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Dalamud.Interface;
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
|
|
@ -9,34 +9,34 @@ public static class Combos
|
||||||
{
|
{
|
||||||
// Different combos to use with enums.
|
// Different combos to use with enums.
|
||||||
public static bool Race(string label, ModelRace current, out ModelRace race, float unscaledWidth = 100)
|
public static bool Race(string label, ModelRace current, out ModelRace race, float unscaledWidth = 100)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out race, RaceEnumExtensions.ToName, 1);
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out race, RaceEnumExtensions.ToName, 1);
|
||||||
|
|
||||||
public static bool Gender(string label, Gender current, out Gender gender, float unscaledWidth = 120)
|
public static bool Gender(string label, Gender current, out Gender gender, float unscaledWidth = 120)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth, current, out gender, RaceEnumExtensions.ToName, 1);
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth, current, out gender, RaceEnumExtensions.ToName, 1);
|
||||||
|
|
||||||
public static bool EqdpEquipSlot(string label, EquipSlot current, out EquipSlot slot, float unscaledWidth = 100)
|
public static bool EqdpEquipSlot(string label, EquipSlot current, out EquipSlot slot, float unscaledWidth = 100)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out slot, EquipSlotExtensions.EqdpSlots,
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out slot, EquipSlotExtensions.EqdpSlots,
|
||||||
EquipSlotExtensions.ToName);
|
EquipSlotExtensions.ToName);
|
||||||
|
|
||||||
public static bool EqpEquipSlot(string label, EquipSlot current, out EquipSlot slot, float unscaledWidth = 100)
|
public static bool EqpEquipSlot(string label, EquipSlot current, out EquipSlot slot, float unscaledWidth = 100)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out slot, EquipSlotExtensions.EquipmentSlots,
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out slot, EquipSlotExtensions.EquipmentSlots,
|
||||||
EquipSlotExtensions.ToName);
|
EquipSlotExtensions.ToName);
|
||||||
|
|
||||||
public static bool AccessorySlot(string label, EquipSlot current, out EquipSlot slot, float unscaledWidth = 100)
|
public static bool AccessorySlot(string label, EquipSlot current, out EquipSlot slot, float unscaledWidth = 100)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out slot, EquipSlotExtensions.AccessorySlots,
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out slot, EquipSlotExtensions.AccessorySlots,
|
||||||
EquipSlotExtensions.ToName);
|
EquipSlotExtensions.ToName);
|
||||||
|
|
||||||
public static bool SubRace(string label, SubRace current, out SubRace subRace, float unscaledWidth = 150)
|
public static bool SubRace(string label, SubRace current, out SubRace subRace, float unscaledWidth = 150)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out subRace, RaceEnumExtensions.ToName, 1);
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out subRace, RaceEnumExtensions.ToName, 1);
|
||||||
|
|
||||||
public static bool RspAttribute(string label, RspAttribute current, out RspAttribute attribute, float unscaledWidth = 200)
|
public static bool RspAttribute(string label, RspAttribute current, out RspAttribute attribute, float unscaledWidth = 200)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out attribute,
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out attribute,
|
||||||
RspAttributeExtensions.ToFullString, 0, 1);
|
RspAttributeExtensions.ToFullString, 0, 1);
|
||||||
|
|
||||||
public static bool EstSlot(string label, EstType current, out EstType attribute, float unscaledWidth = 200)
|
public static bool EstSlot(string label, EstType current, out EstType attribute, float unscaledWidth = 200)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out attribute);
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out attribute);
|
||||||
|
|
||||||
public static bool ImcType(string label, ObjectType current, out ObjectType type, float unscaledWidth = 110)
|
public static bool ImcType(string label, ObjectType current, out ObjectType type, float unscaledWidth = 110)
|
||||||
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * UiHelpers.Scale, current, out type, ObjectTypeExtensions.ValidImcTypes,
|
=> ImGuiUtil.GenericEnumCombo(label, unscaledWidth * Im.Style.GlobalScale, current, out type, ObjectTypeExtensions.ValidImcTypes,
|
||||||
ObjectTypeExtensions.ToName);
|
ObjectTypeExtensions.ToName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
||||||
namespace Penumbra.UI.Classes;
|
namespace Penumbra.UI.Classes;
|
||||||
|
|
@ -12,18 +10,18 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
using var header = ImUtf8.CollapsingHeaderId("Migration"u8);
|
using var header = Im.Tree.HeaderId("Migration"u8);
|
||||||
if (!header)
|
if (!header)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_buttonSize = UiHelpers.InputTextWidth;
|
_buttonSize = UiHelpers.InputTextWidth;
|
||||||
DrawSettings();
|
DrawSettings();
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
DrawMdlMigration();
|
DrawMdlMigration();
|
||||||
DrawMdlRestore();
|
DrawMdlRestore();
|
||||||
DrawMdlCleanup();
|
DrawMdlCleanup();
|
||||||
// TODO enable when this works
|
// TODO enable when this works
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
//DrawMtrlMigration();
|
//DrawMtrlMigration();
|
||||||
DrawMtrlRestore();
|
DrawMtrlRestore();
|
||||||
DrawMtrlCleanup();
|
DrawMtrlCleanup();
|
||||||
|
|
@ -32,26 +30,26 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
private void DrawSettings()
|
private void DrawSettings()
|
||||||
{
|
{
|
||||||
var value = config.MigrateImportedModelsToV6;
|
var value = config.MigrateImportedModelsToV6;
|
||||||
if (ImUtf8.Checkbox("Automatically Migrate V5 Models to V6 on Import"u8, ref value))
|
if (Im.Checkbox("Automatically Migrate V5 Models to V6 on Import"u8, ref value))
|
||||||
{
|
{
|
||||||
config.MigrateImportedModelsToV6 = value;
|
config.MigrateImportedModelsToV6 = value;
|
||||||
config.Save();
|
config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImUtf8.HoverTooltip("This increments the version marker and restructures the bone table to the new version."u8);
|
Im.Tooltip.OnHover("This increments the version marker and restructures the bone table to the new version."u8);
|
||||||
|
|
||||||
// TODO enable when this works
|
// TODO enable when this works
|
||||||
//value = config.MigrateImportedMaterialsToLegacy;
|
//value = config.MigrateImportedMaterialsToLegacy;
|
||||||
//if (ImUtf8.Checkbox("Automatically Migrate Materials to Dawntrail on Import"u8, ref value))
|
//if (Im.Checkbox("Automatically Migrate Materials to Dawntrail on Import"u8, ref value))
|
||||||
//{
|
//{
|
||||||
// config.MigrateImportedMaterialsToLegacy = value;
|
// config.MigrateImportedMaterialsToLegacy = value;
|
||||||
// config.Save();
|
// config.Save();
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//ImUtf8.HoverTooltip(
|
//Im.Tooltip.OnHover(
|
||||||
// "This currently only increases the color-table size and switches the shader from 'character.shpk' to 'characterlegacy.shpk', if the former is used."u8);
|
// "This currently only increases the color-table size and switches the shader from 'character.shpk' to 'characterlegacy.shpk', if the former is used."u8);
|
||||||
|
|
||||||
ImUtf8.Checkbox("Create Backups During Manual Migration", ref _createBackups);
|
Im.Checkbox("Create Backups During Manual Migration"u8, ref _createBackups);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlySpan<byte> MigrationTooltip
|
private static ReadOnlySpan<byte> MigrationTooltip
|
||||||
|
|
@ -59,10 +57,10 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
private void DrawMdlMigration()
|
private void DrawMdlMigration()
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Migrate Model Files From V5 to V6"u8, "\0"u8, _buttonSize, migrationManager.IsRunning))
|
if (ImEx.Button("Migrate Model Files From V5 to V6"u8, _buttonSize, StringU8.Empty, migrationManager.IsRunning))
|
||||||
migrationManager.MigrateMdlDirectory(config.ModDirectory, _createBackups);
|
migrationManager.MigrateMdlDirectory(config.ModDirectory, _createBackups);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
Im.Line.SameInner();
|
||||||
DrawCancelButton(MigrationManager.TaskType.MdlMigration, "Cancel the migration. This does not revert already finished migrations."u8);
|
DrawCancelButton(MigrationManager.TaskType.MdlMigration, "Cancel the migration. This does not revert already finished migrations."u8);
|
||||||
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MdlMigration, IsRunning: true });
|
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MdlMigration, IsRunning: true });
|
||||||
DrawData(migrationManager.MdlMigration, "No model files found."u8, "migrated"u8);
|
DrawData(migrationManager.MdlMigration, "No model files found."u8, "migrated"u8);
|
||||||
|
|
@ -70,10 +68,10 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
private void DrawMtrlMigration()
|
private void DrawMtrlMigration()
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Migrate Material Files to Dawntrail"u8, "\0"u8, _buttonSize, migrationManager.IsRunning))
|
if (ImEx.Button("Migrate Material Files to Dawntrail"u8, _buttonSize, StringU8.Empty, migrationManager.IsRunning))
|
||||||
migrationManager.MigrateMtrlDirectory(config.ModDirectory, _createBackups);
|
migrationManager.MigrateMtrlDirectory(config.ModDirectory, _createBackups);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
Im.Line.SameInner();
|
||||||
DrawCancelButton(MigrationManager.TaskType.MtrlMigration, MigrationTooltip);
|
DrawCancelButton(MigrationManager.TaskType.MtrlMigration, MigrationTooltip);
|
||||||
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MtrlMigration, IsRunning: true });
|
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MtrlMigration, IsRunning: true });
|
||||||
DrawData(migrationManager.MtrlMigration, "No material files found."u8, "migrated"u8);
|
DrawData(migrationManager.MtrlMigration, "No material files found."u8, "migrated"u8);
|
||||||
|
|
@ -85,10 +83,10 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
private void DrawMdlCleanup()
|
private void DrawMdlCleanup()
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Delete Existing Model Backup Files"u8, "\0"u8, _buttonSize, migrationManager.IsRunning))
|
if (ImEx.Button("Delete Existing Model Backup Files"u8, _buttonSize, StringU8.Empty, migrationManager.IsRunning))
|
||||||
migrationManager.CleanMdlBackups(config.ModDirectory);
|
migrationManager.CleanMdlBackups(config.ModDirectory);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
Im.Line.SameInner();
|
||||||
DrawCancelButton(MigrationManager.TaskType.MdlCleanup, CleanupTooltip);
|
DrawCancelButton(MigrationManager.TaskType.MdlCleanup, CleanupTooltip);
|
||||||
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MdlCleanup, IsRunning: true });
|
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MdlCleanup, IsRunning: true });
|
||||||
DrawData(migrationManager.MdlCleanup, "No model backup files found."u8, "deleted"u8);
|
DrawData(migrationManager.MdlCleanup, "No model backup files found."u8, "deleted"u8);
|
||||||
|
|
@ -96,10 +94,10 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
private void DrawMtrlCleanup()
|
private void DrawMtrlCleanup()
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Delete Existing Material Backup Files"u8, "\0"u8, _buttonSize, migrationManager.IsRunning))
|
if (ImEx.Button("Delete Existing Material Backup Files"u8, _buttonSize, StringU8.Empty, migrationManager.IsRunning))
|
||||||
migrationManager.CleanMtrlBackups(config.ModDirectory);
|
migrationManager.CleanMtrlBackups(config.ModDirectory);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
Im.Line.SameInner();
|
||||||
DrawCancelButton(MigrationManager.TaskType.MtrlCleanup, CleanupTooltip);
|
DrawCancelButton(MigrationManager.TaskType.MtrlCleanup, CleanupTooltip);
|
||||||
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MtrlCleanup, IsRunning: true });
|
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MtrlCleanup, IsRunning: true });
|
||||||
DrawData(migrationManager.MtrlCleanup, "No material backup files found."u8, "deleted"u8);
|
DrawData(migrationManager.MtrlCleanup, "No material backup files found."u8, "deleted"u8);
|
||||||
|
|
@ -110,10 +108,10 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
private void DrawMdlRestore()
|
private void DrawMdlRestore()
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Restore Model Backups"u8, "\0"u8, _buttonSize, migrationManager.IsRunning))
|
if (ImEx.Button("Restore Model Backups"u8, _buttonSize, StringU8.Empty, migrationManager.IsRunning))
|
||||||
migrationManager.RestoreMdlBackups(config.ModDirectory);
|
migrationManager.RestoreMdlBackups(config.ModDirectory);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
Im.Line.SameInner();
|
||||||
DrawCancelButton(MigrationManager.TaskType.MdlRestoration, RestorationTooltip);
|
DrawCancelButton(MigrationManager.TaskType.MdlRestoration, RestorationTooltip);
|
||||||
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MdlRestoration, IsRunning: true });
|
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MdlRestoration, IsRunning: true });
|
||||||
DrawData(migrationManager.MdlRestoration, "No model backup files found."u8, "restored"u8);
|
DrawData(migrationManager.MdlRestoration, "No model backup files found."u8, "restored"u8);
|
||||||
|
|
@ -121,10 +119,10 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
|
|
||||||
private void DrawMtrlRestore()
|
private void DrawMtrlRestore()
|
||||||
{
|
{
|
||||||
if (ImUtf8.ButtonEx("Restore Material Backups"u8, "\0"u8, _buttonSize, migrationManager.IsRunning))
|
if (ImEx.Button("Restore Material Backups"u8, _buttonSize, StringU8.Empty, migrationManager.IsRunning))
|
||||||
migrationManager.RestoreMtrlBackups(config.ModDirectory);
|
migrationManager.RestoreMtrlBackups(config.ModDirectory);
|
||||||
|
|
||||||
ImUtf8.SameLineInner();
|
Im.Line.SameInner();
|
||||||
DrawCancelButton(MigrationManager.TaskType.MtrlRestoration, RestorationTooltip);
|
DrawCancelButton(MigrationManager.TaskType.MtrlRestoration, RestorationTooltip);
|
||||||
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MtrlRestoration, IsRunning: true });
|
DrawSpinner(migrationManager is { CurrentTask: MigrationManager.TaskType.MtrlRestoration, IsRunning: true });
|
||||||
DrawData(migrationManager.MtrlRestoration, "No material backup files found."u8, "restored"u8);
|
DrawData(migrationManager.MtrlRestoration, "No material backup files found."u8, "restored"u8);
|
||||||
|
|
@ -136,13 +134,13 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImEx.Spinner("Spinner"u8, ImGui.GetTextLineHeight() / 2, 2, ImGuiColor.Text.Get());
|
ImEx.Spinner("Spinner"u8, Im.Style.TextHeight / 2, 2, ImGuiColor.Text.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCancelButton(MigrationManager.TaskType task, ReadOnlySpan<byte> tooltip)
|
private void DrawCancelButton(MigrationManager.TaskType task, ReadOnlySpan<byte> tooltip)
|
||||||
{
|
{
|
||||||
using var _ = ImUtf8.PushId((int)task);
|
using var _ = Im.Id.Push((int)task);
|
||||||
if (ImUtf8.ButtonEx("Cancel"u8, tooltip, disabled: !migrationManager.IsRunning || task != migrationManager.CurrentTask))
|
if (ImEx.Button("Cancel"u8, Vector2.Zero, tooltip, !migrationManager.IsRunning || task != migrationManager.CurrentTask))
|
||||||
migrationManager.Cancel();
|
migrationManager.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,14 +148,14 @@ public class MigrationSectionDrawer(MigrationManager migrationManager, Configura
|
||||||
{
|
{
|
||||||
if (!data.HasData)
|
if (!data.HasData)
|
||||||
{
|
{
|
||||||
ImUtf8.IconDummy();
|
Im.FrameDummy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var total = data.Total;
|
var total = data.Total;
|
||||||
if (total == 0)
|
if (total is 0)
|
||||||
ImUtf8.TextFrameAligned(empty);
|
ImEx.TextFrameAligned(empty);
|
||||||
else
|
else
|
||||||
ImUtf8.TextFrameAligned($"{data.Changed} files {action}, {data.Failed} files failed, {total} files found.");
|
ImEx.TextFrameAligned($"{data.Changed} files {action}, {data.Failed} files failed, {total} files found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
using Dalamud.Interface.GameFonts;
|
using Dalamud.Interface.GameFonts;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.ManagedFontAtlas;
|
using Dalamud.Interface.ManagedFontAtlas;
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
|
||||||
using OtterGui.Raii;
|
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
using Penumbra.GameData.Actors;
|
using Penumbra.GameData.Actors;
|
||||||
|
|
@ -40,10 +34,9 @@ public sealed class CollectionPanel(
|
||||||
private readonly InheritanceUi _inheritanceUi = new(manager, incognito);
|
private readonly InheritanceUi _inheritanceUi = new(manager, incognito);
|
||||||
private readonly IFontHandle _nameFont = pi.UiBuilder.FontAtlas.NewGameFontHandle(new GameFontStyle(GameFontFamilyAndSize.Jupiter23));
|
private readonly IFontHandle _nameFont = pi.UiBuilder.FontAtlas.NewGameFontHandle(new GameFontStyle(GameFontFamilyAndSize.Jupiter23));
|
||||||
|
|
||||||
private static readonly IReadOnlyDictionary<CollectionType, (string Name, uint Border)> Buttons = CreateButtons();
|
private static readonly IReadOnlyDictionary<CollectionType, (StringU8 Name, Vector4 Border)> Buttons = CreateButtons();
|
||||||
private static readonly IReadOnlyList<(CollectionType, bool, bool, string, uint)> AdvancedTree = CreateTree();
|
private static readonly IReadOnlyList<(CollectionType, bool, bool, StringU8, Vector4)> AdvancedTree = CreateTree();
|
||||||
private readonly List<(CollectionType Type, ActorIdentifier Identifier)> _inUseCache = [];
|
private readonly List<(CollectionType Type, ActorIdentifier Identifier)> _inUseCache = [];
|
||||||
private string? _newName;
|
|
||||||
|
|
||||||
private int _draggedIndividualAssignment = -1;
|
private int _draggedIndividualAssignment = -1;
|
||||||
|
|
||||||
|
|
@ -61,7 +54,7 @@ public sealed class CollectionPanel(
|
||||||
Im.TextWrapped(
|
Im.TextWrapped(
|
||||||
"There are functions you can assign these collections to, so different mod configurations apply for different things.\n"u8
|
"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."u8);
|
+ "You can assign an existing collection to such a function by clicking the function or dragging the collection over."u8);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
|
|
||||||
var buttonWidth = new Vector2(200 * Im.Style.GlobalScale, 2 * Im.Style.FrameHeightWithSpacing);
|
var buttonWidth = new Vector2(200 * Im.Style.GlobalScale, 2 * Im.Style.FrameHeightWithSpacing);
|
||||||
using var style = Im.Style.Push(ImStyleDouble.ButtonTextAlign, Vector2.Zero)
|
using var style = Im.Style.Push(ImStyleDouble.ButtonTextAlign, Vector2.Zero)
|
||||||
|
|
@ -74,11 +67,12 @@ public sealed class CollectionPanel(
|
||||||
DrawSimpleCollectionButton(CollectionType.MaleNonPlayerCharacter, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.MaleNonPlayerCharacter, buttonWidth);
|
||||||
DrawSimpleCollectionButton(CollectionType.FemaleNonPlayerCharacter, buttonWidth);
|
DrawSimpleCollectionButton(CollectionType.FemaleNonPlayerCharacter, buttonWidth);
|
||||||
|
|
||||||
ImGuiUtil.DrawColoredText(("Individual ", ColorId.NewMod.Value().Color),
|
ImEx.TextMultiColored("Individual"u8, ColorId.NewMod.Value())
|
||||||
("Assignments take precedence before anything else and only apply to one specific character or monster.", 0));
|
.Then("Assignments take precedence before anything else and only apply to one specific character or monster."u8)
|
||||||
ImGui.Dummy(Vector2.UnitX);
|
.End();
|
||||||
|
Im.Dummy(1);
|
||||||
|
|
||||||
var specialWidth = buttonWidth with { X = 275 * ImGuiHelpers.GlobalScale };
|
var specialWidth = buttonWidth with { X = 275 * Im.Style.GlobalScale };
|
||||||
DrawCurrentCharacter(specialWidth);
|
DrawCurrentCharacter(specialWidth);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
DrawCurrentTarget(specialWidth);
|
DrawCurrentTarget(specialWidth);
|
||||||
|
|
@ -107,31 +101,31 @@ public sealed class CollectionPanel(
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
{
|
{
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
ImGui.TextUnformatted("Currently Active Advanced Assignments");
|
Im.Text("Currently Active Advanced Assignments"u8);
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawButton(name, type, buttonWidth, border, ActorIdentifier.Invalid, 's', collection);
|
DrawButton(name, type, buttonWidth, border, ActorIdentifier.Invalid, 's', collection);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGui.GetContentRegionAvail().X < buttonWidth.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X)
|
if (Im.ContentRegion.Available.X < buttonWidth.X + Im.Style.ItemSpacing.X + Im.Style.WindowPadding.X)
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Draw the panel containing new and existing individual assignments. </summary>
|
/// <summary> Draw the panel containing new and existing individual assignments. </summary>
|
||||||
public void DrawIndividualPanel()
|
public void DrawIndividualPanel()
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, Vector2.Zero)
|
using var style = ImStyleDouble.ButtonTextAlign.Push(Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale);
|
.Push(ImStyleSingle.FrameBorderThickness, Im.Style.GlobalScale);
|
||||||
var width = new Vector2(300 * ImGuiHelpers.GlobalScale, 2 * ImGui.GetTextLineHeightWithSpacing());
|
var width = new Vector2(300 * Im.Style.GlobalScale, 2 * Im.Style.TextHeightWithSpacing);
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
DrawCurrentCharacter(width);
|
DrawCurrentCharacter(width);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
DrawCurrentTarget(width);
|
DrawCurrentTarget(width);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
style.Pop();
|
style.Pop();
|
||||||
_individualAssignmentUi.DrawWorldCombo(width.X / 2);
|
_individualAssignmentUi.DrawWorldCombo(width.X / 2);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -143,58 +137,58 @@ public sealed class CollectionPanel(
|
||||||
Im.Line.Same();
|
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);
|
Im.Dummy(Vector2.One);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
style.Push(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale);
|
style.Push(ImStyleSingle.FrameBorderThickness, Im.Style.GlobalScale);
|
||||||
|
|
||||||
DrawNewPlayer(width);
|
DrawNewPlayer(width);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Also check General Settings for UI characters and inheritance through ownership.");
|
Im.TextWrapped("Also check General Settings for UI characters and inheritance through ownership."u8);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
|
|
||||||
DrawNewRetainer(width);
|
DrawNewRetainer(width);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Bell Retainers apply to Mannequins, but not to outdoor retainers, since those only carry their owners name.");
|
Im.TextWrapped("Bell Retainers apply to Mannequins, but not to outdoor retainers, since those only carry their owners name."u8);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
|
|
||||||
DrawNewNpc(width);
|
DrawNewNpc(width);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Some NPCs are available as Battle - and Event NPCs and need to be setup for both if desired.");
|
Im.TextWrapped("Some NPCs are available as Battle - and Event NPCs and need to be setup for both if desired."u8);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
|
|
||||||
DrawNewOwned(width);
|
DrawNewOwned(width);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGuiUtil.TextWrapped("Owned NPCs take precedence before unowned NPCs of the same type.");
|
Im.TextWrapped("Owned NPCs take precedence before unowned NPCs of the same type."u8);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
|
|
||||||
DrawIndividualCollections(width with { X = 200 * ImGuiHelpers.GlobalScale });
|
DrawIndividualCollections(width with { X = 200 * Im.Style.GlobalScale });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Draw the panel containing all special group assignments. </summary>
|
/// <summary> Draw the panel containing all special group assignments. </summary>
|
||||||
public void DrawGroupPanel()
|
public void DrawGroupPanel()
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
using var table = ImRaii.Table("##advanced", 4, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
using var table = Im.Table.Begin("##advanced"u8, 4, TableFlags.SizingFixedFit | TableFlags.RowBackground);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, Vector2.Zero)
|
using var style = ImStyleDouble.ButtonTextAlign.Push(Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale);
|
.Push(ImStyleSingle.FrameBorderThickness, Im.Style.GlobalScale);
|
||||||
|
|
||||||
var buttonWidth = new Vector2(150 * ImGuiHelpers.GlobalScale, 2 * ImGui.GetTextLineHeightWithSpacing());
|
var buttonWidth = new Vector2(150 * Im.Style.GlobalScale, 2 * Im.Style.TextHeightWithSpacing);
|
||||||
var dummy = new Vector2(1, 0);
|
var dummy = new Vector2(1, 0);
|
||||||
|
|
||||||
foreach (var (type, pre, post, name, border) in AdvancedTree)
|
foreach (var (type, pre, post, name, border) in AdvancedTree)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
if (type is CollectionType.Inactive)
|
if (type is CollectionType.Inactive)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pre)
|
if (pre)
|
||||||
ImGui.Dummy(dummy);
|
Im.Dummy(dummy);
|
||||||
DrawAssignmentButton(type, buttonWidth, name, border);
|
DrawAssignmentButton(type, buttonWidth, name, border);
|
||||||
if (post)
|
if (post)
|
||||||
ImGui.Dummy(dummy);
|
Im.Dummy(dummy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,108 +200,103 @@ public sealed class CollectionPanel(
|
||||||
DrawStatistics(collection);
|
DrawStatistics(collection);
|
||||||
DrawCollectionData(collection);
|
DrawCollectionData(collection);
|
||||||
_inheritanceUi.Draw();
|
_inheritanceUi.Draw();
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
DrawInactiveSettingsList(collection);
|
DrawInactiveSettingsList(collection);
|
||||||
DrawSettingsList(collection);
|
DrawSettingsList(collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCollectionData(ModCollection collection)
|
private void DrawCollectionData(ModCollection collection)
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.Zero);
|
Im.Dummy(Vector2.Zero);
|
||||||
ImGui.BeginGroup();
|
using (Im.Group())
|
||||||
ImGui.AlignTextToFramePadding();
|
{
|
||||||
ImGui.TextUnformatted("Name");
|
ImEx.TextFrameAligned("Name"u8);
|
||||||
ImGui.AlignTextToFramePadding();
|
ImEx.TextFrameAligned("Identifier"u8);
|
||||||
ImGui.TextUnformatted("Identifier");
|
}
|
||||||
ImGui.EndGroup();
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGui.BeginGroup();
|
using (Im.Group())
|
||||||
var width = ImGui.GetContentRegionAvail().X;
|
|
||||||
using (ImRaii.Disabled(_collections.DefaultNamed == collection))
|
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f));
|
var width = Im.ContentRegion.Available.X;
|
||||||
var name = _newName ?? collection.Identity.Name;
|
using (Im.Disabled(_collections.DefaultNamed == collection))
|
||||||
ImGui.SetNextItemWidth(width);
|
|
||||||
if (ImGui.InputText("##name", ref name, 128))
|
|
||||||
_newName = name;
|
|
||||||
if (ImGui.IsItemDeactivatedAfterEdit() && _newName != null && _newName != collection.Identity.Name)
|
|
||||||
{
|
{
|
||||||
collection.Identity.Name = _newName;
|
using var style = ImStyleDouble.ButtonTextAlign.Push(new Vector2(0, 0.5f));
|
||||||
saveService.QueueSave(new ModCollectionSave(mods, collection));
|
Im.Item.SetNextWidth(width);
|
||||||
selector.RestoreCollections();
|
if (ImEx.InputOnDeactivation.Text("##name"u8, collection.Identity.Name, out string newName)
|
||||||
_newName = null;
|
&& newName != collection.Identity.Name)
|
||||||
|
{
|
||||||
|
collection.Identity.Name = newName;
|
||||||
|
saveService.QueueSave(new ModCollectionSave(mods, collection));
|
||||||
|
selector.RestoreCollections();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (ImGui.IsItemDeactivated())
|
|
||||||
{
|
|
||||||
_newName = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (_collections.DefaultNamed == collection)
|
|
||||||
ImUtf8.HoverTooltip(ImGuiHoveredFlags.AllowWhenDisabled, "The Default collection can not be renamed."u8);
|
|
||||||
|
|
||||||
var identifier = collection.Identity.Identifier;
|
if (_collections.DefaultNamed == collection)
|
||||||
var fileName = saveService.FileNames.CollectionFile(collection);
|
Im.Tooltip.OnHover(HoveredFlags.AllowWhenDisabled, "The Default collection can not be renamed."u8);
|
||||||
using (ImRaii.PushFont(UiBuilder.MonoFont))
|
|
||||||
{
|
var identifier = collection.Identity.Identifier;
|
||||||
if (ImGui.Button(collection.Identity.Identifier, new Vector2(width, 0)))
|
var fileName = saveService.FileNames.CollectionFile(collection);
|
||||||
try
|
using (Im.Font.PushMono())
|
||||||
{
|
{
|
||||||
Process.Start(new ProcessStartInfo(fileName) { UseShellExecute = true });
|
if (Im.Button(collection.Identity.Identifier, new Vector2(width, 0)))
|
||||||
}
|
try
|
||||||
catch (Exception ex)
|
{
|
||||||
{
|
Process.Start(new ProcessStartInfo(fileName) { UseShellExecute = true });
|
||||||
Penumbra.Messager.NotificationMessage(ex, $"Could not open file {fileName}.", $"Could not open file {fileName}",
|
}
|
||||||
NotificationType.Warning);
|
catch (Exception ex)
|
||||||
}
|
{
|
||||||
|
Penumbra.Messager.NotificationMessage(ex, $"Could not open file {fileName}.", $"Could not open file {fileName}",
|
||||||
|
NotificationType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Im.Item.RightClicked())
|
||||||
|
Im.Clipboard.Set(identifier);
|
||||||
|
|
||||||
|
Im.Tooltip.OnHover(
|
||||||
|
$"Open the file\n\t{fileName}\ncontaining this design in the .json-editor of your choice.\n\nRight-Click to copy identifier to clipboard.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
Im.Dummy(Vector2.Zero);
|
||||||
ImGui.SetClipboardText(identifier);
|
Im.Separator();
|
||||||
|
Im.Dummy(Vector2.Zero);
|
||||||
ImGuiUtil.HoverTooltip(
|
|
||||||
$"Open the file\n\t{fileName}\ncontaining this design in the .json-editor of your choice.\n\nRight-Click to copy identifier to clipboard.");
|
|
||||||
|
|
||||||
ImGui.EndGroup();
|
|
||||||
ImGui.Dummy(Vector2.Zero);
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Dummy(Vector2.Zero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawContext(bool open, ModCollection? collection, CollectionType type, ActorIdentifier identifier, string text, char suffix)
|
private void DrawContext(bool open, ModCollection? collection, CollectionType type, ActorIdentifier identifier, StringU8 text, char suffix)
|
||||||
{
|
{
|
||||||
var label = $"{type}{text}{suffix}";
|
var label = $"{type}{text}{suffix}";
|
||||||
if (open)
|
if (open)
|
||||||
ImGui.OpenPopup(label);
|
Im.Popup.Open(label);
|
||||||
|
|
||||||
using var context = ImRaii.Popup(label);
|
using var context = Im.Popup.Begin(label);
|
||||||
if (!context)
|
if (!context)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (var color = ImGuiColor.Text.Push(Colors.DiscordColor))
|
using (ImGuiColor.Text.Push(Colors.DiscordColor))
|
||||||
{
|
{
|
||||||
if (ImGui.MenuItem("Use no mods."))
|
if (Im.Menu.Item("Use no mods."u8))
|
||||||
_active.SetCollection(ModCollection.Empty, type, _active.Individuals.GetGroup(identifier));
|
_active.SetCollection(ModCollection.Empty, type, _active.Individuals.GetGroup(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (collection != null && type.CanBeRemoved())
|
if (collection is not null && type.CanBeRemoved())
|
||||||
{
|
{
|
||||||
using var color = ImGuiColor.Text.Push(Colors.RegexWarningBorder);
|
using var color = ImGuiColor.Text.Push(Colors.RegexWarningBorder);
|
||||||
if (ImGui.MenuItem("Remove this assignment."))
|
if (Im.Menu.Item("Remove this assignment."u8))
|
||||||
_active.SetCollection(null, type, _active.Individuals.GetGroup(identifier));
|
_active.SetCollection(null, type, _active.Individuals.GetGroup(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var coll in _collections.OrderBy(c => c.Identity.Name))
|
foreach (var coll in _collections.OrderBy(c => c.Identity.Name))
|
||||||
{
|
{
|
||||||
if (coll != collection && ImGui.MenuItem($"Use {coll.Identity.Name}."))
|
if (coll != collection && Im.Menu.Item($"Use {coll.Identity.Name}."))
|
||||||
_active.SetCollection(coll, type, _active.Individuals.GetGroup(identifier));
|
_active.SetCollection(coll, type, _active.Individuals.GetGroup(identifier));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawButton(string text, CollectionType type, Vector2 width, Rgba32 borderColor, ActorIdentifier id, char suffix,
|
private void DrawButton(StringU8 text, CollectionType type, Vector2 width, Rgba32 borderColor, ActorIdentifier id, char suffix,
|
||||||
ModCollection? collection = null)
|
ModCollection? collection = null)
|
||||||
{
|
{
|
||||||
using var group = ImRaii.Group();
|
using var group = Im.Group();
|
||||||
var invalid = type == CollectionType.Individual && !id.IsValid;
|
var invalid = type is CollectionType.Individual && !id.IsValid;
|
||||||
var redundancy = _active.RedundancyCheck(type, id);
|
var redundancy = _active.RedundancyCheck(type, id);
|
||||||
collection ??= _active.ByType(type, id);
|
collection ??= _active.ByType(type, id);
|
||||||
using var color = ImGuiColor.Button.Push(
|
using var color = ImGuiColor.Button.Push(
|
||||||
|
|
@ -321,38 +310,36 @@ public sealed class CollectionPanel(
|
||||||
? ColorId.NoModsAssignment.Value()
|
? ColorId.NoModsAssignment.Value()
|
||||||
: ImGuiColor.Button.Get(), !invalid)
|
: ImGuiColor.Button.Get(), !invalid)
|
||||||
.Push(ImGuiColor.Border, borderColor == 0 ? ImGuiColor.TextDisabled.Get().Color : borderColor);
|
.Push(ImGuiColor.Border, borderColor == 0 ? ImGuiColor.TextDisabled.Get().Color : borderColor);
|
||||||
using var disabled = ImRaii.Disabled(invalid);
|
using var disabled = Im.Disabled(invalid);
|
||||||
var button = ImGui.Button(text, width) || ImGui.IsItemClicked(ImGuiMouseButton.Right);
|
var button = Im.Button(text, width) || Im.Item.RightClicked();
|
||||||
var hovered = redundancy.Length > 0 && ImGui.IsItemHovered();
|
var hovered = redundancy.Length > 0 && Im.Item.Hovered();
|
||||||
DrawIndividualDragSource(text, id);
|
DrawIndividualDragSource(text, id);
|
||||||
DrawIndividualDragTarget(id);
|
DrawIndividualDragTarget(id);
|
||||||
if (!invalid)
|
if (!invalid)
|
||||||
{
|
{
|
||||||
selector.DragTargetAssignment(type, id);
|
selector.DragTargetAssignment(type, id);
|
||||||
var name = Name(collection);
|
var name = Name(collection);
|
||||||
var size = ImGui.CalcTextSize(name);
|
var size = Im.Font.CalculateSize(name);
|
||||||
var textPos = ImGui.GetItemRectMax() - size - ImGui.GetStyle().FramePadding;
|
var textPos = Im.Item.LowerRightCorner - size - Im.Style.FramePadding;
|
||||||
ImGui.GetWindowDrawList().AddText(textPos, ImGuiColor.Text.Get().Color, name);
|
Im.Window.DrawList.Text(textPos, ImGuiColor.Text.Get().Color, name);
|
||||||
DrawContext(button, collection, type, id, text, suffix);
|
DrawContext(button, collection, type, id, text, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hovered)
|
if (hovered)
|
||||||
ImGui.SetTooltip(redundancy);
|
Im.Tooltip.Set(redundancy);
|
||||||
|
|
||||||
return button;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawIndividualDragSource(string text, ActorIdentifier id)
|
private void DrawIndividualDragSource(ReadOnlySpan<byte> text, ActorIdentifier id)
|
||||||
{
|
{
|
||||||
if (!id.IsValid)
|
if (!id.IsValid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var source = ImRaii.DragDropSource();
|
using var source = Im.DragDrop.Source();
|
||||||
if (!source)
|
if (!source)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.SetDragDropPayload("DragIndividual", null, 0);
|
Im.DragDrop.SetPayload("DragIndividual"u8);
|
||||||
ImGui.TextUnformatted($"Re-ordering {text}...");
|
Im.Text($"Re-ordering {text}...");
|
||||||
_draggedIndividualAssignment = _active.Individuals.Index(id);
|
_draggedIndividualAssignment = _active.Individuals.Index(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,8 +348,8 @@ public sealed class CollectionPanel(
|
||||||
if (!id.IsValid)
|
if (!id.IsValid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var target = ImRaii.DragDropTarget();
|
using var target = Im.DragDrop.Target();
|
||||||
if (!target || !ImGuiUtil.IsDropping("DragIndividual"))
|
if (!target || !target.IsDropping("DragIndividual"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var currentIdx = _active.Individuals.Index(id);
|
var currentIdx = _active.Individuals.Index(id);
|
||||||
|
|
@ -373,55 +360,84 @@ 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(new StringU8(type.ToName()), type, width, 0, ActorIdentifier.Invalid, 's');
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
using (var group = ImRaii.Group())
|
using (Im.Group())
|
||||||
{
|
{
|
||||||
ImGuiUtil.TextWrapped(type.ToDescription());
|
Im.TextWrapped(type.ToDescription());
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case CollectionType.Default: ImGui.TextUnformatted("Overruled by any other Assignment."); break;
|
case CollectionType.Default: Im.Text("Overruled by any other Assignment."u8); break;
|
||||||
case CollectionType.Yourself:
|
case CollectionType.Yourself:
|
||||||
ImGuiUtil.DrawColoredText(("Overruled by ", 0), ("Individual ", ColorId.NewMod.Value().Color), ("Assignments.", 0));
|
ImEx.TextMultiColored("Overruled by "u8)
|
||||||
|
.Then("Individual "u8, ColorId.NewMod.Value().Color)
|
||||||
|
.Then("Assignments."u8)
|
||||||
|
.End();
|
||||||
break;
|
break;
|
||||||
case CollectionType.MalePlayerCharacter:
|
case CollectionType.MalePlayerCharacter:
|
||||||
ImGuiUtil.DrawColoredText(("Overruled by ", 0), ("Male Racial Player", Colors.DiscordColor), (", ", 0),
|
ImEx.TextMultiColored("Overruled by "u8)
|
||||||
("Your Character", ColorId.HandledConflictMod.Value().Color), (", or ", 0),
|
.Then("Male Racial Player"u8, Colors.DiscordColor)
|
||||||
("Individual ", ColorId.NewMod.Value().Color), ("Assignments.", 0));
|
.Then(", "u8)
|
||||||
|
.Then("Your Character"u8, ColorId.HandledConflictMod.Value().Color)
|
||||||
|
.Then(", or "u8)
|
||||||
|
.Then("Individual "u8, ColorId.NewMod.Value().Color)
|
||||||
|
.Then("Assignments."u8)
|
||||||
|
.End();
|
||||||
break;
|
break;
|
||||||
case CollectionType.FemalePlayerCharacter:
|
case CollectionType.FemalePlayerCharacter:
|
||||||
ImGuiUtil.DrawColoredText(("Overruled by ", 0), ("Female Racial Player", Colors.ReniColorActive), (", ", 0),
|
ImEx.TextMultiColored("Overruled by "u8)
|
||||||
("Your Character", ColorId.HandledConflictMod.Value().Color), (", or ", 0),
|
.Then("Female Racial Player"u8, Colors.ReniColorActive)
|
||||||
("Individual ", ColorId.NewMod.Value().Color), ("Assignments.", 0));
|
.Then(", "u8)
|
||||||
|
.Then("Your Character"u8, ColorId.HandledConflictMod.Value().Color)
|
||||||
|
.Then(", or "u8)
|
||||||
|
.Then("Individual "u8, ColorId.NewMod.Value().Color)
|
||||||
|
.Then("Assignments."u8)
|
||||||
|
.End();
|
||||||
break;
|
break;
|
||||||
case CollectionType.MaleNonPlayerCharacter:
|
case CollectionType.MaleNonPlayerCharacter:
|
||||||
ImGuiUtil.DrawColoredText(("Overruled by ", 0), ("Male Racial NPC", Colors.DiscordColor), (", ", 0),
|
ImEx.TextMultiColored("Overruled by "u8)
|
||||||
("Children", ColorId.FolderLine.Value().Color), (", ", 0), ("Elderly", Colors.MetaInfoText), (", or ", 0),
|
.Then("Male Racial NPC"u8, Colors.DiscordColor)
|
||||||
("Individual ", ColorId.NewMod.Value().Color), ("Assignments.", 0));
|
.Then(", "u8)
|
||||||
|
.Then("Children"u8, ColorId.FolderLine.Value().Color)
|
||||||
|
.Then(", "u8)
|
||||||
|
.Then("Elderly"u8, Colors.MetaInfoText)
|
||||||
|
.Then(", or "u8)
|
||||||
|
.Then("Individual "u8, ColorId.NewMod.Value().Color)
|
||||||
|
.Then("Assignments.")
|
||||||
|
.End();
|
||||||
break;
|
break;
|
||||||
case CollectionType.FemaleNonPlayerCharacter:
|
case CollectionType.FemaleNonPlayerCharacter:
|
||||||
ImGuiUtil.DrawColoredText(("Overruled by ", 0), ("Female Racial NPC", Colors.ReniColorActive), (", ", 0),
|
ImEx.TextMultiColored("Overruled by "u8)
|
||||||
("Children", ColorId.FolderLine.Value().Color), (", ", 0), ("Elderly", Colors.MetaInfoText), (", or ", 0),
|
.Then("Female Racial NPC"u8, Colors.ReniColorActive)
|
||||||
("Individual ", ColorId.NewMod.Value().Color), ("Assignments.", 0));
|
.Then(", "u8)
|
||||||
|
.Then("Children"u8, ColorId.FolderLine.Value().Color)
|
||||||
|
.Then(", "u8)
|
||||||
|
.Then("Elderly"u8, Colors.MetaInfoText)
|
||||||
|
.Then(", or ")
|
||||||
|
.Then("Individual "u8, ColorId.NewMod.Value().Color)
|
||||||
|
.Then("Assignments."u8)
|
||||||
|
.End();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawAssignmentButton(CollectionType type, Vector2 width, string name, uint color)
|
private void DrawAssignmentButton(CollectionType type, Vector2 width, StringU8 name, Vector4 color)
|
||||||
=> DrawButton(name, type, width, color, ActorIdentifier.Invalid, 's', _active.ByType(type));
|
=> DrawButton(name, type, width, color, ActorIdentifier.Invalid, 's', _active.ByType(type));
|
||||||
|
|
||||||
/// <summary> Respect incognito mode for names of identifiers. </summary>
|
/// <summary> Respect incognito mode for names of identifiers. </summary>
|
||||||
private string Name(ActorIdentifier id, string? name)
|
private StringU8 Name(ActorIdentifier id, string? name)
|
||||||
=> incognito.IncognitoMode && id.Type is IdentifierType.Player or IdentifierType.Owned
|
=> incognito.IncognitoMode && id.Type is IdentifierType.Player or IdentifierType.Owned
|
||||||
? id.Incognito(name)
|
? new StringU8(id.Incognito(name))
|
||||||
: name ?? id.ToString();
|
: name is not null
|
||||||
|
? new StringU8(name)
|
||||||
|
: new StringU8($"{id}");
|
||||||
|
|
||||||
/// <summary> Respect incognito mode for names of collections. </summary>
|
/// <summary> Respect incognito mode for names of collections. </summary>
|
||||||
private string Name(ModCollection? collection)
|
private string Name(ModCollection? collection)
|
||||||
=> collection == null ? "Unassigned" :
|
=> collection is null ? "Unassigned" :
|
||||||
collection == ModCollection.Empty ? "Use No Mods" :
|
collection == ModCollection.Empty ? "Use No Mods" :
|
||||||
incognito.IncognitoMode ? collection.Identity.AnonymizedName : collection.Identity.Name;
|
incognito.IncognitoMode ? collection.Identity.AnonymizedName : collection.Identity.Name;
|
||||||
|
|
||||||
|
|
@ -429,16 +445,16 @@ public sealed class CollectionPanel(
|
||||||
{
|
{
|
||||||
if (identifiers.Length > 0 && identifiers[0].IsValid)
|
if (identifiers.Length > 0 && identifiers[0].IsValid)
|
||||||
{
|
{
|
||||||
DrawButton($"{intro} ({Name(identifiers[0], null)})", CollectionType.Individual, width, 0, identifiers[0], suffix);
|
DrawButton(new StringU8($"{intro} ({Name(identifiers[0], null)})"), CollectionType.Individual, width, 0, identifiers[0], suffix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (tooltip.Length == 0 && identifiers.Length > 0)
|
if (tooltip.Length == 0 && identifiers.Length > 0)
|
||||||
tooltip = $"The current target {identifiers[0].PlayerName} is not valid for an assignment.";
|
tooltip = $"The current target {identifiers[0].PlayerName} is not valid for an assignment.";
|
||||||
DrawButton($"{intro} (Unavailable)", CollectionType.Individual, width, 0, ActorIdentifier.Invalid, suffix);
|
DrawButton(new StringU8($"{intro} (Unavailable)"), CollectionType.Individual, width, 0, ActorIdentifier.Invalid, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(tooltip);
|
Im.Tooltip.OnHover(tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCurrentCharacter(Vector2 width)
|
private void DrawCurrentCharacter(Vector2 width)
|
||||||
|
|
@ -472,50 +488,49 @@ public sealed class CollectionPanel(
|
||||||
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);
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGui.GetContentRegionAvail().X < width.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X
|
if (Im.ContentRegion.Available.X < width.X + Im.Style.ItemSpacing.X + Im.Style.WindowPadding.X
|
||||||
&& i < _active.Individuals.Count - 1)
|
&& i < _active.Individuals.Count - 1)
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_active.Individuals.Count > 0)
|
if (_active.Individuals.Count > 0)
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCollectionName(ModCollection collection)
|
private void DrawCollectionName(ModCollection collection)
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
using var color = ImGuiColor.Border.Push(Colors.MetaInfoText);
|
using var style = ImStyleBorder.Frame.Push(Colors.MetaInfoText, 2 * Im.Style.GlobalScale);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, 2 * UiHelpers.Scale);
|
|
||||||
using var f = _nameFont.Push();
|
using var f = _nameFont.Push();
|
||||||
var name = Name(collection);
|
var name = Name(collection);
|
||||||
var size = ImGui.CalcTextSize(name).X;
|
var size = Im.Font.CalculateSize(name).X;
|
||||||
var pos = ImGui.GetContentRegionAvail().X - size + ImGui.GetStyle().FramePadding.X * 2;
|
var pos = Im.ContentRegion.Available.X - size + Im.Style.FramePadding.X * 2;
|
||||||
if (pos > 0)
|
if (pos > 0)
|
||||||
ImGui.SetCursorPosX(pos / 2);
|
Im.Cursor.X = pos / 2;
|
||||||
ImGuiUtil.DrawTextButton(name, Vector2.Zero, 0);
|
ImEx.TextFramed(name, Vector2.Zero, 0);
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawStatistics(ModCollection collection)
|
private void DrawStatistics(ModCollection collection)
|
||||||
{
|
{
|
||||||
GatherInUse(collection);
|
GatherInUse(collection);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
|
|
||||||
var buttonHeight = 2 * ImGui.GetTextLineHeightWithSpacing();
|
var buttonHeight = 2 * Im.Style.TextHeightWithSpacing;
|
||||||
if (_inUseCache.Count == 0 && collection.Inheritance.DirectlyInheritedBy.Count == 0)
|
if (_inUseCache.Count == 0 && collection.Inheritance.DirectlyInheritedBy.Count == 0)
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
using var f = _nameFont.Push();
|
using var f = _nameFont.Push();
|
||||||
ImGuiUtil.DrawTextButton("Collection is not used.", new Vector2(ImGui.GetContentRegionAvail().X, buttonHeight),
|
ImEx.TextFramed("Collection is not used."u8, Im.ContentRegion.Available with { Y = buttonHeight },
|
||||||
Colors.PressEnterWarningBg);
|
Colors.PressEnterWarningBg);
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var buttonWidth = new Vector2(175 * ImGuiHelpers.GlobalScale, buttonHeight);
|
var buttonWidth = new Vector2(175 * Im.Style.GlobalScale, buttonHeight);
|
||||||
DrawInUseStatistics(collection, buttonWidth);
|
DrawInUseStatistics(collection, buttonWidth);
|
||||||
DrawInheritanceStatistics(collection, buttonWidth);
|
DrawInheritanceStatistics(collection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -528,8 +543,8 @@ public sealed class CollectionPanel(
|
||||||
.Where(t => _active.ByType(t) == collection))
|
.Where(t => _active.ByType(t) == collection))
|
||||||
_inUseCache.Add((special, ActorIdentifier.Invalid));
|
_inUseCache.Add((special, ActorIdentifier.Invalid));
|
||||||
|
|
||||||
foreach (var (_, id, coll) in _active.Individuals.Assignments.Where(t
|
foreach (var (_, id, _) in _active.Individuals.Assignments.Where(t
|
||||||
=> t.Collection == collection && t.Identifiers.FirstOrDefault().IsValid))
|
=> t.Collection == collection && t.Identifiers.Count > 0 && t.Identifiers[0].IsValid))
|
||||||
_inUseCache.Add((CollectionType.Individual, id[0]));
|
_inUseCache.Add((CollectionType.Individual, id[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -538,155 +553,152 @@ public sealed class CollectionPanel(
|
||||||
if (_inUseCache.Count <= 0)
|
if (_inUseCache.Count <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (var _ = ImRaii.PushStyle(ImGuiStyleVar.FramePadding, Vector2.Zero))
|
using (ImStyleDouble.FramePadding.Push(Vector2.Zero))
|
||||||
{
|
{
|
||||||
ImGuiUtil.DrawTextButton("In Use By", ImGui.GetContentRegionAvail() with { Y = 0 }, 0);
|
ImEx.TextFramed("In Use By"u8, Im.ContentRegion.Available with { Y = 0 }, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale)
|
using var style = ImStyleSingle.FrameBorderThickness.Push(Im.Style.GlobalScale)
|
||||||
.Push(ImGuiStyleVar.ButtonTextAlign, Vector2.Zero);
|
.Push(ImStyleDouble.ButtonTextAlign, Vector2.Zero);
|
||||||
|
|
||||||
foreach (var (idx, (type, id)) in _inUseCache.Index())
|
foreach (var (idx, (type, id)) in _inUseCache.Index())
|
||||||
{
|
{
|
||||||
var name = type == CollectionType.Individual ? Name(id, null) : Buttons[type].Name;
|
var name = type is 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 : Vector4.Zero;
|
||||||
DrawButton(name, type, buttonWidth, color, id, 's', collection);
|
DrawButton(name, type, buttonWidth, color, id, 's', collection);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImGui.GetContentRegionAvail().X < buttonWidth.X + ImGui.GetStyle().ItemSpacing.X + ImGui.GetStyle().WindowPadding.X
|
if (Im.ContentRegion.Available.X < buttonWidth.X + Im.Style.ItemSpacing.X + Im.Style.WindowPadding.X
|
||||||
&& idx != _inUseCache.Count - 1)
|
&& idx != _inUseCache.Count - 1)
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawInheritanceStatistics(ModCollection collection, Vector2 buttonWidth)
|
private void DrawInheritanceStatistics(ModCollection collection)
|
||||||
{
|
{
|
||||||
if (collection.Inheritance.DirectlyInheritedBy.Count <= 0)
|
if (collection.Inheritance.DirectlyInheritedBy.Count <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (var _ = ImRaii.PushStyle(ImGuiStyleVar.FramePadding, Vector2.Zero))
|
using (ImStyleDouble.FramePadding.Push(Vector2.Zero))
|
||||||
{
|
{
|
||||||
ImGuiUtil.DrawTextButton("Inherited by", ImGui.GetContentRegionAvail() with { Y = 0 }, 0);
|
ImEx.TextFramed("Inherited by"u8, Im.ContentRegion.Available with { Y = 0 }, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
using var f = _nameFont.Push();
|
using var f = _nameFont.Push();
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, ImGuiHelpers.GlobalScale);
|
using var style = ImStyleBorder.Frame.Push(Colors.MetaInfoText);
|
||||||
using var color = ImGuiColor.Border.Push(Colors.MetaInfoText);
|
ImEx.TextFramed(Name(collection.Inheritance.DirectlyInheritedBy[0]), Vector2.Zero, 0);
|
||||||
ImGuiUtil.DrawTextButton(Name(collection.Inheritance.DirectlyInheritedBy[0]), Vector2.Zero, 0);
|
var constOffset = (Im.Style.FramePadding.X + Im.Style.GlobalScale) * 2
|
||||||
var constOffset = (ImGui.GetStyle().FramePadding.X + ImGuiHelpers.GlobalScale) * 2
|
+ Im.Style.ItemSpacing.X
|
||||||
+ ImGui.GetStyle().ItemSpacing.X
|
+ Im.Style.WindowPadding.X;
|
||||||
+ ImGui.GetStyle().WindowPadding.X;
|
|
||||||
foreach (var parent in collection.Inheritance.DirectlyInheritedBy.Skip(1))
|
foreach (var parent in collection.Inheritance.DirectlyInheritedBy.Skip(1))
|
||||||
{
|
{
|
||||||
var name = Name(parent);
|
var name = Name(parent);
|
||||||
var size = ImGui.CalcTextSize(name).X;
|
var size = Im.Font.CalculateSize(name).X;
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (constOffset + size >= ImGui.GetContentRegionAvail().X)
|
if (constOffset + size >= Im.ContentRegion.Available.X)
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGuiUtil.DrawTextButton(name, Vector2.Zero, 0);
|
ImEx.TextFramed(name, Vector2.Zero, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawSettingsList(ModCollection collection)
|
private void DrawSettingsList(ModCollection collection)
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
var size = new Vector2(ImGui.GetContentRegionAvail().X, 10 * ImGui.GetFrameHeightWithSpacing());
|
var size = Im.ContentRegion.Available with { Y = 10 * Im.Style.FrameHeightWithSpacing };
|
||||||
using var table = ImRaii.Table("##activeSettings", 4, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY, size);
|
using var table = Im.Table.Begin("##activeSettings"u8, 4, TableFlags.ScrollY | TableFlags.RowBackground, size);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupScrollFreeze(0, 1);
|
table.SetupScrollFreeze(0, 1);
|
||||||
ImGui.TableSetupColumn("Mod Name", ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Mod Name"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Inherited From", ImGuiTableColumnFlags.WidthFixed, 5f * ImGui.GetFrameHeight());
|
table.SetupColumn("Inherited From"u8, TableColumnFlags.WidthFixed, 5f * Im.Style.FrameHeight);
|
||||||
ImGui.TableSetupColumn("State", ImGuiTableColumnFlags.WidthFixed, 1.75f * ImGui.GetFrameHeight());
|
table.SetupColumn("State"u8, TableColumnFlags.WidthFixed, 1.75f * Im.Style.FrameHeight);
|
||||||
ImGui.TableSetupColumn("Priority", ImGuiTableColumnFlags.WidthFixed, 2.5f * ImGui.GetFrameHeight());
|
table.SetupColumn("Priority"u8, TableColumnFlags.WidthFixed, 2.5f * Im.Style.FrameHeight);
|
||||||
ImGui.TableHeadersRow();
|
table.HeaderRow();
|
||||||
|
|
||||||
foreach (var (mod, (settings, parent)) in mods.Select(m => (m, collection.GetInheritedSettings(m.Index)))
|
foreach (var (mod, (settings, parent)) in mods.Select(m => (m, collection.GetInheritedSettings(m.Index)))
|
||||||
.Where(t => t.Item2.Settings != null)
|
.Where(t => t.Item2.Settings != null)
|
||||||
.OrderBy(t => t.m.Name))
|
.OrderBy(t => t.m.Name))
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
ImGuiUtil.CopyOnClickSelectable(mod.Name);
|
ImEx.CopyOnClickSelectable(mod.Name);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
if (parent != collection)
|
if (parent != collection)
|
||||||
ImGui.TextUnformatted(Name(parent));
|
Im.Text(Name(parent));
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
var enabled = settings!.Enabled;
|
var enabled = settings!.Enabled;
|
||||||
using (var dis = ImRaii.Disabled())
|
using (Im.Disabled())
|
||||||
{
|
{
|
||||||
ImGui.Checkbox("##check", ref enabled);
|
Im.Checkbox("##check"u8, ref enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
ImGuiUtil.RightAlign(settings.Priority.ToString(), ImGui.GetStyle().WindowPadding.X);
|
ImEx.TextRightAligned($"{settings.Priority}", Im.Style.WindowPadding.X);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawInactiveSettingsList(ModCollection collection)
|
private void DrawInactiveSettingsList(ModCollection collection)
|
||||||
{
|
{
|
||||||
if (collection.Settings.Unused.Count == 0)
|
if (collection.Settings.Unused.Count is 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
var text = collection.Settings.Unused.Count > 1
|
if (Im.Button(collection.Settings.Unused.Count > 1
|
||||||
? $"Clear all {collection.Settings.Unused.Count} unused settings from deleted mods."
|
? $"Clear all {collection.Settings.Unused.Count} unused settings from deleted mods."
|
||||||
: "Clear the currently unused setting from a deleted mods.";
|
: "Clear the currently unused setting from a deleted mods."u8, Im.ContentRegion.Available with { Y = 0 }))
|
||||||
if (ImGui.Button(text, new Vector2(ImGui.GetContentRegionAvail().X, 0)))
|
|
||||||
_collections.CleanUnavailableSettings(collection);
|
_collections.CleanUnavailableSettings(collection);
|
||||||
|
|
||||||
ImGui.Dummy(Vector2.One);
|
Im.Dummy(Vector2.One);
|
||||||
|
|
||||||
var size = new Vector2(ImGui.GetContentRegionAvail().X,
|
var size = Im.ContentRegion.Available with { Y = Math.Min(10, collection.Settings.Unused.Count + 1) * Im.Style.FrameHeightWithSpacing };
|
||||||
Math.Min(10, collection.Settings.Unused.Count + 1) * ImGui.GetFrameHeightWithSpacing());
|
using var table = Im.Table.Begin("##inactiveSettings"u8, 4, TableFlags.ScrollY | TableFlags.RowBackground, size);
|
||||||
using var table = ImRaii.Table("##inactiveSettings", 4, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY, size);
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.TableSetupScrollFreeze(0, 1);
|
table.SetupScrollFreeze(0, 1);
|
||||||
ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, UiHelpers.IconButtonSize.X);
|
table.SetupColumn(StringU8.Empty, TableColumnFlags.WidthFixed, UiHelpers.IconButtonSize.X);
|
||||||
ImGui.TableSetupColumn("Unused Mod Identifier", ImGuiTableColumnFlags.WidthStretch);
|
table.SetupColumn("Unused Mod Identifier"u8, TableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("State", ImGuiTableColumnFlags.WidthFixed, 1.75f * ImGui.GetFrameHeight());
|
table.SetupColumn("State"u8, TableColumnFlags.WidthFixed, 1.75f * Im.Style.FrameHeight);
|
||||||
ImGui.TableSetupColumn("Priority", ImGuiTableColumnFlags.WidthFixed, 2.5f * ImGui.GetFrameHeight());
|
table.SetupColumn("Priority"u8, TableColumnFlags.WidthFixed, 2.5f * Im.Style.FrameHeight);
|
||||||
ImGui.TableHeadersRow();
|
table.HeaderRow();
|
||||||
string? delete = null;
|
string? delete = null;
|
||||||
foreach (var (name, settings) in collection.Settings.Unused.OrderBy(n => n.Key))
|
foreach (var (name, settings) in collection.Settings.Unused.OrderBy(n => n.Key))
|
||||||
{
|
{
|
||||||
using var id = ImRaii.PushId(name);
|
using var id = Im.Id.Push(name);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Trash.ToIconString(), UiHelpers.IconButtonSize,
|
if (ImEx.Icon.Button(LunaStyle.DeleteIcon, "Delete this unused setting."u8))
|
||||||
"Delete this unused setting.", false, true))
|
|
||||||
delete = name;
|
delete = name;
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
ImGuiUtil.CopyOnClickSelectable(name);
|
ImEx.CopyOnClickSelectable(name);
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
var enabled = settings.Enabled;
|
var enabled = settings.Enabled;
|
||||||
using (var dis = ImRaii.Disabled())
|
using (Im.Disabled())
|
||||||
{
|
{
|
||||||
ImGui.Checkbox("##check", ref enabled);
|
Im.Checkbox("##check"u8, ref enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
table.NextColumn();
|
||||||
ImGuiUtil.RightAlign(settings.Priority.ToString(), ImGui.GetStyle().WindowPadding.X);
|
ImEx.TextRightAligned($"{settings.Priority}", Im.Style.WindowPadding.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
_collections.CleanUnavailableSetting(collection, delete);
|
_collections.CleanUnavailableSetting(collection, delete);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Create names and border colors for special assignments. </summary>
|
/// <summary> Create names and border colors for special assignments. </summary>
|
||||||
private static IReadOnlyDictionary<CollectionType, (string Name, uint Border)> CreateButtons()
|
private static IReadOnlyDictionary<CollectionType, (StringU8 Name, Vector4 Border)> CreateButtons()
|
||||||
{
|
{
|
||||||
var ret = Enum.GetValues<CollectionType>().ToDictionary(t => t, t => (t.ToName(), 0u));
|
var ret = Enum.GetValues<CollectionType>().ToDictionary(t => t, t => (new StringU8(t.ToName()), Vector4.Zero));
|
||||||
|
|
||||||
foreach (var race in Enum.GetValues<SubRace>().Skip(1))
|
foreach (var race in Enum.GetValues<SubRace>().Skip(1))
|
||||||
{
|
{
|
||||||
var color = race switch
|
Rgba32 color = race switch
|
||||||
{
|
{
|
||||||
SubRace.Midlander => 0xAA5C9FE4u,
|
SubRace.Midlander => 0xAA5C9FE4u,
|
||||||
SubRace.Highlander => 0xAA5C9FE4u,
|
SubRace.Highlander => 0xAA5C9FE4u,
|
||||||
|
|
@ -707,29 +719,25 @@ public sealed class CollectionPanel(
|
||||||
_ => 0u,
|
_ => 0u,
|
||||||
};
|
};
|
||||||
|
|
||||||
ret[CollectionTypeExtensions.FromParts(race, Gender.Male, false)] = ($"♂ {race.ToShortName()}", color);
|
ret[CollectionTypeExtensions.FromParts(race, Gender.Male, false)] = (new StringU8($"♂ {race.ToShortName()}"), color.ToVector());
|
||||||
ret[CollectionTypeExtensions.FromParts(race, Gender.Female, false)] = ($"♀ {race.ToShortName()}", color);
|
ret[CollectionTypeExtensions.FromParts(race, Gender.Female, false)] = (new StringU8($"♀ {race.ToShortName()}"), color.ToVector());
|
||||||
ret[CollectionTypeExtensions.FromParts(race, Gender.Male, true)] = ($"♂ {race.ToShortName()} (NPC)", color);
|
ret[CollectionTypeExtensions.FromParts(race, Gender.Male, true)] =
|
||||||
ret[CollectionTypeExtensions.FromParts(race, Gender.Female, true)] = ($"♀ {race.ToShortName()} (NPC)", color);
|
(new StringU8($"♂ {race.ToShortName()} (NPC)"), color.ToVector());
|
||||||
|
ret[CollectionTypeExtensions.FromParts(race, Gender.Female, true)] =
|
||||||
|
(new StringU8($"♀ {race.ToShortName()} (NPC)"), color.ToVector());
|
||||||
}
|
}
|
||||||
|
|
||||||
ret[CollectionType.MalePlayerCharacter] = ("♂ Player", 0);
|
ret[CollectionType.MalePlayerCharacter] = (new StringU8("♂ Player"), Vector4.Zero);
|
||||||
ret[CollectionType.FemalePlayerCharacter] = ("♀ Player", 0);
|
ret[CollectionType.FemalePlayerCharacter] = (new StringU8("♀ Player"), Vector4.Zero);
|
||||||
ret[CollectionType.MaleNonPlayerCharacter] = ("♂ NPC", 0);
|
ret[CollectionType.MaleNonPlayerCharacter] = (new StringU8("♂ NPC"), Vector4.Zero);
|
||||||
ret[CollectionType.FemaleNonPlayerCharacter] = ("♀ NPC", 0);
|
ret[CollectionType.FemaleNonPlayerCharacter] = (new StringU8("♀ NPC"), Vector4.Zero);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Create the special assignment tree in order and with free spaces. </summary>
|
/// <summary> Create the special assignment tree in order and with free spaces. </summary>
|
||||||
private static IReadOnlyList<(CollectionType, bool, bool, string, uint)> CreateTree()
|
private static List<(CollectionType, bool, bool, StringU8, Vector4)> CreateTree()
|
||||||
{
|
{
|
||||||
var ret = new List<(CollectionType, bool, bool, string, uint)>(Buttons.Count);
|
var ret = new List<(CollectionType, bool, bool, StringU8, Vector4)>(Buttons.Count);
|
||||||
|
|
||||||
void Add(CollectionType type, bool pre, bool post)
|
|
||||||
{
|
|
||||||
var (name, border) = Buttons[type];
|
|
||||||
ret.Add((type, pre, post, name, border));
|
|
||||||
}
|
|
||||||
|
|
||||||
Add(CollectionType.Default, false, false);
|
Add(CollectionType.Default, false, false);
|
||||||
Add(CollectionType.Interface, false, false);
|
Add(CollectionType.Interface, false, false);
|
||||||
|
|
@ -754,5 +762,11 @@ public sealed class CollectionPanel(
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
void Add(CollectionType type, bool localPre, bool post)
|
||||||
|
{
|
||||||
|
var (name, border) = Buttons[type];
|
||||||
|
ret.Add((type, localPre, post, name, border));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
|
|
||||||
DrawNewInheritanceSelection();
|
DrawNewInheritanceSelection();
|
||||||
Im.Line.Same();
|
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(Im.ContentRegion.Available.X, 0)))
|
||||||
ImGui.OpenPopup("InheritanceHelp");
|
ImGui.OpenPopup("InheritanceHelp");
|
||||||
|
|
||||||
DrawHelpPopup();
|
DrawHelpPopup();
|
||||||
|
|
@ -61,9 +61,9 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawHelpPopup()
|
private static void DrawHelpPopup()
|
||||||
=> ImGuiUtil.HelpPopup("InheritanceHelp", new Vector2(1000 * UiHelpers.Scale, 20 * ImGui.GetTextLineHeightWithSpacing()), () =>
|
=> ImGuiUtil.HelpPopup("InheritanceHelp", new Vector2(1000 * Im.Style.GlobalScale, 20 * Im.Style.TextHeightWithSpacing), () =>
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.TextUnformatted("Every mod in a collection can have three basic states: 'Enabled', 'Disabled' and 'Unconfigured'.");
|
ImGui.TextUnformatted("Every mod in a collection can have three basic states: 'Enabled', 'Disabled' and 'Unconfigured'.");
|
||||||
ImGui.BulletText("If the mod is 'Enabled' or 'Disabled', it does not matter if the collection inherits from other collections.");
|
ImGui.BulletText("If the mod is 'Enabled' or 'Disabled', it does not matter if the collection inherits from other collections.");
|
||||||
ImGui.BulletText(
|
ImGui.BulletText(
|
||||||
|
|
@ -73,7 +73,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
ImGui.BulletText("If no such collection is found, the mod will be treated as disabled.");
|
ImGui.BulletText("If no such collection is found, the mod will be treated as disabled.");
|
||||||
ImGui.BulletText(
|
ImGui.BulletText(
|
||||||
"Highlighted collections in the left box are never reached because they are already checked in a sub-inheritance before.");
|
"Highlighted collections in the left box are never reached because they are already checked in a sub-inheritance before.");
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.TextUnformatted("Example");
|
ImGui.TextUnformatted("Example");
|
||||||
ImGui.BulletText("Collection A has the Bibo+ body and a Hempen Camise mod enabled.");
|
ImGui.BulletText("Collection A has the Bibo+ body and a Hempen Camise mod enabled.");
|
||||||
ImGui.BulletText(
|
ImGui.BulletText(
|
||||||
|
|
@ -102,9 +102,9 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
var lineStart = ImGui.GetCursorScreenPos();
|
var lineStart = ImGui.GetCursorScreenPos();
|
||||||
var offsetX = -ImGui.GetStyle().IndentSpacing + ImGui.GetTreeNodeToLabelSpacing() / 2;
|
var offsetX = -ImGui.GetStyle().IndentSpacing + ImGui.GetTreeNodeToLabelSpacing() / 2;
|
||||||
var drawList = ImGui.GetWindowDrawList();
|
var drawList = ImGui.GetWindowDrawList();
|
||||||
var lineSize = Math.Max(0, ImGui.GetStyle().IndentSpacing - 9 * UiHelpers.Scale);
|
var lineSize = Math.Max(0, ImGui.GetStyle().IndentSpacing - 9 * Im.Style.GlobalScale);
|
||||||
lineStart.X += offsetX;
|
lineStart.X += offsetX;
|
||||||
lineStart.Y -= 2 * UiHelpers.Scale;
|
lineStart.Y -= 2 * Im.Style.GlobalScale;
|
||||||
var lineEnd = lineStart;
|
var lineEnd = lineStart;
|
||||||
|
|
||||||
// Skip the collection itself.
|
// Skip the collection itself.
|
||||||
|
|
@ -127,12 +127,12 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
// Draw the notch and increase the line length.
|
// Draw the notch and increase the line length.
|
||||||
var midPoint = (minRect.Y + maxRect.Y) / 2f - 1f;
|
var midPoint = (minRect.Y + maxRect.Y) / 2f - 1f;
|
||||||
drawList.AddLine(lineStart with { Y = midPoint }, new Vector2(lineStart.X + lineSize, midPoint), Colors.MetaInfoText,
|
drawList.AddLine(lineStart with { Y = midPoint }, new Vector2(lineStart.X + lineSize, midPoint), Colors.MetaInfoText,
|
||||||
UiHelpers.Scale);
|
Im.Style.GlobalScale);
|
||||||
lineEnd.Y = midPoint;
|
lineEnd.Y = midPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, draw the folder line.
|
// Finally, draw the folder line.
|
||||||
drawList.AddLine(lineStart, lineEnd, Colors.MetaInfoText, UiHelpers.Scale);
|
drawList.AddLine(lineStart, lineEnd, Colors.MetaInfoText, Im.Style.GlobalScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Draw a single primary inherited collection. </summary>
|
/// <summary> Draw a single primary inherited collection. </summary>
|
||||||
|
|
@ -158,7 +158,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
private void DrawCurrentCollectionInheritance()
|
private void DrawCurrentCollectionInheritance()
|
||||||
{
|
{
|
||||||
using var list = ImRaii.ListBox("##inheritanceList",
|
using var list = ImRaii.ListBox("##inheritanceList",
|
||||||
new Vector2(UiHelpers.InputTextMinusButton, ImGui.GetTextLineHeightWithSpacing() * InheritedCollectionHeight));
|
new Vector2(UiHelpers.InputTextMinusButton, Im.Style.TextHeightWithSpacing * InheritedCollectionHeight));
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
/// <summary> Draw a drag and drop button to delete. </summary>
|
/// <summary> Draw a drag and drop button to delete. </summary>
|
||||||
private void DrawInheritanceTrashButton()
|
private void DrawInheritanceTrashButton()
|
||||||
{
|
{
|
||||||
var size = UiHelpers.IconButtonSize with { Y = ImGui.GetTextLineHeightWithSpacing() * InheritedCollectionHeight };
|
var size = UiHelpers.IconButtonSize with { Y = Im.Style.TextHeightWithSpacing * InheritedCollectionHeight };
|
||||||
var buttonColor = Im.Style[ImGuiColor.Button];
|
var buttonColor = Im.Style[ImGuiColor.Button];
|
||||||
// Prevent hovering from highlighting the button.
|
// Prevent hovering from highlighting the button.
|
||||||
using var color = ImGuiColor.ButtonActive.Push(buttonColor)
|
using var color = ImGuiColor.ButtonActive.Push(buttonColor)
|
||||||
|
|
@ -300,7 +300,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void DrawInheritanceTreeClicks(ModCollection collection, bool withDelete)
|
private void DrawInheritanceTreeClicks(ModCollection collection, bool withDelete)
|
||||||
{
|
{
|
||||||
if (ImGui.GetIO().KeyCtrl && ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (ImGui.GetIO().KeyCtrl && Im.Item.RightClicked())
|
||||||
{
|
{
|
||||||
if (withDelete && ImGui.GetIO().KeyShift)
|
if (withDelete && ImGui.GetIO().KeyShift)
|
||||||
_inheritanceAction = (_active.Current.Inheritance.DirectlyInheritsFrom.IndexOf(collection), -1);
|
_inheritanceAction = (_active.Current.Inheritance.DirectlyInheritsFrom.IndexOf(collection), -1);
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,14 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using ImSharp;
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using OtterGui;
|
|
||||||
using OtterGui.Raii;
|
|
||||||
using OtterGui.Text;
|
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
using Penumbra.UI.Tabs;
|
using Penumbra.UI.Tabs;
|
||||||
using Penumbra.Util;
|
|
||||||
using Window = Dalamud.Interface.Windowing.Window;
|
|
||||||
|
|
||||||
namespace Penumbra.UI;
|
namespace Penumbra.UI;
|
||||||
|
|
||||||
public sealed class ConfigWindow : Window, Luna.IUiService
|
public sealed class ConfigWindow : Window
|
||||||
{
|
{
|
||||||
private readonly IDalamudPluginInterface _pluginInterface;
|
private readonly IDalamudPluginInterface _pluginInterface;
|
||||||
private readonly Configuration _config;
|
private readonly Configuration _config;
|
||||||
|
|
@ -55,10 +49,10 @@ public sealed class ConfigWindow : Window, Luna.IUiService
|
||||||
public override void PreDraw()
|
public override void PreDraw()
|
||||||
{
|
{
|
||||||
if (_config.Ephemeral.FixMainWindow)
|
if (_config.Ephemeral.FixMainWindow)
|
||||||
Flags |= ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove;
|
Flags |= WindowFlags.NoResize | WindowFlags.NoMove;
|
||||||
else
|
else
|
||||||
Flags &= ~(ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove);
|
Flags &= ~(WindowFlags.NoResize | WindowFlags.NoMove);
|
||||||
SizeConstraints = new WindowSizeConstraints()
|
SizeConstraints = new WindowSizeConstraints
|
||||||
{
|
{
|
||||||
MinimumSize = _config.MinimumSize,
|
MinimumSize = _config.MinimumSize,
|
||||||
MaximumSize = new Vector2(4096, 2160),
|
MaximumSize = new Vector2(4096, 2160),
|
||||||
|
|
@ -138,33 +132,33 @@ public sealed class ConfigWindow : Window, Luna.IUiService
|
||||||
? "Penumbra###PenumbraConfigWindow"
|
? "Penumbra###PenumbraConfigWindow"
|
||||||
: $"Penumbra v{checker.Version}###PenumbraConfigWindow";
|
: $"Penumbra v{checker.Version}###PenumbraConfigWindow";
|
||||||
|
|
||||||
private void DrawProblemWindow(string text)
|
private void DrawProblemWindow(Utf8StringHandler<TextStringHandlerBuffer> text)
|
||||||
{
|
{
|
||||||
using var color = ImGuiColor.Text.Push(Colors.RegexWarningBorder);
|
using var color = ImGuiColor.Text.Push(Colors.RegexWarningBorder);
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImUtf8.TextWrapped(text);
|
Im.TextWrapped(ref text);
|
||||||
color.Pop();
|
color.Pop();
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
SupportButton.Discord(Penumbra.Messager, 0);
|
SupportButton.Discord(Penumbra.Messager, 0);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
UiHelpers.DrawSupportButton(_penumbra!);
|
UiHelpers.DrawSupportButton(_penumbra!);
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawImcExceptions()
|
private void DrawImcExceptions()
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted("Exceptions");
|
Im.Text("Exceptions"u8);
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
using var box = ImRaii.ListBox("##Exceptions", new Vector2(-1, -1));
|
using var box = Im.ListBox.Begin("##Exceptions"u8, new Vector2(-1, -1));
|
||||||
foreach (var exception in _validityChecker.ImcExceptions)
|
foreach (var exception in _validityChecker.ImcExceptions)
|
||||||
{
|
{
|
||||||
ImGuiUtil.TextWrapped(exception.ToString());
|
Im.TextWrapped($"{exception}");
|
||||||
ImGui.Separator();
|
Im.Separator();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using Dalamud.Bindings.ImGui;
|
using ImSharp;
|
||||||
using Luna;
|
using Luna;
|
||||||
using Penumbra.Communication;
|
using Penumbra.Communication;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
|
|
@ -120,7 +120,7 @@ public class FileDialogService : IDisposable, IUiService
|
||||||
{
|
{
|
||||||
var fileManager = new FileDialogManager
|
var fileManager = new FileDialogManager
|
||||||
{
|
{
|
||||||
AddedWindowFlags = ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoDocking,
|
AddedWindowFlags = (WindowFlags.NoCollapse | WindowFlags.NoDocking).ToDalamudWindowFlags(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (WindowsFunctions.GetDownloadsFolder(out var downloadsFolder))
|
if (WindowsFunctions.GetDownloadsFolder(out var downloadsFolder))
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public class DescriptionEditPopup(ModManager modManager) : Luna.IUiService
|
||||||
ImUtf8.OpenPopup(PopupId);
|
ImUtf8.OpenPopup(PopupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
var inputSize = ImGuiHelpers.ScaledVector2(800);
|
var inputSize = ImEx.ScaledVector(800);
|
||||||
using var popup = ImUtf8.Popup(PopupId);
|
using var popup = ImUtf8.Popup(PopupId);
|
||||||
if (!popup)
|
if (!popup)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -59,8 +60,8 @@ public readonly struct CombiningModGroupEditDrawer(ModGroupEditDrawer editor, Co
|
||||||
new Vector2(400 * ImUtf8.GlobalScale, 0)))
|
new Vector2(400 * ImUtf8.GlobalScale, 0)))
|
||||||
ImUtf8.OpenPopup("DataContainerNames"u8);
|
ImUtf8.OpenPopup("DataContainerNames"u8);
|
||||||
|
|
||||||
var sizeX = group.OptionData.Count * (ImGui.GetStyle().ItemInnerSpacing.X + ImGui.GetFrameHeight()) + 300 * ImUtf8.GlobalScale;
|
var sizeX = group.OptionData.Count * (ImGui.GetStyle().ItemInnerSpacing.X + Im.Style.FrameHeight) + 300 * ImUtf8.GlobalScale;
|
||||||
ImGui.SetNextWindowSize(new Vector2(sizeX, ImGui.GetFrameHeightWithSpacing() * Math.Min(16, group.Data.Count) + 200 * ImUtf8.GlobalScale));
|
ImGui.SetNextWindowSize(new Vector2(sizeX, Im.Style.FrameHeightWithSpacing * Math.Min(16, group.Data.Count) + 200 * ImUtf8.GlobalScale));
|
||||||
using var popup = ImUtf8.Popup("DataContainerNames"u8);
|
using var popup = ImUtf8.Popup("DataContainerNames"u8);
|
||||||
if (!popup)
|
if (!popup)
|
||||||
return;
|
return;
|
||||||
|
|
@ -71,10 +72,10 @@ public readonly struct CombiningModGroupEditDrawer(ModGroupEditDrawer editor, Co
|
||||||
ImUtf8.SameLineInner();
|
ImUtf8.SameLineInner();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
using var child = ImUtf8.Child("##Child"u8, ImGui.GetContentRegionAvail());
|
using var child = ImUtf8.Child("##Child"u8, Im.ContentRegion.Available);
|
||||||
ImGuiClip.ClippedDraw(group.Data, DrawRow, ImGui.GetFrameHeightWithSpacing());
|
ImGuiClip.ClippedDraw(group.Data, DrawRow, Im.Style.FrameHeightWithSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawRow(CombinedDataContainer container, int index)
|
private void DrawRow(CombinedDataContainer container, int index)
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public sealed class ModGroupDrawer : Luna.IUiService
|
||||||
CurrentSelectionIdx = currentOption;
|
CurrentSelectionIdx = currentOption;
|
||||||
CurrentSelection = _group.Options[CurrentSelectionIdx];
|
CurrentSelection = _group.Options[CurrentSelectionIdx];
|
||||||
if (Draw(string.Empty, CurrentSelection.Name, string.Empty, ref CurrentSelectionIdx, UiHelpers.InputTextWidth.X * 3 / 4,
|
if (Draw(string.Empty, CurrentSelection.Name, string.Empty, ref CurrentSelectionIdx, UiHelpers.InputTextWidth.X * 3 / 4,
|
||||||
ImGui.GetTextLineHeightWithSpacing()))
|
Im.Style.TextHeightWithSpacing))
|
||||||
parent.SetModSetting(_group, _groupIdx, Setting.Single(CurrentSelectionIdx));
|
parent.SetModSetting(_group, _groupIdx, Setting.Single(CurrentSelectionIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -173,7 +173,7 @@ public sealed class ModGroupDrawer : Luna.IUiService
|
||||||
|
|
||||||
Widget.EndFramedGroup();
|
Widget.EndFramedGroup();
|
||||||
var label = $"##multi{groupIdx}";
|
var label = $"##multi{groupIdx}";
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (Im.Item.RightClicked())
|
||||||
ImUtf8.OpenPopup($"##multi{groupIdx}");
|
ImUtf8.OpenPopup($"##multi{groupIdx}");
|
||||||
|
|
||||||
DrawMultiPopup(group, groupIdx, label);
|
DrawMultiPopup(group, groupIdx, label);
|
||||||
|
|
@ -254,7 +254,7 @@ public sealed class ModGroupDrawer : Luna.IUiService
|
||||||
{
|
{
|
||||||
var optionWidth = options.Max(o => ImUtf8.CalcTextSize(o.Name).X)
|
var optionWidth = options.Max(o => ImUtf8.CalcTextSize(o.Name).X)
|
||||||
+ ImGui.GetStyle().ItemInnerSpacing.X
|
+ ImGui.GetStyle().ItemInnerSpacing.X
|
||||||
+ ImGui.GetFrameHeight()
|
+ Im.Style.FrameHeight
|
||||||
+ ImGui.GetStyle().FramePadding.X;
|
+ ImGui.GetStyle().FramePadding.X;
|
||||||
var width = Math.Max(optionWidth, minWidth);
|
var width = Math.Max(optionWidth, minWidth);
|
||||||
if (ImUtf8.Button(buttonTextShow, new Vector2(width, 0)))
|
if (ImUtf8.Button(buttonTextShow, new Vector2(width, 0)))
|
||||||
|
|
|
||||||
|
|
@ -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;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
|
@ -23,7 +24,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
Configuration config,
|
Configuration config,
|
||||||
FilenameService filenames,
|
FilenameService filenames,
|
||||||
DescriptionEditPopup descriptionPopup,
|
DescriptionEditPopup descriptionPopup,
|
||||||
ImcChecker imcChecker) : Luna.IUiService
|
ImcChecker imcChecker) : IUiService
|
||||||
{
|
{
|
||||||
private static ReadOnlySpan<byte> AcrossGroupsLabel
|
private static ReadOnlySpan<byte> AcrossGroupsLabel
|
||||||
=> "##DragOptionAcross"u8;
|
=> "##DragOptionAcross"u8;
|
||||||
|
|
@ -99,7 +100,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
{
|
{
|
||||||
var text = _currentGroupEdited == group ? _currentGroupName ?? group.Name : group.Name;
|
var text = _currentGroupEdited == group ? _currentGroupName ?? group.Name : group.Name;
|
||||||
ImGui.SetNextItemWidth(_groupNameWidth);
|
ImGui.SetNextItemWidth(_groupNameWidth);
|
||||||
using var border = ImRaii.PushFrameBorder(UiHelpers.ScaleX2, Colors.RegexWarningBorder, !_isGroupNameValid);
|
using var border = ImRaii.PushFrameBorder(Im.Style.GlobalScale * 2, Colors.RegexWarningBorder, !_isGroupNameValid);
|
||||||
if (ImUtf8.InputText("##GroupName"u8, ref text))
|
if (ImUtf8.InputText("##GroupName"u8, ref text))
|
||||||
{
|
{
|
||||||
_currentGroupEdited = group;
|
_currentGroupEdited = group;
|
||||||
|
|
@ -140,7 +141,7 @@ public sealed class ModGroupEditDrawer(
|
||||||
? (_currentGroupPriority ?? group.Priority).Value
|
? (_currentGroupPriority ?? group.Priority).Value
|
||||||
: group.Priority.Value;
|
: group.Priority.Value;
|
||||||
ImGui.SetNextItemWidth(PriorityWidth);
|
ImGui.SetNextItemWidth(PriorityWidth);
|
||||||
if (ImGui.InputInt("##GroupPriority", ref priority, 0, 0))
|
if (ImGui.InputInt("##GroupPriority", ref priority))
|
||||||
{
|
{
|
||||||
_currentGroupEdited = group;
|
_currentGroupEdited = group;
|
||||||
_currentGroupPriority = new ModPriority(priority);
|
_currentGroupPriority = new ModPriority(priority);
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
.Push(ImGuiColor.HeaderHovered, 0x4000FFFF, leaf.Value.Favorite);
|
.Push(ImGuiColor.HeaderHovered, 0x4000FFFF, leaf.Value.Favorite);
|
||||||
using var id = ImUtf8.PushId(leaf.Value.Index);
|
using var id = ImUtf8.PushId(leaf.Value.Index);
|
||||||
ImUtf8.TreeNode(leaf.Value.Name, flags).Dispose();
|
ImUtf8.TreeNode(leaf.Value.Name, flags).Dispose();
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Middle))
|
if (Im.Item.MiddleClicked())
|
||||||
{
|
{
|
||||||
_modManager.SetKnown(leaf.Value);
|
_modManager.SetKnown(leaf.Value);
|
||||||
var (setting, collection) = _collectionManager.Active.Current.GetActualSettings(leaf.Value.Index);
|
var (setting, collection) = _collectionManager.Active.Current.GetActualSettings(leaf.Value.Index);
|
||||||
|
|
@ -439,9 +439,9 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
|
|
||||||
private void DrawHelpPopup()
|
private void DrawHelpPopup()
|
||||||
{
|
{
|
||||||
ImGuiUtil.HelpPopup("ExtendedHelp", new Vector2(1000 * UiHelpers.Scale, 38.5f * ImGui.GetTextLineHeightWithSpacing()), () =>
|
ImGuiUtil.HelpPopup("ExtendedHelp", new Vector2(1000 * Im.Style.GlobalScale, 38.5f * Im.Style.TextHeightWithSpacing), () =>
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.UnitY * ImGui.GetTextLineHeight());
|
ImGui.Dummy(Vector2.UnitY * Im.Style.TextHeight);
|
||||||
ImUtf8.Text("Mod Management"u8);
|
ImUtf8.Text("Mod Management"u8);
|
||||||
ImUtf8.BulletText("You can create empty mods or import mods with the buttons in this row."u8);
|
ImUtf8.BulletText("You can create empty mods or import mods with the buttons in this row."u8);
|
||||||
using var indent = ImRaii.PushIndent();
|
using var indent = ImRaii.PushIndent();
|
||||||
|
|
@ -452,7 +452,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
ImUtf8.BulletText("You can also create empty mod folders and delete mods."u8);
|
ImUtf8.BulletText("You can also create empty mod folders and delete mods."u8);
|
||||||
ImUtf8.BulletText(
|
ImUtf8.BulletText(
|
||||||
"For further editing of mods, select them and use the Edit Mod tab in the panel or the Advanced Editing popup."u8);
|
"For further editing of mods, select them and use the Edit Mod tab in the panel or the Advanced Editing popup."u8);
|
||||||
ImGui.Dummy(Vector2.UnitY * ImGui.GetTextLineHeight());
|
ImGui.Dummy(Vector2.UnitY * Im.Style.TextHeight);
|
||||||
ImUtf8.Text("Mod Selector"u8);
|
ImUtf8.Text("Mod Selector"u8);
|
||||||
ImUtf8.BulletText("Select a mod to obtain more information or change settings."u8);
|
ImUtf8.BulletText("Select a mod to obtain more information or change settings."u8);
|
||||||
ImUtf8.BulletText("Names are colored according to your config and their current state in the collection:"u8);
|
ImUtf8.BulletText("Names are colored according to your config and their current state in the collection:"u8);
|
||||||
|
|
@ -792,12 +792,12 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
{
|
{
|
||||||
using var combo = ImUtf8.Combo("##filterCombo"u8, ""u8,
|
using var combo = ImUtf8.Combo("##filterCombo"u8, ""u8,
|
||||||
ImGuiComboFlags.NoPreview | ImGuiComboFlags.PopupAlignLeft | ImGuiComboFlags.HeightLargest);
|
ImGuiComboFlags.NoPreview | ImGuiComboFlags.PopupAlignLeft | ImGuiComboFlags.HeightLargest);
|
||||||
var ret = ImGui.IsItemClicked(ImGuiMouseButton.Right);
|
var ret = Im.Item.RightClicked();
|
||||||
if (!combo)
|
if (!combo)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing,
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing,
|
||||||
ImGui.GetStyle().ItemSpacing with { Y = 3 * UiHelpers.Scale });
|
ImGui.GetStyle().ItemSpacing with { Y = 3 * Im.Style.GlobalScale });
|
||||||
|
|
||||||
if (ImUtf8.Checkbox("Everything"u8, ref everything))
|
if (ImUtf8.Checkbox("Everything"u8, ref everything))
|
||||||
{
|
{
|
||||||
|
|
@ -805,7 +805,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
SetFilterDirty();
|
SetFilterDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy(new Vector2(0, 5 * UiHelpers.Scale));
|
ImGui.Dummy(new Vector2(0, 5 * Im.Style.GlobalScale));
|
||||||
foreach (var (onFlag, offFlag, name) in ModFilterExtensions.TriStatePairs)
|
foreach (var (onFlag, offFlag, name) in ModFilterExtensions.TriStatePairs)
|
||||||
{
|
{
|
||||||
if (TriStateCheckbox.Instance.Draw(name, ref _stateFilter, onFlag, offFlag))
|
if (TriStateCheckbox.Instance.Draw(name, ref _stateFilter, onFlag, offFlag))
|
||||||
|
|
@ -829,7 +829,7 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
protected override (float, bool) CustomFilters(float width)
|
protected override (float, bool) CustomFilters(float width)
|
||||||
{
|
{
|
||||||
var pos = ImGui.GetCursorPos();
|
var pos = ImGui.GetCursorPos();
|
||||||
var remainingWidth = width - ImGui.GetFrameHeight();
|
var remainingWidth = width - Im.Style.FrameHeight;
|
||||||
var comboPos = new Vector2(pos.X + remainingWidth, pos.Y);
|
var comboPos = new Vector2(pos.X + remainingWidth, pos.Y);
|
||||||
|
|
||||||
var everything = _stateFilter == ModFilterExtensions.UnfilteredStateMods;
|
var everything = _stateFilter == ModFilterExtensions.UnfilteredStateMods;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using ImSharp;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.UI.AdvancedWindow;
|
|
||||||
|
|
||||||
namespace Penumbra.UI.ModsTab;
|
namespace Penumbra.UI.ModsTab;
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class ModPanel : IDisposable, Luna.IUiService
|
||||||
_header.Draw();
|
_header.Draw();
|
||||||
ImGui.SetCursorPosX(ImGui.GetScrollX() + ImGui.GetCursorPosX());
|
ImGui.SetCursorPosX(ImGui.GetScrollX() + ImGui.GetCursorPosX());
|
||||||
using var child = ImRaii.Child("Tabs",
|
using var child = ImRaii.Child("Tabs",
|
||||||
new Vector2(ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X, ImGui.GetContentRegionAvail().Y));
|
Im.ContentRegion.Available with { X = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X });
|
||||||
if (child)
|
if (child)
|
||||||
_tabs.Draw(_mod);
|
_tabs.Draw(_mod);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ public class ModPanelChangedItemsTab(
|
||||||
_stateStorage = ImGui.GetStateStorage();
|
_stateStorage = ImGui.GetStateStorage();
|
||||||
cache.Update(selector.Selected, drawer, config.Ephemeral.ChangedItemFilter, config.ChangedItemDisplay);
|
cache.Update(selector.Selected, drawer, config.Ephemeral.ChangedItemFilter, config.ChangedItemDisplay);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
_buttonSize = new Vector2(ImGui.GetStyle().ItemSpacing.Y + ImGui.GetFrameHeight());
|
_buttonSize = new Vector2(ImGui.GetStyle().ItemSpacing.Y + Im.Style.FrameHeight);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, Vector2.Zero)
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.FramePadding, Vector2.Zero)
|
.Push(ImGuiStyleVar.FramePadding, Vector2.Zero)
|
||||||
|
|
@ -237,7 +237,7 @@ public class ModPanelChangedItemsTab(
|
||||||
.Push(ImGuiColor.ButtonHovered, Rgba32.Transparent);
|
.Push(ImGuiColor.ButtonHovered, Rgba32.Transparent);
|
||||||
|
|
||||||
using var table = ImUtf8.Table("##changedItems"u8, cache.AnyExpandable ? 2 : 1, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY,
|
using var table = ImUtf8.Table("##changedItems"u8, cache.AnyExpandable ? 2 : 1, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, -1));
|
new Vector2(Im.ContentRegion.Available.X, -1));
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
|
|
@ -27,7 +28,7 @@ public class ModPanelCollectionsTab(CollectionManager manager, ModFileSystemSele
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
var (direct, inherited) = CountUsage(selector.Selected!);
|
var (direct, inherited) = CountUsage(selector.Selected!);
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
if (direct == 1)
|
if (direct == 1)
|
||||||
ImUtf8.Text("This Mod is directly configured in 1 collection."u8);
|
ImUtf8.Text("This Mod is directly configured in 1 collection."u8);
|
||||||
else if (direct == 0)
|
else if (direct == 0)
|
||||||
|
|
@ -37,15 +38,15 @@ public class ModPanelCollectionsTab(CollectionManager manager, ModFileSystemSele
|
||||||
if (inherited > 0)
|
if (inherited > 0)
|
||||||
ImUtf8.Text($"It is also implicitly used in {inherited} {(inherited == 1 ? "collection" : "collections")} through inheritance.");
|
ImUtf8.Text($"It is also implicitly used in {inherited} {(inherited == 1 ? "collection" : "collections")} through inheritance.");
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
using var table = ImUtf8.Table("##modCollections"u8, 3, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
using var table = ImUtf8.Table("##modCollections"u8, 3, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var size = ImUtf8.CalcTextSize(ToText(ModState.Unconfigured)).X + 20 * ImGuiHelpers.GlobalScale;
|
var size = ImUtf8.CalcTextSize(ToText(ModState.Unconfigured)).X + 20 * Im.Style.GlobalScale;
|
||||||
var collectionSize = 200 * ImGuiHelpers.GlobalScale;
|
var collectionSize = 200 * Im.Style.GlobalScale;
|
||||||
ImGui.TableSetupColumn("Collection", ImGuiTableColumnFlags.WidthFixed, collectionSize);
|
ImGui.TableSetupColumn("Collection", ImGuiTableColumnFlags.WidthFixed, collectionSize);
|
||||||
ImGui.TableSetupColumn("State", ImGuiTableColumnFlags.WidthFixed, size);
|
ImGui.TableSetupColumn("State", ImGuiTableColumnFlags.WidthFixed, size);
|
||||||
ImGui.TableSetupColumn("Inherited From", ImGuiTableColumnFlags.WidthFixed, collectionSize);
|
ImGui.TableSetupColumn("Inherited From", ImGuiTableColumnFlags.WidthFixed, collectionSize);
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,13 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
|
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
using var table = ImRaii.Table("conflicts", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY, ImGui.GetContentRegionAvail());
|
using var table = ImRaii.Table("conflicts", 3, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY, Im.ContentRegion.Available);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var buttonSize = new Vector2(ImGui.GetFrameHeight());
|
var buttonSize = new Vector2(Im.Style.FrameHeight);
|
||||||
var spacing = ImGui.GetStyle().ItemInnerSpacing with { Y = ImGui.GetStyle().ItemSpacing.Y };
|
var spacing = ImGui.GetStyle().ItemInnerSpacing with { Y = ImGui.GetStyle().ItemSpacing.Y };
|
||||||
var priorityRowWidth = ImGui.CalcTextSize("Priority").X + 20 * ImGuiHelpers.GlobalScale + 2 * buttonSize.X;
|
var priorityRowWidth = ImGui.CalcTextSize("Priority").X + 20 * Im.Style.GlobalScale + 2 * buttonSize.X;
|
||||||
var priorityWidth = priorityRowWidth - 2 * (buttonSize.X + spacing.X);
|
var priorityWidth = priorityRowWidth - 2 * (buttonSize.X + spacing.X);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
||||||
ImGui.TableSetupColumn("Conflicting Mod", ImGuiTableColumnFlags.WidthStretch);
|
ImGui.TableSetupColumn("Conflicting Mod", ImGuiTableColumnFlags.WidthStretch);
|
||||||
|
|
@ -106,7 +106,7 @@ public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSy
|
||||||
if (ImGui.Selectable(conflict.Mod2.Name) && conflict.Mod2 is Mod otherMod)
|
if (ImGui.Selectable(conflict.Mod2.Name) && conflict.Mod2 is Mod otherMod)
|
||||||
selector.SelectByValue(otherMod);
|
selector.SelectByValue(otherMod);
|
||||||
var hovered = ImGui.IsItemHovered();
|
var hovered = ImGui.IsItemHovered();
|
||||||
var rightClicked = ImGui.IsItemClicked(ImGuiMouseButton.Right);
|
var rightClicked = Im.Item.RightClicked();
|
||||||
if (conflict.Mod2 is Mod otherMod2)
|
if (conflict.Mod2 is Mod otherMod2)
|
||||||
{
|
{
|
||||||
if (hovered)
|
if (hovered)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Utility;
|
using ImSharp;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Widgets;
|
using OtterGui.Widgets;
|
||||||
|
|
@ -26,11 +26,11 @@ public class ModPanelDescriptionTab(
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.Dummy(ImGuiHelpers.ScaledVector2(2));
|
ImGui.Dummy(ImEx.ScaledVector(2));
|
||||||
|
|
||||||
ImGui.Dummy(ImGuiHelpers.ScaledVector2(2));
|
ImGui.Dummy(ImEx.ScaledVector(2));
|
||||||
var (predefinedTagsEnabled, predefinedTagButtonOffset) = predefinedTagsConfig.Enabled
|
var (predefinedTagsEnabled, predefinedTagButtonOffset) = predefinedTagsConfig.Enabled
|
||||||
? (true, ImGui.GetFrameHeight() + ImGui.GetStyle().WindowPadding.X + (ImGui.GetScrollMaxY() > 0 ? ImGui.GetStyle().ScrollbarSize : 0))
|
? (true, Im.Style.FrameHeight + ImGui.GetStyle().WindowPadding.X + (ImGui.GetScrollMaxY() > 0 ? ImGui.GetStyle().ScrollbarSize : 0))
|
||||||
: (false, 0);
|
: (false, 0);
|
||||||
var tagIdx = _localTags.Draw("Local Tags: ",
|
var tagIdx = _localTags.Draw("Local Tags: ",
|
||||||
"Custom tags you can set personally that will not be exported to the mod data but only set for you.\n"
|
"Custom tags you can set personally that will not be exported to the mod data but only set for you.\n"
|
||||||
|
|
@ -49,7 +49,7 @@ public class ModPanelDescriptionTab(
|
||||||
selector.Selected!.ModTags, out _, false,
|
selector.Selected!.ModTags, out _, false,
|
||||||
ImGui.CalcTextSize("Local ").X - ImGui.CalcTextSize("Mod ").X);
|
ImGui.CalcTextSize("Local ").X - ImGui.CalcTextSize("Mod ").X);
|
||||||
|
|
||||||
ImGui.Dummy(ImGuiHelpers.ScaledVector2(2));
|
ImGui.Dummy(ImEx.ScaledVector(2));
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
ImGuiUtil.TextWrapped(selector.Selected!.Description);
|
ImGuiUtil.TextWrapped(selector.Selected!.Description);
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class ModPanelEditTab(
|
||||||
|
|
||||||
UiHelpers.DefaultLineSpace();
|
UiHelpers.DefaultLineSpace();
|
||||||
var sharedTagsEnabled = predefinedTagManager.Enabled;
|
var sharedTagsEnabled = predefinedTagManager.Enabled;
|
||||||
var sharedTagButtonOffset = sharedTagsEnabled ? ImGui.GetFrameHeight() + ImGui.GetStyle().FramePadding.X : 0;
|
var sharedTagButtonOffset = sharedTagsEnabled ? Im.Style.FrameHeight + ImGui.GetStyle().FramePadding.X : 0;
|
||||||
var tagIdx = _modTags.Draw("Mod Tags: ", "Edit tags by clicking them, or add new tags. Empty tags are removed.", _mod.ModTags,
|
var tagIdx = _modTags.Draw("Mod Tags: ", "Edit tags by clicking them, or add new tags. Empty tags are removed.", _mod.ModTags,
|
||||||
out var editedTag, rightEndOffset: sharedTagButtonOffset);
|
out var editedTag, rightEndOffset: sharedTagButtonOffset);
|
||||||
if (tagIdx >= 0)
|
if (tagIdx >= 0)
|
||||||
|
|
@ -98,7 +98,7 @@ public class ModPanelEditTab(
|
||||||
/// <summary> The general edit row for non-detailed mod edits. </summary>
|
/// <summary> The general edit row for non-detailed mod edits. </summary>
|
||||||
private void EditButtons()
|
private void EditButtons()
|
||||||
{
|
{
|
||||||
var buttonSize = new Vector2(150 * UiHelpers.Scale, 0);
|
var buttonSize = new Vector2(150 * Im.Style.GlobalScale, 0);
|
||||||
var folderExists = Directory.Exists(_mod.ModPath.FullName);
|
var folderExists = Directory.Exists(_mod.ModPath.FullName);
|
||||||
var tt = folderExists
|
var tt = folderExists
|
||||||
? $"Open \"{_mod.ModPath.FullName}\" in the file explorer of your choice."
|
? $"Open \"{_mod.ModPath.FullName}\" in the file explorer of your choice."
|
||||||
|
|
@ -129,7 +129,7 @@ public class ModPanelEditTab(
|
||||||
if (ImUtf8.ButtonEx("Export Mod"u8, tt, buttonSize, ModBackup.CreatingBackup))
|
if (ImUtf8.ButtonEx("Export Mod"u8, tt, buttonSize, ModBackup.CreatingBackup))
|
||||||
backup.CreateAsync();
|
backup.CreateAsync();
|
||||||
|
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (Im.Item.RightClicked())
|
||||||
ImUtf8.OpenPopup("context"u8);
|
ImUtf8.OpenPopup("context"u8);
|
||||||
|
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
@ -181,7 +181,7 @@ public class ModPanelEditTab(
|
||||||
UiHelpers.InputTextWidth.X))
|
UiHelpers.InputTextWidth.X))
|
||||||
modManager.DataEditor.ChangeModWebsite(_mod, newWebsite);
|
modManager.DataEditor.ChangeModWebsite(_mod, newWebsite);
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(UiHelpers.ScaleX3));
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(Im.Style.GlobalScale * 3));
|
||||||
|
|
||||||
var reducedSize = new Vector2(UiHelpers.InputTextMinusButton3, 0);
|
var reducedSize = new Vector2(UiHelpers.InputTextMinusButton3, 0);
|
||||||
if (ImGui.Button("Edit Description", reducedSize))
|
if (ImGui.Button("Edit Description", reducedSize))
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,10 @@ public class ModPanelHeader : IDisposable
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
UpdateModData();
|
UpdateModData();
|
||||||
var height = ImGui.GetContentRegionAvail().Y;
|
var height = Im.ContentRegion.Available.Y;
|
||||||
var maxHeight = 3 * height / 4;
|
var maxHeight = 3 * height / 4;
|
||||||
using var child = _lastPreSettingsHeight > maxHeight && _communicator.PreSettingsTabBarDraw.HasSubscribers
|
using var child = _lastPreSettingsHeight > maxHeight && _communicator.PreSettingsTabBarDraw.HasSubscribers
|
||||||
? ImRaii.Child("HeaderChild", new Vector2(ImGui.GetContentRegionAvail().X, maxHeight), false)
|
? ImRaii.Child("HeaderChild", new Vector2(Im.ContentRegion.Available.X, maxHeight), false)
|
||||||
: null;
|
: null;
|
||||||
using (ImRaii.Group())
|
using (ImRaii.Group())
|
||||||
{
|
{
|
||||||
|
|
@ -75,7 +75,7 @@ public class ModPanelHeader : IDisposable
|
||||||
{
|
{
|
||||||
using var f = _nameFont.Push();
|
using var f = _nameFont.Push();
|
||||||
_modName = name;
|
_modName = name;
|
||||||
_modNameWidth = ImGui.CalcTextSize(name).X + 2 * (ImGui.GetStyle().FramePadding.X + 2 * UiHelpers.Scale);
|
_modNameWidth = ImGui.CalcTextSize(name).X + 2 * (ImGui.GetStyle().FramePadding.X + 2 * Im.Style.GlobalScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Author
|
// Author
|
||||||
|
|
@ -178,7 +178,7 @@ public class ModPanelHeader : IDisposable
|
||||||
{
|
{
|
||||||
if (_modWebsiteButton.Length == 0)
|
if (_modWebsiteButton.Length == 0)
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public class ModPanelSettingsTab(
|
||||||
|
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
using var table = ImUtf8.Table("##settings"u8, 1, ImGuiTableFlags.ScrollY, ImGui.GetContentRegionAvail());
|
using var table = ImUtf8.Table("##settings"u8, 1, ImGuiTableFlags.ScrollY, Im.ContentRegion.Available);
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ public class ModPanelSettingsTab(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var color = ImGuiColor.Button.Push(Rgba32.TintColor(Im.Style[ImGuiColor.Button], ColorId.TemporaryModSettingsTint.Value().ToVector()));
|
using var color = ImGuiColor.Button.Push(Rgba32.TintColor(Im.Style[ImGuiColor.Button], ColorId.TemporaryModSettingsTint.Value().ToVector()));
|
||||||
var width = new Vector2(ImGui.GetContentRegionAvail().X, 0);
|
var width = new Vector2(Im.ContentRegion.Available.X, 0);
|
||||||
if (ImUtf8.ButtonEx($"These settings are temporarily set by {selection.TemporarySettings!.Source}{(_locked ? " and locked." : ".")}",
|
if (ImUtf8.ButtonEx($"These settings are temporarily set by {selection.TemporarySettings!.Source}{(_locked ? " and locked." : ".")}",
|
||||||
width,
|
width,
|
||||||
_locked))
|
_locked))
|
||||||
|
|
@ -93,7 +93,7 @@ public class ModPanelSettingsTab(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var color = ImGuiColor.Button.Push(Colors.PressEnterWarningBg);
|
using var color = ImGuiColor.Button.Push(Colors.PressEnterWarningBg);
|
||||||
var width = new Vector2(ImGui.GetContentRegionAvail().X, 0);
|
var width = new Vector2(Im.ContentRegion.Available.X, 0);
|
||||||
if (ImUtf8.ButtonEx($"These settings are inherited from {selection.Collection.Identity.Name}.", width, _locked))
|
if (ImUtf8.ButtonEx($"These settings are inherited from {selection.Collection.Identity.Name}.", width, _locked))
|
||||||
{
|
{
|
||||||
if (_temporary)
|
if (_temporary)
|
||||||
|
|
@ -142,7 +142,7 @@ public class ModPanelSettingsTab(
|
||||||
using var group = ImUtf8.Group();
|
using var group = ImUtf8.Group();
|
||||||
var settings = selection.Settings;
|
var settings = selection.Settings;
|
||||||
var priority = _currentPriority ?? settings.Priority.Value;
|
var priority = _currentPriority ?? settings.Priority.Value;
|
||||||
ImGui.SetNextItemWidth(50 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(50 * Im.Style.GlobalScale);
|
||||||
using var disabled = ImRaii.Disabled(_locked);
|
using var disabled = ImRaii.Disabled(_locked);
|
||||||
if (ImUtf8.InputScalar("##Priority"u8, ref priority))
|
if (ImUtf8.InputScalar("##Priority"u8, ref priority))
|
||||||
_currentPriority = priority;
|
_currentPriority = priority;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class MultiModPanel(ModFileSystemSelector selector, ModDataEditor editor,
|
||||||
if (selector.SelectedPaths.Count == 0)
|
if (selector.SelectedPaths.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
var treeNodePos = ImGui.GetCursorPos();
|
var treeNodePos = ImGui.GetCursorPos();
|
||||||
var numLeaves = DrawModList();
|
var numLeaves = DrawModList();
|
||||||
DrawCounts(treeNodePos, numLeaves);
|
DrawCounts(treeNodePos, numLeaves);
|
||||||
|
|
@ -50,8 +50,8 @@ public class MultiModPanel(ModFileSystemSelector selector, ModDataEditor editor,
|
||||||
if (!tree)
|
if (!tree)
|
||||||
return selector.SelectedPaths.Count(l => l is ModFileSystem.Leaf);
|
return selector.SelectedPaths.Count(l => l is ModFileSystem.Leaf);
|
||||||
|
|
||||||
var sizeType = new Vector2(ImGui.GetFrameHeight());
|
var sizeType = new Vector2(Im.Style.FrameHeight);
|
||||||
var availableSizePercent = (ImGui.GetContentRegionAvail().X - sizeType.X - 4 * ImGui.GetStyle().CellPadding.X) / 100;
|
var availableSizePercent = (Im.ContentRegion.Available.X - sizeType.X - 4 * ImGui.GetStyle().CellPadding.X) / 100;
|
||||||
var sizeMods = availableSizePercent * 35;
|
var sizeMods = availableSizePercent * 35;
|
||||||
var sizeFolders = availableSizePercent * 65;
|
var sizeFolders = availableSizePercent * 65;
|
||||||
|
|
||||||
|
|
@ -94,14 +94,14 @@ public class MultiModPanel(ModFileSystemSelector selector, ModDataEditor editor,
|
||||||
|
|
||||||
private void DrawMultiTagger()
|
private void DrawMultiTagger()
|
||||||
{
|
{
|
||||||
var width = ImGuiHelpers.ScaledVector2(150, 0);
|
var width = ImEx.ScaledVector(150, 0);
|
||||||
ImUtf8.TextFrameAligned("Multi Tagger:"u8);
|
ImUtf8.TextFrameAligned("Multi Tagger:"u8);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
|
|
||||||
var predefinedTagsEnabled = tagManager.Enabled;
|
var predefinedTagsEnabled = tagManager.Enabled;
|
||||||
var inputWidth = predefinedTagsEnabled
|
var inputWidth = predefinedTagsEnabled
|
||||||
? ImGui.GetContentRegionAvail().X - 2 * width.X - 3 * ImGui.GetStyle().ItemInnerSpacing.X - ImGui.GetFrameHeight()
|
? Im.ContentRegion.Available.X - 2 * width.X - 3 * ImGui.GetStyle().ItemInnerSpacing.X - Im.Style.FrameHeight
|
||||||
: ImGui.GetContentRegionAvail().X - 2 * (width.X + ImGui.GetStyle().ItemInnerSpacing.X);
|
: Im.ContentRegion.Available.X - 2 * (width.X + ImGui.GetStyle().ItemInnerSpacing.X);
|
||||||
ImGui.SetNextItemWidth(inputWidth);
|
ImGui.SetNextItemWidth(inputWidth);
|
||||||
ImUtf8.InputText("##tag"u8, ref _tag, "Local Tag Name..."u8);
|
ImUtf8.InputText("##tag"u8, ref _tag, "Local Tag Name..."u8);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ public sealed class ResourceWatcher : IDisposable, ITab, Luna.IUiService
|
||||||
{
|
{
|
||||||
UpdateRecords();
|
UpdateRecords();
|
||||||
|
|
||||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetTextLineHeightWithSpacing() / 2);
|
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + Im.Style.TextHeightWithSpacing / 2);
|
||||||
var isEnabled = _ephemeral.EnableResourceWatcher;
|
var isEnabled = _ephemeral.EnableResourceWatcher;
|
||||||
if (Im.Checkbox("Enable"u8, ref isEnabled))
|
if (Im.Checkbox("Enable"u8, ref isEnabled))
|
||||||
{
|
{
|
||||||
|
|
@ -182,7 +182,7 @@ public sealed class ResourceWatcher : IDisposable, ITab, Luna.IUiService
|
||||||
Im.Item.SetNextWidthScaled(80);
|
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 (Im.Item.RightClicked() && ImGui.GetIO().KeyCtrl)
|
||||||
{
|
{
|
||||||
change = true;
|
change = true;
|
||||||
_newMaxEntries = DefaultMaxEntries;
|
_newMaxEntries = DefaultMaxEntries;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class PathColumn : ColumnString<Record>
|
private sealed class PathColumn : ColumnString<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 300 * UiHelpers.Scale;
|
=> 300 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override string ToName(Record item)
|
public override string ToName(Record item)
|
||||||
=> item.Path.ToString();
|
=> item.Path.ToString();
|
||||||
|
|
@ -51,7 +51,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
=> lhs.Path.CompareTo(rhs.Path);
|
=> lhs.Path.CompareTo(rhs.Path);
|
||||||
|
|
||||||
public override void DrawColumn(Record item, int _)
|
public override void DrawColumn(Record item, int _)
|
||||||
=> DrawByteString(item.Path, 280 * UiHelpers.Scale);
|
=> DrawByteString(item.Path, 280 * Im.Style.GlobalScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static unsafe void DrawByteString(CiByteString path, float length)
|
private static unsafe void DrawByteString(CiByteString path, float length)
|
||||||
|
|
@ -104,7 +104,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 80 * UiHelpers.Scale;
|
=> 80 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override bool FilterFunc(Record item)
|
public override bool FilterFunc(Record item)
|
||||||
=> FilterValue.HasFlag(item.RecordType);
|
=> FilterValue.HasFlag(item.RecordType);
|
||||||
|
|
@ -139,7 +139,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class DateColumn : Column<Record>
|
private sealed class DateColumn : Column<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 80 * UiHelpers.Scale;
|
=> 80 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override int Compare(Record lhs, Record rhs)
|
public override int Compare(Record lhs, Record rhs)
|
||||||
=> lhs.Time.CompareTo(rhs.Time);
|
=> lhs.Time.CompareTo(rhs.Time);
|
||||||
|
|
@ -167,7 +167,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class CollectionColumn : ColumnString<Record>
|
private sealed class CollectionColumn : ColumnString<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 80 * UiHelpers.Scale;
|
=> 80 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override string ToName(Record item)
|
public override string ToName(Record item)
|
||||||
=> (item.Collection != null ? item.Collection.Identity.Name : null) ?? string.Empty;
|
=> (item.Collection != null ? item.Collection.Identity.Name : null) ?? string.Empty;
|
||||||
|
|
@ -176,7 +176,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class ObjectColumn : ColumnString<Record>
|
private sealed class ObjectColumn : ColumnString<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 200 * UiHelpers.Scale;
|
=> 200 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override string ToName(Record item)
|
public override string ToName(Record item)
|
||||||
=> item.AssociatedGameObject;
|
=> item.AssociatedGameObject;
|
||||||
|
|
@ -185,7 +185,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class OriginalPathColumn : ColumnString<Record>
|
private sealed class OriginalPathColumn : ColumnString<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 200 * UiHelpers.Scale;
|
=> 200 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override string ToName(Record item)
|
public override string ToName(Record item)
|
||||||
=> item.OriginalPath.ToString();
|
=> item.OriginalPath.ToString();
|
||||||
|
|
@ -194,7 +194,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
=> lhs.OriginalPath.CompareTo(rhs.OriginalPath);
|
=> lhs.OriginalPath.CompareTo(rhs.OriginalPath);
|
||||||
|
|
||||||
public override void DrawColumn(Record item, int _)
|
public override void DrawColumn(Record item, int _)
|
||||||
=> DrawByteString(item.OriginalPath, 190 * UiHelpers.Scale);
|
=> DrawByteString(item.OriginalPath, 190 * Im.Style.GlobalScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class ResourceCategoryColumn : ColumnFlags<ResourceCategoryFlag, Record>
|
private sealed class ResourceCategoryColumn : ColumnFlags<ResourceCategoryFlag, Record>
|
||||||
|
|
@ -208,7 +208,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 80 * UiHelpers.Scale;
|
=> 80 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override bool FilterFunc(Record item)
|
public override bool FilterFunc(Record item)
|
||||||
=> FilterValue.HasFlag(item.Category);
|
=> FilterValue.HasFlag(item.Category);
|
||||||
|
|
@ -245,7 +245,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 50 * UiHelpers.Scale;
|
=> 50 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override bool FilterFunc(Record item)
|
public override bool FilterFunc(Record item)
|
||||||
=> FilterValue.HasFlag(item.ResourceType);
|
=> FilterValue.HasFlag(item.ResourceType);
|
||||||
|
|
@ -272,7 +272,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class LoadStateColumn : ColumnFlags<LoadStateColumn.LoadStateFlag, Record>
|
private sealed class LoadStateColumn : ColumnFlags<LoadStateColumn.LoadStateFlag, Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 50 * UiHelpers.Scale;
|
=> 50 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum LoadStateFlag : byte
|
public enum LoadStateFlag : byte
|
||||||
|
|
@ -354,7 +354,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class HandleColumn : ColumnString<Record>
|
private sealed class HandleColumn : ColumnString<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 120 * UiHelpers.Scale;
|
=> 120 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override unsafe string ToName(Record item)
|
public override unsafe string ToName(Record item)
|
||||||
=> item.Handle == null ? string.Empty : $"0x{(ulong)item.Handle:X}";
|
=> item.Handle == null ? string.Empty : $"0x{(ulong)item.Handle:X}";
|
||||||
|
|
@ -419,7 +419,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class CustomLoadColumn : OptBoolColumn
|
private sealed class CustomLoadColumn : OptBoolColumn
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 60 * UiHelpers.Scale;
|
=> 60 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override bool FilterFunc(Record item)
|
public override bool FilterFunc(Record item)
|
||||||
=> FilterFunc(item.CustomLoad);
|
=> FilterFunc(item.CustomLoad);
|
||||||
|
|
@ -431,7 +431,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class SynchronousLoadColumn : OptBoolColumn
|
private sealed class SynchronousLoadColumn : OptBoolColumn
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 45 * UiHelpers.Scale;
|
=> 45 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override bool FilterFunc(Record item)
|
public override bool FilterFunc(Record item)
|
||||||
=> FilterFunc(item.Synchronously);
|
=> FilterFunc(item.Synchronously);
|
||||||
|
|
@ -443,7 +443,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class RefCountColumn : Column<Record>
|
private sealed class RefCountColumn : Column<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 30 * UiHelpers.Scale;
|
=> 30 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override void DrawColumn(Record item, int _)
|
public override void DrawColumn(Record item, int _)
|
||||||
=> ImGuiUtil.RightAlign(item.RefCount.ToString());
|
=> ImGuiUtil.RightAlign(item.RefCount.ToString());
|
||||||
|
|
@ -455,7 +455,7 @@ internal sealed class ResourceWatcherTable : Table<Record>
|
||||||
private sealed class OsThreadColumn : ColumnString<Record>
|
private sealed class OsThreadColumn : ColumnString<Record>
|
||||||
{
|
{
|
||||||
public override float Width
|
public override float Width
|
||||||
=> 60 * UiHelpers.Scale;
|
=> 60 * Im.Style.GlobalScale;
|
||||||
|
|
||||||
public override string ToName(Record item)
|
public override string ToName(Record item)
|
||||||
=> item.OsThreadId.ToString();
|
=> item.OsThreadId.ToString();
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class ChangedItemsTab(
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_buttonSize = new Vector2(ImGui.GetStyle().ItemSpacing.Y + ImGui.GetFrameHeight());
|
_buttonSize = new Vector2(ImGui.GetStyle().ItemSpacing.Y + Im.Style.FrameHeight);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, Vector2.Zero)
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.CellPadding, Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
.Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero)
|
||||||
.Push(ImGuiStyleVar.FramePadding, Vector2.Zero)
|
.Push(ImGuiStyleVar.FramePadding, Vector2.Zero)
|
||||||
|
|
@ -50,9 +50,9 @@ public class ChangedItemsTab(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ImGuiTableColumnFlags flags = ImGuiTableColumnFlags.NoResize | ImGuiTableColumnFlags.WidthFixed;
|
const ImGuiTableColumnFlags flags = ImGuiTableColumnFlags.NoResize | ImGuiTableColumnFlags.WidthFixed;
|
||||||
ImUtf8.TableSetupColumn("items"u8, flags, 450 * UiHelpers.Scale);
|
ImUtf8.TableSetupColumn("items"u8, flags, 450 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("mods"u8, flags, varWidth - 140 * UiHelpers.Scale);
|
ImUtf8.TableSetupColumn("mods"u8, flags, varWidth - 140 * Im.Style.GlobalScale);
|
||||||
ImUtf8.TableSetupColumn("id"u8, flags, 140 * UiHelpers.Scale);
|
ImUtf8.TableSetupColumn("id"u8, flags, 140 * Im.Style.GlobalScale);
|
||||||
|
|
||||||
var items = collectionManager.Active.Current.ChangedItems;
|
var items = collectionManager.Active.Current.ChangedItems;
|
||||||
var rest = ImGuiClip.FilteredClippedDraw(items, skips, FilterChangedItem, DrawChangedItemColumn);
|
var rest = ImGuiClip.FilteredClippedDraw(items, skips, FilterChangedItem, DrawChangedItemColumn);
|
||||||
|
|
@ -62,10 +62,10 @@ public class ChangedItemsTab(
|
||||||
/// <summary> Draw a pair of filters and return the variable width of the flexible column. </summary>
|
/// <summary> Draw a pair of filters and return the variable width of the flexible column. </summary>
|
||||||
private float DrawFilters()
|
private float DrawFilters()
|
||||||
{
|
{
|
||||||
var varWidth = ImGui.GetContentRegionAvail().X
|
var varWidth = Im.ContentRegion.Available.X
|
||||||
- 450 * UiHelpers.Scale
|
- 450 * Im.Style.GlobalScale
|
||||||
- ImGui.GetStyle().ItemSpacing.X;
|
- ImGui.GetStyle().ItemSpacing.X;
|
||||||
ImGui.SetNextItemWidth(450 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(450 * Im.Style.GlobalScale);
|
||||||
Im.Input.Text("##changedItemsFilter"u8, ref _changedItemFilter, "Filter Item..."u8);
|
Im.Input.Text("##changedItemsFilter"u8, ref _changedItemFilter, "Filter Item..."u8);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
ImGui.SetNextItemWidth(varWidth);
|
ImGui.SetNextItemWidth(varWidth);
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,9 @@ public sealed class CollectionsTab : IDisposable, ITab, Luna.IUiService
|
||||||
|
|
||||||
private void DrawHeaderLine()
|
private void DrawHeaderLine()
|
||||||
{
|
{
|
||||||
var withSpacing = ImGui.GetFrameHeightWithSpacing();
|
var withSpacing = Im.Style.FrameHeightWithSpacing;
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameRounding, 0).Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameRounding, 0).Push(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
||||||
var buttonSize = new Vector2((ImGui.GetContentRegionAvail().X - withSpacing) / 4f, ImGui.GetFrameHeight());
|
var buttonSize = new Vector2((Im.ContentRegion.Available.X - withSpacing) / 4f, Im.Style.FrameHeight);
|
||||||
|
|
||||||
using var _ = ImRaii.Group();
|
using var _ = ImRaii.Group();
|
||||||
var tabSelectedColor = Im.Style[ImGuiColor.TabSelected];
|
var tabSelectedColor = Im.Style[ImGuiColor.TabSelected];
|
||||||
|
|
@ -122,7 +122,7 @@ public sealed class CollectionsTab : IDisposable, ITab, Luna.IUiService
|
||||||
private void DrawPanel()
|
private void DrawPanel()
|
||||||
{
|
{
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
||||||
using var child = ImRaii.Child("##CollectionSettings", new Vector2(ImGui.GetContentRegionAvail().X, 0), true);
|
using var child = ImRaii.Child("##CollectionSettings", new Vector2(Im.ContentRegion.Available.X, 0), true);
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public static class CrashDataExtensions
|
||||||
ImGuiUtil.DrawTableColumn(character.CollectionId.ToString());
|
ImGuiUtil.DrawTableColumn(character.CollectionId.ToString());
|
||||||
ImGuiUtil.DrawTableColumn(character.CharacterAddress);
|
ImGuiUtil.DrawTableColumn(character.CharacterAddress);
|
||||||
ImGuiUtil.DrawTableColumn(character.Timestamp.ToString());
|
ImGuiUtil.DrawTableColumn(character.Timestamp.ToString());
|
||||||
}, ImGui.GetTextLineHeightWithSpacing());
|
}, Im.Style.TextHeightWithSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawFiles(this CrashData data)
|
public static void DrawFiles(this CrashData data)
|
||||||
|
|
@ -83,7 +83,7 @@ public static class CrashDataExtensions
|
||||||
ImGuiUtil.DrawTableColumn(file.CollectionId.ToString());
|
ImGuiUtil.DrawTableColumn(file.CollectionId.ToString());
|
||||||
ImGuiUtil.DrawTableColumn(file.CharacterAddress);
|
ImGuiUtil.DrawTableColumn(file.CharacterAddress);
|
||||||
ImGuiUtil.DrawTableColumn(file.Timestamp.ToString());
|
ImGuiUtil.DrawTableColumn(file.Timestamp.ToString());
|
||||||
}, ImGui.GetTextLineHeightWithSpacing());
|
}, Im.Style.TextHeightWithSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawVfxInvocations(this CrashData data)
|
public static void DrawVfxInvocations(this CrashData data)
|
||||||
|
|
@ -106,6 +106,6 @@ public static class CrashDataExtensions
|
||||||
ImGuiUtil.DrawTableColumn(vfx.CollectionId.ToString());
|
ImGuiUtil.DrawTableColumn(vfx.CollectionId.ToString());
|
||||||
ImGuiUtil.DrawTableColumn(vfx.CharacterAddress);
|
ImGuiUtil.DrawTableColumn(vfx.CharacterAddress);
|
||||||
ImGuiUtil.DrawTableColumn(vfx.Timestamp.ToString());
|
ImGuiUtil.DrawTableColumn(vfx.Timestamp.ToString());
|
||||||
}, ImGui.GetTextLineHeightWithSpacing());
|
}, Im.Style.TextHeightWithSpacing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,17 +243,17 @@ public class DebugTab : Window, ITab
|
||||||
if (i < collection.Inheritance.DirectlyInheritsFrom.Count)
|
if (i < collection.Inheritance.DirectlyInheritsFrom.Count)
|
||||||
ImUtf8.Text(collection.Inheritance.DirectlyInheritsFrom[i].Identity.Name);
|
ImUtf8.Text(collection.Inheritance.DirectlyInheritsFrom[i].Identity.Name);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, ImGui.GetTextLineHeight()));
|
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, Im.Style.TextHeight));
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (i < collection.Inheritance.DirectlyInheritedBy.Count)
|
if (i < collection.Inheritance.DirectlyInheritedBy.Count)
|
||||||
ImUtf8.Text(collection.Inheritance.DirectlyInheritedBy[i].Identity.Name);
|
ImUtf8.Text(collection.Inheritance.DirectlyInheritedBy[i].Identity.Name);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, ImGui.GetTextLineHeight()));
|
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, Im.Style.TextHeight));
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if (i < collection.Inheritance.FlatHierarchy.Count)
|
if (i < collection.Inheritance.FlatHierarchy.Count)
|
||||||
ImUtf8.Text(collection.Inheritance.FlatHierarchy[i].Identity.Name);
|
ImUtf8.Text(collection.Inheritance.FlatHierarchy[i].Identity.Name);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, ImGui.GetTextLineHeight()));
|
ImGui.Dummy(new Vector2(200 * ImUtf8.GlobalScale, Im.Style.TextHeight));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -500,7 +500,7 @@ public class DebugTab : Window, ITab
|
||||||
using (var start = Im.Tree.Node("Startup Performance"u8, TreeNodeFlags.DefaultOpen))
|
using (var start = Im.Tree.Node("Startup Performance"u8, TreeNodeFlags.DefaultOpen))
|
||||||
{
|
{
|
||||||
if (start)
|
if (start)
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -820,7 +820,7 @@ public class DebugTab : Window, ITab
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var list = ImUtf8.ListBox("##ChangedItemList"u8,
|
using var list = ImUtf8.ListBox("##ChangedItemList"u8,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, 8 * ImGui.GetTextLineHeightWithSpacing()));
|
new Vector2(Im.ContentRegion.Available.X, 8 * Im.Style.TextHeightWithSpacing));
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -865,11 +865,11 @@ public class DebugTab : Window, ITab
|
||||||
ImGui.InputText("File Name", ref _emoteSearchFile, 256);
|
ImGui.InputText("File Name", ref _emoteSearchFile, 256);
|
||||||
ImGui.InputText("Emote Name", ref _emoteSearchName, 256);
|
ImGui.InputText("Emote Name", ref _emoteSearchName, 256);
|
||||||
using var table = Im.Table.Begin("##table"u8, 2, TableFlags.RowBackground | TableFlags.ScrollY | TableFlags.SizingFixedFit,
|
using var table = Im.Table.Begin("##table"u8, 2, TableFlags.RowBackground | TableFlags.ScrollY | TableFlags.SizingFixedFit,
|
||||||
new Vector2(-1, 12 * ImGui.GetTextLineHeightWithSpacing()));
|
new Vector2(-1, 12 * Im.Style.TextHeightWithSpacing));
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var skips = ImGuiClip.GetNecessarySkips(ImGui.GetTextLineHeightWithSpacing());
|
var skips = ImGuiClip.GetNecessarySkips(Im.Style.TextHeightWithSpacing);
|
||||||
var dummy = ImGuiClip.FilteredClippedDraw(_emotes, skips,
|
var dummy = ImGuiClip.FilteredClippedDraw(_emotes, skips,
|
||||||
p => p.Key.Contains(_emoteSearchFile, StringComparison.OrdinalIgnoreCase)
|
p => p.Key.Contains(_emoteSearchFile, StringComparison.OrdinalIgnoreCase)
|
||||||
&& (_emoteSearchName.Length == 0
|
&& (_emoteSearchName.Length == 0
|
||||||
|
|
@ -881,7 +881,7 @@ public class DebugTab : Window, ITab
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.TextUnformatted(string.Join(", ", p.Value.Select(v => v.Name.ToDalamudString().TextValue)));
|
ImGui.TextUnformatted(string.Join(", ", p.Value.Select(v => v.Name.ToDalamudString().TextValue)));
|
||||||
});
|
});
|
||||||
ImGuiClip.DrawEndDummy(dummy, ImGui.GetTextLineHeightWithSpacing());
|
ImGuiClip.DrawEndDummy(dummy, Im.Style.TextHeightWithSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _tmbKeyFilter = string.Empty;
|
private string _tmbKeyFilter = string.Empty;
|
||||||
|
|
@ -896,11 +896,11 @@ public class DebugTab : Window, ITab
|
||||||
if (ImGui.InputText("Key", ref _tmbKeyFilter, 256))
|
if (ImGui.InputText("Key", ref _tmbKeyFilter, 256))
|
||||||
_tmbKeyFilterU8 = CiByteString.FromString(_tmbKeyFilter, out var r, MetaDataComputation.All) ? r : CiByteString.Empty;
|
_tmbKeyFilterU8 = CiByteString.FromString(_tmbKeyFilter, out var r, MetaDataComputation.All) ? r : CiByteString.Empty;
|
||||||
using var table = Im.Table.Begin("##table"u8, 2, TableFlags.RowBackground | TableFlags.ScrollY | TableFlags.SizingFixedFit,
|
using var table = Im.Table.Begin("##table"u8, 2, TableFlags.RowBackground | TableFlags.ScrollY | TableFlags.SizingFixedFit,
|
||||||
new Vector2(-1, 12 * ImGui.GetTextLineHeightWithSpacing()));
|
new Vector2(-1, 12 * Im.Style.TextHeightWithSpacing));
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var skips = ImGuiClip.GetNecessarySkips(ImGui.GetTextLineHeightWithSpacing());
|
var skips = ImGuiClip.GetNecessarySkips(Im.Style.TextHeightWithSpacing);
|
||||||
var dummy = ImGuiClip.FilteredClippedDraw(_schedulerService.ActionTmbs.OrderBy(r => r.Value), skips,
|
var dummy = ImGuiClip.FilteredClippedDraw(_schedulerService.ActionTmbs.OrderBy(r => r.Value), skips,
|
||||||
kvp => kvp.Key.Contains(_tmbKeyFilterU8),
|
kvp => kvp.Key.Contains(_tmbKeyFilterU8),
|
||||||
p =>
|
p =>
|
||||||
|
|
@ -908,7 +908,7 @@ public class DebugTab : Window, ITab
|
||||||
ImUtf8.DrawTableColumn($"{p.Value}");
|
ImUtf8.DrawTableColumn($"{p.Value}");
|
||||||
ImUtf8.DrawTableColumn(p.Key.Span);
|
ImUtf8.DrawTableColumn(p.Key.Span);
|
||||||
});
|
});
|
||||||
ImGuiClip.DrawEndDummy(dummy, ImGui.GetTextLineHeightWithSpacing());
|
ImGuiClip.DrawEndDummy(dummy, Im.Style.TextHeightWithSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawStainTemplates()
|
private void DrawStainTemplates()
|
||||||
|
|
@ -949,7 +949,7 @@ public class DebugTab : Window, ITab
|
||||||
{
|
{
|
||||||
var color = list[i];
|
var color = list[i];
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var frame = new Vector2(ImGui.GetTextLineHeight());
|
var frame = new Vector2(Im.Style.TextHeight);
|
||||||
ImGui.ColorButton("###color", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)color), 1), 0, frame);
|
ImGui.ColorButton("###color", new Vector4(MtrlTab.PseudoSqrtRgb((Vector3)color), 1), 0, frame);
|
||||||
Im.Line.Same();
|
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}");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using ImSharp;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
|
|
@ -25,11 +26,11 @@ public class EffectiveTab(CollectionManager collectionManager, CollectionSelectH
|
||||||
SetupEffectiveSizes();
|
SetupEffectiveSizes();
|
||||||
collectionHeader.Draw(true);
|
collectionHeader.Draw(true);
|
||||||
DrawFilters();
|
DrawFilters();
|
||||||
using var child = ImRaii.Child("##EffectiveChangesTab", ImGui.GetContentRegionAvail(), false);
|
using var child = ImRaii.Child("##EffectiveChangesTab", Im.ContentRegion.Available, false);
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var height = ImGui.GetTextLineHeightWithSpacing() + 2 * ImGui.GetStyle().CellPadding.Y;
|
var height = Im.Style.TextHeightWithSpacing + 2 * ImGui.GetStyle().CellPadding.Y;
|
||||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||||
using var table = ImRaii.Table("##EffectiveChangesTable", 3, ImGuiTableFlags.RowBg);
|
using var table = ImRaii.Table("##EffectiveChangesTable", 3, ImGuiTableFlags.RowBg);
|
||||||
if (!table)
|
if (!table)
|
||||||
|
|
@ -60,11 +61,11 @@ public class EffectiveTab(CollectionManager collectionManager, CollectionSelectH
|
||||||
{
|
{
|
||||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||||
_effectiveUnscaledArrowLength =
|
_effectiveUnscaledArrowLength =
|
||||||
ImGui.CalcTextSize(FontAwesomeIcon.LongArrowAltLeft.ToIconString()).X / UiHelpers.Scale;
|
ImGui.CalcTextSize(FontAwesomeIcon.LongArrowAltLeft.ToIconString()).X / Im.Style.GlobalScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
_effectiveArrowLength = _effectiveUnscaledArrowLength * UiHelpers.Scale;
|
_effectiveArrowLength = _effectiveUnscaledArrowLength * Im.Style.GlobalScale;
|
||||||
_effectiveLeftTextLength = 450 * UiHelpers.Scale;
|
_effectiveLeftTextLength = 450 * Im.Style.GlobalScale;
|
||||||
_effectiveRightTextLength = ImGui.GetWindowSize().X - _effectiveArrowLength - _effectiveLeftTextLength;
|
_effectiveRightTextLength = ImGui.GetWindowSize().X - _effectiveArrowLength - _effectiveLeftTextLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class ModsTab(
|
||||||
collectionHeader.Draw(false);
|
collectionHeader.Draw(false);
|
||||||
|
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero);
|
||||||
using (var child = ImRaii.Child("##ModsTabMod", new Vector2(ImGui.GetContentRegionAvail().X, config.HideRedrawBar ? 0 : -ImGui.GetFrameHeight()),
|
using (var child = ImRaii.Child("##ModsTabMod", new Vector2(Im.ContentRegion.Available.X, config.HideRedrawBar ? 0 : -Im.Style.FrameHeight),
|
||||||
true, ImGuiWindowFlags.HorizontalScrollbar))
|
true, ImGuiWindowFlags.HorizontalScrollbar))
|
||||||
{
|
{
|
||||||
style.Pop();
|
style.Pop();
|
||||||
|
|
@ -94,7 +94,7 @@ public class ModsTab(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var frameHeight = new Vector2(0, ImGui.GetFrameHeight());
|
var frameHeight = new Vector2(0, Im.Style.FrameHeight);
|
||||||
var frameColor = ImGuiColor.FrameBackground.Get().Color;
|
var frameColor = ImGuiColor.FrameBackground.Get().Color;
|
||||||
using (var _ = ImRaii.Group())
|
using (var _ = ImRaii.Group())
|
||||||
{
|
{
|
||||||
|
|
@ -115,7 +115,7 @@ 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);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
var buttonWidth = frameHeight with { X = ImGui.GetContentRegionAvail().X / 5 };
|
var buttonWidth = frameHeight with { X = Im.ContentRegion.Available.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;
|
||||||
|
|
@ -139,7 +139,7 @@ public class ModsTab(
|
||||||
tt = !IsIndoors()
|
tt = !IsIndoors()
|
||||||
? "\nCan currently only be used for indoor furniture."
|
? "\nCan currently only be used for indoor furniture."
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
DrawButton(frameHeight with { X = ImGui.GetContentRegionAvail().X - 1 }, "Furniture", "furniture", tt);
|
DrawButton(frameHeight with { X = Im.ContentRegion.Available.X - 1 }, "Furniture", "furniture", tt);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
void DrawButton(Vector2 size, string label, string lower, string additionalTooltip)
|
void DrawButton(Vector2 size, string label, string lower, string additionalTooltip)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class ResourceTab(Configuration config, ResourceManagerService resourceMa
|
||||||
resourceManager.IterateGraphs(DrawCategoryContainer);
|
resourceManager.IterateGraphs(DrawCategoryContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(
|
ImGui.TextUnformatted(
|
||||||
|
|
@ -131,8 +131,8 @@ public class ResourceTab(Configuration config, ResourceManagerService resourceMa
|
||||||
/// <summary> Set the widths for a resource table. </summary>
|
/// <summary> Set the widths for a resource table. </summary>
|
||||||
private void SetTableWidths()
|
private void SetTableWidths()
|
||||||
{
|
{
|
||||||
_hashColumnWidth = 100 * UiHelpers.Scale;
|
_hashColumnWidth = 100 * Im.Style.GlobalScale;
|
||||||
_pathColumnWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - 300 * UiHelpers.Scale;
|
_pathColumnWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - 300 * Im.Style.GlobalScale;
|
||||||
_refsColumnWidth = 30 * UiHelpers.Scale;
|
_refsColumnWidth = 30 * Im.Style.GlobalScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (!child)
|
if (!child)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var c2 = ImRaii.Child("a", new Vector2(300, 5 * ImGui.GetTextLineHeightWithSpacing()), true,
|
using var c2 = ImRaii.Child("a", new Vector2(300, 5 * Im.Style.TextHeightWithSpacing), true,
|
||||||
ImGuiWindowFlags.AlwaysVerticalScrollbar);
|
ImGuiWindowFlags.AlwaysVerticalScrollbar);
|
||||||
TreeLine.Draw(List, 0xFFFFFFFF);
|
TreeLine.Draw(List, 0xFFFFFFFF);
|
||||||
|
|
||||||
|
|
@ -193,11 +193,11 @@ public class SettingsTab : ITab, IUiService
|
||||||
//EphemeralCheckbox("Lock Main Window", "Prevent the main window from being resized or moved.", _config.Ephemeral.FixMainWindow,
|
//EphemeralCheckbox("Lock Main Window", "Prevent the main window from being resized or moved.", _config.Ephemeral.FixMainWindow,
|
||||||
// v => _config.Ephemeral.FixMainWindow = v);
|
// v => _config.Ephemeral.FixMainWindow = v);
|
||||||
//
|
//
|
||||||
//ImGui.NewLine();
|
//Im.Line.New();
|
||||||
//DrawRootFolder();
|
//DrawRootFolder();
|
||||||
//DrawDirectoryButtons();
|
//DrawDirectoryButtons();
|
||||||
//ImGui.NewLine();
|
//Im.Line.New();
|
||||||
//ImGui.NewLine();
|
//Im.Line.New();
|
||||||
//
|
//
|
||||||
//DrawGeneralSettings();
|
//DrawGeneralSettings();
|
||||||
//_migrationDrawer.Draw();
|
//_migrationDrawer.Draw();
|
||||||
|
|
@ -350,7 +350,7 @@ 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(Im.Style.GlobalScale * 3, 0));
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
DrawDirectoryPickerButton();
|
DrawDirectoryPickerButton();
|
||||||
style.Pop();
|
style.Pop();
|
||||||
|
|
@ -372,7 +372,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_tutorial.OpenTutorial(BasicTutorialSteps.ModDirectory);
|
_tutorial.OpenTutorial(BasicTutorialSteps.ModDirectory);
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
var pos = ImGui.GetCursorPosX();
|
var pos = ImGui.GetCursorPosX();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
if (_config.ModDirectory != _newModDirectory
|
if (_config.ModDirectory != _newModDirectory
|
||||||
&& _newModDirectory.Length != 0
|
&& _newModDirectory.Length != 0
|
||||||
|
|
@ -433,7 +433,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
UiHelpers.DefaultLineSpace();
|
UiHelpers.DefaultLineSpace();
|
||||||
|
|
||||||
DrawModEditorSettings();
|
DrawModEditorSettings();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _singleGroupRadioMax = int.MaxValue;
|
private int _singleGroupRadioMax = int.MaxValue;
|
||||||
|
|
@ -739,7 +739,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
private void DrawDefaultModImportPath()
|
private void DrawDefaultModImportPath()
|
||||||
{
|
{
|
||||||
var tmp = _config.DefaultModImportPath;
|
var tmp = _config.DefaultModImportPath;
|
||||||
var spacing = new Vector2(UiHelpers.ScaleX3);
|
var spacing = new Vector2(Im.Style.GlobalScale * 3);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
||||||
|
|
@ -780,7 +780,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
private void DrawDefaultModExportPath()
|
private void DrawDefaultModExportPath()
|
||||||
{
|
{
|
||||||
var tmp = _config.ExportDirectory;
|
var tmp = _config.ExportDirectory;
|
||||||
var spacing = new Vector2(UiHelpers.ScaleX3);
|
var spacing = new Vector2(Im.Style.GlobalScale * 3);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
||||||
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
||||||
if (ImGui.InputText("##defaultModExport", ref tmp, 256))
|
if (ImGui.InputText("##defaultModExport", ref tmp, 256))
|
||||||
|
|
@ -817,7 +817,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
private void DrawFileWatcherPath()
|
private void DrawFileWatcherPath()
|
||||||
{
|
{
|
||||||
var tmp = _tempWatchDirectory ?? _config.WatchDirectory;
|
var tmp = _tempWatchDirectory ?? _config.WatchDirectory;
|
||||||
var spacing = new Vector2(UiHelpers.ScaleX3);
|
var spacing = new Vector2(Im.Style.GlobalScale * 3);
|
||||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing);
|
||||||
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
||||||
if (ImGui.InputText("##fileWatchPath", ref tmp, 256))
|
if (ImGui.InputText("##fileWatchPath", ref tmp, 256))
|
||||||
|
|
@ -942,7 +942,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
_config.Save();
|
_config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Advanced Settings
|
#region Advanced Settings
|
||||||
|
|
@ -980,7 +980,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
DrawReloadFontsButton();
|
DrawReloadFontsButton();
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
DrawCleanupButtons();
|
DrawCleanupButtons();
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCrashHandler()
|
private void DrawCrashHandler()
|
||||||
|
|
@ -1027,8 +1027,8 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (_compactor.MassCompactRunning)
|
if (_compactor.MassCompactRunning)
|
||||||
{
|
{
|
||||||
ImGui.ProgressBar((float)_compactor.CurrentIndex / _compactor.TotalFiles,
|
ImGui.ProgressBar((float)_compactor.CurrentIndex / _compactor.TotalFiles,
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - UiHelpers.IconButtonSize.X,
|
new Vector2(Im.ContentRegion.Available.X - ImGui.GetStyle().ItemSpacing.X - UiHelpers.IconButtonSize.X,
|
||||||
ImGui.GetFrameHeight()),
|
Im.Style.FrameHeight),
|
||||||
_compactor.CurrentFile?.FullName[(_modManager.BasePath.FullName.Length + 1)..] ?? "Gathering Files...");
|
_compactor.CurrentFile?.FullName[(_modManager.BasePath.FullName.Length + 1)..] ?? "Gathering Files...");
|
||||||
Im.Line.Same();
|
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.",
|
||||||
|
|
@ -1082,7 +1082,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (warning.Length > 0)
|
if (warning.Length > 0)
|
||||||
ImGuiUtil.DrawTextButton(warning, UiHelpers.InputTextWidth, Colors.PressEnterWarningBg);
|
ImGuiUtil.DrawTextButton(warning, UiHelpers.InputTextWidth, Colors.PressEnterWarningBg);
|
||||||
else
|
else
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
|
|
||||||
if (!edited)
|
if (!edited)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1095,7 +1095,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
|
|
||||||
private void DrawHdrRenderTargets()
|
private void DrawHdrRenderTargets()
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(ImUtf8.CalcTextSize("M"u8).X * 5.0f + ImGui.GetFrameHeight());
|
ImGui.SetNextItemWidth(ImUtf8.CalcTextSize("M"u8).X * 5.0f + Im.Style.FrameHeight);
|
||||||
using (var combo = ImUtf8.Combo("##hdrRenderTarget"u8, _config.HdrRenderTargets ? "HDR"u8 : "SDR"u8))
|
using (var combo = ImUtf8.Combo("##hdrRenderTarget"u8, _config.HdrRenderTargets ? "HDR"u8 : "SDR"u8))
|
||||||
{
|
{
|
||||||
if (combo)
|
if (combo)
|
||||||
|
|
@ -1176,7 +1176,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
var enabled = _config.DeleteModModifier.IsActive();
|
var enabled = _config.DeleteModModifier.IsActive();
|
||||||
if (_cleanupService.Progress is not 0.0 and not 1.0)
|
if (_cleanupService.Progress is not 0.0 and not 1.0)
|
||||||
{
|
{
|
||||||
ImUtf8.ProgressBar((float)_cleanupService.Progress, new Vector2(200 * ImUtf8.GlobalScale, ImGui.GetFrameHeight()),
|
ImUtf8.ProgressBar((float)_cleanupService.Progress, new Vector2(200 * ImUtf8.GlobalScale, Im.Style.FrameHeight),
|
||||||
$"{_cleanupService.Progress * 100}%");
|
$"{_cleanupService.Progress * 100}%");
|
||||||
Im.Line.Same();
|
Im.Line.Same();
|
||||||
if (ImUtf8.Button("Cancel##FileCleanup"u8))
|
if (ImUtf8.Button("Cancel##FileCleanup"u8))
|
||||||
|
|
@ -1184,7 +1184,7 @@ public class SettingsTab : ITab, IUiService
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.NewLine();
|
Im.Line.New();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImUtf8.ButtonEx("Clear Unused Local Mod Data Files"u8,
|
if (ImUtf8.ButtonEx("Clear Unused Local Mod Data Files"u8,
|
||||||
|
|
@ -1240,27 +1240,27 @@ public class SettingsTab : ITab, IUiService
|
||||||
if (ImGui.GetScrollMaxY() > 0)
|
if (ImGui.GetScrollMaxY() > 0)
|
||||||
xPos -= ImGui.GetStyle().ScrollbarSize + ImGui.GetStyle().FramePadding.X;
|
xPos -= ImGui.GetStyle().ScrollbarSize + ImGui.GetStyle().FramePadding.X;
|
||||||
|
|
||||||
ImGui.SetCursorPos(new Vector2(xPos, ImGui.GetFrameHeightWithSpacing()));
|
ImGui.SetCursorPos(new Vector2(xPos, Im.Style.FrameHeightWithSpacing));
|
||||||
UiHelpers.DrawSupportButton(_penumbra);
|
UiHelpers.DrawSupportButton(_penumbra);
|
||||||
|
|
||||||
ImGui.SetCursorPos(new Vector2(xPos, 0));
|
ImGui.SetCursorPos(new Vector2(xPos, 0));
|
||||||
SupportButton.Discord(Penumbra.Messager, width);
|
SupportButton.Discord(Penumbra.Messager, width);
|
||||||
|
|
||||||
ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing()));
|
ImGui.SetCursorPos(new Vector2(xPos, 2 * Im.Style.FrameHeightWithSpacing));
|
||||||
SupportButton.ReniGuide(Penumbra.Messager, width);
|
SupportButton.ReniGuide(Penumbra.Messager, width);
|
||||||
|
|
||||||
ImGui.SetCursorPos(new Vector2(xPos, 3 * ImGui.GetFrameHeightWithSpacing()));
|
ImGui.SetCursorPos(new Vector2(xPos, 3 * Im.Style.FrameHeightWithSpacing));
|
||||||
if (ImGui.Button("Restart Tutorial", new Vector2(width, 0)))
|
if (ImGui.Button("Restart Tutorial", new Vector2(width, 0)))
|
||||||
{
|
{
|
||||||
_config.Ephemeral.TutorialStep = 0;
|
_config.Ephemeral.TutorialStep = 0;
|
||||||
_config.Ephemeral.Save();
|
_config.Ephemeral.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SetCursorPos(new Vector2(xPos, 4 * ImGui.GetFrameHeightWithSpacing()));
|
ImGui.SetCursorPos(new Vector2(xPos, 4 * Im.Style.FrameHeightWithSpacing));
|
||||||
if (ImGui.Button("Show Changelogs", new Vector2(width, 0)))
|
if (ImGui.Button("Show Changelogs", new Vector2(width, 0)))
|
||||||
_penumbra.ForceChangelogOpen();
|
_penumbra.ForceChangelogOpen();
|
||||||
|
|
||||||
ImGui.SetCursorPos(new Vector2(xPos, 5 * ImGui.GetFrameHeightWithSpacing()));
|
ImGui.SetCursorPos(new Vector2(xPos, 5 * Im.Style.FrameHeightWithSpacing));
|
||||||
SupportButton.KoFiPatreon(Penumbra.Messager, new Vector2(width, 0));
|
SupportButton.KoFiPatreon(Penumbra.Messager, new Vector2(width, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue