mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
inspector aug: docs as tooltips
convert feilddocs to an 80-char per line tooltip to better help folks understand what a given variables intent is
This commit is contained in:
parent
3c358d45d0
commit
53a87af2b1
|
|
@ -931,6 +931,34 @@ void GuiInspectorField::_setFieldDocs( StringTableEntry docs )
|
|||
else
|
||||
mFieldDocs = docs;
|
||||
}
|
||||
|
||||
String inDocs(docs);
|
||||
String outDocs("");
|
||||
String outLine("");
|
||||
S32 newline = inDocs.find('\n');
|
||||
if (newline == -1)
|
||||
outDocs = docs;
|
||||
else
|
||||
{
|
||||
U32 uCount = StringUnit::getUnitCount(inDocs, " ");
|
||||
for (U32 i = 0; i < uCount; i++)
|
||||
{
|
||||
String docWord = StringUnit::getUnit(inDocs, i, " ");
|
||||
if (!docWord.isEmpty())
|
||||
outLine += docWord;
|
||||
|
||||
if (outLine.length() > 80)
|
||||
{
|
||||
outLine += "\n";
|
||||
outDocs += outLine;
|
||||
outLine.clear();
|
||||
}
|
||||
else
|
||||
outLine += " ";
|
||||
}
|
||||
}
|
||||
outDocs += String("\n") + outLine;
|
||||
mTooltip = outDocs;
|
||||
}
|
||||
|
||||
void GuiInspectorField::setHeightOverride(bool useOverride, U32 heightOverride)
|
||||
|
|
|
|||
Loading…
Reference in a new issue