More UI tweaking

This commit is contained in:
Regalis
2017-04-20 20:56:28 +03:00
parent 499284dc91
commit 2cac176c87
10 changed files with 73 additions and 35 deletions
+11 -5
View File
@@ -36,15 +36,21 @@ namespace Barotrauma
GUIComponentStyle componentStyle = null;
if (parent != null)
{
string parentStyleName = parent.GetType().Name.ToLowerInvariant();
GUIComponentStyle parentStyle = null;
if (!componentStyles.TryGetValue(parentStyleName, out parentStyle))
GUIComponentStyle parentStyle = parent.Style;
if (parent.Style == null)
{
DebugConsole.ThrowError("Couldn't find a GUI style \""+ parentStyleName + "\"");
return;
string parentStyleName = parent.GetType().Name.ToLowerInvariant();
if (!componentStyles.TryGetValue(parentStyleName, out parentStyle))
{
DebugConsole.ThrowError("Couldn't find a GUI style \""+ parentStyleName + "\"");
return;
}
}
string childStyleName = string.IsNullOrEmpty(styleName) ? targetComponent.GetType().Name : styleName;
parentStyle.ChildStyles.TryGetValue(childStyleName.ToLowerInvariant(), out componentStyle);
}