Skip to content

Commit

Permalink
Oops forgor
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyceri committed Jul 24, 2024
1 parent e4f6393 commit b1af746
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion PetNicknames/PetNicknames/Services/PetServices.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PetRenamer.Legacy.LegacyStepper;
using Dalamud.Utility;
using PetRenamer.Legacy.LegacyStepper;
using PetRenamer.PetNicknames.Services.Interface;
using PetRenamer.PetNicknames.Services.ServiceWrappers;
using PetRenamer.PetNicknames.Services.ServiceWrappers.Interfaces;
Expand All @@ -22,6 +23,7 @@ public PetServices(DalamudServices services)
DalamudServices = services;

PetLog = new PetLogWrapper(services.PluginLog);
MoveOldConfig();
Configuration = services.PetNicknamesPlugin.GetPluginConfig() as Configuration ?? new Configuration();
StringHelper = new StringHelperWrapper();
PetSheets = new SheetsWrapper(ref services, StringHelper);
Expand All @@ -35,4 +37,21 @@ void CheckConfigFailure()
if (Configuration.currentSaveFileVersion == Configuration.Version) return;
_ = new LegacyStepper(Configuration, this);
}

void MoveOldConfig()
{
DirectoryInfo directory = DalamudServices.PetNicknamesPlugin.ConfigDirectory;
if (directory == null) return;

try
{
string? path = directory.Parent!.FullName;
if (path.IsNullOrWhitespace()) return;

string oldPath = path + "\\PetRenamer.json";
string newPath = path + "\\PetNicknames.json";

File.Move(oldPath, newPath);
} catch { }
}
}

0 comments on commit b1af746

Please sign in to comment.