mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-21 16:09:27 +01:00
A lot of interface stuff, some more cleanup and fixes. Main functionality should be mostly fine, importing works. Missing a lot of mod edit options.
This commit is contained in:
parent
8dd681bdda
commit
dbb9931189
77 changed files with 3332 additions and 2066 deletions
44
Penumbra/Mods/Mod.BasePath.cs
Normal file
44
Penumbra/Mods/Mod.BasePath.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System.IO;
|
||||
using Dalamud.Logging;
|
||||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public enum ModPathChangeType
|
||||
{
|
||||
Added,
|
||||
Deleted,
|
||||
Moved,
|
||||
}
|
||||
|
||||
public partial class Mod
|
||||
{
|
||||
public DirectoryInfo BasePath { get; private set; }
|
||||
public int Index { get; private set; } = -1;
|
||||
|
||||
private Mod( DirectoryInfo basePath )
|
||||
=> BasePath = basePath;
|
||||
|
||||
public static Mod? LoadMod( DirectoryInfo basePath )
|
||||
{
|
||||
basePath.Refresh();
|
||||
if( !basePath.Exists )
|
||||
{
|
||||
PluginLog.Error( $"Supplied mod directory {basePath} does not exist." );
|
||||
return null;
|
||||
}
|
||||
|
||||
var mod = new Mod( basePath );
|
||||
mod.LoadMeta();
|
||||
if( mod.Name.Length == 0 )
|
||||
{
|
||||
PluginLog.Error( $"Mod at {basePath} without name is not supported." );
|
||||
}
|
||||
|
||||
mod.LoadDefaultOption();
|
||||
mod.LoadAllGroups();
|
||||
mod.ComputeChangedItems();
|
||||
mod.SetCounts();
|
||||
|
||||
return mod;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue