Added obsolete text to tooltip (only works, if another property attribute is present)
This commit is contained in:
parent
492b882a51
commit
e4eb4dab47
|
|
@ -24,7 +24,6 @@ namespace Module.Inspector.Editor
|
|||
|
||||
bool prevEnabled = GUI.enabled;
|
||||
GUI.enabled = accessType == EAccessType.Enabled;
|
||||
// TODO: What to do with [Obsolete]?
|
||||
|
||||
if (result.draw != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,12 +126,22 @@ namespace Module.Inspector.Editor.Utilities
|
|||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(obsoleteText))
|
||||
if (isObsolete)
|
||||
{
|
||||
if (string.IsNullOrEmpty(obsoleteText))
|
||||
{
|
||||
if (tooltip != null)
|
||||
tooltip += $"\n[Obsolete: {obsoleteText}";
|
||||
tooltip += $"\n[Obsolete]";
|
||||
else
|
||||
tooltip = $"Obsolete: {obsoleteText}";
|
||||
tooltip = $"[Obsolete]";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tooltip != null)
|
||||
tooltip += $"\n[Obsolete: {obsoleteText}]";
|
||||
else
|
||||
tooltip = $"[Obsolete: {obsoleteText}]";
|
||||
}
|
||||
}
|
||||
|
||||
return new Result(drawer, predrawerModifiers, valueModifiers, accessModifiers, tooltip, isObsolete);
|
||||
|
|
|
|||
Loading…
Reference in a new issue