Added a bunch of logging, small fix.

This commit is contained in:
Ottermandias 2022-04-29 15:30:08 +02:00
parent 9af4406c8c
commit e8ee729ec5
16 changed files with 86 additions and 38 deletions

View file

@ -338,6 +338,7 @@ public sealed partial class ModFileSystemSelector : FileSystemSelector< Mod, Mod
{
base.SelectedLeaf = ( ModFileSystem.Leaf? )FileSystem.Root.GetAllDescendants( SortMode.Lexicographical )
.FirstOrDefault( l => l is ModFileSystem.Leaf m && m.Value.BasePath.FullName == _lastSelectedDirectory );
OnSelectionChange( null, base.SelectedLeaf?.Value, default );
_lastSelectedDirectory = string.Empty;
}
}

View file

@ -6,6 +6,7 @@ using Penumbra.Mods;
using Penumbra.UI.Classes;
using System;
using System.Numerics;
using Dalamud.Logging;
namespace Penumbra.UI;
@ -18,21 +19,36 @@ public partial class ConfigWindow
return;
}
using var tab = ImRaii.TabItem( "Mods" );
if( !tab )
try
{
return;
using var tab = ImRaii.TabItem( "Mods" );
if( !tab )
{
return;
}
_selector.Draw( GetModSelectorSize() );
ImGui.SameLine();
using var group = ImRaii.Group();
DrawHeaderLine();
using var child = ImRaii.Child( "##ModsTabMod", -Vector2.One, true, ImGuiWindowFlags.HorizontalScrollbar );
if( child )
{
_modPanel.Draw( _selector );
}
}
_selector.Draw( GetModSelectorSize() );
ImGui.SameLine();
using var group = ImRaii.Group();
DrawHeaderLine();
using var child = ImRaii.Child( "##ModsTabMod", -Vector2.One, true, ImGuiWindowFlags.HorizontalScrollbar );
if( child )
catch( Exception e )
{
_modPanel.Draw( _selector );
PluginLog.Error($"Exception thrown during ModPanel Render:\n{e}" );
PluginLog.Error($"{Penumbra.ModManager.Count} Mods\n"
+ $"{Penumbra.CollectionManager.Current.Name} Current Collection\n"
+ $"{Penumbra.CollectionManager.Current.Settings.Count} Settings\n"
+ $"{_selector.SortMode} Sort Mode\n"
+ $"{_selector.SelectedLeaf?.Name ?? "NULL"} Selected Leaf\n"
+ $"{_selector.Selected?.Name ?? "NULL"} Selected Mod\n"
+ $"{string.Join(", ", Penumbra.CollectionManager.Current.Inheritance)} Inheritances\n"
+ $"{_selector.SelectedSettingCollection.Name} Collection\n");
}
}

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Numerics;
using Dalamud.Interface;
using Dalamud.Interface.Windowing;
using Dalamud.Logging;
using ImGuiNET;
using OtterGui.Raii;
using Penumbra.Mods;
@ -27,7 +28,7 @@ public sealed partial class ConfigWindow : Window, IDisposable
{
_penumbra = penumbra;
_settingsTab = new SettingsTab( this );
_selector = new ModFileSystemSelector( _penumbra.ModFileSystem );
_selector = new ModFileSystemSelector( _penumbra.ModFileSystem );
_modPanel = new ModPanel( this );
_collectionsTab = new CollectionsTab( this );
_effectiveTab = new EffectiveTab();
@ -47,15 +48,22 @@ public sealed partial class ConfigWindow : Window, IDisposable
public override void Draw()
{
using var bar = ImRaii.TabBar( string.Empty, ImGuiTabBarFlags.NoTooltip );
SetupSizes();
_settingsTab.Draw();
DrawModsTab();
_collectionsTab.Draw();
DrawChangedItemTab();
_effectiveTab.Draw();
_debugTab.Draw();
_resourceTab.Draw();
try
{
using var bar = ImRaii.TabBar( string.Empty, ImGuiTabBarFlags.NoTooltip );
SetupSizes();
_settingsTab.Draw();
DrawModsTab();
_collectionsTab.Draw();
DrawChangedItemTab();
_effectiveTab.Draw();
_debugTab.Draw();
_resourceTab.Draw();
}
catch( Exception e )
{
PluginLog.Error( $"Exception thrown during UI Render:\n{e}" );
}
}
public void Dispose()