mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r26303) -Add: [nogo] ScriptStoryPageList() - a list of all story pages
This commit is contained in:
parent
ebcc8462b7
commit
5165be2698
|
@ -1036,6 +1036,7 @@
|
|||
<ClInclude Include="..\src\script\api\script_station.hpp" />
|
||||
<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_subsidy.hpp" />
|
||||
<ClInclude Include="..\src\script\api\script_subsidylist.hpp" />
|
||||
<ClInclude Include="..\src\script\api\script_testmode.hpp" />
|
||||
|
@ -1098,6 +1099,7 @@
|
|||
<ClCompile Include="..\src\script\api\script_station.cpp" />
|
||||
<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_subsidy.cpp" />
|
||||
<ClCompile Include="..\src\script\api\script_subsidylist.cpp" />
|
||||
<ClCompile Include="..\src\script\api\script_testmode.cpp" />
|
||||
|
|
|
@ -2337,6 +2337,9 @@
|
|||
<ClInclude Include="..\src\script\api\script_story_page.hpp">
|
||||
<Filter>Script API</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\script\api\script_storypagelist.hpp">
|
||||
<Filter>Script API</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\script\api\script_subsidy.hpp">
|
||||
<Filter>Script API</Filter>
|
||||
</ClInclude>
|
||||
|
@ -2523,6 +2526,9 @@
|
|||
<ClCompile Include="..\src\script\api\script_story_page.cpp">
|
||||
<Filter>Script API Implementation</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\script\api\script_storypagelist.cpp">
|
||||
<Filter>Script API Implementation</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\script\api\script_subsidy.cpp">
|
||||
<Filter>Script API Implementation</Filter>
|
||||
</ClCompile>
|
||||
|
|
|
@ -3478,6 +3478,10 @@
|
|||
RelativePath=".\..\src\script\api\script_story_page.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_storypagelist.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_subsidy.hpp"
|
||||
>
|
||||
|
@ -3730,6 +3734,10 @@
|
|||
RelativePath=".\..\src\script\api\script_story_page.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_storypagelist.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_subsidy.cpp"
|
||||
>
|
||||
|
|
|
@ -3475,6 +3475,10 @@
|
|||
RelativePath=".\..\src\script\api\script_story_page.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_storypagelist.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_subsidy.hpp"
|
||||
>
|
||||
|
@ -3727,6 +3731,10 @@
|
|||
RelativePath=".\..\src\script\api\script_story_page.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_storypagelist.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\script\api\script_subsidy.cpp"
|
||||
>
|
||||
|
|
|
@ -816,6 +816,7 @@ script/api/script_signlist.hpp
|
|||
script/api/script_station.hpp
|
||||
script/api/script_stationlist.hpp
|
||||
script/api/script_story_page.hpp
|
||||
script/api/script_storypagelist.hpp
|
||||
script/api/script_subsidy.hpp
|
||||
script/api/script_subsidylist.hpp
|
||||
script/api/script_testmode.hpp
|
||||
|
@ -880,6 +881,7 @@ script/api/script_signlist.cpp
|
|||
script/api/script_station.cpp
|
||||
script/api/script_stationlist.cpp
|
||||
script/api/script_story_page.cpp
|
||||
script/api/script_storypagelist.cpp
|
||||
script/api/script_subsidy.cpp
|
||||
script/api/script_subsidylist.cpp
|
||||
script/api/script_testmode.cpp
|
||||
|
|
|
@ -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_storypagelist.hpp.sq"
|
||||
#include "../script/api/game/game_subsidy.hpp.sq"
|
||||
#include "../script/api/game/game_subsidylist.hpp.sq"
|
||||
#include "../script/api/game/game_testmode.hpp.sq"
|
||||
|
@ -171,6 +172,7 @@ void GameInstance::RegisterAPI()
|
|||
SQGSStationList_Register(this->engine);
|
||||
SQGSStationList_Vehicle_Register(this->engine);
|
||||
SQGSStoryPage_Register(this->engine);
|
||||
SQGSStoryPageList_Register(this->engine);
|
||||
SQGSSubsidy_Register(this->engine);
|
||||
SQGSSubsidyList_Register(this->engine);
|
||||
SQGSTestMode_Register(this->engine);
|
||||
|
|
|
@ -32,6 +32,7 @@ void SQGSStoryPage_Register(Squirrel *engine)
|
|||
SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::New, "New", 3, ".i.");
|
||||
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::SetTitle, "SetTitle", 3, ".i.");
|
||||
SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::Show, "Show", 2, ".i");
|
||||
SQGSStoryPage.DefSQStaticMethod(engine, &ScriptStoryPage::Remove, "Remove", 2, ".i");
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
* \li GSGoal::SetText
|
||||
* \li GSStation::HasCargoRating
|
||||
* \li GSStoryPage
|
||||
* \li GSStoryPageList
|
||||
* \li GSTile::GetTerrainType
|
||||
* \li GSTown::FoundTown
|
||||
* \li GSTown::GetFundBuildingsDuration
|
||||
|
|
|
@ -98,6 +98,13 @@
|
|||
type == ::SPET_TEXT || type == ::SPET_LOCATION ? text->GetEncodedText() : NULL);
|
||||
}
|
||||
|
||||
/* static */ uint32 ScriptStoryPage::GetPageSort(StoryPageID story_page_id)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidStoryPage(story_page_id));
|
||||
|
||||
return StoryPage::Get(story_page_id)->sort_value;
|
||||
}
|
||||
|
||||
/* static */ bool ScriptStoryPage::SetTitle(StoryPageID story_page_id, Text *title)
|
||||
{
|
||||
CCountedPtr<Text> counter(title);
|
||||
|
|
|
@ -118,6 +118,16 @@ public:
|
|||
*/
|
||||
static bool UpdateElement(StoryPageElementID story_page_element_id, uint32 reference, Text *text);
|
||||
|
||||
/**
|
||||
* Get story page sort value. Each page has a sort value that is internally assigned and used
|
||||
* to sort the pages in 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_id The story page to get the sort value of.
|
||||
* @return Page sort value.
|
||||
*/
|
||||
static uint32 GetPageSort(StoryPageID story_page_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.
|
||||
|
|
Loading…
Reference in New Issue