Changeset - r26987:4e1f32de7366
[Not reviewed]
master
0 2 0
glx22 - 16 months ago 2023-03-04 18:07:30
glx@openttd.org
Codechange: Use SQInteger for generic numbers in script_storypage
2 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_story_page.cpp
Show inline comments
 
@@ -55,7 +55,7 @@ static inline bool StoryPageElementTypeR
 
	return (ScriptStoryPage::StoryPageID)0;
 
}
 

	
 
/* static */ ScriptStoryPage::StoryPageElementID ScriptStoryPage::NewElement(StoryPageID story_page_id, StoryPageElementType type, uint32 reference, Text *text)
 
/* static */ ScriptStoryPage::StoryPageElementID ScriptStoryPage::NewElement(StoryPageID story_page_id, StoryPageElementType type, SQInteger reference, Text *text)
 
{
 
	CCountedPtr<Text> counter(text);
 

	
 
@@ -101,7 +101,7 @@ static inline bool StoryPageElementTypeR
 
	return (ScriptStoryPage::StoryPageElementID)0;
 
}
 

	
 
/* static */ bool ScriptStoryPage::UpdateElement(StoryPageElementID story_page_element_id, uint32 reference, Text *text)
 
/* static */ bool ScriptStoryPage::UpdateElement(StoryPageElementID story_page_element_id, SQInteger reference, Text *text)
 
{
 
	CCountedPtr<Text> counter(text);
 

	
 
@@ -143,14 +143,14 @@ static inline bool StoryPageElementTypeR
 
	return ScriptObject::Command<CMD_UPDATE_STORY_PAGE_ELEMENT>::Do(reftile, story_page_element_id, refid, encoded_text);
 
}
 

	
 
/* static */ uint32 ScriptStoryPage::GetPageSortValue(StoryPageID story_page_id)
 
/* static */ SQInteger ScriptStoryPage::GetPageSortValue(StoryPageID story_page_id)
 
{
 
	EnforcePrecondition(false, IsValidStoryPage(story_page_id));
 

	
 
	return StoryPage::Get(story_page_id)->sort_value;
 
}
 

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

	
src/script/api/script_story_page.hpp
Show inline comments
 
@@ -207,7 +207,7 @@ public:
 
	 * @pre type != SPET_GOAL || ScriptGoal::IsValidGoal(reference).
 
	 * @pre if type is SPET_GOAL and story_page is a global page, then referenced goal must be global.
 
	 */
 
	static StoryPageElementID NewElement(StoryPageID story_page_id, StoryPageElementType type, uint32 reference, Text *text);
 
	static StoryPageElementID NewElement(StoryPageID story_page_id, StoryPageElementType type, SQInteger reference, Text *text);
 

	
 
	/**
 
	 * Update the content of a page element
 
@@ -222,7 +222,7 @@ public:
 
	 * @pre type != SPET_GOAL || ScriptGoal::IsValidGoal(reference).
 
	 * @pre if type is SPET_GOAL and story_page is a global page, then referenced goal must be global.
 
	 */
 
	static bool UpdateElement(StoryPageElementID story_page_element_id, uint32 reference, Text *text);
 
	static bool UpdateElement(StoryPageElementID story_page_element_id, SQInteger reference, Text *text);
 

	
 
	/**
 
	 * Get story page sort value. Each page has a sort value that is internally assigned and used
 
@@ -232,7 +232,7 @@ public:
 
	 * @param story_page_id The story page to get the sort value of.
 
	 * @return Page sort value.
 
	 */
 
	static uint32 GetPageSortValue(StoryPageID story_page_id);
 
	static SQInteger GetPageSortValue(StoryPageID story_page_id);
 

	
 
	/**
 
	 * Get story page element sort value. Each page element has a sort value that is internally
 
@@ -243,7 +243,7 @@ public:
 
	 * @param story_page_element_id The story page element to get the sort value of.
 
	 * @return Page element sort value.
 
	 */
 
	static uint32 GetPageElementSortValue(StoryPageElementID story_page_element_id);
 
	static SQInteger GetPageElementSortValue(StoryPageElementID story_page_element_id);
 

	
 
	/**
 
	 * Get the company which the page belongs to. If the page is global,
0 comments (0 inline, 0 general)