summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/ai_instance.cpp5
-rw-r--r--src/script/api/ai/ai_text.hpp.sq31
-rw-r--r--src/script/api/script_text.hpp2
-rwxr-xr-xsrc/script/api/squirrel_export.sh2
4 files changed, 5 insertions, 35 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index 695a01d8a..cf7106b9c 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -26,6 +26,9 @@
#include "ai_info.hpp"
#include "ai_instance.hpp"
+/* Manually include the Text glue. */
+#include "../script/api/template/template_text.hpp.sq"
+
/* Convert all AI related classes to Squirrel data.
* Note: this line is a marker in squirrel_export.sh. Do not change! */
#include "../script/api/ai/ai_accounting.hpp.sq"
@@ -69,7 +72,6 @@
#include "../script/api/ai/ai_subsidy.hpp.sq"
#include "../script/api/ai/ai_subsidylist.hpp.sq"
#include "../script/api/ai/ai_testmode.hpp.sq"
-#include "../script/api/ai/ai_text.hpp.sq"
#include "../script/api/ai/ai_tile.hpp.sq"
#include "../script/api/ai/ai_tilelist.hpp.sq"
#include "../script/api/ai/ai_town.hpp.sq"
@@ -172,7 +174,6 @@ void AIInstance::RegisterAPI()
SQAISubsidy_Register(this->engine);
SQAISubsidyList_Register(this->engine);
SQAITestMode_Register(this->engine);
- SQAIText_Register(this->engine);
SQAITile_Register(this->engine);
SQAITileList_Register(this->engine);
SQAITileList_IndustryAccepting_Register(this->engine);
diff --git a/src/script/api/ai/ai_text.hpp.sq b/src/script/api/ai/ai_text.hpp.sq
deleted file mode 100644
index 39f3ac792..000000000
--- a/src/script/api/ai/ai_text.hpp.sq
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-
-/*
- * This file is part of OpenTTD.
- * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
- * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-
-#include "../script_text.hpp"
-#include "../template/template_text.hpp.sq"
-
-
-template <> const char *GetClassName<ScriptText, ST_AI>() { return "AIText"; }
-
-void SQAIText_Register(Squirrel *engine)
-{
- DefSQClass<ScriptText, ST_AI> SQAIText("AIText");
- SQAIText.PreRegister(engine);
- SQAIText.AddSQAdvancedConstructor(engine);
-
- SQAIText.DefSQConst(engine, ScriptText::SCRIPT_TEXT_MAX_PARAMETERS, "SCRIPT_TEXT_MAX_PARAMETERS");
-
- SQAIText.DefSQAdvancedMethod(engine, &ScriptText::_set, "_set");
- SQAIText.DefSQAdvancedMethod(engine, &ScriptText::SetParam, "SetParam");
- SQAIText.DefSQAdvancedMethod(engine, &ScriptText::AddParam, "AddParam");
-
- SQAIText.PostRegister(engine);
-}
diff --git a/src/script/api/script_text.hpp b/src/script/api/script_text.hpp
index 112947b29..cd2bca45f 100644
--- a/src/script/api/script_text.hpp
+++ b/src/script/api/script_text.hpp
@@ -65,7 +65,7 @@ private:
* can directly give those arguments to the ScriptText constructor, like this:
* \code local text = ScriptText(ScriptText.STR_NEWS, 1); \endcode
*
- * @api ai game
+ * @api game
*/
class ScriptText : public Text , public ZeroedMemoryAllocator {
public:
diff --git a/src/script/api/squirrel_export.sh b/src/script/api/squirrel_export.sh
index fb8e5bb8b..92bd434b9 100755
--- a/src/script/api/squirrel_export.sh
+++ b/src/script/api/squirrel_export.sh
@@ -106,7 +106,7 @@ functions=``
echo "
{ }
-/.hpp.sq/ { next }
+/.hpp.sq/ { if (match(\$0, \"template\")) print \$0; next }
/SQ${apiuc}Controller_Register/ { print \$0; next }
/SQ${apiuc}.*_Register/ { next }