fixed wave counter's lack of font

This commit is contained in:
msk
2022-01-30 14:41:03 -08:00
parent d4c5e84404
commit 640245cdd5
5 changed files with 32 additions and 16 deletions
+14 -10
View File
@@ -27,20 +27,24 @@ namespace TNHQoLImprovements
if (initialized)
return;
this.scoreDisplay = tnhScore;
// don't run with TNHTweaker installed
this.gObjLoading = gObjLoading;
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;
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);
}
initialized = true;
}
@@ -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);
}
+2 -1
View File
@@ -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");