diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 21:00:55 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 21:00:55 +0000 |
commit | ad48ab923764087bf66153d1c26ed0eb05a19989 (patch) | |
tree | 7851cc098dee7c0e5c5ea0ffe183711342b2a283 /src/script/api/script_town.cpp | |
parent | 894216083d3f0b7c01ad705c253723e948297138 (diff) | |
download | openttd-ad48ab923764087bf66153d1c26ed0eb05a19989.tar.xz |
(svn r23626) -Add: ScriptTown::SetText, which adds custom text to the Town GUI
Diffstat (limited to 'src/script/api/script_town.cpp')
-rw-r--r-- | src/script/api/script_town.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp index d213f1d0d..081bccd51 100644 --- a/src/script/api/script_town.cpp +++ b/src/script/api/script_town.cpp @@ -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; |