Changeset - r21217:433ac9b65f88
[Not reviewed]
projects/openttd_vs100.vcxproj
Show inline comments
 
@@ -1037,6 +1037,7 @@
 
    <ClInclude Include="..\src\script\api\script_stationlist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_story_page.hpp" />
 
    <ClInclude Include="..\src\script\api\script_storypagelist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_storypageelementlist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_subsidy.hpp" />
 
    <ClInclude Include="..\src\script\api\script_subsidylist.hpp" />
 
    <ClInclude Include="..\src\script\api\script_testmode.hpp" />
 
@@ -1100,6 +1101,7 @@
 
    <ClCompile Include="..\src\script\api\script_stationlist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_story_page.cpp" />
 
    <ClCompile Include="..\src\script\api\script_storypagelist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_storypageelementlist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_subsidy.cpp" />
 
    <ClCompile Include="..\src\script\api\script_subsidylist.cpp" />
 
    <ClCompile Include="..\src\script\api\script_testmode.cpp" />
projects/openttd_vs100.vcxproj.filters
Show inline comments
 
@@ -2340,6 +2340,9 @@
 
    <ClInclude Include="..\src\script\api\script_storypagelist.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_storypageelementlist.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
    <ClInclude Include="..\src\script\api\script_subsidy.hpp">
 
      <Filter>Script API</Filter>
 
    </ClInclude>
 
@@ -2529,6 +2532,9 @@
 
    <ClCompile Include="..\src\script\api\script_storypagelist.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_storypageelementlist.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
 
    <ClCompile Include="..\src\script\api\script_subsidy.cpp">
 
      <Filter>Script API Implementation</Filter>
 
    </ClCompile>
projects/openttd_vs80.vcproj
Show inline comments
 
@@ -3483,6 +3483,10 @@
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_storypageelementlist.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_subsidy.hpp"
 
				>
 
			</File>
 
@@ -3739,6 +3743,10 @@
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_storypageelementlist.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_subsidy.cpp"
 
				>
 
			</File>
projects/openttd_vs90.sln
Show inline comments
 
@@ -35,12 +35,10 @@ Global
 
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|Win32.ActiveCfg = Debug|Win32
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|Win32.Build.0 = Debug|Win32
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|x64.ActiveCfg = Debug|x64
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|x64.Build.0 = Debug|x64
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|x64.ActiveCfg = Debug|Win32
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Release|Win32.ActiveCfg = Release|Win32
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Release|Win32.Build.0 = Release|Win32
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.ActiveCfg = Release|x64
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.Build.0 = Release|x64
 
		{668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.ActiveCfg = Release|Win32
 
		{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug|Win32.ActiveCfg = Debug|Win32
 
		{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug|Win32.Build.0 = Debug|Win32
 
		{A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug|x64.ActiveCfg = Debug|Win32
projects/openttd_vs90.vcproj
Show inline comments
 
@@ -3480,6 +3480,10 @@
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_storypageelementlist.hpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_subsidy.hpp"
 
				>
 
			</File>
 
@@ -3736,6 +3740,10 @@
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_storypageelementlist.cpp"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\script\api\script_subsidy.cpp"
 
				>
 
			</File>
source.list
Show inline comments
 
@@ -817,6 +817,7 @@ script/api/script_station.hpp
 
script/api/script_stationlist.hpp
 
script/api/script_story_page.hpp
 
script/api/script_storypagelist.hpp
 
script/api/script_storypageelementlist.hpp
 
script/api/script_subsidy.hpp
 
script/api/script_subsidylist.hpp
 
script/api/script_testmode.hpp
 
@@ -882,6 +883,7 @@ script/api/script_station.cpp
 
script/api/script_stationlist.cpp
 
script/api/script_story_page.cpp
 
script/api/script_storypagelist.cpp
 
script/api/script_storypageelementlist.cpp
 
script/api/script_subsidy.cpp
 
script/api/script_subsidylist.cpp
 
script/api/script_testmode.cpp
src/game/game_instance.cpp
Show inline comments
 
@@ -67,6 +67,7 @@
 
#include "../script/api/game/game_station.hpp.sq"
 
#include "../script/api/game/game_stationlist.hpp.sq"
 
#include "../script/api/game/game_story_page.hpp.sq"
 
#include "../script/api/game/game_storypageelementlist.hpp.sq"
 
#include "../script/api/game/game_storypagelist.hpp.sq"
 
#include "../script/api/game/game_subsidy.hpp.sq"
 
#include "../script/api/game/game_subsidylist.hpp.sq"
 
@@ -172,6 +173,7 @@ void GameInstance::RegisterAPI()
 
	SQGSStationList_Register(this->engine);
 
	SQGSStationList_Vehicle_Register(this->engine);
 
	SQGSStoryPage_Register(this->engine);
 
	SQGSStoryPageElementList_Register(this->engine);
 
	SQGSStoryPageList_Register(this->engine);
 
	SQGSSubsidy_Register(this->engine);
 
	SQGSSubsidyList_Register(this->engine);
src/script/api/game/game_story_page.hpp.sq
Show inline comments
 
@@ -33,6 +33,7 @@ void SQGSStoryPage_Register(Squirrel *en
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::NewElement,              "NewElement",              5, ".iii.");
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::UpdateElement,           "UpdateElement",           4, ".ii.");
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::GetPageSort,             "GetPageSort",             2, ".i");
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::GetPageElementSort,      "GetPageElementSort",      2, ".i");
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::SetTitle,                "SetTitle",                3, ".i.");
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::Show,                    "Show",                    2, ".i");
 
	SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::Remove,                  "Remove",                  2, ".i");
