mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Updated logging
This commit is contained in:
parent
1dca5245f5
commit
83d85c5339
@ -12,6 +12,7 @@ namespace Marshmallow
|
||||
public static OWRigidbody OWRB;
|
||||
public static Sector SECTOR;
|
||||
public static SpawnPoint SPAWN;
|
||||
public static AstroObject ASTROOBJECT;
|
||||
|
||||
public static IModHelper helper;
|
||||
|
||||
@ -25,6 +26,10 @@ namespace Marshmallow
|
||||
|
||||
helper = base.ModHelper;
|
||||
|
||||
Main.Log("Begin load of planet config...");
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(ModHelper.Manifest.ModFolderPath + @"planets\"))
|
||||
{
|
||||
PlanetConfig config = ModHelper.Storage.Load<PlanetConfig>(file.Replace(ModHelper.Manifest.ModFolderPath, ""));
|
||||
@ -34,6 +39,11 @@ namespace Marshmallow
|
||||
Log(config.GetSettingsValue<Vector3>("position").ToString());
|
||||
Log(config.GetSettingsValue<Color32>("fogTint").ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Main.Log("Error! - " + ex.Message);
|
||||
}
|
||||
|
||||
if (planetList.Count != 0)
|
||||
{
|
||||
@ -58,6 +68,8 @@ namespace Marshmallow
|
||||
|
||||
planet.transform.position = config.GetSettingsValue<Vector3>("position");
|
||||
planet.SetActive(true);
|
||||
|
||||
General.MakeOrbitLine.Make(planet, ASTROOBJECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,7 +82,9 @@ namespace Marshmallow
|
||||
|
||||
var name = config.GetSettingsValue<string>("name");
|
||||
var topCloudSize = config.GetSettingsValue<float>("topCloudSize");
|
||||
Log("Got top cloud size as " + topCloudSize);
|
||||
var bottomCloudSize = config.GetSettingsValue<float>("bottomCloudSize");
|
||||
Log("Got bottom cloud size as " + bottomCloudSize);
|
||||
|
||||
GameObject body;
|
||||
|
||||
@ -79,7 +93,7 @@ namespace Marshmallow
|
||||
|
||||
Body.MakeGeometry.Make(body, groundScale);
|
||||
|
||||
General.MakeOrbitingAstroObject.Make(body, 0.02f, config.GetSettingsValue<float>("orbitAngle"), config.GetSettingsValue<bool>("hasGravity"), config.GetSettingsValue<float>("surfaceAcceleration"), groundScale);
|
||||
ASTROOBJECT = General.MakeOrbitingAstroObject.Make(body, 0.02f, config.GetSettingsValue<float>("orbitAngle"), config.GetSettingsValue<bool>("hasGravity"), config.GetSettingsValue<float>("surfaceAcceleration"), groundScale);
|
||||
General.MakeRFVolume.Make(body);
|
||||
|
||||
if (config.GetSettingsValue<bool>("hasMapMarker"))
|
||||
@ -119,7 +133,7 @@ namespace Marshmallow
|
||||
|
||||
public static void Log(string text)
|
||||
{
|
||||
helper.Console.WriteLine("[Marshmallow] : " + text);
|
||||
helper.Console.WriteLine(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
Marshmallow/MakeOrbitLine.cs
Normal file
24
Marshmallow/MakeOrbitLine.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using OWML.ModHelper.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Marshmallow.General
|
||||
{
|
||||
static class MakeOrbitLine
|
||||
{
|
||||
public static void Make(GameObject body, AstroObject astroobject)
|
||||
{
|
||||
GameObject orbit = new GameObject();
|
||||
orbit.transform.parent = body.transform;
|
||||
|
||||
orbit.AddComponent<LineRenderer>();
|
||||
|
||||
var ol = orbit.AddComponent<OrbitLine>();
|
||||
ol.SetValue("_astroObject", astroobject);
|
||||
ol.SetValue("_fade", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,7 @@ namespace Marshmallow.General
|
||||
{
|
||||
static class MakeOrbitingAstroObject
|
||||
{
|
||||
public static void Make(GameObject body, float angularSpeed, float orbitAngle, bool hasGravity, float surfaceAccel, float groundSize)
|
||||
public static AstroObject Make(GameObject body, float angularSpeed, float orbitAngle, bool hasGravity, float surfaceAccel, float groundSize)
|
||||
{
|
||||
Rigidbody RB = body.AddComponent<Rigidbody>();
|
||||
RB.mass = 10000;
|
||||
@ -25,6 +25,7 @@ namespace Marshmallow.General
|
||||
InitialMotion IM = body.AddComponent<InitialMotion>();
|
||||
IM.SetPrimaryBody(Locator.GetAstroObject(AstroObject.Name.Sun).GetAttachedOWRigidbody());
|
||||
IM.SetValue("_orbitAngle", orbitAngle);
|
||||
Main.Log("Got orbit angle as " + orbitAngle);
|
||||
IM.SetValue("_isGlobalAxis", false);
|
||||
IM.SetValue("_initAngularSpeed", angularSpeed);
|
||||
IM.SetValue("_initLinearSpeed", 0f);
|
||||
@ -47,6 +48,9 @@ namespace Marshmallow.General
|
||||
GravityVolume GV = MakeGravityWell.Make(body, surfaceAccel, groundSize, groundSize);
|
||||
AO.SetValue("_gravityVolume", GV);
|
||||
}
|
||||
|
||||
return AO;
|
||||
//General.MakeOrbitLine.Make(body, AO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,35 +31,35 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony, Version=1.2.0.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Lib.Harmony.1.2.0.1\lib\net35\0Harmony.dll</HintPath>
|
||||
<Reference Include="0Harmony, Version=2.0.0.9, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Lib.Harmony.2.0.0.9\lib\net35\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>E:\Epic\Epic Games\OuterWilds\OuterWilds_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NAudio-Unity, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\NAudio-Unity.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\NAudio-Unity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Json.Net.Unity3D.9.0.1\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OWML, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\OWML.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\OWML.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OWML.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\OWML.Common.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\OWML.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OWML.ModHelper, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\OWML.ModHelper.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\OWML.ModHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OWML.ModHelper.Assets, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\OWML.ModHelper.Assets.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\OWML.ModHelper.Assets.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OWML.ModHelper.Events, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\OWML.ModHelper.Events.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\OWML.ModHelper.Events.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OWML.ModHelper.Menus, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OWML.0.3.43\lib\net35\OWML.ModHelper.Menus.dll</HintPath>
|
||||
<HintPath>..\packages\OWML.0.3.44\lib\net35\OWML.ModHelper.Menus.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -105,6 +105,7 @@
|
||||
<Compile Include="MakeGravityWell.cs" />
|
||||
<Compile Include="MakeMapMarker.cs" />
|
||||
<Compile Include="MakeOrbitingAstroObject.cs" />
|
||||
<Compile Include="MakeOrbitLine.cs" />
|
||||
<Compile Include="MakeRFVolume.cs" />
|
||||
<Compile Include="MakeSector.cs" />
|
||||
<Compile Include="MakeSpawnPoint.cs" />
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Json.Net.Unity3D" version="9.0.1" targetFramework="net35" />
|
||||
<package id="Lib.Harmony" version="1.2.0.1" targetFramework="net35" />
|
||||
<package id="OWML" version="0.3.43" targetFramework="net35" />
|
||||
<package id="Lib.Harmony" version="2.0.0.9" targetFramework="net35" />
|
||||
<package id="OWML" version="0.3.44" targetFramework="net35" />
|
||||
</packages>
|
||||
Loading…
x
Reference in New Issue
Block a user