new-horizons/NewHorizons/Utility/AddToUITable.cs
Nick J. Connors d721201b0e Forked
Renamed to new horizons, updated to current versions of OWML and Outer Wilds, added BlackHoleBuilder, LavaBuilder, RingBuilder. Added support to modify existing planets with configs.
2021-12-08 00:09:11 -05:00

21 lines
604 B
C#

using OWML.Utils;
using System.Linq;
using UnityEngine;
namespace NewHorizons.Utility
{
static class AddToUITable
{
public static int Add(string text)
{
TextTranslation.TranslationTable instance = GameObject.FindObjectOfType<TextTranslation>().GetValue<TextTranslation.TranslationTable>("m_table");
instance.Insert_UI(instance.theUITable.Keys.Max() + 1, text);
Logger.Log($"Added [{text}] to UI table with key [{instance.theUITable.Keys.Max()}]", Logger.LogType.Log);
return instance.theUITable.Keys.Max();
}
}
}