src/script/api/game/game_storypageelementlist.hpp.sq
Show inline comments
 
new file 100644
 
/* $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);
 
}
src/script/api/game_changelog.hpp
Show inline comments
 
@@ -29,6 +29,7 @@
 
 * \li GSStation::HasCargoRating
 
 * \li GSStoryPage
 
 * \li GSStoryPageList
 
 * \li GSStoryPageElementList
 
 * \li GSTile::GetTerrainType
 
 * \li GSTown::FoundTown
 
 * \li GSTown::GetFundBuildingsDuration
src/script/api/script_story_page.cpp
Show inline comments
 
@@ -105,6 +105,13 @@
 
	return StoryPage::Get(story_page_id)->sort_value;
 
}
 

	
 
/* static */ uint32 ScriptStoryPage::GetPageElementSort(StoryPageElementID story_page_element_id)
 
{
 
	EnforcePrecondition(false, IsValidStoryPageElement(story_page_element_id));
 

	
 
	return StoryPageElement::Get(story_page_element_id)->sort_value;
 
}
 

	
 
/* static */ bool ScriptStoryPage::SetTitle(StoryPageID story_page_id, Text *title)
 
{
 
	CCountedPtr<Text> counter(title);
src/script/api/script_story_page.hpp
Show inline comments
 
@@ -129,6 +129,17 @@ public:
 
	static uint32 GetPageSort(StoryPageID story_page_id);
 

	
 
	/**
 
	 * Get story page element sort value. Each page element has a sort value that is internally
 
	 * assigned and used to sort the page elements within a page of the story book. OpenTTD
 
	 * maintains this number so that the sort order is perceived. This API exist only so that
 
	 * you can sort ScriptStoryPageList the same order as in GUI. You should not use this number
 
	 * for anything else.
 
	 * @param story_page_element_id The story page element to get the sort value of.
 
	 * @return Page element sort value.
 
	 */
 
	static uint32 GetPageElementSort(StoryPageElementID story_page_element_id);
 

	
 
	/**
 
	 * Update title of a story page. The title is shown in the page selector drop down.
 
	 * @param story_page_id The story page to update.
 
	 * @param title Page title (can be either a raw string, a ScriptText object, or null).
src/script/api/script_storypageelementlist.cpp
Show inline comments
 
new file 100644
 
/* $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);
 
		}
 
	}
 
}
src/script/api/script_storypageelementlist.hpp
Show inline comments
 
new file 100644
 
/* $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 */
src/script/api/template/template_storypageelementlist.hpp.sq
Show inline comments
 
new file 100644
 
/* $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
0 comments (0 inline, 0 general)