2022-01-30 03:16:24 -08:00
|
|
|
using HarmonyLib;
|
2022-01-28 19:57:50 -08:00
|
|
|
using UnityEngine;
|
2022-01-30 03:16:24 -08:00
|
|
|
using UnityEngine.UI;
|
2022-01-28 19:57:50 -08:00
|
|
|
using FistVR;
|
|
|
|
|
|
|
|
|
|
namespace TNHQoLImprovements
|
|
|
|
|
{
|
|
|
|
|
public class WaveCounter : MonoBehaviour
|
|
|
|
|
{
|
2022-01-30 03:16:24 -08:00
|
|
|
private TNH_HoldPoint curHoldPoint;
|
|
|
|
|
private Traverse<int> trCurPhaseIdx;
|
|
|
|
|
private Traverse<int> trMaxPhases;
|
2022-01-28 19:57:50 -08:00
|
|
|
|
2022-01-30 03:16:24 -08:00
|
|
|
private Text text;
|
2022-01-28 19:57:50 -08:00
|
|
|
|
|
|
|
|
// Use this for initialization
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2022-01-30 14:41:03 -08:00
|
|
|
transform.GetChild(0).GetComponent<Text>().font = MeatKitPlugin.fontAgencyFB;
|
2022-01-30 03:16:24 -08:00
|
|
|
text = transform.GetChild(1).GetComponent<Text>();
|
2022-01-30 14:41:03 -08:00
|
|
|
text.font = MeatKitPlugin.fontAgencyFB;
|
2022-01-30 03:16:24 -08:00
|
|
|
}
|
2022-01-28 19:57:50 -08:00
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
2022-01-30 03:16:24 -08:00
|
|
|
if (InPlay.tnhManager.Phase != TNH_Phase.Hold)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if(!ReferenceEquals(curHoldPoint, InPlay.tnhManager.m_curHoldPoint))
|
|
|
|
|
{
|
|
|
|
|
curHoldPoint = InPlay.tnhManager.m_curHoldPoint;
|
|
|
|
|
trCurPhaseIdx = Traverse.Create(curHoldPoint).Field<int>("m_phaseIndex");
|
|
|
|
|
trMaxPhases = Traverse.Create(curHoldPoint).Field<int>("m_maxPhases");
|
|
|
|
|
}
|
|
|
|
|
text.text = string.Format("{0} / {1}", trCurPhaseIdx.Value, trMaxPhases.Value);
|
|
|
|
|
}
|
2022-01-28 19:57:50 -08:00
|
|
|
}
|
|
|
|
|
}
|