diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 2300fd9db..8bbb52b05 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -1761,6 +1761,23 @@ do ---@field breath_cooldown integer ---@field punish_ball boolean +---@class JournalProgressStickerSlot + ---@field theme integer + ---@field grid_position integer + ---@field entity_type ENT_TYPE + ---@field x number + ---@field y number + ---@field angle number + +---@class JournalProgressStainSlot + ---@field x number + ---@field y number + ---@field angle number + ---@field scale number + ---@field texture_column integer + ---@field texture_row integer + ---@field texture_range integer + ---@class SelectPlayerSlot ---@field activated boolean ---@field character ENT_TYPE @@ -1896,6 +1913,12 @@ do ---@field storage_uid integer @entity uid of the first floor_storage entity ---@field waddler_storage ENT_TYPE[] @size: 99 ---@field waddler_metadata integer[] @size: 99 + ---@field journal_progress_sticker_count integer + ---@field journal_progress_sticker_slots JournalProgressStickerSlot[] @size: 40 @stickers for notable items and entities in journal progress page + ---@field journal_progress_stain_count integer + ---@field journal_progress_stain_slots JournalProgressStainSlot[] @size: 30 @blood splats and paw prints in journal progress page + ---@field journal_progress_theme_count integer + ---@field journal_progress_theme_slots integer[] @size: 9 @visited themes in journal progress page ---@field theme_info ThemeInfo @Points to the current ThemeInfo ---@field logic LogicList @Level logic like dice game and cutscenes ---@field liquid LiquidPhysics diff --git a/docs/generate.py b/docs/generate.py index 39776fe62..86b20adb8 100644 --- a/docs/generate.py +++ b/docs/generate.py @@ -592,6 +592,8 @@ def print_lf(lf): "Camera", "QuestsInfo", "PlayerSlot", + "JournalProgressStickerSlot", + "JournalProgressStainSlot" ] ): cat = "State types" diff --git a/docs/src/includes/_enums.md b/docs/src/includes/_enums.md index 88c3d6662..b4464ff8f 100644 --- a/docs/src/includes/_enums.md +++ b/docs/src/includes/_enums.md @@ -379,7 +379,7 @@ Name | Data | Description Name | Data | Description ---- | ---- | ----------- -[DAMSEL_STYLE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=GAME_SETTING.DAMSEL_STYLE) | 0 | +[WINDOW_SCALE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=GAME_SETTING.WINDOW_SCALE) | 0 | ...check [game_settings.txt](game_data/game_settings.txt)... | | [CROSSPROGRESS_AUTOSYNC](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=GAME_SETTING.CROSSPROGRESS_AUTOSYNC) | 47 | diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index 7c7ebbf45..8ea2f3c21 100644 --- a/docs/src/includes/_types.md +++ b/docs/src/includes/_types.md @@ -2423,6 +2423,33 @@ int | [leader](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=leader) array<[Inventory](#Inventory), MAX_PLAYERS> | [player_inventory](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=player_inventory) | array<[SelectPlayerSlot](#SelectPlayerSlot), MAX_PLAYERS> | [player_select](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=player_select) | +### JournalProgressStainSlot + +Used in [StateMemory](#StateMemory) + +Type | Name | Description +---- | ---- | ----------- +float | [x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=x) | +float | [y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=y) | +float | [angle](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=angle) | +float | [scale](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=scale) | +int | [texture_column](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=texture_column) | +int | [texture_row](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=texture_row) | +int | [texture_range](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=texture_range) | + +### JournalProgressStickerSlot + +Used in [StateMemory](#StateMemory) + +Type | Name | Description +---- | ---- | ----------- +int | [theme](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=theme) | +int | [grid_position](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=grid_position) | +[ENT_TYPE](#ENT_TYPE) | [entity_type](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=entity_type) | +float | [x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=x) | +float | [y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=y) | +float | [angle](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=angle) | + ### PlayerSlot @@ -2570,6 +2597,12 @@ int | [time_startup](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ti int | [storage_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=storage_uid) | entity uid of the first floor_storage entity array<[ENT_TYPE](#ENT_TYPE), 99> | [waddler_storage](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=waddler_storage) | array<int, 99> | [waddler_metadata](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=waddler_metadata) | +int | [journal_progress_sticker_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=journal_progress_sticker_count) | +array<[JournalProgressStickerSlot](#JournalProgressStickerSlot), 40> | [journal_progress_sticker_slots](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=journal_progress_sticker_slots) | stickers for notable items and entities in journal progress page +int | [journal_progress_stain_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=journal_progress_stain_count) | +array<[JournalProgressStainSlot](#JournalProgressStainSlot), 30> | [journal_progress_stain_slots](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=journal_progress_stain_slots) | blood splats and paw prints in journal progress page +int | [journal_progress_theme_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=journal_progress_theme_count) | +array<int, 9> | [journal_progress_theme_slots](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=journal_progress_theme_slots) | visited themes in journal progress page [ThemeInfo](#ThemeInfo) | [theme_info](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=theme_info) | Points to the current [ThemeInfo](#ThemeInfo) [LogicList](#LogicList) | [logic](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=logic) | Level logic like dice game and cutscenes [LiquidPhysics](#LiquidPhysics) | [liquid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=liquid) | diff --git a/src/game_api/script/lua_vm.cpp b/src/game_api/script/lua_vm.cpp index abf418209..67d1dc92f 100644 --- a/src/game_api/script/lua_vm.cpp +++ b/src/game_api/script/lua_vm.cpp @@ -2468,7 +2468,7 @@ end /// Paramater to get_setting (and set_setting in unsafe mode) lua.create_named_table("GAME_SETTING" - //, "DAMSEL_STYLE", 0 + //, "WINDOW_SCALE", 0 //, "", ...check__[game_settings.txt]\[game_data/game_settings.txt\]... //, "CROSSPROGRESS_AUTOSYNC", 47 ); diff --git a/src/game_api/script/usertypes/state_lua.cpp b/src/game_api/script/usertypes/state_lua.cpp index c98a86385..b2cc8de25 100644 --- a/src/game_api/script/usertypes/state_lua.cpp +++ b/src/game_api/script/usertypes/state_lua.cpp @@ -156,6 +156,40 @@ void register_usertypes(sol::state& lua) arenastate_type["breath_cooldown"] = &ArenaState::breath_cooldown; arenastate_type["punish_ball"] = &ArenaState::punish_ball; + /// Used in StateMemory + lua.new_usertype( + "JournalProgressStickerSlot", + "theme", + &JournalProgressStickerSlot::theme, + "grid_position", + &JournalProgressStickerSlot::grid_position, + "entity_type", + &JournalProgressStickerSlot::entity_type, + "x", + &JournalProgressStickerSlot::x, + "y", + &JournalProgressStickerSlot::y, + "angle", + &JournalProgressStickerSlot::angle); + + /// Used in StateMemory + lua.new_usertype( + "JournalProgressStainSlot", + "x", + &JournalProgressStainSlot::x, + "y", + &JournalProgressStainSlot::y, + "angle", + &JournalProgressStainSlot::angle, + "scale", + &JournalProgressStainSlot::scale, + "texture_column", + &JournalProgressStainSlot::texture_column, + "texture_row", + &JournalProgressStainSlot::texture_row, + "texture_range", + &JournalProgressStainSlot::texture_range); + /// Used in Items lua.new_usertype( "SelectPlayerSlot", @@ -357,6 +391,12 @@ void register_usertypes(sol::state& lua) statememory_type["storage_uid"] = &StateMemory::waddler_floor_storage; statememory_type["waddler_storage"] = &StateMemory::waddler_storage; statememory_type["waddler_metadata"] = &StateMemory::waddler_storage_meta; + statememory_type["journal_progress_sticker_count"] = &StateMemory::journal_progress_sticker_count; + statememory_type["journal_progress_sticker_slots"] = &StateMemory::journal_progress_sticker_slots; + statememory_type["journal_progress_stain_count"] = &StateMemory::journal_progress_stain_count; + statememory_type["journal_progress_stain_slots"] = &StateMemory::journal_progress_stain_slots; + statememory_type["journal_progress_theme_count"] = &StateMemory::journal_progress_theme_count; + statememory_type["journal_progress_theme_slots"] = &StateMemory::journal_progress_theme_slots; statememory_type["theme_info"] = &StateMemory::current_theme; statememory_type["logic"] = &StateMemory::logic; statememory_type["liquid"] = &StateMemory::liquid_physics; diff --git a/src/game_api/state.hpp b/src/game_api/state.hpp index 5c464c4db..df8e0c412 100644 --- a/src/game_api/state.hpp +++ b/src/game_api/state.hpp @@ -7,7 +7,7 @@ #include // for vector #include "aliases.hpp" // for ENT_TYPE, LAYER -#include "state_structs.hpp" // for JournalProgressionSlot, Illumination (p... +#include "state_structs.hpp" // for JournalProgressStickerSlot, Illumination (p... class Entity; class ScreenArenaIntro; @@ -160,12 +160,17 @@ struct StateMemory uint8_t unknown2d; std::array waddler_storage; std::array waddler_storage_meta; // to store mattock durability for example - uint16_t journal_progression_count; - std::array journal_progression_slots; - uint8_t death_screen_blood_splats_count; - uint8_t skip2[3]; // padding - std::array death_screen_blood_splats; - ThemeProgression theme_progression; + uint8_t journal_progress_sticker_count; + uint8_t padding4; + /// stickers for notable items and entities in journal progress page + std::array journal_progress_sticker_slots; + uint8_t journal_progress_stain_count; + uint8_t padding5[3]; + /// blood splats and paw prints in journal progress page + std::array journal_progress_stain_slots; + uint8_t journal_progress_theme_count; + /// visited themes in journal progress page + std::array journal_progress_theme_slots; uint8_t unknown3; uint8_t unknown4; uint8_t unknown5a; diff --git a/src/game_api/state_structs.hpp b/src/game_api/state_structs.hpp index 64992cad1..dd820d06c 100644 --- a/src/game_api/state_structs.hpp +++ b/src/game_api/state_structs.hpp @@ -187,22 +187,28 @@ struct Camera uint32_t unknown7; }; -struct JournalProgressionSlot +struct JournalProgressStickerSlot { - uint8_t unknown1; + uint8_t theme; int8_t grid_position; // -1 = unassigned, will be assigned when opening the journal and gets the zoom effect uint8_t unknown3; uint8_t unknown4; - ENT_TYPE entity; + ENT_TYPE entity_type; float x; float y; float angle; }; -struct ThemeProgression +struct JournalProgressStainSlot { - uint8_t count; - uint8_t visited_themes[9]; + float x; + float y; + float angle; + float scale; + int32_t texture_column; + int32_t texture_row; + uint8_t texture_range; // when stain is first displayed, rolls [0, texture_range] and adds it to texture_column + uint8_t padding[3]; }; struct ArenaConfigArenas // size: 40 bytes @@ -995,14 +1001,3 @@ struct MultiLineTextRendering float x; // center of the text box? float z; // center of the text box? }; - -struct DeathScreenBloodSlot -{ - float x; - float y; - float size_x; /* Unsure */ - float size_y; /* Unsure */ - int32_t texture_column; // normally set to 4 - int32_t texture_row; // normally set to 5 - int32_t texture_range; // when the death screens renders it rools 0 to this value, normally the value is 2 so it can roll 0, 1, or 2 (?) -};