From e6feed8da2adc9a39d2320b887a0ba6b91b5e67e Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Wed, 18 Oct 2023 20:32:42 +0200 Subject: [PATCH] update doc --- docs/game_data/spel2.lua | 10 +++++----- docs/src/includes/_globals.md | 6 +++--- docs/src/includes/_types.md | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 3e55452d1..22aed2f7a 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -77,7 +77,7 @@ function messpect(...) end ---@param any any ---@param depth integer? ---@return table -function dump(object, depth) end +function dump(any, depth) end ---Adds a command that can be used in the console. ---@param name string ---@param cmd function @@ -2429,7 +2429,7 @@ function Entity:overlaps_with(rect_left, rect_bottom, rect_right, rect_top) end ---@return boolean function Entity:overlaps_with(other) end ---Kill entity along with all entities attached to it. Be aware that for example killing push block with this function will also kill anything on top of it, any items, players, monsters etc. ----To a that, you can inclusively or exclusively limit certain MASK and ENT_TYPE. Note: the function will first check mask, if the entity doesn't match, it will look in the provided ENT_TYPE's +---To avoid that, you can inclusively or exclusively limit certain MASK and ENT_TYPE. Note: the function will first check mask, if the entity doesn't match, it will look in the provided ENT_TYPE's ---destroy_corpse and responsible are the standard parameters for the kill funciton ---@param destroy_corpse boolean ---@param responsible Entity @@ -2444,7 +2444,7 @@ function Entity:kill_recursive(destroy_corpse, responsible, mask, ent_types, rec ---@return nil function Entity:kill_recursive(destroy_corpse, responsible) end ---Destroy entity along with all entities attached to it. Be aware that for example destroying push block with this function will also destroy anything on top of it, any items, players, monsters etc. ----To a that, you can inclusively or exclusively limit certain MASK and ENT_TYPE. Note: the function will first check the mask, if the entity doesn't match, it will look in the provided ENT_TYPE's +---To avoid that, you can inclusively or exclusively limit certain MASK and ENT_TYPE. Note: the function will first check the mask, if the entity doesn't match, it will look in the provided ENT_TYPE's ---@param mask integer? ---@param ent_types ENT_TYPE[] ---@param rec_mode RECURSIVE_MODE @@ -4789,8 +4789,8 @@ function CustomSound:play(paused, sound_type) end ---@class SoundMeta ---@field x number ---@field y number - ---@field left_channel number[] @size: 38 @Use VANILLA_SOUND_PARAM as index, warning: special case with first index at 0, loop using tuples will get you all results but the key/index will be wrong, ituples will have correct key/index but will skip the first element - ---@field right_channel number[] @size: 38 @Use VANILLA_SOUND_PARAM as index warning: special case with first index at 0, loop using tuples will get you all results but the key/index will be wrong, ituples will have correct key/index but will skip the first element + ---@field left_channel number[] @size: 38 @Use VANILLA_SOUND_PARAM as index, warning: special case with first index at 0, loop using pairs will get you all results but the key/index will be wrong, ipairs will have correct key/index but will skip the first element + ---@field right_channel number[] @size: 38 @Use VANILLA_SOUND_PARAM as index warning: special case with first index at 0, loop using pairs will get you all results but the key/index will be wrong, ipairs will have correct key/index but will skip the first element ---@field start_over boolean @when false, current track starts from the beginning, is immediately set back to true ---@field playing boolean @set to false to turn off diff --git a/docs/src/includes/_globals.md b/docs/src/includes/_globals.md index 72697a706..0f14b8260 100644 --- a/docs/src/includes/_globals.md +++ b/docs/src/includes/_globals.md @@ -376,7 +376,7 @@ If you set such a callback and then play the same sound yourself you have to wai > Search script examples for [dump](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=dump) -#### table dump(object object, optional depth) +#### table dump(any object, optional depth) Dump the object (table, container, class) as a recursive table, for pretty printing in console. Don't use this for anything except debug printing. Unsafe. @@ -631,9 +631,9 @@ Recommended to always set the mask, even if you look for one entity type > Search script examples for [get_entities_by_draw_depth](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_entities_by_draw_depth) -#### array<int> get_entities_by_draw_depth(int draw_depth, [LAYER](#LAYER) l) +#### vector<int> get_entities_by_draw_depth(int draw_depth, [LAYER](#LAYER) l) -#### array<int> get_entities_by_draw_depth(array draw_depths, [LAYER](#LAYER) l) +#### vector<int> get_entities_by_draw_depth(array draw_depths, [LAYER](#LAYER) l) Get uids of entities by draw_depth. Can also use table of draw_depths. You can later use [filter_entities](#filter_entities) if you want specific entity diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index fca6e4edc..182146534 100644 --- a/docs/src/includes/_types.md +++ b/docs/src/includes/_types.md @@ -1252,7 +1252,7 @@ float | [spawn_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn float | [spawn_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_y) | int | [spawn_room_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_room_x) | int | [spawn_room_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_room_y) | -custom_array<[Vec2](#Vec2)> | [exit_doors](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=exit_doors) | +vector<[Vec2](#Vec2)> | [exit_doors](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=exit_doors) | array<[ThemeInfo](#ThemeInfo), 18> | [themes](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=themes) | 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) | @@ -4034,9 +4034,9 @@ nil | [set_invisible(bool value)](https://github.com/spelunky-fyi/overlunky/sear span<int> | [get_items()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_items) | bool | [is_in_liquid()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_in_liquid) | Returns true if entity is in water/lava bool | [is_cursed()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_cursed) | -nil | [kill_recursive(bool destroy_corpse, Entity responsible, optional mask, const array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kill_recursive) | Kill entity along with all entities attached to it. Be aware that for example killing push block with this function will also kill anything on top of it, any items, players, monsters etc.
To a that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s
destroy_corpse and responsible are the standard parameters for the kill funciton +nil | [kill_recursive(bool destroy_corpse, Entity responsible, optional mask, array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kill_recursive) | Kill entity along with all entities attached to it. Be aware that for example killing push block with this function will also kill anything on top of it, any items, players, monsters etc.
To avoid that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s
destroy_corpse and responsible are the standard parameters for the kill funciton nil | [kill_recursive(bool destroy_corpse, Entity responsible)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kill_recursive) | Short for using [RECURSIVE_MODE](#RECURSIVE_MODE).NONE -nil | [destroy_recursive(optional mask, const array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_recursive) | Destroy entity along with all entities attached to it. Be aware that for example destroying push block with this function will also destroy anything on top of it, any items, players, monsters etc.
To a that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check the mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s +nil | [destroy_recursive(optional mask, array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_recursive) | Destroy entity along with all entities attached to it. Be aware that for example destroying push block with this function will also destroy anything on top of it, any items, players, monsters etc.
To avoid that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check the mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s nil | [destroy_recursive()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_recursive) | Short for using [RECURSIVE_MODE](#RECURSIVE_MODE).NONE [CallbackId](#Aliases) | [set_pre_virtual(ENTITY_OVERRIDE entry, function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_virtual) | Hooks before the virtual function at index `entry`. [CallbackId](#Aliases) | [set_post_virtual(ENTITY_OVERRIDE entry, function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_virtual) | Hooks after the virtual function at index `entry`.