mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Reorganize advanced editing tabs a bit.
This commit is contained in:
parent
e4e74376fc
commit
f01b2f8754
4 changed files with 40 additions and 20 deletions
|
|
@ -40,6 +40,9 @@ public sealed class ModPathChanged : EventWrapper<Action<ModPathChangeType, Mod,
|
||||||
/// <seealso cref="Mods.Editor.ModMerger.OnModPathChange"/>
|
/// <seealso cref="Mods.Editor.ModMerger.OnModPathChange"/>
|
||||||
ModMerger = 0,
|
ModMerger = 0,
|
||||||
|
|
||||||
|
/// <seealso cref="UI.AdvancedWindow.ModEditWindow.OnModPathChange"/>
|
||||||
|
ModEditWindow = 0,
|
||||||
|
|
||||||
/// <seealso cref="Collections.Manager.CollectionStorage.OnModPathChange"/>
|
/// <seealso cref="Collections.Manager.CollectionStorage.OnModPathChange"/>
|
||||||
CollectionStorage = 10,
|
CollectionStorage = 10,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<byte> Label
|
public ReadOnlySpan<byte> Label
|
||||||
=> "Item Swap (WIP)"u8;
|
=> "Item Swap"u8;
|
||||||
|
|
||||||
public void DrawContent()
|
public void DrawContent()
|
||||||
{
|
{
|
||||||
|
|
@ -416,10 +416,10 @@ public class ItemSwapTab : IDisposable, ITab
|
||||||
DrawEquipmentSwap(SwapType.Ring);
|
DrawEquipmentSwap(SwapType.Ring);
|
||||||
DrawAccessorySwap();
|
DrawAccessorySwap();
|
||||||
DrawHairSwap();
|
DrawHairSwap();
|
||||||
DrawFaceSwap();
|
//DrawFaceSwap();
|
||||||
DrawEarSwap();
|
DrawEarSwap();
|
||||||
DrawTailSwap();
|
DrawTailSwap();
|
||||||
DrawWeaponSwap();
|
//DrawWeaponSwap();
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImRaii.IEndObject DrawTab(SwapType newTab)
|
private ImRaii.IEndObject DrawTab(SwapType newTab)
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void DrawTextureTab()
|
private void DrawTextureTab()
|
||||||
{
|
{
|
||||||
using var tab = ImRaii.TabItem("Texture Import/Export");
|
using var tab = ImRaii.TabItem("Textures");
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -10,12 +11,14 @@ using ImGuiNET;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
|
using Penumbra.Communication;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Files;
|
using Penumbra.GameData.Files;
|
||||||
using Penumbra.Import.Textures;
|
using Penumbra.Import.Textures;
|
||||||
using Penumbra.Interop.ResourceTree;
|
using Penumbra.Interop.ResourceTree;
|
||||||
using Penumbra.Meta;
|
using Penumbra.Meta;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
|
using Penumbra.Mods.Manager;
|
||||||
using Penumbra.Services;
|
using Penumbra.Services;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
|
@ -27,15 +30,16 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
private const string WindowBaseLabel = "###SubModEdit";
|
private const string WindowBaseLabel = "###SubModEdit";
|
||||||
|
|
||||||
private readonly PerformanceTracker _performance;
|
private readonly PerformanceTracker _performance;
|
||||||
private readonly ModEditor _editor;
|
private readonly ModEditor _editor;
|
||||||
private readonly Configuration _config;
|
private readonly Configuration _config;
|
||||||
private readonly ItemSwapTab _itemSwapTab;
|
private readonly ItemSwapTab _itemSwapTab;
|
||||||
private readonly DalamudServices _dalamud;
|
private readonly DalamudServices _dalamud;
|
||||||
private readonly MetaFileManager _metaFileManager;
|
private readonly MetaFileManager _metaFileManager;
|
||||||
private readonly ActiveCollections _activeCollections;
|
private readonly ActiveCollections _activeCollections;
|
||||||
private readonly StainService _stainService;
|
private readonly StainService _stainService;
|
||||||
private readonly ModMergeTab _modMergeTab;
|
private readonly ModMergeTab _modMergeTab;
|
||||||
|
private readonly CommunicatorService _communicator;
|
||||||
|
|
||||||
private Mod? _mod;
|
private Mod? _mod;
|
||||||
private Vector2 _iconSize = Vector2.Zero;
|
private Vector2 _iconSize = Vector2.Zero;
|
||||||
|
|
@ -146,17 +150,20 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
DrawMetaTab();
|
DrawMetaTab();
|
||||||
DrawSwapTab();
|
DrawSwapTab();
|
||||||
_modMergeTab.Draw();
|
_modMergeTab.Draw();
|
||||||
DrawMissingFilesTab();
|
|
||||||
DrawDuplicatesTab();
|
DrawDuplicatesTab();
|
||||||
DrawQuickImportTab();
|
|
||||||
DrawMaterialReassignmentTab();
|
DrawMaterialReassignmentTab();
|
||||||
|
DrawQuickImportTab();
|
||||||
_modelTab.Draw();
|
_modelTab.Draw();
|
||||||
_materialTab.Draw();
|
_materialTab.Draw();
|
||||||
DrawTextureTab();
|
DrawTextureTab();
|
||||||
_shaderPackageTab.Draw();
|
_shaderPackageTab.Draw();
|
||||||
using var tab = ImRaii.TabItem("Item Swap (WIP)");
|
using (var tab = ImRaii.TabItem("Item Swap"))
|
||||||
if (tab)
|
{
|
||||||
_itemSwapTab.DrawContent();
|
if (tab)
|
||||||
|
_itemSwapTab.DrawContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawMissingFilesTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> A row of three buttonSizes and a help marker that can be used for material suffix changing. </summary>
|
/// <summary> A row of three buttonSizes and a help marker that can be used for material suffix changing. </summary>
|
||||||
|
|
@ -512,7 +519,8 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
|
|
||||||
public ModEditWindow(PerformanceTracker performance, FileDialogService fileDialog, ItemSwapTab itemSwapTab, DataManager gameData,
|
public ModEditWindow(PerformanceTracker performance, FileDialogService fileDialog, ItemSwapTab itemSwapTab, DataManager gameData,
|
||||||
Configuration config, ModEditor editor, ResourceTreeFactory resourceTreeFactory, MetaFileManager metaFileManager,
|
Configuration config, ModEditor editor, ResourceTreeFactory resourceTreeFactory, MetaFileManager metaFileManager,
|
||||||
StainService stainService, ActiveCollections activeCollections, UiBuilder uiBuilder, DalamudServices dalamud, ModMergeTab modMergeTab)
|
StainService stainService, ActiveCollections activeCollections, UiBuilder uiBuilder, DalamudServices dalamud, ModMergeTab modMergeTab,
|
||||||
|
CommunicatorService communicator)
|
||||||
: base(WindowBaseLabel)
|
: base(WindowBaseLabel)
|
||||||
{
|
{
|
||||||
_performance = performance;
|
_performance = performance;
|
||||||
|
|
@ -524,24 +532,33 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
_activeCollections = activeCollections;
|
_activeCollections = activeCollections;
|
||||||
_dalamud = dalamud;
|
_dalamud = dalamud;
|
||||||
_modMergeTab = modMergeTab;
|
_modMergeTab = modMergeTab;
|
||||||
|
_communicator = communicator;
|
||||||
_fileDialog = fileDialog;
|
_fileDialog = fileDialog;
|
||||||
_materialTab = new FileEditor<MtrlTab>(this, gameData, config, _fileDialog, "Materials", ".mtrl",
|
_materialTab = new FileEditor<MtrlTab>(this, gameData, config, _fileDialog, "Materials", ".mtrl",
|
||||||
() => _editor.Files.Mtrl, DrawMaterialPanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
() => _editor.Files.Mtrl, DrawMaterialPanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
||||||
bytes => new MtrlTab(this, new MtrlFile(bytes)));
|
bytes => new MtrlTab(this, new MtrlFile(bytes)));
|
||||||
_modelTab = new FileEditor<MdlFile>(this, gameData, config, _fileDialog, "Models", ".mdl",
|
_modelTab = new FileEditor<MdlFile>(this, gameData, config, _fileDialog, "Models", ".mdl",
|
||||||
() => _editor.Files.Mdl, DrawModelPanel, () => _mod?.ModPath.FullName ?? string.Empty, bytes => new MdlFile(bytes));
|
() => _editor.Files.Mdl, DrawModelPanel, () => _mod?.ModPath.FullName ?? string.Empty, bytes => new MdlFile(bytes));
|
||||||
_shaderPackageTab = new FileEditor<ShpkTab>(this, gameData, config, _fileDialog, "Shader Packages", ".shpk",
|
_shaderPackageTab = new FileEditor<ShpkTab>(this, gameData, config, _fileDialog, "Shaders", ".shpk",
|
||||||
() => _editor.Files.Shpk, DrawShaderPackagePanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
() => _editor.Files.Shpk, DrawShaderPackagePanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
||||||
bytes => new ShpkTab(_fileDialog, bytes));
|
bytes => new ShpkTab(_fileDialog, bytes));
|
||||||
_center = new CombinedTexture(_left, _right);
|
_center = new CombinedTexture(_left, _right);
|
||||||
_quickImportViewer = new ResourceTreeViewer(_config, resourceTreeFactory, 2, OnQuickImportRefresh, DrawQuickImportActions);
|
_quickImportViewer = new ResourceTreeViewer(_config, resourceTreeFactory, 2, OnQuickImportRefresh, DrawQuickImportActions);
|
||||||
|
_communicator.ModPathChanged.Subscribe(OnModPathChanged, ModPathChanged.Priority.ModEditWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
_communicator.ModPathChanged.Unsubscribe(OnModPathChanged);
|
||||||
_editor?.Dispose();
|
_editor?.Dispose();
|
||||||
_left.Dispose();
|
_left.Dispose();
|
||||||
_right.Dispose();
|
_right.Dispose();
|
||||||
_center.Dispose();
|
_center.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModPathChanged(ModPathChangeType type, Mod mod, DirectoryInfo? _1, DirectoryInfo? _2)
|
||||||
|
{
|
||||||
|
if (type is ModPathChangeType.Reloaded)
|
||||||
|
ChangeMod(mod);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue