2020-06-19 08:01:46 +00:00
|
|
|
using ConformalDecals.Text;
|
2020-07-13 03:27:19 +00:00
|
|
|
using ConformalDecals.UI;
|
2020-06-15 22:39:05 +00:00
|
|
|
using ConformalDecals.Util;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
2020-07-13 03:27:19 +00:00
|
|
|
using UnityEngine.UI;
|
2020-06-15 22:39:05 +00:00
|
|
|
|
|
|
|
namespace ConformalDecals {
|
|
|
|
public class ModuleConformalText: ModuleConformalDecal {
|
|
|
|
[KSPField(isPersistant = true)] public string text = "Hello World!";
|
|
|
|
|
2020-07-13 03:27:19 +00:00
|
|
|
private GameObject _textEntryGui;
|
|
|
|
|
2020-06-15 22:39:05 +00:00
|
|
|
public override void OnLoad(ConfigNode node) {
|
|
|
|
base.OnLoad(node);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnStart(StartState state) {
|
|
|
|
base.OnStart(state);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-07-13 03:27:19 +00:00
|
|
|
[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);
|
2020-06-15 22:39:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|