summaryrefslogtreecommitdiff
path: root/src/script/api/template/template_story_page.hpp.sq
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2020-05-22 22:22:55 +0200
committerGitHub <noreply@github.com>2020-05-22 22:22:55 +0200
commit800ade77021b34adf8daa5ca5de0efaa8df24152 (patch)
tree7a2eb5c73c926476c81cd782bcb9b42c93bafdc4 /src/script/api/template/template_story_page.hpp.sq
parentc972a63c8cbee7fa8d6d5af2cbbecb8c75ee561a (diff)
downloadopenttd-800ade77021b34adf8daa5ca5de0efaa8df24152.tar.xz
Feature: Push-buttons on storybook pages (#7896)
Allow more direct player-initiated interaction for Game Scripts, by letting the GS put push-buttons on storybook pages. These buttons can either trigger an immediate event, or require the player to first select a tile on the map, or a vehicle. Additionally this reworks how the storybook pages are layouted and rendered, to allow for slightly more complex layouts, and maybe speeding drawing up a bit.
Diffstat (limited to 'src/script/api/template/template_story_page.hpp.sq')
-rw-r--r--src/script/api/template/template_story_page.hpp.sq6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/api/template/template_story_page.hpp.sq b/src/script/api/template/template_story_page.hpp.sq
index 106f9a623..f06d53138 100644
--- a/src/script/api/template/template_story_page.hpp.sq
+++ b/src/script/api/template/template_story_page.hpp.sq
@@ -17,6 +17,12 @@ namespace SQConvert {
template <> inline int Return<ScriptStoryPage::StoryPageElementID>(HSQUIRRELVM vm, ScriptStoryPage::StoryPageElementID res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptStoryPage::StoryPageElementType GetParam(ForceType<ScriptStoryPage::StoryPageElementType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptStoryPage::StoryPageElementType)tmp; }
template <> inline int Return<ScriptStoryPage::StoryPageElementType>(HSQUIRRELVM vm, ScriptStoryPage::StoryPageElementType res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> inline ScriptStoryPage::StoryPageButtonFlags GetParam(ForceType<ScriptStoryPage::StoryPageButtonFlags>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptStoryPage::StoryPageButtonFlags)tmp; }
+ template <> inline int Return<ScriptStoryPage::StoryPageButtonFlags>(HSQUIRRELVM vm, ScriptStoryPage::StoryPageButtonFlags res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> inline ScriptStoryPage::StoryPageButtonCursor GetParam(ForceType<ScriptStoryPage::StoryPageButtonCursor>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptStoryPage::StoryPageButtonCursor)tmp; }
+ template <> inline int Return<ScriptStoryPage::StoryPageButtonCursor>(HSQUIRRELVM vm, ScriptStoryPage::StoryPageButtonCursor res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> inline ScriptStoryPage::StoryPageButtonColour GetParam(ForceType<ScriptStoryPage::StoryPageButtonColour>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptStoryPage::StoryPageButtonColour)tmp; }
+ template <> inline int Return<ScriptStoryPage::StoryPageButtonColour>(HSQUIRRELVM vm, ScriptStoryPage::StoryPageButtonColour res) { sq_pushinteger(vm, (int32)res); return 1; }
/* Allow ScriptStoryPage to be used as Squirrel parameter */
template <> inline ScriptStoryPage *GetParam(ForceType<ScriptStoryPage *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptStoryPage *)instance; }