1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

(svn r23626) -Add: ScriptTown::SetText, which adds custom text to the Town GUI

This commit is contained in:
truebrain
2011-12-19 21:00:55 +00:00
parent 894216083d
commit ad48ab9237
9 changed files with 61 additions and 3 deletions

View File

@@ -43,6 +43,12 @@
return town_name;
}
/* static */ bool ScriptTown::SetText(TownID town_id, const char *text)
{
EnforcePrecondition(false, IsValidTown(town_id));
return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, text);
}
/* static */ int32 ScriptTown::GetPopulation(TownID town_id)
{
if (!IsValidTown(town_id)) return -1;