summaryrefslogtreecommitdiff
path: root/src/script/api/script_text.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-12-21 14:55:28 +0000
committeryexo <yexo@openttd.org>2011-12-21 14:55:28 +0000
commit5988659eea20d3e84fdeadf448133e9b94e9630f (patch)
tree230c16eadf35e9868a3acf6d91b1b73ae412897d /src/script/api/script_text.hpp
parenta55478aaa6453d62f9708ee03393711b2d3120ee (diff)
downloadopenttd-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.hpp17
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