Some style fixes.

This commit is contained in:
Ottermandias 2021-09-16 17:24:23 +02:00
parent d7214cd851
commit d59869dbfe
6 changed files with 16 additions and 14 deletions

View file

@ -14,7 +14,7 @@ namespace Penumbra.Mods
{
private readonly ModManager _manager;
public string CollectionChangedTo { get; private set; }= string.Empty;
public string CollectionChangedTo { get; private set; } = string.Empty;
public Dictionary< string, ModCollection > Collections { get; } = new();
public ModCollection CurrentCollection { get; private set; } = null!;
@ -43,11 +43,11 @@ namespace Penumbra.Mods
if( ActiveCollection.Cache?.MetaManipulations.Count > 0 || newActive.Cache?.MetaManipulations.Count > 0 )
{
var resourceManager = Service<ResidentResources>.Get();
var resourceManager = Service< ResidentResources >.Get();
resourceManager.ReloadPlayerResources();
}
ActiveCollection = newActive;
ActiveCollection = newActive;
return true;
}

View file

@ -35,7 +35,7 @@ namespace Penumbra.Mods
private void ClearOldTmpDir()
{
if (!TempWritable)
if( !TempWritable )
{
return;
}

View file

@ -88,7 +88,7 @@ namespace Penumbra.UI
if( _manager.Collections.AddCollection( _newCollectionName, settings ) )
{
UpdateNames();
SetCurrentCollection( _manager.Collections.Collections[_newCollectionName], true );
SetCurrentCollection( _manager.Collections.Collections[ _newCollectionName ], true );
}
_newCollectionName = string.Empty;
@ -100,10 +100,11 @@ namespace Penumbra.UI
{
var changes = ModFunctions.CleanUpCollection( _manager.Collections.CurrentCollection.Settings,
_manager.BasePath.EnumerateDirectories() );
_manager.Collections.CurrentCollection.UpdateSettings( forceSave: changes );
_manager.Collections.CurrentCollection.UpdateSettings( changes );
}
ImGuiCustom.HoverTooltip( "Remove all stored settings for mods not currently available and fix invalid settings.\nUse at own risk." );
ImGuiCustom.HoverTooltip(
"Remove all stored settings for mods not currently available and fix invalid settings.\nUse at own risk." );
}
private void DrawNewCollectionInput()
@ -128,7 +129,7 @@ namespace Penumbra.UI
var deleteCondition = _manager.Collections.Collections.Count > 1
&& _manager.Collections.CurrentCollection.Name != ModCollection.DefaultCollection;
ImGui.SameLine();
if( ImGuiCustom.DisableButton( "Delete Current Collection", deleteCondition) )
if( ImGuiCustom.DisableButton( "Delete Current Collection", deleteCondition ) )
{
_manager.Collections.RemoveCollection( _manager.Collections.CurrentCollection.Name );
SetCurrentCollection( _manager.Collections.CurrentCollection, true );
@ -149,7 +150,7 @@ namespace Penumbra.UI
return;
}
_manager.Collections.SetCurrentCollection( _collections[idx + 1] );
_manager.Collections.SetCurrentCollection( _collections[ idx + 1 ] );
_currentCollectionIndex = idx;
_selector.Cache.TriggerListReset();
if( _selector.Mod != null )
@ -223,7 +224,7 @@ namespace Penumbra.UI
ImGui.InputTextWithHint( "##New Character", "New Character Name", ref _newCharacterName, 32 );
ImGui.SameLine();
if( ImGuiCustom.DisableButton( "Create New Character Collection", _newCharacterName.Length > 0 ))
if( ImGuiCustom.DisableButton( "Create New Character Collection", _newCharacterName.Length > 0 ) )
{
_manager.Collections.CreateCharacterCollection( _newCharacterName );
_currentCharacterIndices[ _newCharacterName ] = 0;

View file

@ -349,9 +349,9 @@ namespace Penumbra.UI
return;
}
var manager = Service<ModManager>.Get();
var manager = Service< ModManager >.Get();
var cache = manager.Collections.CurrentCollection.Cache;
if( cache == null || !ImGui.BeginTable( "##MissingFilesDebugList", 1, ImGuiTableFlags.RowBg, -Vector2.UnitX))
if( cache == null || !ImGui.BeginTable( "##MissingFilesDebugList", 1, ImGuiTableFlags.RowBg, -Vector2.UnitX ) )
{
return;
}
@ -366,6 +366,7 @@ namespace Penumbra.UI
{
ImGui.SetClipboardText( file.FullName );
}
ImGuiCustom.HoverTooltip( "Click to copy to clipboard." );
}
}

View file

@ -8,7 +8,7 @@ namespace Penumbra.Util
public static void PrintDebugAddress( string name, IntPtr address )
{
var module = Dalamud.SigScanner.Module.BaseAddress.ToInt64();
PluginLog.Debug( "{Name} found at 0x{Address:X16}, +0x{Offset}", name, address.ToInt64(), address.ToInt64() - module );
PluginLog.Debug( "{Name} found at 0x{Address:X16}, +0x{Offset:X}", name, address.ToInt64(), address.ToInt64() - module );
}
}
}