mirror of
https://github.com/muskit/H3VR-TNH-Quality-of-Life-Improvements.git
synced 2026-06-03 04:34:26 -07:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 416e49d6d7 | |||
| 6249f07788 | |||
| 640245cdd5 |
@@ -13,7 +13,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
PackageName: TNH_Quality_of_Life_Improvements
|
||||
Author: muskit
|
||||
Version: 1.1.0
|
||||
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
|
||||
|
||||
@@ -48,6 +48,7 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
public static ConfigEntry<float> cfgHPBackgroundOpacity;
|
||||
//--- Take and Hold Info ---//
|
||||
public static ConfigEntry<bool> cfgShowLPC;
|
||||
public static ConfigEntry<bool> cfgInfoFollowCamera;
|
||||
public static ConfigEntry<bool> cfgShowTokens;
|
||||
public static ConfigEntry<bool> cfgShowHolds;
|
||||
public static ConfigEntry<bool> cfgShowNumbersAtShop;
|
||||
@@ -88,9 +89,16 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
HPReadability.ImproveHPTextReadability(healthCounter.transform.GetChild(0).gameObject);
|
||||
}
|
||||
|
||||
// grab Agency FB from game if it's not set
|
||||
GetFonts();
|
||||
}
|
||||
|
||||
// called on scene change, find fonts from game if they're not set
|
||||
private void GetFonts()
|
||||
{
|
||||
// Agency FB
|
||||
if (fontAgencyFB == null)
|
||||
{
|
||||
var healthCounter = FindObjectOfType<FistVR.FVRHealthBar>();
|
||||
if (healthCounter != null)
|
||||
{
|
||||
fontAgencyFB = healthCounter.transform.GetChild(0).GetChild(0).GetComponent<Text>().font;
|
||||
@@ -108,6 +116,7 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public MeatKitPlugin(): base()
|
||||
@@ -127,7 +136,7 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
bundle = AssetBundle.LoadFromFile(Path.Combine(BasePath, "tnh_qol_improvements"));
|
||||
SceneManager.activeSceneChanged += SceneChanged;
|
||||
|
||||
fontBombardier = MeatKitPlugin.bundle.LoadAsset<Font>("Bombardier");
|
||||
fontBombardier = bundle.LoadAsset<Font>("Bombardier");
|
||||
|
||||
// setup configuration
|
||||
//--- Health Counter ---//
|
||||
@@ -145,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,
|
||||
|
||||
+14
-3
@@ -15,10 +15,21 @@ And... wait, which hold are you on again?
|
||||
|
||||
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).
|
||||
**This mod will not disqualify you from Steam or TNHTweaker leaderboards.**
|
||||
|
||||
For any issues/ideas, please create an issue at the GitHub repository (linked on Thunderstore page).
|
||||
|
||||
## Changelog
|
||||
1.1.0
|
||||
1.1.3
|
||||
* [TNH] Fixed wrist stats still trying to look at the camera in the game over area, resulting in weird rotations
|
||||
|
||||
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
|
||||
|
||||
**1.1.0**
|
||||
* [TNH] Added win/lose count on hold counter
|
||||
* [TNH] Added enemy waves counter (substitutes token counter during hold if enabled)
|
||||
* [TNH] Added token numerical representation to shop
|
||||
@@ -34,7 +45,7 @@ For any issues/ideas, please create an issue on the GitHub repo (linked on Thund
|
||||
* Searching for the deprecated TNH Leaderboards Player Count mod to kill now stops after 120s
|
||||
|
||||
|
||||
1.0.0
|
||||
**1.0.0**
|
||||
* Initial release!
|
||||
|
||||
**NOTE: [*TNH Leaderboard Player Count*](https://h3vr.thunderstore.io/package/muskit/TNH_Leaderboard_Player_Count/) has been merged with this mod. If installed, please remove that mod as it lacks features and is no longer supported.**
|
||||
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<TNHInfo>().GameOverPos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,21 +27,25 @@ namespace TNHQoLImprovements
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
this.scoreDisplay = tnhScore;
|
||||
this.lblGlobalScores = scoreLabel;
|
||||
this.lblGlobalScores.resizeTextForBestFit = true;
|
||||
this.lblGlobalScores.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
// don't run with TNHTweaker installed
|
||||
this.gObjLoading = gObjLoading;
|
||||
loadingStr = gObjLoading.GetComponentInChildren<Text>().text;
|
||||
|
||||
var loadedAssemblies = System.AppDomain.CurrentDomain.GetAssemblies();
|
||||
if (Array.Exists<Assembly>(loadedAssemblies, x => x.GetName().Name == "TakeAndHoldTweaker"))
|
||||
{
|
||||
tnhTweakerInstalled = true;
|
||||
this.gObjLoading.transform.GetChild(0).GetComponent<Text>().text = "<color=lightblue><size=30>Online player count is incompatible with TNHTweaker.</size></color>";
|
||||
this.gObjLoading.SetActive(true);
|
||||
return;
|
||||
}
|
||||
|
||||
this.scoreDisplay = tnhScore;
|
||||
this.lblGlobalScores = scoreLabel;
|
||||
this.lblGlobalScores.resizeTextForBestFit = true;
|
||||
this.lblGlobalScores.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
loadingStr = gObjLoading.GetComponentInChildren<Text>().text;
|
||||
|
||||
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
#endregion
|
||||
@@ -78,7 +82,7 @@ namespace TNHQoLImprovements
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
gObjLoading.GetComponentInChildren<Text>().text = string.Format("<color=lightblue><size=30>Unknown error occured trying to retrieve online player count.</size></color>\n\n" +
|
||||
gObjLoading.GetComponentInChildren<Text>().text = string.Format("<color=lightblue><size=30>Unknown error occured trying to retrieve online player count.</size></color>\n" +
|
||||
"<color=red>{0}</color>", e);
|
||||
gObjLoading.SetActive(true);
|
||||
}
|
||||
|
||||
@@ -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<RectTransform>().pivot = new Vector2(1, 1);
|
||||
holdCounter.transform.localPosition = new Vector3(-250, 0, 0);
|
||||
}
|
||||
|
||||
if (tokenCounter != null)
|
||||
{
|
||||
tokenCounter.gameObject.GetComponent<RectTransform>().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,7 +71,18 @@ namespace TNHQoLImprovements
|
||||
return;
|
||||
}
|
||||
|
||||
// we're in a hold; hide token count
|
||||
// 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)
|
||||
@@ -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);
|
||||
|
||||
@@ -34,7 +34,7 @@ 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<Image>().sprite = tokenSprite;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ namespace TNHQoLImprovements
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
transform.GetChild(0).GetComponent<Text>().font = MeatKitPlugin.fontAgencyFB;
|
||||
text = transform.GetChild(1).GetComponent<Text>();
|
||||
text.font = MeatKitPlugin.fontAgencyFB;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -27,7 +29,6 @@ namespace TNHQoLImprovements
|
||||
|
||||
if(!ReferenceEquals(curHoldPoint, InPlay.tnhManager.m_curHoldPoint))
|
||||
{
|
||||
Debug.Log("Hold point updated!");
|
||||
curHoldPoint = InPlay.tnhManager.m_curHoldPoint;
|
||||
trCurPhaseIdx = Traverse.Create(curHoldPoint).Field<int>("m_phaseIndex");
|
||||
trMaxPhases = Traverse.Create(curHoldPoint).Field<int>("m_maxPhases");
|
||||
|
||||
@@ -3,13 +3,16 @@ 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<br/>
|
||||
<img src=preview/hp.png>
|
||||
|
||||
Token and hold counter on wrist<br/>
|
||||
<img src=preview/stats.png>
|
||||
|
||||
Numbered tokens at item stations<br/>
|
||||
<img src="preview/item station.png">
|
||||
|
||||
Player count for online leaderboards (won't work w/ *TNHTweaker* installed)<br/>
|
||||
<img src=preview/leaderboard.png><br/>
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
Reference in New Issue
Block a user