diff options
author | zuu <zuu@openttd.org> | 2013-07-21 13:18:45 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-07-21 13:18:45 +0000 |
commit | 09897c5fd68668c148859314f5e6a1f64dd4634b (patch) | |
tree | e9f32e20509dcef2ee790c00b5189f978b5bff4c /src/story_base.h | |
parent | 5eb8f0a0bb8fcebeb5605346508d76f1a9cd1044 (diff) | |
download | openttd-09897c5fd68668c148859314f5e6a1f64dd4634b.tar.xz |
(svn r25620) -Fix (r25342): Save/load of story books were broken
Diffstat (limited to 'src/story_base.h')
-rw-r--r-- | src/story_base.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/story_base.h b/src/story_base.h index edb89db7a..d295671f1 100644 --- a/src/story_base.h +++ b/src/story_base.h @@ -28,11 +28,17 @@ extern uint32 _story_page_next_sort_value; * Each story page element is one of these types. */ enum StoryPageElementType { - SPET_TEXT, ///< A text element. + SPET_TEXT = 0, ///< A text element. SPET_LOCATION, ///< An element that references a tile along with a one-line text. SPET_GOAL, ///< An element that references a goal. + SPET_END, + INVALID_SPET = 0xFF, }; +/** Define basic enum properties */ +template <> struct EnumPropsT<StoryPageElementType> : MakeEnumPropsT<StoryPageElementType, byte, SPET_TEXT, SPET_END, INVALID_SPET, 8> {}; +typedef TinyEnumT<StoryPageElementType> StoryPageElementTypeByte; ///< typedefing-enumification of Direction + /** * Struct about story page elements. * Each StoryPage is composed of one or more page elements that provide @@ -40,8 +46,8 @@ enum StoryPageElementType { **/ struct StoryPageElement : StoryPageElementPool::PoolItem<&_story_page_element_pool> { uint32 sort_value; ///< A number that increases for every created story page element. Used for sorting. The id of a story page element is the pool index. - uint16 page; ///< Id of the page which the page element belongs to - StoryPageElementType type; ///< Type of page element + StoryPageID page; ///< Id of the page which the page element belongs to + StoryPageElementTypeByte type; ///< Type of page element uint32 referenced_id; ///< Id of referenced object (location, goal etc.) char *text; ///< Static content text of page element |