SHA256
Add Planet Color Configuration
This commit is contained in:
2 files changed
+35
No files matched your search
@@ -1,5 +1,6 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using ADOFAIRenderer.Util.FFmpeg;
|
using ADOFAIRenderer.Util.FFmpeg;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Data;
|
namespace ADOFAIRenderer.Data;
|
||||||
|
|
||||||
@@ -27,6 +28,10 @@ public class AdvancedConfig
|
|||||||
public bool ProcessAudio { get; set; } = true;
|
public bool ProcessAudio { get; set; } = true;
|
||||||
public bool NonTile { get; set; } = false;
|
public bool NonTile { get; set; } = false;
|
||||||
public string FileExtension { get; set; } = "mkv";
|
public string FileExtension { get; set; } = "mkv";
|
||||||
|
|
||||||
|
public Color? firePlanetColor = null;
|
||||||
|
public Color? icePlanetColor = null;
|
||||||
|
public Color? windPlanetColor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VideoEncodingConfig
|
public class VideoEncodingConfig
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using ADOFAIRenderer.Core;
|
||||||
|
using HarmonyLib;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace ADOFAIRenderer.Patch.Game;
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(PlanetRenderer))]
|
||||||
|
public static class PlanetRendererPatch
|
||||||
|
{
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch("SetColor")]
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
private static void OverrideColor(PlanetRenderer __instance, ref PlanetColor planetColor)
|
||||||
|
{
|
||||||
|
if (RenderManager.Instance.stage == RenderStage.None) return;
|
||||||
|
|
||||||
|
var advConf = RenderManager.Instance.Configuration.AdvancedConfig;
|
||||||
|
ApplyColor(ref planetColor, scrController.instance.planetRed, advConf.firePlanetColor);
|
||||||
|
ApplyColor(ref planetColor, scrController.instance.planetBlue, advConf.icePlanetColor);
|
||||||
|
ApplyColor(ref planetColor, scrController.instance.planetGreen, advConf.windPlanetColor);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
void ApplyColor(ref PlanetColor planetColor, scrPlanet targetPlanet, Color? customColor)
|
||||||
|
{
|
||||||
|
if (__instance == targetPlanet.planetRenderer && customColor != null)
|
||||||
|
planetColor = new PlanetColor(customColor.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user