(svn r26305) -Add: [nogo] ScriptStoryPageElementList() - a list of all story page elements for a given page
parent
14d99c6961
commit
57a88c9de2
@ -0,0 +1,25 @@
|
||||
/* $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_storypageelementlist.hpp"
|
||||
#include "../template/template_storypageelementlist.hpp.sq"
|
||||
|
||||
|
||||
template <> const char *GetClassName<ScriptStoryPageElementList, ST_GS>() { return "GSStoryPageElementList"; }
|
||||
|
||||
void SQGSStoryPageElementList_Register(Squirrel *engine)
|
||||
{
|
||||
DefSQClass<ScriptStoryPageElementList, ST_GS> SQGSStoryPageElementList("GSStoryPageElementList");
|
||||
SQGSStoryPageElementList.PreRegister(engine, "GSList");
|
||||
SQGSStoryPageElementList.AddConstructor<void (ScriptStoryPageElementList::*)(ScriptStoryPage::StoryPageID story_page_id), 2>(engine, "xi");
|
||||
|
||||
SQGSStoryPageElementList.PostRegister(engine);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
/** @file script_storypageelementlist.cpp Implementation of ScriptStoryPageElementList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_storypageelementlist.hpp"
|
||||
#include "../../story_base.h"
|
||||
|
||||
ScriptStoryPageElementList::ScriptStoryPageElementList(ScriptStoryPage::StoryPageID story_page_id)
|
||||
{
|
||||
if (!ScriptStoryPage::IsValidStoryPage(story_page_id)) return;
|
||||
|
||||
StoryPageElement *pe;
|
||||
FOR_ALL_STORY_PAGE_ELEMENTS(pe) {
|
||||
if (pe->page == story_page_id) {
|
||||
this->AddItem(pe->index);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/* $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/>.
|
||||
*/
|
||||
|
||||
/** @file script_storypageelementlist.hpp List all story page elements. */
|
||||
|
||||
#ifndef SCRIPT_STORYPAGEELEMENTLIST_HPP
|
||||
#define SCRIPT_STORYPAGEELEMENTLIST_HPP
|
||||
|
||||
#include "script_list.hpp"
|
||||
#include "script_company.hpp"
|
||||
#include "script_story_page.hpp"
|
||||
|
||||
/**
|
||||
* Create a list of all story page elements.
|
||||
* @api game
|
||||
* @ingroup ScriptList
|
||||
*/
|
||||
class ScriptStoryPageElementList : public ScriptList {
|
||||
public:
|
||||
/**
|
||||
* @param story_page_id The page id of the story page of which all page elements should be included in the list.
|
||||
*/
|
||||
ScriptStoryPageElementList(ScriptStoryPage::StoryPageID story_page_id);
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_STORYPAGEELEMENTLIST_HPP */
|
@ -0,0 +1,21 @@
|
||||
/* $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_storypageelementlist.hpp"
|
||||
|
||||
namespace SQConvert {
|
||||
/* Allow ScriptStoryPageElementList to be used as Squirrel parameter */
|
||||
template <> inline ScriptStoryPageElementList *GetParam(ForceType<ScriptStoryPageElementList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptStoryPageElementList *)instance; }
|
||||
template <> inline ScriptStoryPageElementList &GetParam(ForceType<ScriptStoryPageElementList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptStoryPageElementList *)instance; }
|
||||
template <> inline const ScriptStoryPageElementList *GetParam(ForceType<const ScriptStoryPageElementList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptStoryPageElementList *)instance; }
|
||||
template <> inline const ScriptStoryPageElementList &GetParam(ForceType<const ScriptStoryPageElementList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptStoryPageElementList *)instance; }
|
||||
template <> inline int Return<ScriptStoryPageElementList *>(HSQUIRRELVM vm, ScriptStoryPageElementList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "StoryPageElementList", res, NULL, DefSQDestructorCallback<ScriptStoryPageElementList>, true); return 1; }
|
||||
} // namespace SQConvert
|
Loading…
Reference in New Issue