This commit is contained in:
Ben C 2022-05-21 21:24:02 -04:00
parent 0a061ecbcc
commit 09762a0f53
4 changed files with 29 additions and 3 deletions

BIN
NJsonSchema/NJsonSchema.dll Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,5 @@
using HarmonyLib;
using NJsonSchema;
using NewHorizons.Builder.Props;
using NewHorizons.Components;
using NewHorizons.External.Configs;
@ -12,12 +13,15 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons
{
public class Main : ModBehaviour
{
public static AssetBundle NHAssetBundle { get; private set; }
@ -35,6 +39,8 @@ namespace NewHorizons
public static float SecondsLeftInLoop = -1;
private static JsonSchema _bodySchema;
public static bool IsSystemReady { get; private set; }
public static float FurthestOrbit { get; set; } = 50000f;
@ -108,6 +114,14 @@ namespace NewHorizons
TextTranslation.Get().SetLanguage(TextTranslation.Get().GetLanguage());
}
// TODO: Test class, delete later
[JsonObject]
public class Test
{
[JsonProperty]
public string Name;
}
public void Start()
{
// Patches
@ -121,13 +135,24 @@ namespace NewHorizons
Instance = this;
GlobalMessenger<DeathType>.AddListener("PlayerDeath", OnDeath);
GlobalMessenger.AddListener("WakeUp", new Callback(OnWakeUp));
GlobalMessenger.AddListener("WakeUp", OnWakeUp);
NHAssetBundle = ModHelper.Assets.LoadBundle("AssetBundle/xen.newhorizons");
ResetConfigs(resetTranslation: false);
Logger.Log("Begin load of config files...", Logger.LogType.Log);
try
{
_bodySchema = JsonSchema.FromType<Test>();
}
catch (TypeLoadException te)
{
Logger.LogError(te.ToString());
Application.Quit();
}
try
{
LoadConfigs(this);

View File

@ -10,12 +10,13 @@
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="..\NJsonSchema\*.dll" />
<PackageReference Include="HarmonyX" Version="2.10.0" />
<PackageReference Include="OWML" Version="2.3.3" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" />