mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
json5 support
This commit is contained in:
1 parent
67e1e10256
commit
9113e9fa36
2 files changed
+3
-1
No files matched your search
@@ -38,6 +38,7 @@
|
||||
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1"/>
|
||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native"/>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
|
||||
<PackageReference Include="JsoncParser" Version="2026.122.1022.34" />
|
||||
<PackageReference Include="Samboy063.Cpp2IL.Core" Version="2022.1.0-pre-release.20"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using EHR.Gamemodes;
|
||||
using Global;
|
||||
|
||||
#if !ANDROID
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
@@ -57,7 +58,7 @@ public static class Translator
|
||||
string jsonContent = reader.ReadToEnd();
|
||||
|
||||
// Deserialize the JSON into a dictionary
|
||||
var jsonDictionary = JsonSerializer.Deserialize<Dictionary<string, string>>(jsonContent);
|
||||
if (JsoncParser.Parse(jsonContent) is not Dictionary<string, string> jsonDictionary) continue;
|
||||
|
||||
if (jsonDictionary.TryGetValue("LanguageID", out string languageIdObj) && int.TryParse(languageIdObj, out int languageId))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user