Change folder handling and introduce drag & drop for folders

This commit is contained in:
Ottermandias 2021-08-08 12:43:12 +02:00
parent ec99887387
commit 2532e73f9d
21 changed files with 1690 additions and 651 deletions

View file

@ -16,6 +16,7 @@ namespace Penumbra.UI
private readonly ManageModsButton _manageModsButton;
private readonly MenuBar _menuBar;
private readonly SettingsMenu _menu;
private readonly ModManager _modManager;
public SettingsInterface( Plugin plugin )
{
@ -23,6 +24,7 @@ namespace Penumbra.UI
_manageModsButton = new ManageModsButton( this );
_menuBar = new MenuBar( this );
_menu = new SettingsMenu( this );
_modManager = Service< ModManager >.Get();
}
public void FlipVisibility()
@ -40,12 +42,27 @@ namespace Penumbra.UI
private void ReloadMods()
{
_menu.InstalledTab.Selector.ResetModNamesLower();
_menu.InstalledTab.Selector.ClearSelection();
_modManager.DiscoverMods( _plugin.Configuration.ModDirectory );
_menu.InstalledTab.Selector.Cache.ResetModList();
}
var modManager = Service< ModManager >.Get();
modManager.DiscoverMods( _plugin.Configuration.ModDirectory );
_menu.InstalledTab.Selector.ResetModNamesLower();
private void SaveCurrentCollection( bool recalculateMeta )
{
var current = _modManager.Collections.CurrentCollection;
current.Save( _plugin.PluginInterface );
RecalculateCurrent( recalculateMeta );
}
private void RecalculateCurrent( bool recalculateMeta )
{
var current = _modManager.Collections.CurrentCollection;
if( current.Cache != null )
{
current.CalculateEffectiveFileList( _modManager.BasePath, recalculateMeta,
current == _modManager.Collections.ActiveCollection );
_menu.InstalledTab.Selector.Cache.ResetFilters();
}
}
}
}