mirror of
https://github.com/muskit/H3VR-TNH-Quality-of-Life-Improvements.git
synced 2026-06-02 20:24:26 -07:00
Revert "add small setup delays to address errors in Atlas maps"
This reverts commit 64d8df148b.
This commit is contained in:
Generated
+1
-1
@@ -26,5 +26,5 @@ MonoBehaviour:
|
||||
ApplyHarmonyPatches: 1
|
||||
BuildItems:
|
||||
- {fileID: 11400000, guid: ccaff18373cd99848b344316974e6d46, type: 2}
|
||||
BuildAction: 2
|
||||
BuildAction: 1
|
||||
OutputProfile: C:/Users/Alex/AppData/Roaming/r2modmanPlus-local/H3VR/profiles/dev
|
||||
|
||||
@@ -85,24 +85,8 @@ public static AssetBundle bundle;
|
||||
|
||||
private void SceneChanged(Scene from, Scene to)
|
||||
{
|
||||
StartCoroutine("SceneChangedCoRoutine");
|
||||
}
|
||||
|
||||
private IEnumerator SceneChangedCoRoutine()
|
||||
{
|
||||
// grab H3VR objects
|
||||
playerCamera = null;
|
||||
hpDisplay = null;
|
||||
while (playerCamera == null)
|
||||
{
|
||||
playerCamera = GameObject.FindGameObjectWithTag("MainCamera");
|
||||
hpDisplay = FindObjectOfType<FVRHealthBar>();
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// ---- MAINCAMERA FOUND SIGNIFIES THAT ESSENTIAL GAME OBJECTS HAVE LOADED IN ---- //
|
||||
|
||||
// find Agency font
|
||||
playerCamera = GameObject.FindGameObjectWithTag("MainCamera");
|
||||
hpDisplay = FindObjectOfType<FVRHealthBar>();
|
||||
GetFonts();
|
||||
|
||||
// apply health counter tweaks globally
|
||||
@@ -120,17 +104,34 @@ public static AssetBundle bundle;
|
||||
WristMenuAPI.Buttons.Remove(wmbHPToggle);
|
||||
}
|
||||
|
||||
if (GameObject.Find("_GameManager") != null || FindObjectOfType<TNH_Manager>() != null)
|
||||
StartCoroutine("TryTNH");
|
||||
}
|
||||
|
||||
private IEnumerator TryTNH()
|
||||
{
|
||||
for (int i = 0; i < 11; ++i)
|
||||
{
|
||||
Logger.LogInfo("We are in a TNH game!");
|
||||
instance = new GameObject().AddComponent<InPlay>();
|
||||
// TNH patches
|
||||
if (GameObject.Find("_GameManager") != null || FindObjectOfType<TNH_Manager>() != null)
|
||||
{
|
||||
Logger.LogInfo("We are in a TNH game!");
|
||||
instance = new GameObject().AddComponent<InPlay>();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogInfo(String.Format("Couldn't find a TNH game. Trying again...({0}/10)", i));
|
||||
yield return new WaitForEndOfFrame();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
// destroy self only if we are FOR SURE not in a TNH game
|
||||
if (GameObject.Find("_GameManager") == null || FindObjectOfType<TNH_Manager>() == null)
|
||||
{
|
||||
Logger.LogInfo("We are NOT in a TNH game!");
|
||||
Destroy(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// called on scene change, find fonts from game if they're not set
|
||||
private void GetFonts()
|
||||
|
||||
@@ -21,10 +21,6 @@ Toggle and customize these features in your mod manager's *Config editor*.
|
||||
For any issues/ideas, please create an issue at the GitHub repository (linked on Thunderstore page).
|
||||
|
||||
## Changelog
|
||||
1.2.4
|
||||
* [TNH] Fix errors occurring in Atlas-based maps
|
||||
* Update MeatKit (now on Unity 5.6.7f1!)
|
||||
|
||||
1.2.3
|
||||
* Added button in wrist menu to toggle HP counter (thanks PutterMyBancakes for the suggestion!)
|
||||
* [TNH] Made the search time for deprecated Leaderboard mod based on day of year as an input of the sin()
|
||||
|
||||
@@ -58,10 +58,5 @@ namespace TNHQoLImprovements
|
||||
tnhInfo = Instantiate<GameObject>(MeatKitPlugin.bundle.LoadAsset<GameObject>("TNHInfo"), FindObjectOfType<TAH_Reticle>().transform.GetChild(3));
|
||||
tnhInfo.transform.localScale = new Vector3(0.002f, 0.002f, 0.002f);
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
tnhManager = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -27,7 +26,7 @@ namespace TNHQoLImprovements
|
||||
{
|
||||
private Text text;
|
||||
|
||||
private IEnumerator Start()
|
||||
private void Start()
|
||||
{
|
||||
var gObjText = new GameObject("TokenCounter");
|
||||
gObjText.transform.SetParent(transform, false);
|
||||
@@ -38,26 +37,11 @@ namespace TNHQoLImprovements
|
||||
text.font = MeatKitPlugin.fontBombardier;
|
||||
text.fontSize = 55;
|
||||
text.color = new Color(0.1307786f, 0.2461715f, 0.359f);
|
||||
|
||||
while (InPlay.tnhManager == null)
|
||||
{
|
||||
Debug.Log("[ShopTokenNumber] tnhManager is null!");
|
||||
yield return null;
|
||||
}
|
||||
|
||||
InPlay.tnhManager.TokenCountChangeEvent += UpdateText;
|
||||
UpdateText();
|
||||
}
|
||||
|
||||
private void UpdateText(int _ = 0)
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
int tokens = InPlay.tnhManager.GetNumTokens();
|
||||
text.text = tokens.ToString();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
InPlay.tnhManager.TokenCountChangeEvent -= UpdateText;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,8 +62,8 @@ namespace TNHQoLImprovements
|
||||
|
||||
public void Update()
|
||||
{
|
||||
// game over area; do not update anything else
|
||||
if (InPlay.tnhManager.Phase == TNH_Phase.Dead || InPlay.tnhManager.Phase == TNH_Phase.Completed)
|
||||
// game over area; do not update anything else
|
||||
if (InPlay.tnhManager.Phase == TNH_Phase.Dead || InPlay.tnhManager.Phase == TNH_Phase.Completed)
|
||||
{
|
||||
if (tokenCounter != null)
|
||||
tokenCounter.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user