fix(mod): fixed profiles being corrupted after restart
This commit is contained in:
@@ -8,7 +8,7 @@ using WeebSights.Services;
|
|||||||
|
|
||||||
namespace WeebSights;
|
namespace WeebSights;
|
||||||
|
|
||||||
[Injectable(TypePriority = OnLoadOrder.PostSptModLoader + 1)]
|
[Injectable(TypePriority = OnLoadOrder.PostDBModLoader + 1)]
|
||||||
public class Mod(ISptLogger<Mod> logger,
|
public class Mod(ISptLogger<Mod> logger,
|
||||||
WeebItemService weebItemService,
|
WeebItemService weebItemService,
|
||||||
WeebTraderService weebTraderService,
|
WeebTraderService weebTraderService,
|
||||||
@@ -18,7 +18,6 @@ public class Mod(ISptLogger<Mod> logger,
|
|||||||
{
|
{
|
||||||
var stopWatch = Stopwatch.StartNew();
|
var stopWatch = Stopwatch.StartNew();
|
||||||
var currentAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
var currentAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||||
logger.Info($"[Weeb Iron Sights] Loaded in {currentAssemblyPath}");
|
|
||||||
if (!weebLocaleService.TryLoadLocales(Path.Join(currentAssemblyPath, "/db/locales/en.json"), out var locales))
|
if (!weebLocaleService.TryLoadLocales(Path.Join(currentAssemblyPath, "/db/locales/en.json"), out var locales))
|
||||||
{
|
{
|
||||||
logger.Error("[Weeb Iron Sights] Failed to load locales. Names might be weird");
|
logger.Error("[Weeb Iron Sights] Failed to load locales. Names might be weird");
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using WeebSights.Models;
|
|||||||
|
|
||||||
namespace WeebSights.Services;
|
namespace WeebSights.Services;
|
||||||
|
|
||||||
[Injectable(TypePriority = OnLoadOrder.PostDBModLoader + 4)]
|
[Injectable]
|
||||||
public class WeebLocaleService(JsonUtil jsonUtil)
|
public class WeebLocaleService(JsonUtil jsonUtil)
|
||||||
{
|
{
|
||||||
public bool TryLoadLocales(string filePath, out Dictionary<MongoId, WeebLocaleConfig> outputObject)
|
public bool TryLoadLocales(string filePath, out Dictionary<MongoId, WeebLocaleConfig> outputObject)
|
||||||
|
|||||||
Reference in New Issue
Block a user