mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-20 23:07:51 +01:00
tmp
This commit is contained in:
parent
3c564add0e
commit
73e2793da6
48 changed files with 4231 additions and 456 deletions
|
|
@ -8,6 +8,7 @@ using Penumbra.GameData.Files;
|
|||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
namespace Penumbra.Mods.ItemSwap;
|
||||
|
|
@ -38,7 +39,7 @@ public static class ItemSwap
|
|||
return true;
|
||||
}
|
||||
|
||||
var file = Dalamud.GameData.GetFile( path.InternalName.ToString() );
|
||||
var file = DalamudServices.GameData.GetFile( path.InternalName.ToString() );
|
||||
if( file != null )
|
||||
{
|
||||
data = file.Data;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ using System.Linq;
|
|||
using System.Security.Cryptography;
|
||||
using Penumbra.GameData.Enums;
|
||||
using static Penumbra.Mods.ItemSwap.ItemSwap;
|
||||
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods.ItemSwap;
|
||||
|
||||
public class Swap
|
||||
|
|
@ -139,7 +140,7 @@ public sealed class FileSwap : Swap
|
|||
}
|
||||
|
||||
swap.SwapToModded = redirections( swap.SwapToRequestPath );
|
||||
swap.SwapToModdedExistsInGame = !swap.SwapToModded.IsRooted && Dalamud.GameData.FileExists( swap.SwapToModded.InternalName.ToString() );
|
||||
swap.SwapToModdedExistsInGame = !swap.SwapToModded.IsRooted && DalamudServices.GameData.FileExists( swap.SwapToModded.InternalName.ToString() );
|
||||
swap.SwapToModdedEqualsOriginal = !swap.SwapToModded.IsRooted && swap.SwapToModded.InternalName.Equals( swap.SwapFromRequestPath.Path );
|
||||
|
||||
swap.FileData = type switch
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public sealed partial class Mod
|
||||
{
|
||||
public static DirectoryInfo LocalDataDirectory
|
||||
=> new(Path.Combine( Dalamud.PluginInterface.ConfigDirectory.FullName, "mod_data" ));
|
||||
=> new(Path.Combine( DalamudServices.PluginInterface.ConfigDirectory.FullName, "mod_data" ));
|
||||
|
||||
public long ImportDate { get; private set; } = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds();
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ public sealed partial class Mod
|
|||
public bool Favorite { get; private set; } = false;
|
||||
|
||||
private FileInfo LocalDataFile
|
||||
=> new(Path.Combine( Dalamud.PluginInterface.ConfigDirectory.FullName, "mod_data", $"{ModPath.Name}.json" ));
|
||||
=> new(Path.Combine( DalamudServices.PluginInterface.ConfigDirectory.FullName, "mod_data", $"{ModPath.Name}.json" ));
|
||||
|
||||
private ModDataChangeType LoadLocalData()
|
||||
{
|
||||
|
|
@ -113,8 +114,8 @@ public sealed partial class Mod
|
|||
|
||||
private static void MoveDataFile( DirectoryInfo oldMod, DirectoryInfo newMod )
|
||||
{
|
||||
var oldFile = Path.Combine( Dalamud.PluginInterface.ConfigDirectory.FullName, "mod_data", $"{oldMod.Name}.json" );
|
||||
var newFile = Path.Combine( Dalamud.PluginInterface.ConfigDirectory.FullName, "mod_data", $"{newMod.Name}.json" );
|
||||
var oldFile = Path.Combine( DalamudServices.PluginInterface.ConfigDirectory.FullName, "mod_data", $"{oldMod.Name}.json" );
|
||||
var newFile = Path.Combine( DalamudServices.PluginInterface.ConfigDirectory.FullName, "mod_data", $"{newMod.Name}.json" );
|
||||
if( File.Exists( oldFile ) )
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using OtterGui.Filesystem;
|
||||
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public sealed class ModFileSystem : FileSystem< Mod >, IDisposable
|
||||
{
|
||||
public static string ModFileSystemFile
|
||||
=> Path.Combine( Dalamud.PluginInterface.GetPluginConfigDirectory(), "sort_order.json" );
|
||||
=> Path.Combine( DalamudServices.PluginInterface.GetPluginConfigDirectory(), "sort_order.json" );
|
||||
|
||||
// Save the current sort order.
|
||||
// Does not save or copy the backup in the current mod directory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue