Skip to content

Commit

Permalink
sn
Browse files Browse the repository at this point in the history
  • Loading branch information
Govorunb committed Jul 4, 2024
1 parent 29c4b0d commit 1560520
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions SCHIZO/Credits/CreditsPatches.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using HarmonyLib;
Expand All @@ -16,7 +16,7 @@ public static class UpdateCreditsTextTranspiler
#if BELOWZERO
AccessTools.Method(typeof(UnityEngine.MonoBehaviour), nameof(UnityEngine.MonoBehaviour.Invoke));
#else
AccessTools.Method(typeof(TMPro.TMP_Text), nameof(TMPro.TMP_Text.SetText), new[] { typeof(string), typeof(bool) });
AccessTools.Method(typeof(TMPro.TMP_Text), nameof(TMPro.TMP_Text.SetText), [typeof(string), typeof(bool)]);
#endif

[HarmonyTranspiler, UsedImplicitly]
Expand All @@ -41,7 +41,7 @@ private static void Patch(EndCreditsManager __instance)
#if BELOWZERO
__instance.centerText.SetText(creditsManager.GetCreditsTextBZ() + __instance.centerText.text);
#else
float oldHeight = 14100;//__instance.textField.preferredHeight;
const float oldHeight = 14100;//__instance.textField.preferredHeight;
__instance.textField.SetText(creditsManager.GetCreditsTextSN() + __instance.textField.text);
__instance.scrollSpeed = __instance.textField.preferredHeight * __instance.scrollSpeed / oldHeight;
__instance.scrollStep = __instance.textField.preferredHeight * __instance.scrollStep / oldHeight;
Expand Down
9 changes: 6 additions & 3 deletions SCHIZO/HullPlates/HullPlatePrefab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public HullPlatePrefab(HullPlate hullPlate, HullPlateLoader loader) : base(hullP

private IEnumerator GetPrefab(IOut<GameObject> gameObject)
{
#pragma warning disable CS0612 // Type or member is obsolete
CoroutineTask<GameObject> task = CraftData.GetPrefabForTechTypeAsync(TechType.DioramaHullPlate);
#pragma warning restore CS0612 // Type or member is obsolete
CoroutineTask<GameObject> task = CraftData.GetPrefabForTechTypeAsync(HullPlateTechType);
yield return task;

GameObject instance = GameObject.Instantiate(task.GetResult());
Expand All @@ -53,4 +51,9 @@ private IEnumerator GetPrefab(IOut<GameObject> gameObject)
instance.name = _hullPlate.classId;
gameObject.Set(instance);
}
// lol. lmao, even
#if BELOWZERO
#pragma warning disable CS0612 // Type or member is obsolete
#endif
private const TechType HullPlateTechType = TechType.DioramaHullPlate;
}
6 changes: 3 additions & 3 deletions SCHIZO/Patches/HolsterBeginPatches.Subnautica.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ internal static class HolsterBeginPatches
public static void InjectBeginHolsterCall(QuickSlots __instance)
{
if (__instance.state != QuickSlots.ArmsState.Holster) return;
InventoryItem item = __instance._heldItem;
if (item is null || !item.item) return;
Pickupable item = __instance._heldItem?.item;
if (!item) return;

// the funny
item.item.gameObject.SendMessage("OnHolsterBegin", SendMessageOptions.DontRequireReceiver);
item.gameObject.SendMessage("OnHolsterBegin", SendMessageOptions.DontRequireReceiver);
}
}

0 comments on commit 1560520

Please sign in to comment.