diff options
author | zuu <zuu@openttd.org> | 2014-02-06 19:48:19 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2014-02-06 19:48:19 +0000 |
commit | 1dbd59e6ab9a917214d98c53a8ab8ca5b0d47223 (patch) | |
tree | 374556ba750817bdd6899dab980bd46ea6d37110 /src/script/api/script_story_page.hpp | |
parent | 57a88c9de2c68496c36c5646207541a28a3e31cc (diff) | |
download | openttd-1dbd59e6ab9a917214d98c53a8ab8ca5b0d47223.tar.xz |
(svn r26306) -Add: [nogo] More story APIs: RemovePageElement, GetCompany, GetDate, SetDate
Diffstat (limited to 'src/script/api/script_story_page.hpp')
-rw-r--r-- | src/script/api/script_story_page.hpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/script/api/script_story_page.hpp b/src/script/api/script_story_page.hpp index 315cb2104..49d4a639a 100644 --- a/src/script/api/script_story_page.hpp +++ b/src/script/api/script_story_page.hpp @@ -126,7 +126,7 @@ public: * @param story_page_id The story page to get the sort value of. * @return Page sort value. */ - static uint32 GetPageSort(StoryPageID story_page_id); + static uint32 GetPageSortValue(StoryPageID story_page_id); /** * Get story page element sort value. Each page element has a sort value that is internally @@ -137,7 +137,34 @@ public: * @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); + static uint32 GetPageElementSortValue(StoryPageElementID story_page_element_id); + + /** + * Get the company which the page belongs to. If the page is global, + * ScriptCompany::COMPANY_INVALID is returned. + * @param story_page_id The story page to get the company for. + * @return owner company or ScriptCompany::COMPANY_INVALID + * @pre IsValidStoryPage(story_page_id). + */ + static ScriptCompany::CompanyID GetCompany(StoryPageID story_page_id); + + /** + * Get the page date which is displayed at the top of each page. + * @param story_page_id The story page to get the date of. + * @return The date + * @pre IsValidStoryPage(story_page_id). + */ + static int32 GetDate(StoryPageID story_page_id); + + /** + * Update date of a story page. The date is shown in the top left of the page + * @param story_page_id The story page to set the date for. + * @param date Page date (@see ScriptDate) + * @return True if the action succeeded. + * @pre No ScriptCompanyMode may be in scope. + * @pre IsValidStoryPage(story_page_id). + */ + static bool SetDate(StoryPageID story_page_id, int32 date); /** * Update title of a story page. The title is shown in the page selector drop down. @@ -169,6 +196,15 @@ public: * @pre IsValidStoryPage(story_page_id). */ static bool Remove(StoryPageID story_page_id); + + /** + * Removes a story page element. + * @param story_page_element_id The story page element to remove. + * @return True if the action succeeded. + * @pre No ScriptCompanyMode may be in scope. + * @pre IsValidStoryPageElement(story_page_element_id). + */ + static bool RemoveElement(StoryPageElementID story_page_element_id); }; #endif /* SCRIPT_STORY_HPP */ |