mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-06-11 05:54:07 +00:00
Fix styles updating textbox
This commit is contained in:
parent
1347457ad6
commit
9b5f87ab22
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:af4bdba4554a86d95eebfc736ff4b5ab1f1cf9af48b4b0680cd368daead9d822
|
||||
oid sha256:b89868137e40e433c04e61d89accc0ba5b809f88b03840ac1790765115c92b73
|
||||
size 82432
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace ConformalDecals.UI {
|
|||
private DecalTextStyle _style;
|
||||
private Vector2 _lineSpacingRange;
|
||||
private Vector2 _charSpacingRange;
|
||||
private TMP_InputField _textBoxTMP;
|
||||
|
||||
private FontMenuController _fontMenu;
|
||||
|
||||
|
@ -79,9 +80,9 @@ namespace ConformalDecals.UI {
|
|||
_font = font;
|
||||
font.SetupSample(_fontButton.GetComponentInChildren<TextMeshProUGUI>());
|
||||
|
||||
var textBox = ((TMP_InputField) _textBox);
|
||||
textBox.textComponent.fontStyle = _style.FontStyle | _font.FontStyle;
|
||||
textBox.fontAsset = _font.FontAsset;
|
||||
_textBoxTMP.text = _text;
|
||||
_textBoxTMP.textComponent.fontStyle = _style.FontStyle | _font.FontStyle & ~_font.FontStyleMask;
|
||||
_textBoxTMP.fontAsset = _font.FontAsset;
|
||||
|
||||
UpdateStyleButtons();
|
||||
OnValueChanged();
|
||||
|
@ -137,6 +138,7 @@ namespace ConformalDecals.UI {
|
|||
if (_ignoreUpdates) return;
|
||||
|
||||
_style.Bold = state;
|
||||
_textBoxTMP.textComponent.fontStyle = _style.FontStyle | _font.FontStyle & ~_font.FontStyleMask;
|
||||
OnValueChanged();
|
||||
}
|
||||
|
||||
|
@ -144,6 +146,7 @@ namespace ConformalDecals.UI {
|
|||
if (_ignoreUpdates) return;
|
||||
|
||||
_style.Italic = state;
|
||||
_textBoxTMP.textComponent.fontStyle = _style.FontStyle | _font.FontStyle & ~_font.FontStyleMask;
|
||||
OnValueChanged();
|
||||
}
|
||||
|
||||
|
@ -151,6 +154,7 @@ namespace ConformalDecals.UI {
|
|||
if (_ignoreUpdates) return;
|
||||
|
||||
_style.Underline = state;
|
||||
_textBoxTMP.textComponent.fontStyle = _style.FontStyle | _font.FontStyle & ~_font.FontStyleMask;
|
||||
OnValueChanged();
|
||||
}
|
||||
|
||||
|
@ -158,6 +162,7 @@ namespace ConformalDecals.UI {
|
|||
if (_ignoreUpdates) return;
|
||||
|
||||
_style.SmallCaps = state;
|
||||
_textBoxTMP.textComponent.fontStyle = _style.FontStyle | _font.FontStyle & ~_font.FontStyleMask;
|
||||
OnValueChanged();
|
||||
}
|
||||
|
||||
|
@ -170,7 +175,10 @@ namespace ConformalDecals.UI {
|
|||
|
||||
|
||||
private void Start() {
|
||||
((TMP_InputField) _textBox).text = _text;
|
||||
_textBoxTMP = ((TMP_InputField) _textBox);
|
||||
_textBoxTMP.text = _text;
|
||||
_textBoxTMP.textComponent.fontStyle = _style.FontStyle | _font.FontStyle & ~_font.FontStyleMask;
|
||||
_textBoxTMP.fontAsset = _font.FontAsset;
|
||||
|
||||
_font.SetupSample(_fontButton.GetComponentInChildren<TextMeshProUGUI>());
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user