From 8518c50c1911f3e7eb7e05df4501aa80529fa15a Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:10:32 +0100 Subject: [PATCH] fix the `unordered_map` not being correctly readable from lua, update doc --- docs/game_data/spel2.lua | 4 ++-- docs/src/includes/_types.md | 4 ++-- src/game_api/game_manager.hpp | 19 ++++++++++--------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 349311f9e..3a06946ed 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -2365,7 +2365,7 @@ do ---@field trap_info table ---@field trap_part_to_main table @used for stuff like upsidedown_spikes -> spikes, skulldrop skulls -> skulldrop trap etc. ---@field stickers_data table - ---@field get_SaveData fun(self): SaveData @Gets local version of the SaveData + ---@field get_savegame fun(self): SaveData @Gets local version of the SaveData ---@class JournalPageData ---@field page_nr integer @@ -2387,7 +2387,7 @@ do ---@field background_sprite_id integer ---@field killed_by_NA boolean ---@field defeated_NA boolean - ---@field portret_texture TEXTURE + ---@field portrait_texture TEXTURE ---@class JournalTrapData : JournalPageData ---@field texture TEXTURE diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index 4dbbe8d8a..71f8989d3 100644 --- a/docs/src/includes/_types.md +++ b/docs/src/includes/_types.md @@ -1416,7 +1416,7 @@ Type | Name | Description int | [background_sprite_id](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=background_sprite_id) | bool | [killed_by_NA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=killed_by_NA) | bool | [defeated_NA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=defeated_NA) | -[TEXTURE](#TEXTURE) | [portret_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=portret_texture) | +[TEXTURE](#TEXTURE) | [portrait_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=portrait_texture) | ### JournalTrapData @@ -2128,7 +2128,7 @@ map<[ENT_TYPE](#ENT_TYPE), [JournalPageData](#JournalPageData)> | [item_in map<[ENT_TYPE](#ENT_TYPE), [JournalPageData](#JournalPageData)> | [trap_info](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trap_info) | map<[ENT_TYPE](#ENT_TYPE), [ENT_TYPE](#ENT_TYPE)> | [trap_part_to_main](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trap_part_to_main) | used for stuff like upsidedown_spikes -> spikes, skulldrop skulls -> skulldrop trap etc. map<[ENT_TYPE](#ENT_TYPE), [StickersData](#StickersData)> | [stickers_data](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=stickers_data) | -[SaveData](#SaveData) | [get_SaveData()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_SaveData) | Gets local version of the [SaveData](#SaveData) +[SaveData](#SaveData) | [get_savegame()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_savegame) | Gets local version of the [SaveData](#SaveData) ### Screen diff --git a/src/game_api/game_manager.hpp b/src/game_api/game_manager.hpp index de856cd2d..373747dc2 100644 --- a/src/game_api/game_manager.hpp +++ b/src/game_api/game_manager.hpp @@ -5,6 +5,7 @@ #include "aliases.hpp" // for MAX_PLAYERS #include "containers/game_unordered_map.hpp" // for game_unordered_map +#include "containers/identity_hasher.hpp" // for identity_hasher #include "render_api.hpp" // for TextureRenderingInfo #include "sound_manager.hpp" // for BackgroundSound #include "thread_utils.hpp" // for OnHeapPointer @@ -95,18 +96,18 @@ struct SaveRelated ENT_TYPE progress_stickers_powerups[29]; // pre-journal progress setup, maybe gathering from all players or something? /// Scale and offset not used in those pages. Can't add more - game_unordered_map places_data; - game_unordered_map bestiary_data; + game_unordered_map> places_data; + game_unordered_map> bestiary_data; /// used to map stuff like Osiris_Hand -> Osiris_Head, Hundun limbs -> Hundun etc. - game_unordered_map monster_part_to_main; - game_unordered_map people_info; + game_unordered_map> monster_part_to_main; + game_unordered_map> people_info; /// used to map shopkeeper clone to shopkeeper only - game_unordered_map people_part_to_main; - game_unordered_map item_info; - game_unordered_map trap_info; + game_unordered_map> people_part_to_main; + game_unordered_map> item_info; + game_unordered_map> trap_info; /// used for stuff like upsidedown_spikes -> spikes, skulldrop skulls -> skulldrop trap etc. - game_unordered_map trap_part_to_main; - game_unordered_map stickers_data; + game_unordered_map> trap_part_to_main; + game_unordered_map> stickers_data; /// Gets local version of the SaveData SaveData* get_savegame()