mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Remove all OtterGui.Extensions and some OtterGui.Classes.
This commit is contained in:
parent
3e4e3022d8
commit
6f5903600e
122 changed files with 304 additions and 376 deletions
2
Luna
2
Luna
|
|
@ -1 +1 @@
|
|||
Subproject commit ecbf3e0e8543a81111c71b98ed108b3c87810837
|
||||
Subproject commit 7e73834bb4c25fbd63e97f89951cd7d81306e6c7
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -16,7 +16,7 @@ using Penumbra.Services;
|
|||
|
||||
namespace Penumbra.Api.Api;
|
||||
|
||||
public class ModSettingsApi : IPenumbraApiModSettings, Luna.IApiService, IDisposable
|
||||
public class ModSettingsApi : IPenumbraApiModSettings, IApiService, IDisposable
|
||||
{
|
||||
private readonly CollectionResolver _collectionResolver;
|
||||
private readonly ModManager _modManager;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Compression;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods;
|
||||
|
|
@ -8,7 +8,7 @@ using Penumbra.Services;
|
|||
|
||||
namespace Penumbra.Api.Api;
|
||||
|
||||
public class ModsApi : IPenumbraApiMods, Luna.IApiService, IDisposable
|
||||
public class ModsApi : IPenumbraApiMods, IApiService, IDisposable
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly ModManager _modManager;
|
||||
|
|
@ -16,9 +16,10 @@ public class ModsApi : IPenumbraApiMods, Luna.IApiService, IDisposable
|
|||
private readonly Configuration _config;
|
||||
private readonly ModFileSystem _modFileSystem;
|
||||
private readonly MigrationManager _migrationManager;
|
||||
private readonly Logger _log;
|
||||
|
||||
public ModsApi(ModManager modManager, ModImportManager modImportManager, Configuration config, ModFileSystem modFileSystem,
|
||||
CommunicatorService communicator, MigrationManager migrationManager)
|
||||
CommunicatorService communicator, MigrationManager migrationManager, Logger log)
|
||||
{
|
||||
_modManager = modManager;
|
||||
_modImportManager = modImportManager;
|
||||
|
|
@ -26,6 +27,7 @@ public class ModsApi : IPenumbraApiMods, Luna.IApiService, IDisposable
|
|||
_modFileSystem = modFileSystem;
|
||||
_communicator = communicator;
|
||||
_migrationManager = migrationManager;
|
||||
_log = log;
|
||||
_communicator.ModPathChanged.Subscribe(OnModPathChanged, ModPathChanged.Priority.ApiMods);
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +90,7 @@ public class ModsApi : IPenumbraApiMods, Luna.IApiService, IDisposable
|
|||
}
|
||||
|
||||
if (_config.UseFileSystemCompression)
|
||||
new FileCompactor(Penumbra.Log).StartMassCompact(dir.EnumerateFiles("*.*", SearchOption.AllDirectories),
|
||||
new FileCompactor(_log).StartMassCompact(dir.EnumerateFiles("*.*", SearchOption.AllDirectories),
|
||||
CompressionAlgorithm.Xpress8K, false);
|
||||
|
||||
return ApiHelpers.Return(PenumbraApiEc.Success, args);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using Dalamud.Game.ClientState.Objects.Enums;
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Plugin;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Dalamud.Interface;
|
|||
using Dalamud.Plugin;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Api;
|
||||
|
|
@ -246,7 +245,7 @@ public class TemporaryIpcTester(
|
|||
if (!table)
|
||||
return;
|
||||
|
||||
foreach (var (collection, idx) in tempCollections.Values.WithIndex())
|
||||
foreach (var (idx, collection) in tempCollections.Values.Index())
|
||||
{
|
||||
using var id = ImRaii.PushId(idx);
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Communication;
|
||||
|
|
@ -7,7 +7,6 @@ using Penumbra.Mods.Editor;
|
|||
using Penumbra.String.Classes;
|
||||
using Penumbra.Util;
|
||||
using Penumbra.GameData.Data;
|
||||
using OtterGui.Extensions;
|
||||
|
||||
namespace Penumbra.Collections.Cache;
|
||||
|
||||
|
|
@ -20,14 +19,14 @@ public record ModConflicts(IMod Mod2, List<object> Conflicts, bool HasPriority,
|
|||
/// </summary>
|
||||
public sealed class CollectionCache : IDisposable
|
||||
{
|
||||
private readonly CollectionCacheManager _manager;
|
||||
private readonly ModCollection _collection;
|
||||
public readonly CollectionModData ModData = new();
|
||||
private readonly CollectionCacheManager _manager;
|
||||
private readonly ModCollection _collection;
|
||||
public readonly CollectionModData ModData = new();
|
||||
private readonly SortedList<string, (SingleArray<IMod>, IIdentifiedObjectData)> _changedItems = [];
|
||||
public readonly ConcurrentDictionary<Utf8GamePath, ModPath> ResolvedFiles = new();
|
||||
public readonly CustomResourceCache CustomResources;
|
||||
public readonly MetaCache Meta;
|
||||
public readonly Dictionary<IMod, SingleArray<ModConflicts>> ConflictDict = [];
|
||||
public readonly ConcurrentDictionary<Utf8GamePath, ModPath> ResolvedFiles = new();
|
||||
public readonly CustomResourceCache CustomResources;
|
||||
public readonly MetaCache Meta;
|
||||
public readonly Dictionary<IMod, SingleArray<ModConflicts>> ConflictDict = [];
|
||||
|
||||
public int Calculating = -1;
|
||||
|
||||
|
|
@ -110,7 +109,7 @@ public sealed class CollectionCache : IDisposable
|
|||
|
||||
var ret = new HashSet<Utf8GamePath>[fullPaths.Count];
|
||||
var dict = new Dictionary<FullPath, int>(fullPaths.Count);
|
||||
foreach (var (path, idx) in fullPaths.WithIndex())
|
||||
foreach (var (idx, path) in fullPaths.Index())
|
||||
{
|
||||
dict[new FullPath(path)] = idx;
|
||||
ret[idx] = !Path.IsPathRooted(path) && Utf8GamePath.FromString(path, out var utf8)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Frozen;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Meta;
|
||||
|
|
@ -17,7 +16,7 @@ public sealed class ShapeAttributeHashSet : Dictionary<(HumanSlot Slot, PrimaryI
|
|||
];
|
||||
|
||||
public static readonly FrozenDictionary<GenderRace, int> GenderRaceIndices =
|
||||
GenderRaceValues.WithIndex().ToFrozenDictionary(p => p.Value, p => p.Index);
|
||||
GenderRaceValues.Index().ToFrozenDictionary(p => p.Item, p => p.Index);
|
||||
|
||||
private readonly BitArray _allIds = new(2 * (ShapeAttributeManager.ModelSlotSize + 1) * GenderRaceValues.Count);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
@ -11,7 +10,7 @@ using Penumbra.UI;
|
|||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
||||
public class ActiveCollectionData : Luna.IService
|
||||
public class ActiveCollectionData : IService
|
||||
{
|
||||
public ModCollection Current { get; internal set; } = ModCollection.Empty;
|
||||
public ModCollection Default { get; internal set; } = ModCollection.Empty;
|
||||
|
|
@ -20,7 +19,7 @@ public class ActiveCollectionData : Luna.IService
|
|||
public readonly ModCollection?[] SpecialCollections = new ModCollection?[Enum.GetValues<Api.Enums.ApiCollectionType>().Length - 3];
|
||||
}
|
||||
|
||||
public class ActiveCollections : ISavable, IDisposable, Luna.IService
|
||||
public class ActiveCollections : ISavable, IDisposable, IService
|
||||
{
|
||||
public const int Version = 2;
|
||||
|
||||
|
|
@ -223,23 +222,15 @@ public class ActiveCollections : ISavable, IDisposable, Luna.IService
|
|||
|
||||
switch (collectionType)
|
||||
{
|
||||
case CollectionType.Default:
|
||||
Default = collection;
|
||||
break;
|
||||
case CollectionType.Interface:
|
||||
Interface = collection;
|
||||
break;
|
||||
case CollectionType.Current:
|
||||
Current = collection;
|
||||
break;
|
||||
case CollectionType.Default: Default = collection; break;
|
||||
case CollectionType.Interface: Interface = collection; break;
|
||||
case CollectionType.Current: Current = collection; break;
|
||||
case CollectionType.Individual:
|
||||
if (!Individuals.ChangeCollection(individualIndex, collection))
|
||||
return;
|
||||
|
||||
break;
|
||||
default:
|
||||
SpecialCollections[(int)collectionType] = collection;
|
||||
break;
|
||||
default: SpecialCollections[(int)collectionType] = collection; break;
|
||||
}
|
||||
|
||||
UpdateCurrentCollectionInUse();
|
||||
|
|
@ -247,7 +238,7 @@ public class ActiveCollections : ISavable, IDisposable, Luna.IService
|
|||
collectionType == CollectionType.Individual ? Individuals[individualIndex].DisplayName : string.Empty);
|
||||
}
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.ActiveCollectionsFile;
|
||||
|
||||
public string TypeName
|
||||
|
|
@ -265,8 +256,8 @@ public class ActiveCollections : ISavable, IDisposable, Luna.IService
|
|||
{ nameof(Interface), Interface.Identity.Id },
|
||||
{ nameof(Current), Current.Identity.Id },
|
||||
};
|
||||
foreach (var (type, collection) in SpecialCollections.WithIndex().Where(p => p.Value != null)
|
||||
.Select(p => ((CollectionType)p.Index, p.Value!)))
|
||||
foreach (var (type, collection) in SpecialCollections.Index().Where(p => p.Item != null)
|
||||
.Select(p => ((CollectionType)p.Index, p.Item!)))
|
||||
jObj.Add(type.ToString(), collection.Identity.Id);
|
||||
|
||||
jObj.Add(nameof(Individuals), Individuals.ToJObject());
|
||||
|
|
@ -299,7 +290,8 @@ public class ActiveCollections : ISavable, IDisposable, Luna.IService
|
|||
if (oldCollection == Interface)
|
||||
SetCollection(ModCollection.Empty, CollectionType.Interface);
|
||||
if (oldCollection == Current)
|
||||
SetCollection(Default.Identity.Index > ModCollection.Empty.Identity.Index ? Default : _storage.DefaultNamed, CollectionType.Current);
|
||||
SetCollection(Default.Identity.Index > ModCollection.Empty.Identity.Index ? Default : _storage.DefaultNamed,
|
||||
CollectionType.Current);
|
||||
|
||||
for (var i = 0; i < SpecialCollections.Length; ++i)
|
||||
{
|
||||
|
|
@ -490,15 +482,9 @@ public class ActiveCollections : ISavable, IDisposable, Luna.IService
|
|||
var changed = false;
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
changed = LoadCollectionsV1(jObject);
|
||||
break;
|
||||
case 2:
|
||||
changed = LoadCollectionsV2(jObject);
|
||||
break;
|
||||
case 0 when configChanged:
|
||||
changed = LoadCollectionsNew();
|
||||
break;
|
||||
case 1: changed = LoadCollectionsV1(jObject); break;
|
||||
case 2: changed = LoadCollectionsV2(jObject); break;
|
||||
case 0 when configChanged: changed = LoadCollectionsNew(); break;
|
||||
case 0:
|
||||
Penumbra.Messager.NotificationMessage("Active Collections File has unknown version and will be reset.",
|
||||
NotificationType.Warning);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
@ -159,7 +158,7 @@ public class CollectionEditor(SaveService saveService, CommunicatorService commu
|
|||
savedSettings.Value.ToSettings(targetMod, out var settings);
|
||||
SetModState(collection, targetMod, settings.Enabled);
|
||||
SetModPriority(collection, targetMod, settings.Priority);
|
||||
foreach (var (value, index) in settings.Settings.WithIndex())
|
||||
foreach (var (index, value) in settings.Settings.Index())
|
||||
SetModSetting(collection, targetMod, index, value);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Game.ClientState.Objects.Enums;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.DataContainers.Bases;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.GameData.Actors;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.String.Classes;
|
||||
using Penumbra.Collections.Cache;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
||||
namespace Penumbra.Collections;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Penumbra.Collections;
|
|||
/// </summary>
|
||||
internal readonly struct ModCollectionSave(ModStorage modStorage, ModCollection modCollection) : ISavable
|
||||
{
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.CollectionFile(modCollection);
|
||||
|
||||
public string LogName(string _)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Configuration;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Import.Structs;
|
||||
|
|
@ -27,7 +26,7 @@ public record PcpSettings
|
|||
}
|
||||
|
||||
[Serializable]
|
||||
public class Configuration : IPluginConfiguration, ISavable, Luna.IService
|
||||
public class Configuration : IPluginConfiguration, ISavable, IService
|
||||
{
|
||||
[JsonIgnore]
|
||||
private readonly SaveService _saveService;
|
||||
|
|
@ -94,19 +93,19 @@ public class Configuration : IPluginConfiguration, ISavable, Luna.IService
|
|||
[JsonProperty(Order = int.MaxValue)]
|
||||
public ISortMode<Mod> SortMode = ISortMode<Mod>.FoldersFirst;
|
||||
|
||||
public bool OpenFoldersByDefault { get; set; } = false;
|
||||
public int SingleGroupRadioMax { get; set; } = 2;
|
||||
public string DefaultImportFolder { get; set; } = string.Empty;
|
||||
public string QuickMoveFolder1 { get; set; } = string.Empty;
|
||||
public string QuickMoveFolder2 { get; set; } = string.Empty;
|
||||
public string QuickMoveFolder3 { get; set; } = string.Empty;
|
||||
public DoubleModifier DeleteModModifier { get; set; } = new(ModifierHotkey.Control, ModifierHotkey.Shift);
|
||||
public DoubleModifier IncognitoModifier { get; set; } = new(ModifierHotkey.Control);
|
||||
public bool PrintSuccessfulCommandsToChat { get; set; } = true;
|
||||
public bool AutoDeduplicateOnImport { get; set; } = true;
|
||||
public bool AutoReduplicateUiOnImport { get; set; } = true;
|
||||
public bool UseFileSystemCompression { get; set; } = true;
|
||||
public bool EnableHttpApi { get; set; } = true;
|
||||
public bool OpenFoldersByDefault { get; set; } = false;
|
||||
public int SingleGroupRadioMax { get; set; } = 2;
|
||||
public string DefaultImportFolder { get; set; } = string.Empty;
|
||||
public string QuickMoveFolder1 { get; set; } = string.Empty;
|
||||
public string QuickMoveFolder2 { get; set; } = string.Empty;
|
||||
public string QuickMoveFolder3 { get; set; } = string.Empty;
|
||||
public OtterGui.Classes.DoubleModifier DeleteModModifier { get; set; } = new(OtterGui.Classes.ModifierHotkey.Control, OtterGui.Classes.ModifierHotkey.Shift);
|
||||
public OtterGui.Classes.DoubleModifier IncognitoModifier { get; set; } = new(OtterGui.Classes.ModifierHotkey.Control);
|
||||
public bool PrintSuccessfulCommandsToChat { get; set; } = true;
|
||||
public bool AutoDeduplicateOnImport { get; set; } = true;
|
||||
public bool AutoReduplicateUiOnImport { get; set; } = true;
|
||||
public bool UseFileSystemCompression { get; set; } = true;
|
||||
public bool EnableHttpApi { get; set; } = true;
|
||||
|
||||
public bool MigrateImportedModelsToV6 { get; set; } = true;
|
||||
public bool MigrateImportedMaterialsToLegacy { get; set; } = true;
|
||||
|
|
@ -141,10 +140,10 @@ public class Configuration : IPluginConfiguration, ISavable, Luna.IService
|
|||
errorArgs.ErrorContext.Handled = true;
|
||||
}
|
||||
|
||||
if (File.Exists(_saveService.FileNames.ConfigFile))
|
||||
if (File.Exists(_saveService.FileNames.ConfigurationFile))
|
||||
try
|
||||
{
|
||||
var text = File.ReadAllText(_saveService.FileNames.ConfigFile);
|
||||
var text = File.ReadAllText(_saveService.FileNames.ConfigurationFile);
|
||||
JsonConvert.PopulateObject(text, this, new JsonSerializerSettings
|
||||
{
|
||||
Error = HandleDeserializationError,
|
||||
|
|
@ -213,8 +212,8 @@ public class Configuration : IPluginConfiguration, ISavable, Luna.IService
|
|||
}
|
||||
}
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
=> fileNames.ConfigFile;
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.ConfigurationFile;
|
||||
|
||||
public void Save(StreamWriter writer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Enums;
|
||||
|
|
@ -14,7 +14,7 @@ using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
|||
|
||||
namespace Penumbra;
|
||||
|
||||
public class EphemeralConfig : ISavable, IDisposable, Luna.IService
|
||||
public class EphemeralConfig : ISavable, IDisposable, IService
|
||||
{
|
||||
[JsonIgnore]
|
||||
private readonly SaveService _saveService;
|
||||
|
|
@ -94,7 +94,7 @@ public class EphemeralConfig : ISavable, IDisposable, Luna.IService
|
|||
=> _saveService.DelaySave(this, TimeSpan.FromSeconds(5));
|
||||
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.EphemeralConfigFile;
|
||||
|
||||
public void Save(StreamWriter writer)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using System.Collections.Immutable;
|
|||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Lumina.Extensions;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.GameData.Files.ModelStructs;
|
||||
using SharpGLTF.Geometry;
|
||||
|
|
@ -115,7 +114,7 @@ public class MeshExporter
|
|||
var indexMap = new Dictionary<ushort, int>();
|
||||
// #TODO @ackwell maybe fix for V6 Models, I think this works fine.
|
||||
|
||||
foreach (var (xivBoneIndex, tableIndex) in xivBoneTable.BoneIndex.Take((int)xivBoneTable.BoneCount).WithIndex())
|
||||
foreach (var (tableIndex, xivBoneIndex) in xivBoneTable.BoneIndex.Take((int)xivBoneTable.BoneCount).Index())
|
||||
{
|
||||
var boneName = _mdl.Bones[xivBoneIndex];
|
||||
if (!skeleton.Names.TryGetValue(boneName, out var gltfBoneIndex))
|
||||
|
|
@ -151,10 +150,10 @@ public class MeshExporter
|
|||
return _mdl.SubMeshes
|
||||
.Skip(XivMesh.SubMeshIndex)
|
||||
.Take(XivMesh.SubMeshCount)
|
||||
.WithIndex()
|
||||
.Index()
|
||||
.Select(subMesh => BuildMesh($"mesh {_meshIndex}.{subMesh.Index}", indices, vertices,
|
||||
(int)(subMesh.Value.IndexOffset - XivMesh.StartIndex), (int)subMesh.Value.IndexCount,
|
||||
subMesh.Value.AttributeIndexMask))
|
||||
(int)(subMesh.Item.IndexOffset - XivMesh.StartIndex), (int)subMesh.Item.IndexCount,
|
||||
subMesh.Item.AttributeIndexMask))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +218,7 @@ public class MeshExporter
|
|||
var morphBuilder = meshBuilder.UseMorphTarget(shapeNames.Count);
|
||||
shapeNames.Add(shape.ShapeName);
|
||||
|
||||
foreach (var (shapeValue, shapeValueIndex) in shapeValues.WithIndex())
|
||||
foreach (var (shapeValueIndex, shapeValue) in shapeValues.Index())
|
||||
{
|
||||
var gltfIndex = gltfIndices[shapeValue.BaseIndicesIndex - indexBase];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Lumina.Data.Parsing;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Files.ModelStructs;
|
||||
using SharpGLTF.Schema2;
|
||||
|
||||
|
|
@ -191,7 +190,7 @@ public class MeshImporter(IEnumerable<Node> nodes, IoNotifier notifier)
|
|||
|
||||
var usedJoints = new HashSet<ushort>();
|
||||
|
||||
foreach (var (primitive, primitiveIndex) in node.Mesh.Primitives.WithIndex())
|
||||
foreach (var (primitiveIndex, primitive) in node.Mesh.Primitives.Index())
|
||||
{
|
||||
// Per glTF specification, an asset with a skin MUST contain skinning attributes on its meshes.
|
||||
var joints0Accessor = primitive.GetVertexAccessor("JOINTS_0")?.AsVector4Array();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Lumina.Data.Parsing;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.GameData.Files.ModelStructs;
|
||||
using SharpGLTF.Schema2;
|
||||
|
|
@ -45,7 +44,7 @@ public partial class ModelImporter(ModelRoot model, IoNotifier notifier)
|
|||
private MdlFile Create()
|
||||
{
|
||||
// Group and build out meshes in this model.
|
||||
foreach (var (subMeshNodes, index) in GroupedMeshNodes().WithIndex())
|
||||
foreach (var (index, subMeshNodes) in GroupedMeshNodes().Index())
|
||||
BuildMeshForGroup(subMeshNodes, index);
|
||||
|
||||
// Now that all the meshes have been built, we can build some of the model-wide metadata.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Lumina.Data.Parsing;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using SharpGLTF.Schema2;
|
||||
|
||||
namespace Penumbra.Import.Models.Import;
|
||||
|
|
@ -156,9 +156,9 @@ public class PrimitiveImporter
|
|||
// Record which morph targets have values for this vertex, if any.
|
||||
var index = vertexIndex;
|
||||
var changedMorphs = morphModifiedVertices
|
||||
.WithIndex()
|
||||
.Index()
|
||||
.Where(pair => _vertexAttributes.Any(attribute => attribute.HasMorph(pair.Index, index)))
|
||||
.Select(pair => pair.Value);
|
||||
.Select(pair => pair.Item);
|
||||
foreach (var modifiedVertices in changedMorphs)
|
||||
modifiedVertices.Add(vertexIndex);
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ public class PrimitiveImporter
|
|||
|
||||
var morphShapeValues = new List<List<MdlStructs.ShapeValueStruct>>();
|
||||
|
||||
foreach (var (modifiedVertices, morphIndex) in morphModifiedVertices.WithIndex())
|
||||
foreach (var (morphIndex, modifiedVertices) in morphModifiedVertices.Index())
|
||||
{
|
||||
// For a given mesh, each shape key contains a list of shape value mappings.
|
||||
var shapeValues = new List<MdlStructs.ShapeValueStruct>();
|
||||
|
|
@ -185,8 +185,8 @@ public class PrimitiveImporter
|
|||
_streams[attribute.Stream].AddRange(attribute.BuildMorph(morphIndex, vertexIndex));
|
||||
|
||||
// Find any indices that target this vertex index and create a mapping.
|
||||
var targetingIndices = _indices.WithIndex()
|
||||
.SelectWhere(pair => (pair.Value == vertexIndex, pair.Index));
|
||||
var targetingIndices = _indices.Index()
|
||||
.SelectWhere(pair => (pair.Item == vertexIndex, pair.Index));
|
||||
shapeValues.AddRange(targetingIndices.Select(targetingIndex => new MdlStructs.ShapeValueStruct
|
||||
{
|
||||
BaseIndicesIndex = (ushort)targetingIndex,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System.Text.Json;
|
||||
using Lumina.Data.Parsing;
|
||||
using OtterGui.Extensions;
|
||||
using SharpGLTF.Schema2;
|
||||
|
||||
namespace Penumbra.Import.Models.Import;
|
||||
|
|
@ -72,7 +71,7 @@ public class SubMeshImporter
|
|||
private SubMesh Create()
|
||||
{
|
||||
// Build all the data we'll need.
|
||||
foreach (var (primitive, index) in _node.Mesh.Primitives.WithIndex())
|
||||
foreach (var (index, primitive) in _node.Mesh.Primitives.Index())
|
||||
BuildPrimitive(primitive, index);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(_indices);
|
||||
|
|
@ -144,7 +143,7 @@ public class SubMeshImporter
|
|||
_indices.AddRange(primitive.Indices.Select(i => (ushort)(i + vertexOffset)));
|
||||
|
||||
// Shape values
|
||||
foreach (var (primitiveShapeValues, morphIndex) in primitive.ShapeValues.WithIndex())
|
||||
foreach (var (morphIndex, primitiveShapeValues) in primitive.ShapeValues.Index())
|
||||
{
|
||||
// Per glTF spec, all primitives MUST have the same number of morph targets in the same order.
|
||||
// As such, this lookup should be safe - a failure here is a broken glTF file.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Data.Parsing;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Tasks;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData;
|
||||
|
|
@ -229,7 +228,7 @@ public sealed class ModelManager(IFramework framework, MetaFileManager metaFileM
|
|||
.Select(read)
|
||||
.Where(bytes => bytes != null)
|
||||
.Select(bytes => new SklbFile(bytes!))
|
||||
.WithIndex()
|
||||
.Index()
|
||||
.Select(CreateHavokTask)
|
||||
.ToArray();
|
||||
|
||||
|
|
@ -240,7 +239,7 @@ public sealed class ModelManager(IFramework framework, MetaFileManager metaFileM
|
|||
// finicky at the best of times, and can outright cause a CTD if they
|
||||
// get upset. Running each conversion on its own tick seems to make
|
||||
// this consistently non-crashy across my testing.
|
||||
Task<string> CreateHavokTask((SklbFile Sklb, int Index) pair)
|
||||
Task<string> CreateHavokTask((int Index, SklbFile Sklb) pair)
|
||||
=> manager._framework.RunOnTick(
|
||||
() => HavokConverter.HkxToXml(pair.Sklb.Skeleton),
|
||||
delayTicks: pair.Index, cancellationToken: cancel);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.Xml;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Import.Models.Export;
|
||||
|
||||
namespace Penumbra.Import.Models;
|
||||
|
|
@ -122,7 +121,7 @@ public static class SkeletonConverter
|
|||
var size = int.Parse(element.GetAttribute("size"));
|
||||
var array = new T[size];
|
||||
|
||||
foreach (var (childNode, index) in element.ChildNodes.Cast<XmlElement>().WithIndex())
|
||||
foreach (var (index, childNode) in element.ChildNodes.Cast<XmlElement>().Index())
|
||||
array[index] = convert(childNode);
|
||||
|
||||
return array;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Compression;
|
||||
using Penumbra.Import.Structs;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Import.Structs;
|
||||
using Penumbra.Mods;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System.Text.Unicode;
|
||||
using Dalamud.Hooking;
|
||||
using Iced.Intel;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.String.Classes;
|
||||
using Swan;
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ public sealed class PapRewriter(PeSigScanner sigScanner, PapRewriter.PapResource
|
|||
|
||||
private void UpdatePathAddresses(IEnumerable<Instruction> stackAccesses, nint stringAllocation, string name)
|
||||
{
|
||||
foreach (var (stackAccess, index) in stackAccesses.WithIndex())
|
||||
foreach (var (index, stackAccess) in stackAccesses.Index())
|
||||
{
|
||||
var hookAddress = new IntPtr((long)stackAccess.IP + stackAccess.Length);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData.Actors;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
|||
using FFXIVClientStructs.FFXIV.Client.Graphics.Render;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
using FFXIVClientStructs.Interop;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using OtterGui.Text.HelperObjects;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using OtterGui.Compression;
|
||||
using Luna;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Import;
|
||||
using Penumbra.Interop.Hooks.Meta;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Mods;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Classes;
|
||||
using Luna.Files;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using OtterGui.Compression;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Files;
|
||||
|
||||
|
|
@ -73,8 +72,8 @@ public partial class MdlMaterialEditor(ModFileCollection files) : Luna.IService
|
|||
{
|
||||
var bytes = File.ReadAllBytes(file.File.FullName);
|
||||
var mdlFile = new MdlFile(bytes);
|
||||
var materials = mdlFile.Materials.WithIndex().Where(p => MaterialRegex().IsMatch((string)p.Item1))
|
||||
.Select(p => p.Item2).ToArray();
|
||||
var materials = mdlFile.Materials.Index().Where(p => MaterialRegex().IsMatch(p.Item2))
|
||||
.Select(p => p.Item1).ToArray();
|
||||
if (materials.Length > 0)
|
||||
_modelFiles.Add(new ModelMaterialInfo(file.File, mdlFile, materials));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Compression;
|
||||
using Luna;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Utility;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Luna.Files;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
|
@ -13,7 +13,7 @@ using Penumbra.String.Classes;
|
|||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public class ModMerger : IDisposable, Luna.IService
|
||||
public class ModMerger : IDisposable, IService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Luna.Files;
|
||||
using OtterGui.Tasks;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
@ -264,13 +264,13 @@ public class ModNormalizer(ModManager modManager, Configuration config, SaveServ
|
|||
}
|
||||
|
||||
// Normalize all other options.
|
||||
foreach (var (group, groupIdx) in Mod.Groups.WithIndex())
|
||||
foreach (var (groupIdx, group) in Mod.Groups.Index())
|
||||
{
|
||||
var groupDir = ModCreator.CreateModFolder(directory, group.Name, config.ReplaceNonAsciiOnImport, true);
|
||||
_redirections[groupIdx + 1].EnsureCapacity(group.DataContainers.Count);
|
||||
for (var i = _redirections[groupIdx + 1].Count; i < group.DataContainers.Count; ++i)
|
||||
_redirections[groupIdx + 1].Add([]);
|
||||
foreach (var (data, dataIdx) in group.DataContainers.WithIndex())
|
||||
foreach (var (dataIdx, data) in group.DataContainers.Index())
|
||||
HandleSubMod(groupDir, data, _redirections[groupIdx + 1][dataIdx]);
|
||||
}
|
||||
|
||||
|
|
@ -376,8 +376,8 @@ public class ModNormalizer(ModManager modManager, Configuration config, SaveServ
|
|||
private void ApplyRedirections()
|
||||
{
|
||||
modManager.OptionEditor.SetFiles(Mod.Default, _redirections[0][0]);
|
||||
foreach (var (group, groupIdx) in Mod.Groups.WithIndex())
|
||||
foreach (var (container, containerIdx) in group.DataContainers.WithIndex())
|
||||
foreach (var (groupIdx, group) in Mod.Groups.Index())
|
||||
foreach (var (containerIdx, container) in group.DataContainers.Index())
|
||||
modManager.OptionEditor.SetFiles(container, _redirections[groupIdx + 1][containerIdx]);
|
||||
|
||||
++Step;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using OtterGui.Compression;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ public class ModelMaterialInfo
|
|||
if (!Changed)
|
||||
return;
|
||||
|
||||
foreach (var (idx, i) in _materialIndices.WithIndex())
|
||||
foreach (var (i, idx) in _materialIndices.Index())
|
||||
File.Materials[idx] = _currentMaterials[i];
|
||||
|
||||
try
|
||||
|
|
@ -64,7 +63,7 @@ public class ModelMaterialInfo
|
|||
if (!Changed)
|
||||
return;
|
||||
|
||||
foreach (var (idx, i) in _materialIndices.WithIndex())
|
||||
foreach (var (i, idx) in _materialIndices.Index())
|
||||
_currentMaterials[i] = File.Materials[idx];
|
||||
|
||||
Changed = false;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
using System.Collections.Frozen;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.UI.Classes;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
using Notification = Luna.Notification;
|
||||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -158,7 +157,7 @@ public sealed class ComplexModGroup(Mod mod) : IModGroup
|
|||
}
|
||||
|
||||
// Fix up conditions: No condition on itself.
|
||||
foreach (var (option, index) in ret.Options.WithIndex())
|
||||
foreach (var (index, option) in ret.Options.Index())
|
||||
{
|
||||
option.Conditions = option.Conditions.Limit(ret.Options.Count);
|
||||
option.Conditions = new MaskedSetting(option.Conditions.Mask.SetBit(index, false), option.Conditions.Value);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Penumbra.GameData.Files.ShaderStructs;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.Services;
|
||||
|
|
@ -67,7 +66,7 @@ public readonly struct ModSaveGroup : ISavable
|
|||
_groupIdx = _group?.GetIndex() ?? -1;
|
||||
}
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.OptionGroupFile(_basePath.FullName, _groupIdx, _group?.Name ?? string.Empty, _onlyAscii);
|
||||
|
||||
public void Save(StreamWriter writer)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -115,7 +114,7 @@ public sealed class MultiModGroup(Mod mod) : IModGroup, ITexToolsGroup
|
|||
|
||||
public void AddData(Setting setting, Dictionary<Utf8GamePath, FullPath> redirections, MetaDictionary manipulations)
|
||||
{
|
||||
foreach (var (option, index) in OptionData.WithIndex().OrderByDescending(o => o.Value.Priority))
|
||||
foreach (var (index, option) in OptionData.Index().OrderByDescending(o => o.Item.Priority))
|
||||
{
|
||||
if (setting.HasFlag(index))
|
||||
option.AddDataTo(redirections, manipulations);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Classes;
|
||||
using Luna.Files;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, Luna.IService
|
||||
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, IService
|
||||
{
|
||||
private readonly ModManager _modManager;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
@ -143,7 +143,7 @@ public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, Luna
|
|||
? (string.Empty, false)
|
||||
: (ModToIdentifier(mod), true);
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.FilesystemFile;
|
||||
|
||||
public void Save(StreamWriter writer)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
using Penumbra.Import;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Services;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
@ -40,7 +38,7 @@ public static partial class ModMigration
|
|||
return false;
|
||||
|
||||
if (!saveService.FileNames.GetOptionGroupFiles(mod).All(g => GroupRegex().IsMatch(g.Name)))
|
||||
foreach (var (group, index) in saveService.FileNames.GetOptionGroupFiles(mod).WithIndex().ToArray())
|
||||
foreach (var (index, group) in saveService.FileNames.GetOptionGroupFiles(mod).Index().ToArray())
|
||||
{
|
||||
var newName = GroupStartRegex().Replace(group.Name, $"group_{index + 1:D3}_");
|
||||
try
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Luna.Files;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
@ -21,7 +20,7 @@ public unsafe ref struct ImcAttributeCache
|
|||
_option[i] = byte.MaxValue;
|
||||
|
||||
var flag = (ushort)(1 << i);
|
||||
foreach (var (option, idx) in group.OptionData.WithIndex())
|
||||
foreach (var (idx, option) in group.OptionData.Index())
|
||||
{
|
||||
if ((option.AttributeMask & flag) == 0)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Classes;
|
||||
using Luna.Files;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Classes;
|
||||
using Luna.Files;
|
||||
using Luna;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -93,7 +94,7 @@ public class ModGroupEditor(
|
|||
{
|
||||
var mod = group.Mod;
|
||||
var idxFrom = group.GetIndex();
|
||||
if (!mod.Groups.Move(ref idxFrom, ref groupIdxTo))
|
||||
if (!ListExtensions.Move(mod.Groups, ref idxFrom, ref groupIdxTo))
|
||||
return;
|
||||
|
||||
saveService.SaveAllOptionGroups(mod, false, config.ReplaceNonAsciiOnImport);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Luna.Files;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Classes;
|
||||
using Luna.Files;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Settings;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Classes;
|
||||
using Luna.Files;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Settings;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -74,7 +74,7 @@ public sealed class Mod : IMod
|
|||
public IReadOnlyList<string> LocalTags { get; internal set; } = [];
|
||||
public string Note { get; internal set; } = string.Empty;
|
||||
public HashSet<CustomItemId> PreferredChangedItems { get; internal set; } = [];
|
||||
public bool Favorite { get; internal set; } = false;
|
||||
public bool Favorite { get; internal set; }
|
||||
|
||||
// Options
|
||||
public readonly DefaultSubMod Default;
|
||||
|
|
@ -104,7 +104,7 @@ public sealed class Mod : IMod
|
|||
|
||||
var dictRedirections = new Dictionary<Utf8GamePath, FullPath>(TotalFileCount);
|
||||
var setManips = new MetaDictionary();
|
||||
foreach (var (group, groupIndex) in Groups.WithIndex().Reverse().OrderByDescending(g => g.Value.Priority))
|
||||
foreach (var (groupIndex, group) in Groups.Index().Reverse().OrderByDescending(g => g.Item.Priority))
|
||||
{
|
||||
var config = settings.Settings[groupIndex];
|
||||
group.AddData(config, dictRedirections, setManips);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public readonly struct ModLocalData(Mod mod) : ISavable
|
|||
{
|
||||
public const int FileVersion = 3;
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.LocalDataFile(mod);
|
||||
|
||||
public void Save(StreamWriter writer)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public readonly struct ModMeta(Mod mod) : ISavable
|
|||
{
|
||||
public const uint FileVersion = 3;
|
||||
|
||||
public string ToFilename(FilenameService fileNames)
|
||||
public string ToFilePath(FilenameService fileNames)
|
||||
=> fileNames.ModMetaPath(mod);
|
||||
|
||||
public void Save(StreamWriter writer)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using OtterGui.Extensions;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
|
@ -186,7 +185,7 @@ public class ModSettings
|
|||
public (bool Enabled, ModPriority Priority, Dictionary<string, List<string>> Settings) ConvertToShareable(Mod mod)
|
||||
{
|
||||
var dict = new Dictionary<string, List<string>>(Settings.Count);
|
||||
foreach (var (setting, idx) in Settings.WithIndex())
|
||||
foreach (var (idx, setting) in Settings.Index())
|
||||
{
|
||||
if (idx >= mod.Groups.Count)
|
||||
break;
|
||||
|
|
@ -197,7 +196,7 @@ public class ModSettings
|
|||
dict.Add(single.Name, [single.Options[setting.AsIndex].Name]);
|
||||
break;
|
||||
case { Behaviour: GroupDrawBehaviour.MultiSelection } multi:
|
||||
var list = multi.Options.WithIndex().Where(p => setting.HasFlag(p.Index)).Select(p => p.Value.Name).ToList();
|
||||
var list = multi.Options.Index().Where(p => setting.HasFlag(p.Index)).Select(p => p.Item.Name).ToList();
|
||||
dict.Add(multi.Name, list);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
||||
namespace Penumbra.Mods.SubMods;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
using Dalamud.Plugin;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game;
|
||||
using OtterGui;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -21,17 +18,20 @@ using Penumbra.UI;
|
|||
using ResidentResourceManager = Penumbra.Interop.Services.ResidentResourceManager;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel.Sheets;
|
||||
using Luna;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Interop;
|
||||
using Penumbra.Interop.Hooks;
|
||||
using Penumbra.Interop.Hooks.PostProcessing;
|
||||
using Penumbra.Interop.Hooks.ResourceLoading;
|
||||
using DynamisIpc = OtterGui.Services.DynamisIpc;
|
||||
using MessageService = Penumbra.Services.MessageService;
|
||||
|
||||
namespace Penumbra;
|
||||
|
||||
public class Penumbra : IDalamudPlugin
|
||||
{
|
||||
public static readonly Logger Log = new();
|
||||
public static readonly OtterGui.Log.Logger Log = new();
|
||||
public static MessageService Messager { get; private set; } = null!;
|
||||
public static DynamisIpc Dynamis { get; private set; } = null!;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class Penumbra : IDalamudPlugin
|
|||
try
|
||||
{
|
||||
HookOverrides.Instance = HookOverrides.LoadFile(pluginInterface);
|
||||
_services = StaticServiceManager.CreateProvider(this, pluginInterface, Log);
|
||||
_services = StaticServiceManager.CreateProvider(this, pluginInterface, new());
|
||||
// Invoke the IPC Penumbra.Launching method before any hooks or other services are created.
|
||||
_services.GetService<IpcLaunchingProvider>();
|
||||
Messager = _services.GetService<MessageService>();
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Log;
|
||||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
public class BackupService : Luna.IAsyncService
|
||||
public class BackupService : IAsyncService
|
||||
{
|
||||
private readonly Logger _logger;
|
||||
private readonly DirectoryInfo _configDirectory;
|
||||
|
|
@ -22,8 +21,8 @@ public class BackupService : Luna.IAsyncService
|
|||
{
|
||||
_logger = logger;
|
||||
_fileNames = PenumbraFiles(fileNames);
|
||||
_configDirectory = new DirectoryInfo(fileNames.ConfigDirectory);
|
||||
Awaiter = Task.Run(() => Backup.CreateAutomaticBackup(logger, new DirectoryInfo(fileNames.ConfigDirectory), _fileNames));
|
||||
_configDirectory = new DirectoryInfo(fileNames.ConfigurationDirectory);
|
||||
Awaiter = Task.Run(() => Backup.CreateAutomaticBackup(logger, new DirectoryInfo(fileNames.ConfigurationDirectory), _fileNames));
|
||||
}
|
||||
|
||||
/// <summary> Create a permanent backup with a given name for migrations. </summary>
|
||||
|
|
@ -35,7 +34,7 @@ public class BackupService : Luna.IAsyncService
|
|||
{
|
||||
var list = fileNames.CollectionFiles.ToList();
|
||||
list.AddRange(fileNames.LocalDataFiles);
|
||||
list.Add(new FileInfo(fileNames.ConfigFile));
|
||||
list.Add(new FileInfo(fileNames.ConfigurationFile));
|
||||
list.Add(new FileInfo(fileNames.FilesystemFile));
|
||||
list.Add(new FileInfo(fileNames.ActiveCollectionsFile));
|
||||
list.Add(new FileInfo(fileNames.PredefinedTagFile));
|
||||
|
|
@ -57,7 +56,7 @@ public class BackupService : Luna.IAsyncService
|
|||
catch (Exception ex)
|
||||
{
|
||||
Penumbra.Log.Error($"Failed to load {fileName}, trying to restore from backup:\n{ex}");
|
||||
Backup.TryGetFile(new DirectoryInfo(fileNames.ConfigDirectory), fileName, out ret, out var messages, JObject.Parse);
|
||||
Backup.TryGetFile(new DirectoryInfo(fileNames.ConfigurationDirectory), fileName, out ret, out var messages, JObject.Parse);
|
||||
Penumbra.Messager.NotificationMessage(messages);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class CleanupService(SaveService saveService, ModManager mods, Collection
|
|||
_cancel = new CancellationTokenSource();
|
||||
_task = Task.Run(() =>
|
||||
{
|
||||
var configFiles = Directory.EnumerateFiles(saveService.FileNames.ConfigDirectory, "*.json.bak", SearchOption.AllDirectories)
|
||||
var configFiles = Directory.EnumerateFiles(saveService.FileNames.ConfigurationDirectory, "*.json.bak", SearchOption.AllDirectories)
|
||||
.ToList();
|
||||
Progress = 0.1;
|
||||
if (_cancel.IsCancellationRequested)
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ public class ConfigMigrationService(SaveService saveService, BackupService backu
|
|||
// because it stayed alive for a bunch of people for some reason.
|
||||
DeleteMetaTmp();
|
||||
|
||||
if (config.Version >= Configuration.Constants.CurrentVersion || !File.Exists(saveService.FileNames.ConfigFile))
|
||||
if (config.Version >= Configuration.Constants.CurrentVersion || !File.Exists(saveService.FileNames.ConfigurationFile))
|
||||
{
|
||||
AddColors(config, false);
|
||||
return;
|
||||
}
|
||||
|
||||
_data = JObject.Parse(File.ReadAllText(saveService.FileNames.ConfigFile));
|
||||
_data = JObject.Parse(File.ReadAllText(saveService.FileNames.ConfigurationFile));
|
||||
CreateBackup();
|
||||
|
||||
Version0To1();
|
||||
|
|
@ -392,7 +392,7 @@ public class ConfigMigrationService(SaveService saveService, BackupService backu
|
|||
// Create a backup of the configuration file specifically.
|
||||
private void CreateBackup()
|
||||
{
|
||||
var name = saveService.FileNames.ConfigFile;
|
||||
var name = saveService.FileNames.ConfigurationFile;
|
||||
var bakName = name + ".bak";
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
using Dalamud.Plugin;
|
||||
using Luna.Files;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Mods;
|
||||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
public class FilenameService(IDalamudPluginInterface pi) : Luna.IService
|
||||
public sealed class FilenameService(IDalamudPluginInterface pi) : BaseFilePathProvider(pi)
|
||||
{
|
||||
public readonly string ConfigDirectory = pi.ConfigDirectory.FullName;
|
||||
public readonly string CollectionDirectory = Path.Combine(pi.ConfigDirectory.FullName, "collections");
|
||||
public readonly string LocalDataDirectory = Path.Combine(pi.ConfigDirectory.FullName, "mod_data");
|
||||
public readonly string ConfigFile = pi.ConfigFile.FullName;
|
||||
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 ActiveCollectionsFile = Path.Combine(pi.ConfigDirectory.FullName, "active_collections.json");
|
||||
|
|
|
|||
|
|
@ -1,20 +1,17 @@
|
|||
using Dalamud.Game.Text;
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel.Sheets;
|
||||
using OtterGui.Log;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.String.Classes;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
public class MessageService(Logger log, IUiBuilder builder, IChatGui chat, INotificationManager notificationManager)
|
||||
: OtterGui.Classes.MessageService(log, builder, chat, notificationManager), Luna.IService
|
||||
public class MessageService(Luna.Logger log, IChatGui chat, INotificationManager notificationManager)
|
||||
: Luna.MessageService(log, chat, notificationManager), Luna.IService
|
||||
{
|
||||
public void LinkItem(in Item item)
|
||||
{
|
||||
|
|
@ -50,7 +47,7 @@ public class MessageService(Logger log, IUiBuilder builder, IChatGui chat, INoti
|
|||
return;
|
||||
|
||||
AddTaggedMessage($"{fullPath}.{messageComplement}",
|
||||
new Notification(
|
||||
new Luna.Notification(
|
||||
$"Cowardly refusing to load replacement for {originalGamePath.Filename().ToString().ToLowerInvariant()} by {mod.Name}{(messageComplement.Length > 0 ? ":\n" : ".")}{messageComplement}",
|
||||
NotificationType.Warning, 10000));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Lumina.Data.Files;
|
||||
using OtterGui.Classes;
|
||||
using Lumina.Extensions;
|
||||
using Luna;
|
||||
using Penumbra.GameData.Files.Utility;
|
||||
using Penumbra.Import.Textures;
|
||||
using SharpCompress.Common;
|
||||
|
|
@ -11,7 +11,7 @@ using MtrlFile = Penumbra.GameData.Files.MtrlFile;
|
|||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
public class MigrationManager(Configuration config) : Luna.IService
|
||||
public class MigrationManager(Configuration config) : IService
|
||||
{
|
||||
public enum TaskType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using OtterGui.Classes;
|
||||
using OtterGui.Log;
|
||||
using Luna;
|
||||
using Luna.Files;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ public interface ISavable : ISavable<FilenameService>
|
|||
{ }
|
||||
|
||||
public sealed class SaveService(Logger log, FrameworkManager framework, FilenameService fileNames, BackupService backupService)
|
||||
: SaveServiceBase<FilenameService>(log, framework, fileNames, backupService.Awaiter), Luna.IService
|
||||
: BaseSaveService<FilenameService>(log, framework, fileNames, backupService.Awaiter), IService
|
||||
{
|
||||
/// <summary> Immediately delete all existing option group files for a mod and save them anew. </summary>
|
||||
public void SaveAllOptionGroups(Mod mod, bool backup, bool onlyAscii)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ using Penumbra.Interop.PathResolving;
|
|||
using Penumbra.Meta;
|
||||
using Penumbra.Mods.Manager;
|
||||
using IPenumbraApi = Penumbra.Api.Api.IPenumbraApi;
|
||||
using Logger = OtterGui.Log.Logger;
|
||||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
|
|
@ -23,10 +22,12 @@ public static class StaticServiceManager
|
|||
{
|
||||
public static ServiceManager CreateProvider(Penumbra penumbra, IDalamudPluginInterface pi, Logger log)
|
||||
{
|
||||
var services = new ServiceManager(new Luna.Logger())
|
||||
var services = new ServiceManager(log)
|
||||
.AddDalamudServices(pi)
|
||||
.AddExistingService(log)
|
||||
.AddExistingService(penumbra);
|
||||
// TODO Remove this when migration done
|
||||
services.AddExistingService(Penumbra.Log);
|
||||
services.AddIServices(typeof(EquipItem).Assembly);
|
||||
services.AddIServices(typeof(Penumbra).Assembly);
|
||||
services.AddIServices<OtterGui.Services.IService>(typeof(Penumbra).Assembly);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Plugin;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Framework;
|
||||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Compression;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Dalamud.Interface;
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Text.Widget.Editors;
|
||||
|
|
@ -40,7 +39,7 @@ public partial class MtrlTab
|
|||
{
|
||||
mpPrefix = MaterialParamsConstantName.Value!;
|
||||
var fcGroup = FindOrAddGroup(Constants, "Further Constants");
|
||||
foreach (var (constant, index) in Mtrl.ShaderPackage.Constants.WithIndex())
|
||||
foreach (var (index, constant) in Mtrl.ShaderPackage.Constants.Index())
|
||||
{
|
||||
var values = Mtrl.GetConstantValue<float>(constant);
|
||||
for (var i = 0; i < values.Length; i += 4)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.GameData;
|
||||
|
|
@ -220,7 +219,7 @@ public partial class MtrlTab
|
|||
!hasDkLabel, values));
|
||||
}
|
||||
else
|
||||
foreach (var (key, index) in Mtrl.ShaderPackage.ShaderKeys.WithIndex())
|
||||
foreach (var (index, key) in Mtrl.ShaderPackage.ShaderKeys.Index())
|
||||
{
|
||||
var keyName = Names.KnownNames.TryResolve(key.Key);
|
||||
var valueName = keyName.WithKnownSuffixes().TryResolve(Names.KnownNames, key.Value);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.GameData.Files.MaterialStructs;
|
||||
|
|
@ -33,7 +32,7 @@ public partial class MtrlTab
|
|||
if (Mtrl.Table != null)
|
||||
TextureIds.Add(TableSamplerId);
|
||||
|
||||
foreach (var (sampler, index) in Mtrl.ShaderPackage.Samplers.WithIndex())
|
||||
foreach (var (index, sampler) in Mtrl.ShaderPackage.Samplers.Index())
|
||||
Textures.Add(($"0x{sampler.SamplerId:X8}", sampler.TextureIndex, index, string.Empty, true));
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
|
|
@ -15,7 +14,7 @@ using Penumbra.Meta;
|
|||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.UI.Classes;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
using Notification = Luna.Notification;
|
||||
|
||||
namespace Penumbra.UI.AdvancedWindow.Meta;
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>, Luna
|
|||
var file = new AtchFile(text);
|
||||
foreach (var point in file.Points)
|
||||
{
|
||||
foreach (var (entry, index) in point.Entries.WithIndex())
|
||||
foreach (var (index, entry) in point.Entries.Index())
|
||||
{
|
||||
var identifier = new AtchIdentifier(point.Type, gr, (ushort)index);
|
||||
var defaultValue = AtchCache.GetDefault(MetaFiles, identifier);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using Dalamud.Interface.ImGuiNotification;
|
|||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
@ -45,7 +44,7 @@ public partial class ModEditWindow
|
|||
return;
|
||||
|
||||
var metaColor = ColorId.ItemId.Value();
|
||||
foreach (var (deformer, index) in tab.File.Deformers.WithIndex())
|
||||
foreach (var (index, deformer) in tab.File.Deformers.Index())
|
||||
{
|
||||
var name = deformer.GenderRace.ToName();
|
||||
var raceCode = deformer.GenderRace.ToRaceCode();
|
||||
|
|
@ -167,7 +166,7 @@ public partial class ModEditWindow
|
|||
if (!deformer.RacialDeformer.DeformMatrices.TryAdd(_pbdData.NewBoneName, existingMatrix)
|
||||
&& deformer.RacialDeformer.DeformMatrices.TryGetValue(_pbdData.NewBoneName, out var newBoneMatrix)
|
||||
&& !newBoneMatrix.Equals(existingMatrix))
|
||||
Penumbra.Messager.AddMessage(new Notification(
|
||||
Penumbra.Messager.AddMessage(new Luna.Notification(
|
||||
$"Could not add deformer matrix to {deformer.GenderRace.ToName()}, Bone {_pbdData.NewBoneName} because it already has a deformer that differs from the intended one.",
|
||||
NotificationType.Warning));
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Dalamud.Interface;
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
|
@ -31,8 +30,8 @@ public partial class ModEditWindow
|
|||
private bool CheckFilter(FileRegistry registry)
|
||||
=> _fileFilter.IsEmpty || registry.File.FullName.Contains(_fileFilter.Lower, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
private bool CheckFilter((FileRegistry, int) p)
|
||||
=> CheckFilter(p.Item1);
|
||||
private bool CheckFilter((int, FileRegistry) p)
|
||||
=> CheckFilter(p.Item2);
|
||||
|
||||
private void DrawFileTab()
|
||||
{
|
||||
|
|
@ -121,7 +120,7 @@ public partial class ModEditWindow
|
|||
if (!list)
|
||||
return;
|
||||
|
||||
foreach (var (registry, i) in _editor.Files.Available.WithIndex().Where(CheckFilter))
|
||||
foreach (var (i, registry) in _editor.Files.Available.Index().Where(CheckFilter))
|
||||
{
|
||||
using var id = ImRaii.PushId(i);
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.UI.AdvancedWindow.Materials;
|
||||
|
|
@ -41,7 +40,7 @@ public partial class ModEditWindow
|
|||
if (!table)
|
||||
return;
|
||||
|
||||
foreach (var (info, idx) in _editor.MdlMaterialEditor.ModelFiles.WithIndex())
|
||||
foreach (var (idx, info) in _editor.MdlMaterialEditor.ModelFiles.Index())
|
||||
{
|
||||
using var id = ImRaii.PushId(idx);
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.Import.Models;
|
||||
|
|
@ -356,7 +355,7 @@ public partial class ModEditWindow
|
|||
{
|
||||
var allAttributes = new List<string>();
|
||||
|
||||
foreach (var (attributes, subMeshIndex) in _attributes.WithIndex())
|
||||
foreach (var (subMeshIndex, attributes) in _attributes.Index())
|
||||
{
|
||||
if (attributes == null)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Lumina.Data.Parsing;
|
||||
using Luna.Widgets;
|
||||
using OtterGui;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
|
|
@ -200,7 +200,7 @@ public partial class ModEditWindow
|
|||
borderColor: Colors.RegexWarningBorder);
|
||||
|
||||
var spaceAvail = ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - 100;
|
||||
foreach (var (exception, index) in tab.IoExceptions.WithIndex())
|
||||
foreach (var (index, exception) in tab.IoExceptions.Index())
|
||||
{
|
||||
using var id = ImRaii.PushId(index);
|
||||
var message = $"{exception.GetType().Name}: {exception.Message}";
|
||||
|
|
@ -226,7 +226,7 @@ public partial class ModEditWindow
|
|||
using var frame = ImRaii.FramedGroup("Warnings", size, headerPreIcon: FontAwesomeIcon.ExclamationCircle, borderColor: 0xFF40FFFF);
|
||||
|
||||
var spaceAvail = ImGui.GetContentRegionAvail().X - ImGui.GetStyle().ItemSpacing.X - 100;
|
||||
foreach (var (warning, index) in tab.IoWarnings.WithIndex())
|
||||
foreach (var (index, warning) in tab.IoWarnings.Index())
|
||||
{
|
||||
using var id = ImRaii.PushId(index);
|
||||
var textSize = ImGui.CalcTextSize(warning).X;
|
||||
|
|
@ -287,7 +287,7 @@ public partial class ModEditWindow
|
|||
ImGui.SetNextItemWidth(buttonWidth);
|
||||
using var combo = ImRaii.Combo("Game Path", preview);
|
||||
if (combo.Success)
|
||||
foreach (var (path, index) in tab.GamePaths.WithIndex())
|
||||
foreach (var (index, path) in tab.GamePaths.Index())
|
||||
{
|
||||
if (!ImGui.Selectable(path.ToString(), index == tab.GamePathIndex))
|
||||
continue;
|
||||
|
|
@ -310,7 +310,7 @@ public partial class ModEditWindow
|
|||
|
||||
// Draw the link button. We set the background colour to transparent to mimic the look of a link.
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Button, 0x00000000);
|
||||
CustomGui.DrawLinkButton(Penumbra.Messager, text, address, width);
|
||||
SupportButton.Link(Penumbra.Messager, text, address, width, ""u8);
|
||||
|
||||
// Draw an underline for the text.
|
||||
var lineStart = ImGui.GetItemRectMax();
|
||||
|
|
@ -541,7 +541,7 @@ public partial class ModEditWindow
|
|||
return false;
|
||||
|
||||
var ret = false;
|
||||
foreach (var (material, materialIndex) in tab.Mdl.Materials.WithIndex())
|
||||
foreach (var (materialIndex, material) in tab.Mdl.Materials.Index())
|
||||
{
|
||||
if (!ImGui.Selectable(material, mesh.MaterialIndex == materialIndex))
|
||||
continue;
|
||||
|
|
@ -636,7 +636,7 @@ public partial class ModEditWindow
|
|||
ImGuiUtil.DrawTableColumn(data.LastFile.VertexDeclarations.Length.ToString());
|
||||
ImGuiUtil.DrawTableColumn("Stack Size");
|
||||
ImGuiUtil.DrawTableColumn(data.LastFile.StackSize.ToString());
|
||||
foreach (var (triCount, lod) in data.LodTriCount.WithIndex())
|
||||
foreach (var (lod, triCount) in data.LodTriCount.Index())
|
||||
{
|
||||
ImGuiUtil.DrawTableColumn($"LOD #{lod + 1} Triangle Count");
|
||||
ImGuiUtil.DrawTableColumn(triCount.ToString());
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.GameData.Interop;
|
||||
|
|
@ -12,7 +12,6 @@ using static Penumbra.GameData.Files.ShpkFile;
|
|||
using OtterGui.Widgets;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.GameData.Structs;
|
||||
using OtterGui.Extensions;
|
||||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
|
|
@ -158,28 +157,28 @@ public partial class ModEditWindow
|
|||
{
|
||||
if (node)
|
||||
{
|
||||
foreach (var (key, keyIdx) in shader.SystemValues!.WithIndex())
|
||||
foreach (var (keyIdx, key) in shader.SystemValues!.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Used with System Key {tab.TryResolveName(tab.Shpk.SystemKeys[keyIdx].Id)} \u2208 {{ {tab.NameSetToString(key)} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
}
|
||||
|
||||
foreach (var (key, keyIdx) in shader.SceneValues!.WithIndex())
|
||||
foreach (var (keyIdx, key) in shader.SceneValues!.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Used with Scene Key {tab.TryResolveName(tab.Shpk.SceneKeys[keyIdx].Id)} \u2208 {{ {tab.NameSetToString(key)} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
}
|
||||
|
||||
foreach (var (key, keyIdx) in shader.MaterialValues!.WithIndex())
|
||||
foreach (var (keyIdx, key) in shader.MaterialValues!.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Used with Material Key {tab.TryResolveName(tab.Shpk.MaterialKeys[keyIdx].Id)} \u2208 {{ {tab.NameSetToString(key)} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
}
|
||||
|
||||
foreach (var (key, keyIdx) in shader.SubViewValues!.WithIndex())
|
||||
foreach (var (keyIdx, key) in shader.SubViewValues!.Index())
|
||||
{
|
||||
ImUtf8.TreeNode($"Used with Sub-View Key #{keyIdx} \u2208 {{ {tab.NameSetToString(key)} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
|
|
@ -195,16 +194,16 @@ public partial class ModEditWindow
|
|||
if (!ImUtf8.CollapsingHeader(tab.FilterPopCount == tab.FilterMaximumPopCount ? "Filters###Filters"u8 : "Filters (ACTIVE)###Filters"u8))
|
||||
return;
|
||||
|
||||
foreach (var (key, keyIdx) in tab.Shpk.SystemKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in tab.Shpk.SystemKeys.Index())
|
||||
DrawShaderPackageFilterSet(tab, $"System Key {tab.TryResolveName(key.Id)}", ref tab.FilterSystemValues[keyIdx]);
|
||||
|
||||
foreach (var (key, keyIdx) in tab.Shpk.SceneKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in tab.Shpk.SceneKeys.Index())
|
||||
DrawShaderPackageFilterSet(tab, $"Scene Key {tab.TryResolveName(key.Id)}", ref tab.FilterSceneValues[keyIdx]);
|
||||
|
||||
foreach (var (key, keyIdx) in tab.Shpk.MaterialKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in tab.Shpk.MaterialKeys.Index())
|
||||
DrawShaderPackageFilterSet(tab, $"Material Key {tab.TryResolveName(key.Id)}", ref tab.FilterMaterialValues[keyIdx]);
|
||||
|
||||
foreach (var (_, keyIdx) in tab.Shpk.SubViewKeys.WithIndex())
|
||||
foreach (var (keyIdx, _) in tab.Shpk.SubViewKeys.Index())
|
||||
DrawShaderPackageFilterSet(tab, $"Sub-View Key #{keyIdx}", ref tab.FilterSubViewValues[keyIdx]);
|
||||
|
||||
DrawShaderPackageFilterSet(tab, "Passes", ref tab.FilterPasses);
|
||||
|
|
@ -497,7 +496,7 @@ public partial class ModEditWindow
|
|||
ImGui.SetNextItemWidth(UiHelpers.Scale * 400);
|
||||
using var c = ImUtf8.Combo("##Start", tab.Orphans[tab.NewMaterialParamStart].Name);
|
||||
if (c)
|
||||
foreach (var (start, idx) in tab.Orphans.WithIndex())
|
||||
foreach (var(idx, start) in tab.Orphans.Index())
|
||||
{
|
||||
if (ImGui.Selectable(start.Name, idx == tab.NewMaterialParamStart))
|
||||
tab.UpdateOrphanStart(idx);
|
||||
|
|
@ -615,7 +614,7 @@ public partial class ModEditWindow
|
|||
return;
|
||||
|
||||
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
||||
foreach (var (key, idx) in keys.WithIndex())
|
||||
foreach (var (idx, key) in keys.Index())
|
||||
{
|
||||
using var t2 = ImUtf8.TreeNode(withId ? $"#{idx}: {tab.TryResolveName(key.Id)} (0x{key.Id:X8})" : $"#{idx}");
|
||||
if (t2)
|
||||
|
|
@ -639,7 +638,7 @@ public partial class ModEditWindow
|
|||
|
||||
using var font = ImRaii.PushFont(UiBuilder.MonoFont);
|
||||
|
||||
foreach (var (node, idx) in tab.Shpk.Nodes.WithIndex())
|
||||
foreach (var (idx, node) in tab.Shpk.Nodes.Index())
|
||||
{
|
||||
if (!tab.IsFilterMatch(node))
|
||||
continue;
|
||||
|
|
@ -648,28 +647,28 @@ public partial class ModEditWindow
|
|||
if (!t2)
|
||||
continue;
|
||||
|
||||
foreach (var (key, keyIdx) in node.SystemKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in node.SystemKeys.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"System Key {tab.TryResolveName(tab.Shpk.SystemKeys[keyIdx].Id)} = {tab.TryResolveName(key)} / \u2208 {{ {tab.NameSetToString(node.SystemValues![keyIdx])} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
}
|
||||
|
||||
foreach (var (key, keyIdx) in node.SceneKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in node.SceneKeys.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Scene Key {tab.TryResolveName(tab.Shpk.SceneKeys[keyIdx].Id)} = {tab.TryResolveName(key)} / \u2208 {{ {tab.NameSetToString(node.SceneValues![keyIdx])} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
}
|
||||
|
||||
foreach (var (key, keyIdx) in node.MaterialKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in node.MaterialKeys.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Material Key {tab.TryResolveName(tab.Shpk.MaterialKeys[keyIdx].Id)} = {tab.TryResolveName(key)} / \u2208 {{ {tab.NameSetToString(node.MaterialValues![keyIdx])} }}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
}
|
||||
|
||||
foreach (var (key, keyIdx) in node.SubViewKeys.WithIndex())
|
||||
foreach (var (keyIdx, key) in node.SubViewKeys.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Sub-View Key #{keyIdx} = {tab.TryResolveName(key)} / \u2208 {{ {tab.NameSetToString(node.SubViewValues![keyIdx])} }}",
|
||||
|
|
@ -678,7 +677,7 @@ public partial class ModEditWindow
|
|||
|
||||
ImUtf8.TreeNode($"Pass Indices: {string.Join(' ', node.PassIndices.Select(c => $"{c:X2}"))}",
|
||||
ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.Bullet).Dispose();
|
||||
foreach (var (pass, passIdx) in node.Passes.WithIndex())
|
||||
foreach (var (passIdx, pass) in node.Passes.Index())
|
||||
{
|
||||
ImUtf8.TreeNode(
|
||||
$"Pass #{passIdx}: ID: {tab.TryResolveName(pass.Id)}, Vertex Shader #{pass.VertexShader}, Pixel Shader #{pass.PixelShader}",
|
||||
|
|
@ -733,7 +732,7 @@ public partial class ModEditWindow
|
|||
var sb = new StringBuilder(256);
|
||||
if (withSize)
|
||||
{
|
||||
foreach (var (components, i) in (used ?? Array.Empty<DisassembledShader.VectorComponents>()).WithIndex())
|
||||
foreach (var (i, components) in (used ?? []).Index())
|
||||
{
|
||||
switch (components)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Dalamud.Utility;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.GameData.Files.ShaderStructs;
|
||||
using Penumbra.GameData.Interop;
|
||||
|
|
@ -180,7 +179,7 @@ public partial class ModEditWindow
|
|||
|
||||
MalformedParameters.Clear();
|
||||
UsedIds.Clear();
|
||||
foreach (var (param, idx) in Shpk.MaterialParams.WithIndex())
|
||||
foreach (var (idx, param) in Shpk.MaterialParams.Index())
|
||||
{
|
||||
UsedIds.Add(param.Id);
|
||||
var iStart = param.ByteOffset >> 4;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterTex;
|
||||
using Penumbra.Import.Textures;
|
||||
|
|
@ -50,7 +50,7 @@ public partial class ModEditWindow
|
|||
ImGuiUtil.DrawTextButton(label, new Vector2(-1, 0), ImGui.GetColorU32(ImGuiCol.FrameBg));
|
||||
ImGui.NewLine();
|
||||
|
||||
using (var disabled = ImRaii.Disabled(!_center.SaveTask.IsCompleted))
|
||||
using (ImRaii.Disabled(!_center.SaveTask.IsCompleted))
|
||||
{
|
||||
TextureDrawer.PathInputBox(_textures, tex, ref tex.TmpPath, "##input", "Import Image...",
|
||||
"Can import game paths as well as your own files.", Mod!.ModPath.FullName, _fileDialog, _config.DefaultModImportPath);
|
||||
|
|
@ -85,7 +85,7 @@ public partial class ModEditWindow
|
|||
if (!combo)
|
||||
return;
|
||||
|
||||
foreach (var ((newText, newDesc), idx) in SaveAsStrings.WithIndex())
|
||||
foreach (var (idx, (newText, newDesc)) in SaveAsStrings.Index())
|
||||
{
|
||||
if (ImGui.Selectable(newText, idx == _currentSaveAs))
|
||||
_currentSaveAs = idx;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.DragDrop;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Enums;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
|
@ -189,7 +188,7 @@ public class ModMergeTab(ModMerger modMerger) : Luna.IUiService
|
|||
ImGui.TableSetupColumn("#Swaps", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableSetupColumn("#Manips", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale);
|
||||
ImGui.TableHeadersRow();
|
||||
foreach (var (option, idx) in options.WithIndex())
|
||||
foreach (var (idx, option) in options.Index())
|
||||
{
|
||||
using var id = ImRaii.PushId(idx);
|
||||
var selected = modMerger.SelectedOptions.Contains(option);
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ using Dalamud.Interface.ImGuiNotification;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Data;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Compression;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Enums;
|
||||
|
|
@ -76,7 +74,7 @@ public class ResourceTreeViewer(
|
|||
else if (_task.IsCompletedSuccessfully)
|
||||
{
|
||||
var debugMode = config.DebugMode;
|
||||
foreach (var (tree, index) in _task.Result.WithIndex())
|
||||
foreach (var (index, tree) in _task.Result.Index())
|
||||
{
|
||||
var category = Classify(tree);
|
||||
if (!_categoryFilter.HasFlag(category) || !tree.Name.Contains(_nameFilter, StringComparison.OrdinalIgnoreCase))
|
||||
|
|
@ -229,7 +227,7 @@ public class ResourceTreeViewer(
|
|||
var debugMode = config.DebugMode;
|
||||
var frameHeight = ImGui.GetFrameHeight();
|
||||
|
||||
foreach (var (resourceNode, index) in resourceNodes.WithIndex())
|
||||
foreach (var (index, resourceNode) in resourceNodes.Index())
|
||||
{
|
||||
var nodePathHash = unchecked(pathHash + resourceNode.ResourceHandle);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using OtterGui.Compression;
|
||||
using Luna;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.Interop.ResourceTree;
|
||||
using Penumbra.Services;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Extensions;
|
||||
using Luna;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ using Dalamud.Interface.ManagedFontAtlas;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -17,7 +16,6 @@ using Penumbra.Collections.Manager;
|
|||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.Classes;
|
||||
|
||||
|
|
@ -547,7 +545,7 @@ public sealed class CollectionPanel(
|
|||
using var style = ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, 1 * ImGuiHelpers.GlobalScale)
|
||||
.Push(ImGuiStyleVar.ButtonTextAlign, Vector2.Zero);
|
||||
|
||||
foreach (var ((type, id), idx) in _inUseCache.WithIndex())
|
||||
foreach (var (idx, (type, id)) in _inUseCache.Index())
|
||||
{
|
||||
var name = type == CollectionType.Individual ? Name(id, null) : Buttons[type].Name;
|
||||
var color = Buttons.TryGetValue(type, out var p) ? p.Border : 0;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -287,7 +287,7 @@ public class InheritanceUi(CollectionManager collectionManager, IncognitoService
|
|||
if (!source)
|
||||
return;
|
||||
|
||||
ImGui.SetDragDropPayload(InheritanceDragDropLabel, null, 0);
|
||||
ImGui.SetDragDropPayload(InheritanceDragDropLabel, null);
|
||||
_movedInheritance = collection;
|
||||
ImGui.TextUnformatted($"Moving {(_movedInheritance != null ? Name(_movedInheritance) : "Unknown")}...");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna.Widgets;
|
||||
using OtterGui;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Enums;
|
||||
|
|
@ -150,7 +150,7 @@ public sealed class ConfigWindow : Window, Luna.IUiService
|
|||
|
||||
ImGui.NewLine();
|
||||
ImGui.NewLine();
|
||||
CustomGui.DrawDiscordButton(Penumbra.Messager, 0);
|
||||
SupportButton.Discord(Penumbra.Messager, 0);
|
||||
ImGui.SameLine();
|
||||
UiHelpers.DrawSupportButton(_penumbra!);
|
||||
ImGui.NewLine();
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue