new-horizons/Marshmallow/AddToUITable.cs
2020-04-12 15:31:58 +01:00

21 lines
599 B
C#

using OWML.ModHelper.Events;
using System.Linq;
using UnityEngine;
namespace Marshmallow.UI
{
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);
Main.Log("Added [" + text + "] to UI table with key [" + instance.theUITable.Keys.Max() + "]");
return instance.theUITable.Keys.Max();
}
}
}