summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2012-01-03 20:38:41 +0000
committertruebrain <truebrain@openttd.org>2012-01-03 20:38:41 +0000
commitecb725b34b1b2772c67270a07d7b416c0752e7ce (patch)
treec00126c4ff53ee84339c54ff66ccaa8ef4c1c961 /src
parenta32154eaa00e7beb5e6b52cfc1c21ba1d72607a1 (diff)
downloadopenttd-ecb725b34b1b2772c67270a07d7b416c0752e7ce.tar.xz
(svn r23738) -Fix (r23731): forgot to sync the new window with the script API
Diffstat (limited to 'src')
-rw-r--r--src/script/api/game/game_window.hpp.sq6
-rw-r--r--src/script/api/script_window.hpp17
-rw-r--r--src/script/api/template/template_window.hpp.sq2
-rw-r--r--src/widgets/goal_widget.h2
4 files changed, 26 insertions, 1 deletions
diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq
index 83e40aabd..6b7578a0d 100644
--- a/src/script/api/game/game_window.hpp.sq
+++ b/src/script/api/game/game_window.hpp.sq
@@ -51,6 +51,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_TOOLTIPS, "WC_TOOLTIPS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_QUERY_STRING, "WC_QUERY_STRING");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_CONFIRM_POPUP_QUERY, "WC_CONFIRM_POPUP_QUERY");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WC_GOAL_QUESTION, "WC_GOAL_QUESTION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SAVELOAD, "WC_SAVELOAD");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_LAND_INFO, "WC_LAND_INFO");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_DROPDOWN_MENU, "WC_DROPDOWN_MENU");
@@ -494,6 +495,11 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GP_ABORT, "WID_GP_ABORT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_PANEL, "WID_GL_PANEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_SCROLLBAR, "WID_GL_SCROLLBAR");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GQ_QUESTION, "WID_GQ_QUESTION");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GQ_BUTTONS, "WID_GQ_BUTTONS");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GQ_BUTTON_1, "WID_GQ_BUTTON_1");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GQ_BUTTON_2, "WID_GQ_BUTTON_2");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GQ_BUTTON_3, "WID_GQ_BUTTON_3");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_BACKGROUND, "WID_GL_BACKGROUND");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_FIRST_COMPANY, "WID_GL_FIRST_COMPANY");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GL_LAST_COMPANY, "WID_GL_LAST_COMPANY");
diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp
index e2e1ae319..342a243d1 100644
--- a/src/script/api/script_window.hpp
+++ b/src/script/api/script_window.hpp
@@ -194,6 +194,14 @@ public:
*/
WC_CONFIRM_POPUP_QUERY = ::WC_CONFIRM_POPUP_QUERY,
+ /**
+ * Popup with a set of buttons, designed to ask the user a question
+ * from a GameScript. %Window numbers:
+ * - uniqueid = #GoalQuestionWidgets
+ */
+ WC_GOAL_QUESTION,
+
+
/**
* Saveload window; Window numbers:
@@ -1268,6 +1276,15 @@ public:
WID_GL_SCROLLBAR = ::WID_GL_SCROLLBAR, ///< Scrollbar of the panel.
};
+ /** Widgets of the #GoalQuestionWindow class. */
+ enum GoalQuestionWidgets {
+ WID_GQ_QUESTION = ::WID_GQ_QUESTION, ///< Question text.
+ WID_GQ_BUTTONS = ::WID_GQ_BUTTONS, ///< Buttons selection (between 1, 2 or 3).
+ WID_GQ_BUTTON_1 = ::WID_GQ_BUTTON_1, ///< First button.
+ WID_GQ_BUTTON_2 = ::WID_GQ_BUTTON_2, ///< Second button.
+ WID_GQ_BUTTON_3 = ::WID_GQ_BUTTON_3, ///< Third button.
+ };
+
/** Widgets of the #GraphLegendWindow class. */
enum GraphLegendWidgets {
WID_GL_BACKGROUND = ::WID_GL_BACKGROUND, ///< Background of the window.
diff --git a/src/script/api/template/template_window.hpp.sq b/src/script/api/template/template_window.hpp.sq
index 08c99bc1e..3cb9c1afb 100644
--- a/src/script/api/template/template_window.hpp.sq
+++ b/src/script/api/template/template_window.hpp.sq
@@ -85,6 +85,8 @@ namespace SQConvert {
template <> inline int Return<ScriptWindow::GenerationProgressWidgets>(HSQUIRRELVM vm, ScriptWindow::GenerationProgressWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::GoalListWidgets GetParam(ForceType<ScriptWindow::GoalListWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::GoalListWidgets)tmp; }
template <> inline int Return<ScriptWindow::GoalListWidgets>(HSQUIRRELVM vm, ScriptWindow::GoalListWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> inline ScriptWindow::GoalQuestionWidgets GetParam(ForceType<ScriptWindow::GoalQuestionWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::GoalQuestionWidgets)tmp; }
+ template <> inline int Return<ScriptWindow::GoalQuestionWidgets>(HSQUIRRELVM vm, ScriptWindow::GoalQuestionWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::GraphLegendWidgets GetParam(ForceType<ScriptWindow::GraphLegendWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::GraphLegendWidgets)tmp; }
template <> inline int Return<ScriptWindow::GraphLegendWidgets>(HSQUIRRELVM vm, ScriptWindow::GraphLegendWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::CompanyValueWidgets GetParam(ForceType<ScriptWindow::CompanyValueWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::CompanyValueWidgets)tmp; }
diff --git a/src/widgets/goal_widget.h b/src/widgets/goal_widget.h
index bacdcc55c..20422b1cd 100644
--- a/src/widgets/goal_widget.h
+++ b/src/widgets/goal_widget.h
@@ -22,7 +22,7 @@ enum GoalListWidgets {
/** Widgets of the #GoalQuestionWindow class. */
enum GoalQuestionWidgets {
WID_GQ_QUESTION, ///< Question text.
- WID_GQ_BUTTONS, ///< Buttons selection (between 2 or 3).
+ WID_GQ_BUTTONS, ///< Buttons selection (between 1, 2 or 3).
WID_GQ_BUTTON_1, ///< First button.
WID_GQ_BUTTON_2, ///< Second button.
WID_GQ_BUTTON_3, ///< Third button.