diff --git a/COTL_API/CustomInventory/Patches/CustomItemSpawnPatches.cs b/COTL_API/CustomInventory/Patches/CustomItemSpawnPatches.cs index f3c6230..837006e 100644 --- a/COTL_API/CustomInventory/Patches/CustomItemSpawnPatches.cs +++ b/COTL_API/CustomInventory/Patches/CustomItemSpawnPatches.cs @@ -1,7 +1,6 @@ using HarmonyLib; using MMBiomeGeneration; using MMRoomGeneration; -using MMTools; using UnityEngine; using UnityEngine.AddressableAssets; using Object = UnityEngine.Object; @@ -60,7 +59,6 @@ private static bool Prefix(InventoryItem.ITEM_TYPE type, int quantity, Vector3 p pickUp.type = type; pickUp.Speed = StartSpeed; - }); } else diff --git a/COTL_API/CustomSkins/CustomSkinPatches.cs b/COTL_API/CustomSkins/CustomSkinPatches.cs index 37eeabb..16964e2 100644 --- a/COTL_API/CustomSkins/CustomSkinPatches.cs +++ b/COTL_API/CustomSkins/CustomSkinPatches.cs @@ -26,7 +26,8 @@ private static void SkeletonData_FindSkin(ref Skin? __result, SkeletonData __ins } if (CustomFollowerSkins.TryGetValue(skinName, out var skin)) __result = skin; - if (AlwaysUnlockedSkins.TryGetValue(skinName, out var alwaysUnlocked) && alwaysUnlocked) DataManager.SetFollowerSkinUnlocked(skinName); + if (AlwaysUnlockedSkins.TryGetValue(skinName, out var alwaysUnlocked) && alwaysUnlocked) + DataManager.SetFollowerSkinUnlocked(skinName); } [HarmonyPatch(typeof(Graphics), nameof(Graphics.CopyTexture), typeof(Texture), typeof(int), typeof(int), @@ -57,8 +58,8 @@ private static bool Graphics_CopyTexture(ref Texture src, int srcElement, int sr var fullPix = orig.GetPixels32(); var croppedPix = new Color32[srcWidth * srcHeight]; for (var i = 0; i < srcHeight; i++) - for (var j = 0; j < srcWidth; j++) - croppedPix[i * srcWidth + j] = fullPix[(i + srcY) * orig.width + j + srcX]; + for (var j = 0; j < srcWidth; j++) + croppedPix[i * srcWidth + j] = fullPix[(i + srcY) * orig.width + j + srcX]; dst2d.SetPixels32(croppedPix); diff --git a/COTL_API/UI/UIManager.cs b/COTL_API/UI/UIManager.cs index 60c9a8a..721b2a3 100644 --- a/COTL_API/UI/UIManager.cs +++ b/COTL_API/UI/UIManager.cs @@ -26,14 +26,14 @@ public static class UIManager [HarmonyPostfix] private static void UISettingsMenuController_OnShowStarted(UISettingsMenuController __instance) { + if (SettingsUtils.SliderTemplate == null) + SettingsUtils.SliderTemplate = __instance._audioSettings.GetComponentInChildren() + .content.GetChild(0).gameObject; + if (SettingsUtils.HeaderTemplate == null) SettingsUtils.HeaderTemplate = __instance._graphicsSettings.GetComponentInChildren() .content.GetChild(0).gameObject; - if (SettingsUtils.SliderTemplate == null) - SettingsUtils.SliderTemplate = __instance._gameSettings.GetComponentInChildren() - .content.GetChild(2).gameObject; - if (SettingsUtils.DropdownTemplate == null) SettingsUtils.DropdownTemplate = __instance._graphicsSettings.GetComponentInChildren() .content.GetChild(2).gameObject;