Compare commits

..

No commits in common. "a6de537e4ab0532eb0d10e13edfae35a1c61110b" and "98f774b2aecc3720186b2e3ef4bf8af637e33476" have entirely different histories.

5 changed files with 5 additions and 29 deletions

View File

@ -62,7 +62,6 @@ PART
useBaseNormal = true
scaleMode = MINIMUM
defaultScale = 0.2
defaultDepth = 0.2
defaultCutoff = 0.5
}

View File

@ -31,7 +31,7 @@ namespace ConformalDecals {
[KSPField] public bool scaleAdjustable = true;
[KSPField] public float defaultScale = 1;
[KSPField] public Vector2 scaleRange = new Vector2(0, 5);
[KSPField] public Vector2 scaleRange = new Vector2(0, 10);
[KSPField] public DecalScaleMode scaleMode = DecalScaleMode.HEIGHT;

View File

@ -11,6 +11,7 @@ namespace ConformalDecals.UI {
[Serializable]
public delegate void TextUpdateDelegate(string newText, DecalFont newFont, FontStyles style, bool vertical, float linespacing, float charspacing);
[SerializeField] private Selectable _textBox;
[SerializeField] private Button _fontButton;
@ -39,10 +40,7 @@ namespace ConformalDecals.UI {
private FontMenuController _fontMenu;
private bool _ignoreUpdates;
private bool _isLocked;
private string _lockString;
private static int _lockCounter;
private bool _ignoreUpdates;
public static TextEntryController Create(
string text, DecalFont font, FontStyles style, bool vertical, float linespacing, float charspacing,
@ -72,18 +70,6 @@ namespace ConformalDecals.UI {
Destroy(gameObject);
}
public void SetControlLock(string value = null) {
if (_isLocked) return;
InputLockManager.SetControlLock(_lockString);
_isLocked = true;
}
public void RemoveControlLock(string value = null) {
if (!_isLocked) return;
InputLockManager.RemoveControlLock(_lockString);
_isLocked = false;
}
public void OnTextUpdate(string newText) {
this._text = newText;
@ -209,15 +195,12 @@ namespace ConformalDecals.UI {
OnValueChanged();
}
private void Start() {
_lockString = $"ConformalDecals_TextEditor_{_lockCounter++}";
_textBoxTMP = ((TMP_InputField) _textBox);
_textBoxTMP.text = _text;
_textBoxTMP.textComponent.fontStyle = _style | _font.FontStyle & ~_font.FontStyleMask;
_textBoxTMP.fontAsset = _font.FontAsset;
_textBoxTMP.onSelect.AddListener(SetControlLock);
_textBoxTMP.onDeselect.AddListener(RemoveControlLock);
_font.SetupSample(_fontButton.GetComponentInChildren<TextMeshProUGUI>());
@ -226,10 +209,6 @@ namespace ConformalDecals.UI {
UpdateCharSpacing();
}
private void OnDestroy() {
RemoveControlLock();
}
private void OnValueChanged() {
_onValueChanged(_text, _font, _style, _vertical, _lineSpacing, _charSpacing);
}

View File

@ -1,12 +1,10 @@
v0.2.4
------
- Fixes:
- Fixed red text appearing on planets due to KSP bug by clearing render textures afterwards.
- Fixed fonts not saving correctly.
- Changes:
- Lowered step size for decal size and depth to 1cm.
- Changed default max size to 5m.
- Changed default text decal size to 0.2m
- Changed default max size to 10m.
- Text decals now show as a circle if they contain only whitespace.
v0.2.3