hide some debug options on release builds

This commit is contained in:
Adam 2020-12-25 23:50:11 +11:00
parent 7f1fd95a78
commit e6c8f6be94
2 changed files with 30 additions and 6 deletions

View file

@ -38,7 +38,8 @@ namespace Penumbra.Mods
if( !basePath.Exists ) if( !basePath.Exists )
{ {
Directory.CreateDirectory( basePath.FullName ); Mods = null;
return;
} }
_basePath = basePath; _basePath = basePath;

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
@ -84,10 +85,31 @@ namespace Penumbra.UI
ReloadMods(); ReloadMods();
} }
ImGui.SameLine();
if( ImGui.Button( "Open Mods Folder" ) )
{
Process.Start( _plugin.Configuration.CurrentCollection );
}
ImGui.SetCursorPosY( ImGui.GetCursorPosY() + 15 );
#if DEBUG
ImGui.Text( "debug shit" );
if( ImGui.Button( "Reload Player Resource" ) ) if( ImGui.Button( "Reload Player Resource" ) )
{ {
_plugin.ResourceLoader.ReloadPlayerResource(); _plugin.ResourceLoader.ReloadPlayerResource();
} }
if( _plugin.ResourceLoader != null )
{
ImGui.Checkbox( "DEBUG Log all loaded files", ref _plugin.ResourceLoader.LogAllFiles );
}
ImGui.SetCursorPosY( ImGui.GetCursorPosY() + 15 );
#endif
if( !_isImportRunning ) if( !_isImportRunning )
{ {
@ -139,17 +161,14 @@ namespace Penumbra.UI
{ {
ImGui.Button( "Import in progress..." ); ImGui.Button( "Import in progress..." );
} }
ImGui.SetCursorPosY( ImGui.GetCursorPosY() + 15 );
if( ImGui.Button( "Save Settings" ) ) if( ImGui.Button( "Save Settings" ) )
{ {
_plugin.Configuration.Save(); _plugin.Configuration.Save();
} }
if( _plugin.ResourceLoader != null )
{
ImGui.Checkbox( "DEBUG Log all loaded files", ref _plugin.ResourceLoader.LogAllFiles );
}
ImGui.EndTabItem(); ImGui.EndTabItem();
} }
@ -481,6 +500,10 @@ namespace Penumbra.UI
private void ReloadMods() private void ReloadMods()
{ {
_selectedMod = null; _selectedMod = null;
// create the directory if it doesn't exist
Directory.CreateDirectory( _plugin.Configuration.CurrentCollection );
_plugin.ModManager.DiscoverMods( _plugin.Configuration.CurrentCollection ); _plugin.ModManager.DiscoverMods( _plugin.Configuration.CurrentCollection );
} }
} }