refactor(mod): renamed project file and made build script zip releases automagically
This commit is contained in:
29
WeebSights/Services/WeebLocaleService.cs
Normal file
29
WeebSights/Services/WeebLocaleService.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.DI;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
using WeebSights.Models;
|
||||
|
||||
namespace WeebSights.Services;
|
||||
|
||||
[Injectable]
|
||||
public class WeebLocaleService(JsonUtil jsonUtil)
|
||||
{
|
||||
public bool TryLoadLocales(string filePath, out Dictionary<MongoId, WeebLocaleConfig> outputObject)
|
||||
{
|
||||
var json = LoadLocales(filePath);
|
||||
if (json == null)
|
||||
{
|
||||
outputObject = new Dictionary<MongoId, WeebLocaleConfig>();
|
||||
return false;
|
||||
}
|
||||
|
||||
outputObject = json;
|
||||
return true;
|
||||
}
|
||||
|
||||
public Dictionary<MongoId, WeebLocaleConfig>? LoadLocales(string filePath)
|
||||
{
|
||||
return jsonUtil.DeserializeFromFile<Dictionary<MongoId, WeebLocaleConfig>>(filePath);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user