mirror of
https://github.com/muskit/H3VR-TNH-Quality-of-Life-Improvements.git
synced 2026-06-02 20:24:26 -07:00
bigger hide-HP aim target, hide-HP opacity setting, no HP background by default,
This commit is contained in:
@@ -13,7 +13,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
PackageName: TNH_Quality_of_Life_Improvements
|
||||
Author: muskit
|
||||
Version: 1.2.1
|
||||
Version: 1.2.2
|
||||
Icon: {fileID: 2800000, guid: 785b7946398f5314b95bf593d2d77d67, type: 3}
|
||||
ReadMe: {fileID: 102900000, guid: ab1d6dea017447a48ac348db588a6f35, type: 3}
|
||||
WebsiteURL: https://github.com/muskit/TNH-Quality-of-Life-Improvements
|
||||
|
||||
@@ -44,6 +44,7 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
// BepInEx configuration
|
||||
//--- Health Counter ---//
|
||||
public static ConfigEntry<bool> cfgHPHiddenWhenAiming;
|
||||
public static ConfigEntry<float> cfgHPAimOpacity;
|
||||
public static ConfigEntry<bool> cfgShowHPBackground;
|
||||
public static ConfigEntry<float> cfgHPBackgroundOpacity;
|
||||
public static ConfigEntry<HPTextType> cfgHPTextType;
|
||||
@@ -62,7 +63,7 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
private static InPlay instance;
|
||||
|
||||
// Searching for old leaderboards player count mod to disable
|
||||
private bool lpcModGone = false;
|
||||
private bool lpcStopSearching = false;
|
||||
private float lpcModSearchTimeEnd;
|
||||
|
||||
private Harmony harmony;
|
||||
@@ -147,10 +148,14 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
"Hide HP Counter When Aiming",
|
||||
true,
|
||||
"While aiming around the health counter in view, hide it.");
|
||||
cfgHPAimOpacity = cfgHPBackgroundOpacity = Config.Bind("Health Counter",
|
||||
"Aiming opacity",
|
||||
0f,
|
||||
"Opacity of Health Counter when aiming around it (if Hide HP is enabled).");
|
||||
cfgShowHPBackground = Config.Bind("Health Counter",
|
||||
"Background enabled",
|
||||
true,
|
||||
"Apply a background to the health text.");
|
||||
false,
|
||||
"Apply a background to the Health Counter.");
|
||||
cfgHPBackgroundOpacity = Config.Bind("Health Counter",
|
||||
"Background opacity",
|
||||
0.74f,
|
||||
@@ -196,8 +201,8 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
HealthExpireIndicationType.Flashing,
|
||||
"Add a visual indication on the Health Crystal's despawn timer.");
|
||||
|
||||
// give 120 seconds to search for old mod, which we want to kill
|
||||
lpcModSearchTimeEnd = Time.time + 120;
|
||||
// give 60 seconds to search for old mod, which we want to kill
|
||||
lpcModSearchTimeEnd = Time.time + 60;
|
||||
|
||||
RunPatches();
|
||||
}
|
||||
@@ -240,7 +245,7 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
/// </summary>
|
||||
private void Update()
|
||||
{
|
||||
if (lpcModGone)
|
||||
if (lpcStopSearching)
|
||||
return;
|
||||
|
||||
foreach (var plugin in Chainloader.PluginInfos)
|
||||
@@ -249,14 +254,14 @@ public class MeatKitPlugin : BaseUnityPlugin
|
||||
{
|
||||
Logger.LogWarning("TNH Leaderboard Player Count mod detected. Destroying it to avoid interference.");
|
||||
Destroy(plugin.Value.Instance);
|
||||
lpcModGone = true;
|
||||
lpcStopSearching = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Time.realtimeSinceStartup >= lpcModSearchTimeEnd)
|
||||
{
|
||||
Logger.LogInfo("Stopping search for TNH Leaderboard Player Count mod after 120 seconds.");
|
||||
lpcModGone = true;
|
||||
Logger.LogInfo("Stopping search for TNH Leaderboard Player Count mod after 60 seconds.");
|
||||
lpcStopSearching = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class HPHideWhenAiming : MonoBehaviour {
|
||||
hudCollider = gObjHUD.AddComponent<BoxCollider>();
|
||||
hudCollider.isTrigger = true;
|
||||
hudCollider.gameObject.layer = LayerMask.NameToLayer("UI");
|
||||
hudCollider.size = new Vector3(40, 25, .01f);
|
||||
hudCollider.size = new Vector3(50, 30, .01f);
|
||||
|
||||
//// TESTING: collider visuals
|
||||
//gObjColliderRenderer = new GameObject();
|
||||
@@ -97,7 +97,7 @@ public class HPHideWhenAiming : MonoBehaviour {
|
||||
|
||||
if (rayHit)
|
||||
{
|
||||
canvasGroup.alpha = 0.1f;
|
||||
canvasGroup.alpha = MeatKitPlugin.cfgHPAimOpacity.Value;
|
||||
if (background != null)
|
||||
background.enabled = false;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace TNHQoLImprovements
|
||||
private float beginTime;
|
||||
private float onLength;
|
||||
private float offLength;
|
||||
|
||||
private float stateChangeTime = 0;
|
||||
private float flashQuicklyAfter;
|
||||
private bool visible = true;
|
||||
|
||||
private MeshRenderer mesh;
|
||||
@@ -24,11 +26,19 @@ namespace TNHQoLImprovements
|
||||
mesh = GetComponent<MeshRenderer>();
|
||||
}
|
||||
|
||||
public void Init(float interval, float onToOffRatio = 0.5f, float beginAfter = 0)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="interval">How long an off-on cycle lasts.</param>
|
||||
/// <param name="onToOffRatio">On-time to off-time ratio for the flashing sequence.</param>
|
||||
/// <param name="beginAfter">Postpone the flashing time.</param>
|
||||
/// <param name="flashQuicklyAfter">Once flashing starts, how long until it flashes very quickly.</param>
|
||||
public void Init(float interval, float onToOffRatio = 0.5f, float beginAfter = 0, float flashQuicklyAfter = -1)
|
||||
{
|
||||
beginTime = Time.time + beginAfter;
|
||||
onLength = interval * onToOffRatio;
|
||||
offLength = interval * (1 - onToOffRatio);
|
||||
this.flashQuicklyAfter = flashQuicklyAfter;
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
@@ -52,13 +62,6 @@ namespace TNHQoLImprovements
|
||||
stateChangeTime = Time.time + offLength;
|
||||
}
|
||||
}
|
||||
|
||||
//if (Time.time >= stateChangeTime)
|
||||
// {
|
||||
// stateChangeTime = Time.time + interval;
|
||||
// visible = !visible;
|
||||
// mesh.enabled = visible;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user