Trainz Object HTML Element
<trainz-object> tags define special browser objects which the user can interact with.
These include a graphic dial, a text entry box or a browser frame and a range of parameters can be applied.
public bool FilterPropertyElementList(string propertyID, GSObject[] listObjects, string[] listNames)
{
if (propertyID == "object-list")
{
bool bDidChangeAnything = false;
// Remove any already added objects from the list
int i;
for (i = 0; i < listObjects.size(); )
{
if (IsAlreadyInList(cast<GameObject>(listObjects[i])))
{
listObjects[i,i+1] = null;
listNames[i,i+1] = null;
bDidChangeAnything = true;
}
else
{
++i;
}
}
return bDidChangeAnything;
}
return inherited(propertyID, listObjects, listNames);
}
Display More
public string[] GetPropertyElementList(string propertyID)
{
if (propertyID == "mode")
{
StringTable strTable = GetAsset().GetStringTable();
string[] result = new string[10];
int i;
for (i = 1; i < 10; ++i)
result[i] = strTable.GetString("property_list_mode_" + i);
return result;
}
return inherited(propertyID);
}
Display More
public string GetDescriptionHTML(void)
{
StringTable strTable = GetAsset().GetStringTable();
HTMLBuffer buffer = HTMLBufferStatic.Construct();
buffer.Print("<html><body>");
buffer.Escape(strTable.GetString("property_name_forename"));
buffer.Print(": <a href=live://property/forename>");
buffer.Escape(m_foreName);
buffer.Print("</a><br>");
buffer.Escape(strTable.GetString("property_name_surname"));
buffer.Print(": <a href=live://property/forename>");
buffer.Escape(m_surName);
buffer.Print("</a><br>");
buffer.Print("</body></html>");
return buffer.AsString();
}
Display More