SHA256
Add NonTile Mode Prototype
This commit is contained in:
4 files changed
+89
-2
No files matched your search
@@ -2,6 +2,7 @@ using System.IO;
|
|||||||
using ADOFAIRenderer.Core;
|
using ADOFAIRenderer.Core;
|
||||||
using ADOFAIRenderer.Util;
|
using ADOFAIRenderer.Util;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using MelonLoader;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Patch.Game
|
namespace ADOFAIRenderer.Patch.Game
|
||||||
@@ -10,6 +11,54 @@ namespace ADOFAIRenderer.Patch.Game
|
|||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public static class scnGamePatch
|
public static class scnGamePatch
|
||||||
{
|
{
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch("Play")]
|
||||||
|
public static void ProcessFloors()
|
||||||
|
{
|
||||||
|
var nonTile = RenderManager.Instance.OverrideLoading &&
|
||||||
|
RenderManager.Instance.Configuration.AdvancedConfig.NonTile;
|
||||||
|
|
||||||
|
if (!nonTile) return;
|
||||||
|
foreach (var floor in ADOBase.lm.listFloors)
|
||||||
|
{
|
||||||
|
DisableRenderers(
|
||||||
|
floor.floorRenderer.renderer, floor.legacyFloorSpriteRenderer,
|
||||||
|
floor.iconsprite, floor.outlineSprite,
|
||||||
|
floor.topGlow, floor.bottomGlow,
|
||||||
|
floor.multiplanetLine
|
||||||
|
);
|
||||||
|
|
||||||
|
if (floor.holdRenderer) DisableRenderer(floor.holdRenderer.m_meshRenderer);
|
||||||
|
|
||||||
|
if (floor.dummyPlanets == null) continue;
|
||||||
|
foreach (var planet in floor.dummyPlanets)
|
||||||
|
DisablePlanetRenderer(planet);
|
||||||
|
}
|
||||||
|
|
||||||
|
Melon<RenderMod>.Logger.Msg("Tile Hide");
|
||||||
|
return;
|
||||||
|
|
||||||
|
void DisablePlanetRenderer(PlanetRenderer planet)
|
||||||
|
{
|
||||||
|
if (planet.sprite) DisableRenderer(planet.sprite.meshRenderer);
|
||||||
|
DisableRenderers(
|
||||||
|
planet.coreParticles.GetRenderer(), planet.tailParticles.GetRenderer(),
|
||||||
|
planet.tailParticlesCoop.GetRenderer(), planet.sparks.GetRenderer(), planet.ring, planet.glow,
|
||||||
|
planet.faceSprite, planet.faceDetails, planet.samuraiSprite
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisableRenderers(params Renderer?[] renderers)
|
||||||
|
{
|
||||||
|
foreach (var renderer in renderers) DisableRenderer(renderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisableRenderer(Renderer? renderer)
|
||||||
|
{
|
||||||
|
if (renderer) renderer.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch("UpdateVideo")]
|
[HarmonyPatch("UpdateVideo")]
|
||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
|
|||||||
@@ -1,7 +1,19 @@
|
|||||||
|
using ADOFAIRenderer.Core;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Patch.Game
|
namespace ADOFAIRenderer.Patch.Game
|
||||||
{
|
{
|
||||||
|
[HarmonyPatch(typeof(scrFloor))]
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
public class scrFloorPatch
|
public class scrFloorPatch
|
||||||
{
|
{
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch("SpawnPortalParticles")]
|
||||||
|
public static bool SkipPortalSpawn()
|
||||||
|
{
|
||||||
|
var nonTile = RenderManager.Instance.OverrideLoading &&
|
||||||
|
RenderManager.Instance.Configuration.AdvancedConfig.NonTile;
|
||||||
|
return !nonTile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -7,7 +7,7 @@ using MelonLoader.Utils;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.0.10-INDEV", "ADOFAI Editor Forum")]
|
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.0.11-INDEV", "ADOFAI Editor Forum")]
|
||||||
[assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")]
|
[assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")]
|
||||||
|
|
||||||
namespace ADOFAIRenderer
|
namespace ADOFAIRenderer
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace ADOFAIRenderer.Util
|
||||||
|
{
|
||||||
|
public static class ParticleUtil
|
||||||
|
{
|
||||||
|
private static readonly ConditionalWeakTable<ParticleSystem, ParticleSystemRenderer> Cache = new();
|
||||||
|
|
||||||
|
public static ParticleSystemRenderer? GetRenderer(this ParticleSystem ps)
|
||||||
|
{
|
||||||
|
if (!ps) return null;
|
||||||
|
if (Cache.TryGetValue(ps, out var renderer) && renderer) return renderer;
|
||||||
|
|
||||||
|
var particleSystems = ps.GetComponents<ParticleSystem>();
|
||||||
|
var renderers = ps.GetComponents<ParticleSystemRenderer>();
|
||||||
|
var index = Array.IndexOf(particleSystems, ps);
|
||||||
|
|
||||||
|
renderer = index >= 0 && index < renderers.Length ? renderers[index] : ps.GetComponent<ParticleSystemRenderer>();
|
||||||
|
if (renderer) Cache.Add(ps, renderer);
|
||||||
|
|
||||||
|
return renderer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user