Add LocalizedString support for UI

This commit is contained in:
Wojtek Figat
2021-04-27 14:28:42 +02:00
parent 5fc2f12139
commit 17467c81a4
7 changed files with 86 additions and 33 deletions

View File

@@ -30,9 +30,9 @@ namespace FlaxEditor.CustomEditors.Editors
{
base.Initialize(layout);
if (layout.Children.Count != 1)
if (layout.Children.Count == 0)
return;
var propList = layout.Children[0] as PropertiesListElement;
var propList = layout.Children[layout.Children.Count - 1] as PropertiesListElement;
if (propList == null || propList.Children.Count != 2)
return;
var idElement = propList.Children[0] as TextBoxElement;
@@ -66,6 +66,7 @@ namespace FlaxEditor.CustomEditors.Editors
Text = "+",
TooltipText = "Add new localized text to Localization Settings (all used locales)",
Parent = _valueElement.TextBox,
Enabled = IsSingleObject,
};
addString.SetAnchorPreset(AnchorPresets.MiddleRight, false, true);
addString.ButtonClicked += OnAddStringClicked;
@@ -175,6 +176,7 @@ namespace FlaxEditor.CustomEditors.Editors
allKeys.Add(e.Key);
}
}
_valueElement.TextBox.SetTextAsUser(null);
string newKey = null;
if (string.IsNullOrEmpty(_idElement.Text))
{