diff --git a/Assets/MeatKit/BuildProfile.asset b/Assets/MeatKit/BuildProfile.asset index e4b0bd4..bb87143 100644 --- a/Assets/MeatKit/BuildProfile.asset +++ b/Assets/MeatKit/BuildProfile.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_EditorClassIdentifier: PackageName: TNH_Quality_of_Life_Improvements Author: muskit - Version: 1.1.1 + Version: 1.1.3 Icon: {fileID: 2800000, guid: 785b7946398f5314b95bf593d2d77d67, type: 3} ReadMe: {fileID: 102900000, guid: ab1d6dea017447a48ac348db588a6f35, type: 3} WebsiteURL: https://github.com/muskit/TNH-Quality-of-Life-Improvements diff --git a/Assets/MeatKit/MeatKitPlugin.cs b/Assets/MeatKit/MeatKitPlugin.cs index 01ac577..ed9c9e6 100644 --- a/Assets/MeatKit/MeatKitPlugin.cs +++ b/Assets/MeatKit/MeatKitPlugin.cs @@ -48,6 +48,7 @@ public class MeatKitPlugin : BaseUnityPlugin public static ConfigEntry cfgHPBackgroundOpacity; //--- Take and Hold Info ---// public static ConfigEntry cfgShowLPC; + public static ConfigEntry cfgInfoFollowCamera; public static ConfigEntry cfgShowTokens; public static ConfigEntry cfgShowHolds; public static ConfigEntry cfgShowNumbersAtShop; @@ -135,7 +136,7 @@ public class MeatKitPlugin : BaseUnityPlugin bundle = AssetBundle.LoadFromFile(Path.Combine(BasePath, "tnh_qol_improvements")); SceneManager.activeSceneChanged += SceneChanged; - fontBombardier = MeatKitPlugin.bundle.LoadAsset("Bombardier"); + fontBombardier = bundle.LoadAsset("Bombardier"); // setup configuration //--- Health Counter ---// @@ -153,9 +154,13 @@ public class MeatKitPlugin : BaseUnityPlugin "Set opacity of HP text to full and give it a shadow."); //--- Take and Hold Info ---// cfgShowLPC = Config.Bind("Take and Hold Info", - "Show player count in online leaderboards", + "Show Player Count in Online Leaderboards", true, "Shows the number of players in the currently selected TNH leaderboard."); + cfgInfoFollowCamera = Config.Bind("Take and Hold Info", + "Tilt Wrist Stats Towards Camera", + true, + "Tilt the extra wrist statistics from this mod towards the player's camera, allowing for easier readability."); cfgShowTokens = Config.Bind("Take and Hold Info", "Show Tokens", true, diff --git a/Assets/README.md b/Assets/README.md index ae3acf0..c26fcb3 100644 --- a/Assets/README.md +++ b/Assets/README.md @@ -18,6 +18,12 @@ Toggle and customize these features in your mod manager's *Config editor*. For any issues/ideas, please create an issue on the GitHub repo (linked on Thunderstore page). ## Changelog +1.1.3 +* [TNH] Fixed wrist stats still trying to look at the camera in the game over area + +1.1.2 +* [TNH] Wrist stats can now tilt towards the camera, making it less awkward to read + 1.1.1 * Fixed wave counter text not showing up during a hold diff --git a/Assets/_Prefabs/HoldCounter.prefab b/Assets/_Prefabs/HoldCounter.prefab index 280ae04..3b29063 100644 --- a/Assets/_Prefabs/HoldCounter.prefab +++ b/Assets/_Prefabs/HoldCounter.prefab @@ -385,4 +385,4 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 580, y: 360} - m_Pivot: {x: 1, y: 1} + m_Pivot: {x: 1, y: 0.5} diff --git a/Assets/_Prefabs/TokenCounter.prefab b/Assets/_Prefabs/TokenCounter.prefab index b80c72b..740d9f4 100644 --- a/Assets/_Prefabs/TokenCounter.prefab +++ b/Assets/_Prefabs/TokenCounter.prefab @@ -289,4 +289,4 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 500, y: 360} - m_Pivot: {x: 0, y: 1} + m_Pivot: {x: 0, y: 0.5} diff --git a/Assets/_Prefabs/WaveCounter.prefab b/Assets/_Prefabs/WaveCounter.prefab index 901c615..9e322c8 100644 --- a/Assets/_Prefabs/WaveCounter.prefab +++ b/Assets/_Prefabs/WaveCounter.prefab @@ -277,7 +277,7 @@ RectTransform: m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 580, y: 360} - m_Pivot: {x: 0, y: 1} + m_Pivot: {x: 0, y: 0.5} --- !u!224 &224892970170756718 RectTransform: m_ObjectHideFlags: 1 diff --git a/Assets/_Scripts/InPlay.cs b/Assets/_Scripts/InPlay.cs index 4e072f9..32cd89e 100644 --- a/Assets/_Scripts/InPlay.cs +++ b/Assets/_Scripts/InPlay.cs @@ -42,7 +42,6 @@ namespace TNHQoLImprovements int handSide = tnhManager.RadarHand == TNH_RadarHand.Left ? 0 : 1; tnhInfo.transform.SetParent(hands[handSide], false); - tnhInfo.transform.localScale = new Vector3(.0002f, .0002f, .0002f); tnhInfo.GetComponent().GameOverPos(); } } diff --git a/Assets/_Scripts/TNHInfo.cs b/Assets/_Scripts/TNHInfo.cs index ca510ce..45f07a0 100644 --- a/Assets/_Scripts/TNHInfo.cs +++ b/Assets/_Scripts/TNHInfo.cs @@ -24,23 +24,34 @@ namespace TNHQoLImprovements public void PlayPos() { + transform.localPosition = new Vector3(0, 0, -1.2f); if (holdCounter != null) - holdCounter.transform.localPosition = new Vector3(-333, 0, -450); + holdCounter.transform.localPosition = new Vector3(-333, 0, 0); if (tokenCounter != null) - tokenCounter.transform.localPosition = new Vector3(333, 0, -450); + tokenCounter.transform.localPosition = new Vector3(333, 0, 0); if (waveCounter != null) - waveCounter.transform.localPosition = new Vector3(333, 0, -450); + waveCounter.transform.localPosition = new Vector3(333, 0, 0); } public void GameOverPos() { + transform.localScale = new Vector3(.0002f, .0002f, .0002f); + transform.localPosition = Vector3.zero; + transform.localRotation = Quaternion.identity; + if (holdCounter != null) + { + holdCounter.gameObject.GetComponent().pivot = new Vector2(1, 1); holdCounter.transform.localPosition = new Vector3(-250, 0, 0); + } if (tokenCounter != null) + { + tokenCounter.gameObject.GetComponent().pivot = new Vector2(0, 1); tokenCounter.transform.localPosition = new Vector3(250, 0, 0); + } if (waveCounter != null) { @@ -51,7 +62,8 @@ namespace TNHQoLImprovements public void Update() { - if (InPlay.tnhManager.Phase == TNH_Phase.Dead) + // 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); @@ -59,8 +71,19 @@ namespace TNHQoLImprovements return; } - // we're in a hold; hide token count - if(InPlay.tnhManager.Phase == TNH_Phase.Hold) + // TNHInfo rotate to player camera + if (MeatKitPlugin.cfgInfoFollowCamera.Value) + { + transform.LookAt(MeatKitPlugin.playerCamera.transform); + var rotLook = transform.localEulerAngles; + var rot = Vector3.zero; + + rot.x = -rotLook.x - 90; + transform.localRotation = Quaternion.Euler(rot); + } + + // we're in a hold; hide token count and show wave count + if (InPlay.tnhManager.Phase == TNH_Phase.Hold) { if (tokenCounter != null) tokenCounter.SetActive(false); @@ -68,7 +91,7 @@ namespace TNHQoLImprovements if (waveCounter != null) waveCounter.SetActive(true); } - else // show token count + else // NOT in hold; do the inverse { if (tokenCounter != null) tokenCounter.SetActive(true); diff --git a/Assets/_Scripts/TokenCounter.cs b/Assets/_Scripts/TokenCounter.cs index 5ebb81f..aacf702 100644 --- a/Assets/_Scripts/TokenCounter.cs +++ b/Assets/_Scripts/TokenCounter.cs @@ -34,14 +34,14 @@ namespace TNHQoLImprovements yield return new WaitForEndOfFrame(); } } - Debug.Log("Token sprite found after " + debug_iterations.ToString() + " iterations."); + //Debug.Log("Token sprite found after " + debug_iterations.ToString() + " iterations."); transform.GetChild(0).GetComponent().sprite = tokenSprite; } void Update() { - int tokens = InPlay.tnhManager.GetNumTokens(); - text.text = tokens.ToString(); + int tokens = InPlay.tnhManager.GetNumTokens(); + text.text = tokens.ToString(); } } } \ No newline at end of file diff --git a/README.md b/README.md index 6f3341b..51bce98 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A *Hot Dogs, Horseshoes, and Hand Grenades* mod that adds quality of life improv Get it on [Thunderstore](https://h3vr.thunderstore.io/package/muskit/TNH_Quality_of_Life_Improvements/). -## Features +## Features (check Thunderstore for up-to-date list) More visible HP counter