summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2014-05-24 19:11:20 +0000
committeralberth <alberth@openttd.org>2014-05-24 19:11:20 +0000
commit8755c26793e9ba8f49cef7303e7b7517c69231e9 (patch)
tree4bf06669668ce8c3e1aff6fb8f422caa193c69c1 /src/script
parent8e87ae9120351bb9c9135328b57f5034be028b58 (diff)
downloadopenttd-8755c26793e9ba8f49cef7303e7b7517c69231e9.tar.xz
(svn r26610) -Feature: Select an editable preset name for saving.
Diffstat (limited to 'src/script')
-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
3 files changed, 24 insertions, 1 deletions
diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq
index 52e570ef0..ef8f3da42 100644
--- a/src/script/api/game/game_window.hpp.sq
+++ b/src/script/api/game/game_window.hpp.sq
@@ -137,6 +137,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_NEWGRF_INSPECT, "WC_NEWGRF_INSPECT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SPRITE_ALIGNER, "WC_SPRITE_ALIGNER");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_LINKGRAPH_LEGEND, "WC_LINKGRAPH_LEGEND");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SAVE_PRESET, "WC_SAVE_PRESET");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_INVALID, "WC_INVALID");
SQGSWindow.DefSQConst(engine, ScriptWindow::TC_BLUE, "TC_BLUE");
SQGSWindow.DefSQConst(engine, ScriptWindow::TC_SILVER, "TC_SILVER");
@@ -806,6 +807,11 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NS_CONTENT_DOWNLOAD2, "WID_NS_CONTENT_DOWNLOAD2");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NS_SHOW_REMOVE, "WID_NS_SHOW_REMOVE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NS_SHOW_APPLY, "WID_NS_SHOW_APPLY");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SVP_PRESET_LIST, "WID_SVP_PRESET_LIST");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SVP_SCROLLBAR, "WID_SVP_SCROLLBAR");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SVP_EDITBOX, "WID_SVP_EDITBOX");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SVP_CANCEL, "WID_SVP_CANCEL");
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SVP_SAVE, "WID_SVP_SAVE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SP_PROGRESS_BAR, "WID_SP_PROGRESS_BAR");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SP_PROGRESS_TEXT, "WID_SP_PROGRESS_TEXT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_N_PANEL, "WID_N_PANEL");
diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp
index 28db09859..21cf28f7a 100644
--- a/src/script/api/script_window.hpp
+++ b/src/script/api/script_window.hpp
@@ -753,11 +753,17 @@ public:
WC_SPRITE_ALIGNER = ::WC_SPRITE_ALIGNER,
/**
- * Linkgraph legend; Window numbers:
+ * Linkgraph legend; %Window numbers:
* - 0 = #LinkGraphWidgets
*/
WC_LINKGRAPH_LEGEND = ::WC_LINKGRAPH_LEGEND,
+ /**
+ * Save preset; %Window numbers:
+ * - 0 = #SavePresetWidgets
+ */
+ WC_SAVE_PRESET = ::WC_SAVE_PRESET,
+
WC_INVALID = ::WC_INVALID, ///< Invalid window.
};
@@ -1835,6 +1841,15 @@ public:
WID_NS_SHOW_APPLY = ::WID_NS_SHOW_APPLY, ///< Select display of the buttons below the 'details'.
};
+ /** Widgets of the #SavePresetWindow class. */
+ enum SavePresetWidgets {
+ WID_SVP_PRESET_LIST = ::WID_SVP_PRESET_LIST, ///< List with available preset names.
+ WID_SVP_SCROLLBAR = ::WID_SVP_SCROLLBAR, ///< Scrollbar for the list available preset names.
+ WID_SVP_EDITBOX = ::WID_SVP_EDITBOX, ///< Edit box for changing the preset name.
+ WID_SVP_CANCEL = ::WID_SVP_CANCEL, ///< Button to cancel saving the preset.
+ WID_SVP_SAVE = ::WID_SVP_SAVE, ///< Button to save the preset.
+ };
+
/** Widgets of the #ScanProgressWindow class. */
enum ScanProgressWidgets {
WID_SP_PROGRESS_BAR = ::WID_SP_PROGRESS_BAR, ///< Simple progress bar.
diff --git a/src/script/api/template/template_window.hpp.sq b/src/script/api/template/template_window.hpp.sq
index 9f01e42d5..a21a75ab8 100644
--- a/src/script/api/template/template_window.hpp.sq
+++ b/src/script/api/template/template_window.hpp.sq
@@ -161,6 +161,8 @@ namespace SQConvert {
template <> inline int Return<ScriptWindow::NewGRFParametersWidgets>(HSQUIRRELVM vm, ScriptWindow::NewGRFParametersWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::NewGRFStateWidgets GetParam(ForceType<ScriptWindow::NewGRFStateWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::NewGRFStateWidgets)tmp; }
template <> inline int Return<ScriptWindow::NewGRFStateWidgets>(HSQUIRRELVM vm, ScriptWindow::NewGRFStateWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> inline ScriptWindow::SavePresetWidgets GetParam(ForceType<ScriptWindow::SavePresetWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::SavePresetWidgets)tmp; }
+ template <> inline int Return<ScriptWindow::SavePresetWidgets>(HSQUIRRELVM vm, ScriptWindow::SavePresetWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::ScanProgressWidgets GetParam(ForceType<ScriptWindow::ScanProgressWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::ScanProgressWidgets)tmp; }
template <> inline int Return<ScriptWindow::ScanProgressWidgets>(HSQUIRRELVM vm, ScriptWindow::ScanProgressWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::NewsWidgets GetParam(ForceType<ScriptWindow::NewsWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::NewsWidgets)tmp; }