Mercurial > hg > openttd
changeset 18889:3142bbe78f50 draft
(svn r23738) -Fix (r23731): forgot to sync the new window with the script API
author | truebrain <truebrain@openttd.org> |
---|---|
date | Tue, 03 Jan 2012 20:38:41 +0000 |
parents | 83d5d5d0f5c7 |
children | a6de7ed28fda |
files | src/script/api/game/game_window.hpp.sq src/script/api/script_window.hpp src/script/api/template/template_window.hpp.sq src/widgets/goal_widget.h |
diffstat | 4 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/script/api/game/game_window.hpp.sq +++ b/src/script/api/game/game_window.hpp.sq @@ -51,6 +51,7 @@ 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 @@ 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");
--- a/src/script/api/script_window.hpp +++ b/src/script/api/script_window.hpp @@ -194,6 +194,14 @@ */ 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 @@ 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.
--- a/src/script/api/template/template_window.hpp.sq +++ b/src/script/api/template/template_window.hpp.sq @@ -85,6 +85,8 @@ 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; }
--- a/src/widgets/goal_widget.h +++ b/src/widgets/goal_widget.h @@ -22,7 +22,7 @@ /** 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.