Add unsolved conflicts to both mods, add button to auto-generate groups based on folders, misc. fixes.

This commit is contained in:
Ottermandias 2021-10-18 16:12:32 +02:00
parent 795d605d3f
commit 4a82e6faf1
7 changed files with 102 additions and 12 deletions

View file

@ -1,7 +1,10 @@
using System.IO;
using System.Linq;
using System.Numerics;
using Dalamud.Interface;
using ImGuiNET;
using Lumina.Data.Parsing;
using Lumina.Excel.GeneratedSheets;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Util;
using Penumbra.Meta;
@ -198,6 +201,14 @@ namespace Penumbra.UI
_base._penumbra.Api.InvokeTooltip( data );
raii.Pop();
}
if( data is Item it )
{
var modelId = $"({( ( Quad )it.ModelMain ).A})";
var offset = ImGui.CalcTextSize( modelId ).X - ImGui.GetStyle().ItemInnerSpacing.X;
ImGui.SameLine(ImGui.GetWindowContentRegionWidth() - offset);
ImGui.TextColored( new Vector4(0.5f, 0.5f, 0.5f, 1 ), modelId );
}
}
}
@ -401,6 +412,7 @@ namespace Penumbra.UI
continue;
}
_fullFilenameList![ i ].selected = false;
var relName = _fullFilenameList[ i ].relName;
if( defaultIndex >= 0 )
{
@ -428,6 +440,7 @@ namespace Penumbra.UI
if( changed )
{
_fullFilenameList = null;
_selector.SaveCurrentMod();
// Since files may have changed, we need to recompute effective files.
foreach( var collection in _modManager.Collections.Collections.Values

View file

@ -701,7 +701,7 @@ namespace Penumbra.UI
{
MetaType.Est => new MetaManipulation( newManip.Value.Identifier, ( ulong )def ),
MetaType.Eqp => new MetaManipulation( newManip.Value.Identifier, ( ulong )def ),
MetaType.Eqdp => new MetaManipulation( newManip.Value.Identifier, ( ulong )def ),
MetaType.Eqdp => new MetaManipulation( newManip.Value.Identifier, (ushort) def ),
MetaType.Gmp => new MetaManipulation( newManip.Value.Identifier, ( ulong )def ),
MetaType.Imc => new MetaManipulation( newManip.Value.Identifier,
( ( ImcFile.ImageChangeData )def ).ToInteger() ),

View file

@ -216,6 +216,11 @@ namespace Penumbra.UI
if( ImGui.Checkbox( LabelModEnabled, ref enabled ) )
{
Mod.Settings.Enabled = enabled;
if( !enabled )
{
Mod.Cache.ClearConflicts();
}
_base.SaveCurrentCollection( Mod.Data.Resources.MetaManipulations.Count > 0 );
_selector.Cache.TriggerFilterReset();
}
@ -425,7 +430,7 @@ namespace Penumbra.UI
{
if( ImGui.Button( "Recompute Metadata" ) )
{
_selector.ReloadCurrentMod( true, true );
_selector.ReloadCurrentMod( true, true, true );
}
ImGuiCustom.HoverTooltip(
@ -440,7 +445,7 @@ namespace Penumbra.UI
{
ModCleanup.Deduplicate( Mod!.Data.BasePath, Meta! );
_selector.SaveCurrentMod();
_selector.ReloadCurrentMod();
_selector.ReloadCurrentMod( true, true, true );
}
ImGuiCustom.HoverTooltip( TooltipDeduplicate );
@ -452,12 +457,28 @@ namespace Penumbra.UI
{
ModCleanup.Normalize( Mod!.Data.BasePath, Meta! );
_selector.SaveCurrentMod();
_selector.ReloadCurrentMod();
_selector.ReloadCurrentMod( true, true, true );
}
ImGuiCustom.HoverTooltip( TooltipNormalize );
}
private void DrawAutoGenerateGroupsButton()
{
if( ImGui.Button( "Auto-Generate Groups" ) )
{
ModCleanup.AutoGenerateGroups( Mod!.Data.BasePath, Meta! );
_selector.SaveCurrentMod();
_selector.ReloadCurrentMod( true, true );
}
ImGuiCustom.HoverTooltip( "Automatically generate single-select groups from all folders (clears existing groups):\n"
+ "First subdirectory: Option Group\n"
+ "Second subdirectory: Option Name\n"
+ "Afterwards: Relative file paths.\n"
+ "Experimental - Use at own risk!" );
}
private void DrawSplitButton()
{
if( ImGui.Button( "Split Mod" ) )
@ -487,6 +508,8 @@ namespace Penumbra.UI
ImGui.SameLine();
DrawNormalizeButton();
ImGui.SameLine();
DrawAutoGenerateGroupsButton();
ImGui.SameLine();
DrawSplitButton();
DrawSortOrder( Mod!.Data, _modManager, _selector );
@ -498,7 +521,7 @@ namespace Penumbra.UI
{
using var raii = ImGuiRaii.DeferredEnd( ImGui.EndChild );
var ret = ImGui.BeginChild( LabelModPanel, AutoFillSize, true );
if( !ret || Mod == null )
{
return;

View file

@ -452,14 +452,14 @@ namespace Penumbra.UI
SetSelection( idx, mod );
}
public void ReloadCurrentMod( bool reloadMeta = false, bool recomputeMeta = false )
public void ReloadCurrentMod( bool reloadMeta = false, bool recomputeMeta = false, bool force = false )
{
if( Mod == null )
{
return;
}
if( _index >= 0 && _modManager.UpdateMod( Mod.Data, reloadMeta, recomputeMeta ) )
if( _index >= 0 && _modManager.UpdateMod( Mod.Data, reloadMeta, recomputeMeta, force ) )
{
SelectModOnUpdate( Mod.Data.BasePath.Name );
_base._menu.InstalledTab.ModPanel.Details.ResetState();