You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KSP-Conformal-Decals/Source/ConformalDecals/ModuleConformalText.cs

34 lines
1.0 KiB
C#

using ConformalDecals.Text;
using ConformalDecals.UI;
using ConformalDecals.Util;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace ConformalDecals {
public class ModuleConformalText: ModuleConformalDecal {
[KSPField(isPersistant = true)] public string text = "Hello World!";
private GameObject _textEntryGui;
public override void OnLoad(ConfigNode node) {
base.OnLoad(node);
}
public override void OnStart(StartState state) {
base.OnStart(state);
}
[KSPEvent(guiActive = false, guiActiveEditor = true, guiName = "#LOC_ConformalDecals_gui-select-flag")]
public void SetText()
{
if (_textEntryGui == null) {
_textEntryGui = Instantiate(UILoader.textEntryPrefab, MainCanvasUtil.MainCanvas.transform, true);
_textEntryGui.AddComponent<DragPanel>();
MenuNavigation.SpawnMenuNavigation(_textEntryGui, Navigation.Mode.Automatic, true);
}
}
}
}