diff options
author | yexo <yexo@openttd.org> | 2011-12-21 14:55:28 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2011-12-21 14:55:28 +0000 |
commit | 5988659eea20d3e84fdeadf448133e9b94e9630f (patch) | |
tree | 230c16eadf35e9868a3acf6d91b1b73ae412897d /src/script/api/script_text.hpp | |
parent | a55478aaa6453d62f9708ee03393711b2d3120ee (diff) | |
download | openttd-5988659eea20d3e84fdeadf448133e9b94e9630f.tar.xz |
(svn r23651) -Feature: [NoGo] GSText now accepts string arguments as parameters to the constructor
Diffstat (limited to 'src/script/api/script_text.hpp')
-rw-r--r-- | src/script/api/script_text.hpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/script/api/script_text.hpp b/src/script/api/script_text.hpp index 27bcca485..112947b29 100644 --- a/src/script/api/script_text.hpp +++ b/src/script/api/script_text.hpp @@ -59,8 +59,11 @@ private: * * If you use parameters in your strings, you will have to define those * parameters, for example like this: - * local text = ScriptText(ScriptText.STR_NEWS); text.AddParam(1); - * This will set the {COMPANY} to the name of Company 1. + * \code local text = ScriptText(ScriptText.STR_NEWS); + * text.AddParam(1); \endcode + * This will set the {COMPANY} to the name of Company 1. Alternatively you + * can directly give those arguments to the ScriptText constructor, like this: + * \code local text = ScriptText(ScriptText.STR_NEWS, 1); \endcode * * @api ai game */ @@ -68,12 +71,20 @@ class ScriptText : public Text , public ZeroedMemoryAllocator { public: static const int SCRIPT_TEXT_MAX_PARAMETERS = 20; ///< The maximum amount of parameters you can give to one object. +#ifndef DOXYGEN_API + /** + * The constructor wrapper from Squirrel. + */ + ScriptText(HSQUIRRELVM vm); +#else /** * Generate a text from string. You can set parameters to the instance which * can be required for the string. * @param string The string of the text. + * @param ... Optional arguments for this string. */ - ScriptText(StringID string); + ScriptText(StringID string, ...); +#endif ~ScriptText(); #ifndef DOXYGEN_API |