From fd2d7b97d510773f1e82c6279b7679f33761de8a Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:30:39 +0200 Subject: [PATCH] update doc --- docs/game_data/spel2.lua | 4 ++-- docs/generate_emmylua.py | 2 +- docs/parse_source.py | 2 +- docs/src/includes/_types.md | 4 ++-- src/game_api/script/usertypes/level_lua.cpp | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index e2568c38b..66d717529 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -2430,7 +2430,7 @@ function PRNG:random(min, max) end ---@field hitboxy number ---@field draw_depth integer ---@field collision2_mask integer @MASK, will only call collision2 when colliding with entities that match this mask. - ---@field collision_mask integer @MASK used for collision with floors. + ---@field collision_mask integer @MASK used for collision with floors, walls etc. ---@field friction number ---@field elasticity number ---@field weight number @@ -4831,7 +4831,7 @@ function CustomTheme:override(index, func_) end ---@field flags integer ---@field flags2 integer ---@field flags3 integer - ---@field level_config integer[] + ---@field level_config integer[] @size: 17 ---@class PostRoomGenerationContext ---@field set_room_template fun(self, x: integer, y: integer, layer: LAYER, room_template: ROOM_TEMPLATE): boolean @Set the room template at the given index and layer, returns `false` if the index is outside of the level. diff --git a/docs/generate_emmylua.py b/docs/generate_emmylua.py index b6954234e..d7d73e036 100644 --- a/docs/generate_emmylua.py +++ b/docs/generate_emmylua.py @@ -33,7 +33,7 @@ " = nullopt": "", "void": "", "constexpr": "", - "inline": "", + "inline ": "", "[[nodiscard]]": "", "[[maybe_unused]]": "", "self_return<&": "", diff --git a/docs/parse_source.py b/docs/parse_source.py index 57a7be1cd..d06271649 100644 --- a/docs/parse_source.py +++ b/docs/parse_source.py @@ -55,7 +55,7 @@ "static": "", "[[nodiscard]]": "", "[[maybe_unused]]": "", - "inline": "", + "inline ": "", "self_return<&": "", ">()": "", "unsigned": "", diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index 91aac2636..ea5b33c1f 100644 --- a/docs/src/includes/_types.md +++ b/docs/src/includes/_types.md @@ -462,7 +462,7 @@ float | [hitboxx](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=hitbo float | [hitboxy](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=hitboxy) | int | [draw_depth](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_depth) | int | [collision2_mask](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collision2_mask) | [MASK](#MASK), will only call collision2 when colliding with entities that match this mask. -int | [collision_mask](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collision_mask) | [MASK](#MASK) used for collision with floors. +int | [collision_mask](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collision_mask) | [MASK](#MASK) used for collision with floors, walls etc. float | [friction](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=friction) | float | [elasticity](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=elasticity) | float | [weight](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=weight) | @@ -1378,7 +1378,7 @@ array<[ThemeInfo](#ThemeInfo), 18> | [themes](https://github.com/spelunky- int | [flags](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=flags) | int | [flags2](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=flags2) | int | [flags3](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=flags3) | -array<int> | [level_config](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=level_config) | +array<int, 17> | [level_config](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=level_config) | ## Lighting types diff --git a/src/game_api/script/usertypes/level_lua.cpp b/src/game_api/script/usertypes/level_lua.cpp index 791ce7b84..b38fd9f3b 100644 --- a/src/game_api/script/usertypes/level_lua.cpp +++ b/src/game_api/script/usertypes/level_lua.cpp @@ -1368,8 +1368,8 @@ void register_usertypes(sol::state& lua) /// kept for backward compatibility, don't use, check LevelGenSystem.exit_doors lua.new_usertype("DoorCoords", sol::no_constructor, "door1_x", &DoorCoords::door1_x, "door1_y", &DoorCoords::door1_y, "door2_x", &DoorCoords::door2_x, "door2_y", &DoorCoords::door2_y); - auto level_config = [](LevelGenSystem& level_gen) - { return ZeroIndexArray(level_gen.data->level_config); }; + // auto level_config = [](LevelGenSystem& level_gen) + //{ return ZeroIndexArray(level_gen.data->level_config); }; /// Data relating to level generation, changing anything in here from ON.LEVEL or later will likely have no effect, used in StateMemory lua.new_usertype( @@ -1404,8 +1404,8 @@ void register_usertypes(sol::state& lua) "flags3", &LevelGenSystem::flags3, "level_config", - sol::property([&level_config](LevelGenSystem& lg) // -> array - { return level_config(lg) /**/; })); + sol::property([](LevelGenSystem& lg) // -> array + { return ZeroIndexArray(lg.data->level_config) /**/; })); /// Context received in ON.POST_ROOM_GENERATION. /// Used to change the room templates in the level and other shenanigans that affect level gen.