(svn r26304) -Fix (26303): Forgot to add new files

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
zuu 11 years ago
parent 5165be2698
commit 14d99c6961

@ -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_storypagelist.hpp"
#include "../template/template_storypagelist.hpp.sq"
template <> const char *GetClassName<ScriptStoryPageList, ST_GS>() { return "GSStoryPageList"; }
void SQGSStoryPageList_Register(Squirrel *engine)
{
DefSQClass<ScriptStoryPageList, ST_GS> SQGSStoryPageList("GSStoryPageList");
SQGSStoryPageList.PreRegister(engine, "GSList");
SQGSStoryPageList.AddConstructor<void (ScriptStoryPageList::*)(ScriptCompany::CompanyID company), 2>(engine, "xi");
SQGSStoryPageList.PostRegister(engine);
}

@ -0,0 +1,28 @@
/* $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_storypagelist.cpp Implementation of ScriptStoryPageList and friends. */
#include "../../stdafx.h"
#include "script_storypagelist.hpp"
#include "script_story_page.hpp"
#include "../../story_base.h"
ScriptStoryPageList::ScriptStoryPageList(ScriptCompany::CompanyID company)
{
uint8 c = company;
if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY;
StoryPage *p;
FOR_ALL_STORY_PAGES(p) {
if (p->company == c || p->company == INVALID_COMPANY) {
this->AddItem(p->index);
}
}
}

@ -0,0 +1,31 @@
/* $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_storypagelist.hpp List all story pages. */
#ifndef SCRIPT_STORYPAGELIST_HPP
#define SCRIPT_STORYPAGELIST_HPP
#include "script_list.hpp"
#include "script_company.hpp"
/**
* Create a list of all story pages.
* @api game
* @ingroup ScriptList
*/
class ScriptStoryPageList : public ScriptList {
public:
/**
* @param company The company to list story pages for, or ScriptCompany::COMPANY_INVALID to only show global pages. Global pages are always included independent of this parameter.
*/
ScriptStoryPageList(ScriptCompany::CompanyID company);
};
#endif /* SCRIPT_STORYPAGELIST_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_storypagelist.hpp"
namespace SQConvert {
/* Allow ScriptStoryPageList to be used as Squirrel parameter */
template <> inline ScriptStoryPageList *GetParam(ForceType<ScriptStoryPageList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptStoryPageList *)instance; }
template <> inline ScriptStoryPageList &GetParam(ForceType<ScriptStoryPageList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptStoryPageList *)instance; }
template <> inline const ScriptStoryPageList *GetParam(ForceType<const ScriptStoryPageList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptStoryPageList *)instance; }
template <> inline const ScriptStoryPageList &GetParam(ForceType<const ScriptStoryPageList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptStoryPageList *)instance; }
template <> inline int Return<ScriptStoryPageList *>(HSQUIRRELVM vm, ScriptStoryPageList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "StoryPageList", res, NULL, DefSQDestructorCallback<ScriptStoryPageList>, true); return 1; }
} // namespace SQConvert
Loading…
Cancel
Save