editor: Display object properties well readable

Günther Brammer 2011-01-13 17:55:58 +01:00
parent 94335b6a49
commit 58a257f763
3 changed files with 20 additions and 1 deletions

View File

@ -1837,6 +1837,11 @@ StdStrBuf C4Object::GetDataString()
Output.Append(LoadResStr("IDS_CNS_ACTION"));
Output.Append(GetAction()->GetName());
}
// Properties
Output.Append(LineFeed);
Output.Append(LoadResStr("IDS_CNS_PROPERTIES"));
Output.Append(LineFeed " ");
AppendDataString(&Output, LineFeed " ");
// Effects
if (pEffects)
{
@ -1847,7 +1852,7 @@ StdStrBuf C4Object::GetDataString()
{
Output.Append(LineFeed);
// Effect name
Output.AppendFormat(" %s: Interval %d", pEffect->Name, pEffect->iInterval);
Output.AppendFormat(" %s: Priority %d, Interval %d", pEffect->Name, pEffect->iPriority, pEffect->iInterval);
}
StdStrBuf Output2;

View File

@ -230,6 +230,19 @@ void C4Property::CompileFunc(StdCompiler *pComp)
pComp->Value(Value);
}
void C4PropList::AppendDataString(StdStrBuf * out, const char * delim)
{
StdStrBuf & DataString = *out;
const C4Property * p = Properties.First();
while (p)
{
DataString.Append(p->Key->GetData());
DataString.Append(" = ");
DataString.Append(p->Value.GetDataString());
p = Properties.Next(p);
if (p) DataString.Append(delim);
}
}
const char * C4PropList::GetName() const
{

View File

@ -99,6 +99,7 @@ public:
// Every proplist has to be initialized by either Init or CompileFunc.
void CompileFunc(StdCompiler *pComp);
void AppendDataString(StdStrBuf * out, const char * delim);
bool operator==(const C4PropList &b) const;