|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
using System.Collections;
|
|
|
|
using ConformalDecals.MaterialProperties;
|
|
|
|
using ConformalDecals.MaterialProperties;
|
|
|
|
using ConformalDecals.Text;
|
|
|
|
using ConformalDecals.Text;
|
|
|
|
using ConformalDecals.UI;
|
|
|
|
using ConformalDecals.UI;
|
|
|
@ -99,7 +100,15 @@ namespace ConformalDecals {
|
|
|
|
base.OnLoad(node);
|
|
|
|
base.OnLoad(node);
|
|
|
|
OnAfterDeserialize();
|
|
|
|
OnAfterDeserialize();
|
|
|
|
|
|
|
|
|
|
|
|
UpdateTextRecursive();
|
|
|
|
if (HighLogic.LoadedSceneIsGame) {
|
|
|
|
|
|
|
|
// For some reason, rendering doesnt work right on the first frame a scene is loaded
|
|
|
|
|
|
|
|
// So delay any rendering until the next frame when called in OnLoad
|
|
|
|
|
|
|
|
// This is probably a problem with Unity, not KSP
|
|
|
|
|
|
|
|
StartCoroutine(UpdateTextLate());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
UpdateText();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnSave(ConfigNode node) {
|
|
|
|
public override void OnSave(ConfigNode node) {
|
|
|
@ -107,12 +116,6 @@ namespace ConformalDecals {
|
|
|
|
base.OnSave(node);
|
|
|
|
base.OnSave(node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnStart(StartState state) {
|
|
|
|
|
|
|
|
base.OnStart(state);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpdateTextRecursive();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnAwake() {
|
|
|
|
public override void OnAwake() {
|
|
|
|
base.OnAwake();
|
|
|
|
base.OnAwake();
|
|
|
|
|
|
|
|
|
|
|
@ -252,6 +255,11 @@ namespace ConformalDecals {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IEnumerator UpdateTextLate() {
|
|
|
|
|
|
|
|
yield return null;
|
|
|
|
|
|
|
|
UpdateText();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateText() {
|
|
|
|
private void UpdateText() {
|
|
|
|
// Render text
|
|
|
|
// Render text
|
|
|
|
var newText = new DecalText(text, _font, _style);
|
|
|
|
var newText = new DecalText(text, _font, _style);
|
|
|
|