From de24bf41734c212c51a8a3d77d4ccb9e707d55f7 Mon Sep 17 00:00:00 2001 From: LadyAliceMargatroid Date: Wed, 30 Oct 2024 07:43:28 -0700 Subject: [PATCH] Updated for new DunGenPlus version Fixed anger lighting to be less red Added fake sun lighting Added weather effects to dungeon if moon has certain weathers Doors should work for new enemies. Enemies now open doors normally in their default behaviour Added compability used for Seichi --- .../ScarletMansion/DunGenPatch/Patch.cs | 10 +- .../Components/Lights/ScarletLight.cs | 4 +- .../GamePatch/Components/ScarletDoorLock.cs | 10 +- .../GamePatch/Components/ScarletHDRISky.cs | 85 ----------------- .../GamePatch/Components/ScarletLighting.cs | 19 ---- .../Components/TreasureRoom/TreasureRoom.cs | 7 +- .../GamePatch/Items/ScarletSnowGlobe.cs | 5 + .../GamePatch/ScarletFakeSun.cs | 29 ++++++ .../GamePatch/Weathers/SDMWeatherManager.cs | 63 ++++++++++--- ScarletMansion/ScarletMansion/Plugin.cs | 6 +- .../ScarletMansion/ScarletMansion.csproj | 3 +- .../ScarletMansionSeichiPatch.sln | 25 +++++ .../ScarletMansionSeichiPatch/Patch.cs | 63 +++++++++++++ .../ScarletMansionSeichiPatch/Plugin.cs | 54 +++++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++ .../ScarletMansionSeichiPatch.csproj | 93 +++++++++++++++++++ 16 files changed, 380 insertions(+), 132 deletions(-) delete mode 100644 ScarletMansion/ScarletMansion/GamePatch/Components/ScarletHDRISky.cs delete mode 100644 ScarletMansion/ScarletMansion/GamePatch/Components/ScarletLighting.cs create mode 100644 ScarletMansion/ScarletMansion/GamePatch/ScarletFakeSun.cs create mode 100644 ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.sln create mode 100644 ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Patch.cs create mode 100644 ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Plugin.cs create mode 100644 ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs create mode 100644 ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj diff --git a/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs b/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs index 039f73e..176e350 100644 --- a/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs +++ b/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs @@ -98,12 +98,12 @@ namespace ScarletMansion.DunGenPatch { } var count = PluginConfig.Instance.treasureRoomCountValue; - props.ForcedTilesProperties.UseForcedTiles = count > 0; + props.AdditionalTilesProperties.UseAdditionalTiles = count > 0; - var forcedTilesProperties = props.ForcedTilesProperties; - var copyTarget = forcedTilesProperties.ForcedTileSets[0]; - forcedTilesProperties.ForcedTileSets = new List(); - for(var j = 0; j < count; ++j) forcedTilesProperties.ForcedTileSets.Add(copyTarget); + var addTilesProperties = props.AdditionalTilesProperties; + var copyTarget = addTilesProperties.AdditionalTileSets[0]; + addTilesProperties.AdditionalTileSets = new List(); + for(var j = 0; j < count; ++j) addTilesProperties.AdditionalTileSets.Add(copyTarget); } } diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/Lights/ScarletLight.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/Lights/ScarletLight.cs index 6f6722a..1d240f5 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/Lights/ScarletLight.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Components/Lights/ScarletLight.cs @@ -17,6 +17,8 @@ namespace ScarletMansion.Lights { public int priority = 0; public float chanceEveryHourToDestroy = 1 / 52f; + public const float MAX_LERP = 0.5f; + public enum FlickeringState { None, Light, Heavy, Broke } public FlickeringState flickeringState; private Coroutine flickeringCoroutine; @@ -109,7 +111,7 @@ namespace ScarletMansion.Lights { while(t < 0.375f) { yield return null; t += Time.deltaTime; - light.color = Color.Lerp(c, Color.red, t / 0.375f); + light.color = Color.Lerp(c, Color.red, t / 0.375f * MAX_LERP); } if (duration == 0f) yield break; diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletDoorLock.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletDoorLock.cs index ba5873e..dc3db79 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletDoorLock.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletDoorLock.cs @@ -89,7 +89,9 @@ namespace ScarletMansion.GamePatch.Components { { typeof(KnightV2Variant), (e) => e.currentBehaviourStateIndex == 0 }, { typeof(ButlerEnemyAI), (e) => e.currentBehaviourStateIndex <= 1 }, { typeof(MaidVariant), (e) => e.currentBehaviourStateIndex <= 1 }, - { typeof(KnightGhostVariant), (e) => false } + { typeof(KnightGhostVariant), (e) => false }, + { typeof(ClaySurgeonAI), (e) => false }, + { typeof(CaveDwellerAI), (e) => e.currentBehaviourStateIndex == 0 } }; static readonly Dictionary EnemyDoorDamagePerSecond = new Dictionary(){ @@ -108,13 +110,15 @@ namespace ScarletMansion.GamePatch.Components { { typeof(KnightV2Variant), 12.5f }, { typeof(ButlerEnemyAI), 50f }, { typeof(MaidVariant), 50f }, - { typeof(KnightGhostVariant), 9999f } + { typeof(KnightGhostVariant), 9999f }, + { typeof(ClaySurgeonAI), 9999f }, + { typeof(CaveDwellerAI), 50f } }; public bool IsInOpenDoorNormallyState(EnemyAI enemy){ var type = enemy.GetType(); if (EnemyToDoorOpen.ContainsKey(type)) return EnemyToDoorOpen[type](enemy); - return false; + return true; } public float GetDoorDamagePerSecond(EnemyAI enemy){ diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletHDRISky.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletHDRISky.cs deleted file mode 100644 index 766f848..0000000 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletHDRISky.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Rendering.HighDefinition; -using UnityEngine.InputSystem; -using UnityEngine.InputSystem.Controls; - -/* - -namespace ScarletMansion { - public class ScarletHDRISky : ScarletLighting { - - public Volume volume; - - public HDRISky GetSky(){ - volume.sharedProfile.TryGet(out var sky); - return sky; - } - - public VisualEnvironment GetEnv(){ - volume.sharedProfile.TryGet(out var env); - return env; - } - - public override void DisableLights() { - volume.enabled = false; - } - - public override void UpdateLight(float ratio) { - GetSky().multiplier.value = valueRatio; - GetEnv().skyAmbientMode.value = skyMode; - volume.enabled = trueEnabled; - } - - public int value = 100; - public float valueRatio = 1f; - - public bool trueEnabled = true; - public SkyAmbientMode skyMode = SkyAmbientMode.Dynamic; - - void Update(){ - int direction = 0; - if (IfKeyPress(Keyboard.current.minusKey, Keyboard.current.numpadMinusKey)){ - direction = -1; - } else if (IfKeyPress(Keyboard.current.equalsKey, Keyboard.current.numpadPlusKey)){ - direction = 1; - } - - if (IfKeyPress(Keyboard.current.backspaceKey)){ - trueEnabled = !trueEnabled; - Plugin.logger.LogInfo(trueEnabled); - } - - if (IfKeyPress(Keyboard.current.digit0Key, Keyboard.current.numpad0Key)){ - if (skyMode == SkyAmbientMode.Dynamic) skyMode = SkyAmbientMode.Static; - else skyMode = SkyAmbientMode.Dynamic; - Plugin.logger.LogInfo(skyMode); - } - - if (direction != 0){ - value = Mathf.Clamp(value + direction * 5, -100, 200); - valueRatio = value * 0.01f; - Plugin.logger.LogInfo(value); - } - - } - - bool IfKeyPress(params KeyControl[] keys){ - foreach(var k in keys){ - if (k.wasPressedThisFrame) return true; - } - return false; - } - - } - - - -} - -*/ \ No newline at end of file diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletLighting.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletLighting.cs deleted file mode 100644 index 5c320f6..0000000 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletLighting.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; - -/* - -namespace ScarletMansion { - public abstract class ScarletLighting : MonoBehaviour { - - public abstract void UpdateLight(float ratio); - public abstract void DisableLights() ; - - } -} - -*/ \ No newline at end of file diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/TreasureRoom/TreasureRoom.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/TreasureRoom/TreasureRoom.cs index 8db597f..24a059a 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/TreasureRoom/TreasureRoom.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Components/TreasureRoom/TreasureRoom.cs @@ -28,8 +28,13 @@ namespace ScarletMansion.GamePatch.Components.TreasureRoom { var time = Utility.GetTime(); if (CanOpen()) { foreach(var d in treasureDoorLocks){ + if (d == null) { + Plugin.logger.LogWarning($"Scarlet door was null for {GetType()}: {GetComponentInParent().gameObject.name}. Report to Mr. Dev"); + continue; + }; + d.LockDoorOverrideClientRpc(false); - d.door?.DestroyDoorClientRpc(d.transform.forward); + if (d.door != null) d.door.DestroyDoorClientRpc(d.transform.forward); } opened = true; } diff --git a/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletSnowGlobe.cs b/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletSnowGlobe.cs index 9a8ed95..75d027c 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletSnowGlobe.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletSnowGlobe.cs @@ -57,6 +57,11 @@ namespace ScarletMansion.GamePatch.Items { var index = scrapValue % types.Length; currentType = types[index]; + var childCount = prefabPivot.childCount; + for(var i = childCount - 1; i >= 0; i--) { + Destroy(prefabPivot.GetChild(i).gameObject); + } + Instantiate(currentType.prefab, prefabPivot); scanNode.headerText = $"{currentType.name} Snow Globe"; } diff --git a/ScarletMansion/ScarletMansion/GamePatch/ScarletFakeSun.cs b/ScarletMansion/ScarletMansion/GamePatch/ScarletFakeSun.cs new file mode 100644 index 0000000..598708a --- /dev/null +++ b/ScarletMansion/ScarletMansion/GamePatch/ScarletFakeSun.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace ScarletMansion.GamePatch { + public class ScarletFakeSun : MonoBehaviour { + + public Light light; + public AnimationCurve curve; + + private float intensityInitial; + + void Awake(){ + intensityInitial = light.intensity; + } + + void Update(){ + var timeOfDay = TimeOfDay.Instance; + if (timeOfDay == null) return; + + var timeRatio = timeOfDay.normalizedTimeOfDay; + light.intensity = intensityInitial * curve.Evaluate(timeRatio); + } + + } +} diff --git a/ScarletMansion/ScarletMansion/GamePatch/Weathers/SDMWeatherManager.cs b/ScarletMansion/ScarletMansion/GamePatch/Weathers/SDMWeatherManager.cs index 399a3b8..b509cc7 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Weathers/SDMWeatherManager.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Weathers/SDMWeatherManager.cs @@ -1,4 +1,5 @@ -using System; +using DunGen; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,30 +7,66 @@ using System.Threading.Tasks; using UnityEngine; namespace ScarletMansion.GamePatch.Weathers { - public class SDMWeatherManager : MonoBehaviour { + public class SDMWeatherManager : MonoBehaviour, IDungeonCompleteReceiver { [Header("Rainy")] public GameObject rainGameObject; public ParticleSystem rainParticleSystem; public AudioSource rainAudioSource; - // fix itself - void Start() { - var timeofDay = TimeOfDay.Instance; - if (timeofDay == null) { + private static readonly LevelWeatherType[] rainyWeathers = new LevelWeatherType[] { LevelWeatherType.Rainy, LevelWeatherType.Stormy, LevelWeatherType.Flooded, LevelWeatherType.Eclipsed }; + private static readonly LevelWeatherType[] bloodRainWeathers = new LevelWeatherType[] { LevelWeatherType.Eclipsed }; + + public void OnDungeonComplete(Dungeon dungeon) { + DunGenPlus.Managers.DoorwayManager.onMainEntranceTeleportSpawnedEvent.AddTemporaryEvent("Weather", FixWeather); + } + + private Color ColorLerp(Color a, Color b, float lerp, float alphaLerp){ + return new Color( + Mathf.Lerp(a.r, b.r, lerp), + Mathf.Lerp(a.g, b.g, lerp), + Mathf.Lerp(a.b, b.b, lerp), + Mathf.Lerp(a.a, b.a, alphaLerp)); + } + + private void FixWeather(){ + var timeOfDay = TimeOfDay.Instance; + if (timeOfDay == null) { Plugin.logger.LogError("How is TimeOfDay null?"); return; } - var rainEffect = timeofDay.effects.FirstOrDefault(x => x.name == "rainy"); - var rainGameObject = rainEffect.effectObject; - Utility.FixParticleSystemMaterialAndChildren(rainParticleSystem, rainGameObject.GetComponentInChildren()); - rainAudioSource.clip = rainGameObject.GetComponentInChildren().clip; - rainAudioSource.Play(); + var weather = timeOfDay.currentLevelWeather; - Plugin.logger.LogDebug("Fixed Rainy weather references"); + // is rainy weather + if (rainyWeathers.Contains(weather)){ + var rainEffect = timeOfDay.effects.FirstOrDefault(x => x.name == "rainy"); + var rainCopy = rainEffect.effectObject; + Utility.FixParticleSystemMaterialAndChildren(rainParticleSystem, rainCopy.GetComponentInChildren()); + rainAudioSource.clip = rainCopy.GetComponentInChildren().clip; + rainGameObject.SetActive(true); + rainParticleSystem.Play(); + rainAudioSource.Play(); + + Plugin.logger.LogDebug("Fixed Rainy weather references"); + } + + if (bloodRainWeathers.Contains(weather)){ + var pss = rainParticleSystem.GetComponentsInChildren(); + foreach(var p in pss){ + //var main = p.main; + //var startColor = main.startColor; + //startColor.color = ColorLerp(startColor.color, new Color(1f, 0f, 0f), 0.8f, 0.2f); + //main.startColor = startColor; + + var ren = p.GetComponent(); + var matCopy = ren.material; + matCopy.color = ColorLerp(matCopy.color, new Color(1f, 0f, 0f), 0.8f, 0.2f); + } + + Plugin.logger.LogDebug("Fixed Eclipsed weather references"); + } } - } } diff --git a/ScarletMansion/ScarletMansion/Plugin.cs b/ScarletMansion/ScarletMansion/Plugin.cs index 1bb495c..78b0d50 100644 --- a/ScarletMansion/ScarletMansion/Plugin.cs +++ b/ScarletMansion/ScarletMansion/Plugin.cs @@ -23,7 +23,7 @@ namespace ScarletMansion { [BepInDependency("imabatby.lethallevelloader", "1.2.0.3")] [BepInDependency("evaisa.lethallib", "0.13.2")] - [BepInDependency("dev.ladyalice.dungenplus", "1.1.2")] + [BepInDependency("dev.ladyalice.dungenplus", "1.2.0")] //[BepInDependency(ModCompability.advancedCompanyGuid, BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency(ModCompability.lethalConfigGuid, BepInDependency.DependencyFlags.SoftDependency)] @@ -34,7 +34,7 @@ namespace ScarletMansion { public class Plugin : BaseUnityPlugin { public const string modGUID = "dev.ladyalice.scarletmansion"; private const string modName = "Scarlet Mansion"; - private const string modVersion = "1.3.27"; + private const string modVersion = "1.3.29"; public readonly Harmony harmony = new Harmony(modGUID); @@ -47,7 +47,7 @@ namespace ScarletMansion { if (Instance == null) Instance = this; logger = BepInEx.Logging.Logger.CreateLogSource(modGUID); - logger.LogInfo($"Plugin {modName} has been added!"); + logger.LogInfo($"Plugin {modName} has been added! Death to Bepinex!"); MyConfig = new PluginConfig(Config); diff --git a/ScarletMansion/ScarletMansion/ScarletMansion.csproj b/ScarletMansion/ScarletMansion/ScarletMansion.csproj index 86b5a88..6336a39 100644 --- a/ScarletMansion/ScarletMansion/ScarletMansion.csproj +++ b/ScarletMansion/ScarletMansion/ScarletMansion.csproj @@ -164,8 +164,6 @@ - - @@ -220,6 +218,7 @@ + diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.sln b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.sln new file mode 100644 index 0000000..b8fe0a1 --- /dev/null +++ b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35122.118 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScarletMansionSeichiPatch", "ScarletMansionSeichiPatch\ScarletMansionSeichiPatch.csproj", "{3FB44756-2543-4EE4-ACE4-DA3FDB995192}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D2692B6E-5996-41ED-BF25-925DB4BF340C} + EndGlobalSection +EndGlobal diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Patch.cs b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Patch.cs new file mode 100644 index 0000000..3657dd6 --- /dev/null +++ b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Patch.cs @@ -0,0 +1,63 @@ +using HarmonyLib; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.SceneManagement; + +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; + +namespace ScarletMansionSeichiPatch { + public class Patch { + + public static void Activate() { + Plugin.Instance.harmony.PatchAll(typeof(Patch)); + } + + public static Volume GetVolume(){ + + GameObject[] rootGameObjects = null; + + for(var i = 0; i < SceneManager.sceneCount; i++){ + var scene = SceneManager.GetSceneAt(i); + if (scene.name.ToLowerInvariant() == "seichi") { + rootGameObjects = scene.GetRootGameObjects(); + Plugin.logger.LogInfo("Found Seichi scene"); + break; + } + } + + if (rootGameObjects == null) return null; + + foreach(var root in rootGameObjects){ + if (root.name.ToLowerInvariant() == "environment") { + var item = root.transform.Find("RaphtaliaVolume"); + if (item != null) { + return item.GetComponentInChildren(true); + } + } + } + + return null; + } + + [HarmonyPatch(typeof(RoundManager), "SetPowerOffAtStart")] + [HarmonyPostfix] + public static void ShipLandedPatch(ref RoundManager __instance){ + if (!ScarletMansion.DunGenPatch.Patch.active) return; + + var volume = GetVolume(); + if (volume == null) { + Plugin.logger.LogWarning($"Couldn't setup SDM/Seichi compatibility feature"); + return; + } + + volume.enabled = true; + } + + } +} diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Plugin.cs b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Plugin.cs new file mode 100644 index 0000000..1b2a942 --- /dev/null +++ b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Plugin.cs @@ -0,0 +1,54 @@ +using BepInEx; +using BepInEx.Bootstrap; +using BepInEx.Logging; +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ScarletMansionSeichiPatch { + + [BepInPlugin(modGUID, modName, modVersion)] + [BepInDependency(targetModGUID, BepInDependency.DependencyFlags.SoftDependency)] + + public class Plugin : BaseUnityPlugin { + + public const string modGUID = "dev.ladyalice.scarletmansion.seichipatch"; + private const string modName = "Scarlet Mansion Seichi Patch"; + private const string modVersion = "1.0.0"; + + public const string targetModGUID = "dev.ladyalice.scarletmansion"; + public const string targetModVersion = "1.3.27"; + + public readonly Harmony harmony = new Harmony(modGUID); + public static Plugin Instance {get; private set;} + public static ManualLogSource logger { get; internal set; } + + void Awake(){ + if (Instance == null) Instance = this; + + logger = BepInEx.Logging.Logger.CreateLogSource(modGUID); + + var modLoaded = Chainloader.PluginInfos.ContainsKey(targetModGUID); + if (!modLoaded) return; + + bool validVersion; + var pluginInfo = Chainloader.PluginInfos[targetModGUID]; + var loadedVersion = pluginInfo.Metadata.Version; + if (string.IsNullOrWhiteSpace(targetModVersion)){ + validVersion = true; + } else { + var requiredVersion = new Version(targetModVersion); + validVersion = loadedVersion >= requiredVersion; + } + + if (validVersion){ + logger.LogInfo($"Plugin {modName} has been added!"); + Patch.Activate(); + } + } + + } +} diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..048aafc --- /dev/null +++ b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下を通して制御されます +// 制御されます。アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("ScarletMansionSeichiPatch")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ScarletMansionSeichiPatch")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから +// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります +[assembly: Guid("3fb44756-2543-4ee4-ace4-da3fdb995192")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// メジャー バージョン +// マイナー バージョン +// ビルド番号 +// リビジョン +// +// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj new file mode 100644 index 0000000..a75e6b8 --- /dev/null +++ b/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj @@ -0,0 +1,93 @@ + + + + + Debug + AnyCPU + {3FB44756-2543-4EE4-ACE4-DA3FDB995192} + Library + Properties + ScarletMansionSeichiPatch + ScarletMansionSeichiPatch + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\Libraries\0Harmony.dll + + + ..\..\..\Libraries\Assembly-CSharp-firstpass.dll + + + ..\..\..\Libraries\Assembly-CSharp-publicized.dll + + + ..\..\..\Libraries\BepInEx.dll + + + ..\..\..\Libraries\BepInEx.Harmony.dll + + + ..\..\..\Libraries\ScarletMansion.dll + + + + + + + + + + + ..\..\..\Libraries\Unity.Collections.dll + + + False + ..\..\..\Libraries\Unity.Netcode.Components.dll + + + False + ..\..\..\Libraries\Unity.Netcode.Runtime.dll + + + ..\..\..\Libraries\Unity.RenderPipelines.Core.Runtime.dll + + + ..\..\..\Libraries\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + + + ..\..\..\Libraries\Unity.RenderPipelines.HighDefinition.Runtime.dll + + + ..\..\..\Libraries\UnityEngine.dll + + + ..\..\..\Libraries\UnityEngine.CoreModule.dll + + + + + + + + + \ No newline at end of file