Update READMEs, code cleanup

This commit is contained in:
msk
2022-01-22 23:41:31 -08:00
parent ba206f54ec
commit 2f4ef7c87c
5 changed files with 29 additions and 23 deletions
+3 -3
View File
@@ -4,9 +4,9 @@ This mod adds quality of life improvements to the *Take and Hold* experience.
## Features ## Features
* More visible HP counter * More visible HP counter
* Token and hold counter on wrist * Token and hold counter on wrist
* Player count for online leaderboards * Player count for online leaderboards; see how you stack up!
* Incompatiible with TNHTweaker * Incompatible with [*TakeAndHoldTweaker*](https://h3vr.thunderstore.io/package/devyndamonster/TakeAndHoldTweaker/); feature will be disabled!
Enable/disable these features in your mod manager's *Config editor*. Enable/disable these features in your mod manager's *Config editor*.
**The [TNH Leaderboard Player Count](https://h3vr.thunderstore.io/package/muskit/TNH_Leaderboard_Player_Count/) has been merged with this mod. Please remove that mod as it lacks features and is no longer supported.** **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.**
+8 -1
View File
@@ -8,19 +8,26 @@ namespace TNHQoLImprovements
{ {
public class HoldCounter : MonoBehaviour public class HoldCounter : MonoBehaviour
{ {
private void OnDeath(bool _)
{
Debug.Log("I died!");
}
void Start() void Start()
{ {
transform.parent = GameObject.Find("_NewTAHReticle/TAHReticle_HealthBar").transform; transform.parent = GameObject.Find("_NewTAHReticle/TAHReticle_HealthBar").transform;
transform.localPosition = new Vector3(-1f, 0, -.5f); transform.localPosition = new Vector3(-1f, 0, -.5f);
transform.localRotation = Quaternion.Euler(90, 0, 0); transform.localRotation = Quaternion.Euler(90, 0, 0);
transform.localScale = new Vector3(0.002f, 0.002f, 0.002f); transform.localScale = new Vector3(0.002f, 0.002f, 0.002f);
GameObject.Find("[SceneSettings]").GetComponent<FVRSceneSettings>().PlayerDeathEvent += OnDeath;
} }
void Update() void Update()
{ {
string display = ""; string display = "";
if (InPlay.tnhManager.ProgressionMode == TNHSetting_ProgressionType.Marathon) if (InPlay.tnhManager.ProgressionMode == TNHSetting_ProgressionType.Marathon)
display = string.Format("{0} / ∞", InPlay.tnhManager.m_level); display = InPlay.tnhManager.m_level.ToString() + " / ∞";
else else
display = string.Format("{0} / {1}", InPlay.tnhManager.m_level, InPlay.tnhManager.m_maxLevels); display = string.Format("{0} / {1}", InPlay.tnhManager.m_level, InPlay.tnhManager.m_maxLevels);
+13 -9
View File
@@ -20,15 +20,16 @@ namespace TNHQoLImprovements
private Text lblGlobalScores; private Text lblGlobalScores;
private GameObject gObjLoading; private GameObject gObjLoading;
public void Start() #region INITIALIZATION
{ // public void Start()
Debug.Log("--- Installed BepInEx Plugins ---"); // {
foreach (var plugin in Chainloader.PluginInfos) // Debug.Log("--- Installed BepInEx Plugins ---");
{ // foreach (var plugin in Chainloader.PluginInfos)
Debug.Log(plugin.Key); // {
} // Debug.Log(plugin.Key);
Debug.Log("--- End Plugins ---"); // }
} // Debug.Log("--- End Plugins ---");
//}
public void Init(TNH_ScoreDisplay tnhScore, Text scoreLabel, GameObject gObjLoading) public void Init(TNH_ScoreDisplay tnhScore, Text scoreLabel, GameObject gObjLoading)
{ {
@@ -51,7 +52,9 @@ namespace TNHQoLImprovements
initialized = true; initialized = true;
} }
#endregion
#region UPDATE
private void Update() private void Update()
{ {
if (!initialized || tnhTweakerInstalled) if (!initialized || tnhTweakerInstalled)
@@ -81,4 +84,5 @@ namespace TNHQoLImprovements
} }
} }
} }
#endregion
} }
@@ -47,12 +47,5 @@ namespace TNHQoLImprovements
var playerCountComponent = gObjLeaderboard.AddComponent<LeaderboardPlayerCount>(); var playerCountComponent = gObjLeaderboard.AddComponent<LeaderboardPlayerCount>();
playerCountComponent.Init(__instance, uiGlobalText, gObjLoading); playerCountComponent.Init(__instance, uiGlobalText, gObjLoading);
} }
[HarmonyPostfix]
[HarmonyPatch(typeof(TNH_ScoreDisplay), "SwitchToModeID")]
public static void OnModeIDSwitch_Post(string id, TNH_ScoreDisplay __instance)
{
Debug.Log(string.Format("Changing scoreboard mode to {0}!", id));
}
} }
} }
+4 -2
View File
@@ -5,6 +5,8 @@ A *Hot Dogs, Horseshoes, and Hand Grenades* mod that adds quality of life improv
* More visible HP counter * More visible HP counter
* Token and hold counter on wrist * Token and hold counter on wrist
* Player count for online leaderboards * Player count for online leaderboards
* Incompatiible with TNHTweaker * Incompatible with [*TakeAndHoldTweaker*](https://github.com/devyndamonster/TakeAndHoldTweaker/)
Enable/disable these features in your mod manager's *Config editor*. Features are modifiable via the mod manager's *Config editor*.
**NOTE: [*TNH Leaderboard Player Count*](https://github.com/muskit/TNH-Leaderboard-Player-Count/) has been merged with this mod.**