diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 1a6287398..a4d50f213 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -2445,6 +2445,8 @@ function PRNG:random(min, max) end ---@field texture_num integer ---@field get_entity fun(self): Entity ---@field set_normal_map_texture fun(self, texture_id: TEXTURE): boolean @Sets second_texture to the texture specified, then sets third_texture to SHINE_0 and texture_num to 3. You still have to change shader to 30 to render with normal map (same as COG normal maps) + ---@field get_second_texture fun(self): TEXTURE? + ---@field get_third_texture fun(self): TEXTURE? ---@field set_second_texture fun(self, texture_id: TEXTURE): boolean ---@field set_third_texture fun(self, texture_id: TEXTURE): boolean ---@field set_texture_num fun(self, num: integer): boolean @Set the number of textures that may be used, need to have them set before for it to work @@ -11436,12 +11438,10 @@ YANG = { ---@alias YANG integer local MAX_PLAYERS = 4 ----@alias in_port_t number ---@class Logic ---@alias OnlinePlayerShort any ---@alias UdpServer any ----@alias Texture any ---@alias SpearDanglerAnimFrames any ---@alias OnlineLobbyScreenPlayer any ---@alias SoundCallbackFunction function diff --git a/docs/generate.py b/docs/generate.py index 74f6e5e07..1191d690d 100644 --- a/docs/generate.py +++ b/docs/generate.py @@ -365,20 +365,20 @@ def print_lf(lf): print("int | vector:find(any value) | Searches for the value in vector, returns index of the item in vector or nil if not found, only available for simple values that are comparable") print("int | span:find(any value) | Searches for the value in span, returns index of the item in span or nil if not found, only available for simple values that are comparable") -print("any | set:find(any value) | Searches for the value in set, returns the value itself or nil if not found, only available for simple values that are comparable") +print("any | set:find(any key) | Searches for the value in set, returns the value itself or nil if not found, only available for simple values that are comparable") print("any | map:find(any key) | Searches for the key in map, returns the value itself or nil if not found, only available for simple keys that are comparable") print("nil | vector:erase(int index) | Removes element at given index, the rest of elements shift down so that the vector stays contiguous") -print("nil | set:erase(any value) | Removes element from set") -print("nil | map:erase(any key) | Removes element from map by key") +print("nil | set:erase(any key) | Removes element from set") +print("nil | map:erase(any key) | Removes element from map") print("nil | vector:clear() | Removes all elements from vector") print("nil | set:clear() | Removes all elements from set") print("nil | map:clear() | Removes all elements from map") print("nil | vector:insert(int index, any element) | Inserts element at given index, the rest of elements shift up in index") -print("nil | set:insert(int order, any element) | The order param doesn't acutally matter and can be set to nil") -print("nil | map:insert(any key, any value) | unsure, probably easier to just use `map[key] = value`") +print("nil | set:insert(int order, any key) | The order param doesn't acutally matter and can be set to nil") +print("nil | map:insert(any key, any value)? | unsure, probably easier to just use `map[key] = value`") print("# Functions") diff --git a/docs/generate_emmylua.py b/docs/generate_emmylua.py index b2e0cf0b7..d434bda71 100644 --- a/docs/generate_emmylua.py +++ b/docs/generate_emmylua.py @@ -297,8 +297,6 @@ def main(): else "" ) if "function" in var and var["function"]: - # if var["name"] == "clear_behaviors": - # gu.breakpoint() signature = var["signature"] m = re.search(r"\s*(.*)\s+([^\(]*)\((.*)\)", signature) if m: @@ -442,12 +440,10 @@ def main(): print( """local MAX_PLAYERS = 4 ----@alias in_port_t number ---@class Logic ---@alias OnlinePlayerShort any ---@alias UdpServer any ----@alias Texture any ---@alias SpearDanglerAnimFrames any ---@alias OnlineLobbyScreenPlayer any ---@alias SoundCallbackFunction function""" diff --git a/docs/parse_source.py b/docs/parse_source.py index 017f7224a..b6b4b8638 100644 --- a/docs/parse_source.py +++ b/docs/parse_source.py @@ -742,7 +742,7 @@ def run_parse(): } ) elif cpp.startswith("[]("): - param_match = re.match(r"\[\]\(([\w &*:,]+)?\) -> ([\w.*&<>\[\]:]+)?(?: )?{", cpp) + param_match = re.match(r"\[\]\(([\w &*:,]+)?\) -> ([\w.*&<>\?\[\]:]+)?(?: )?{", cpp) if param_match: ret = param_match.group(2) if ret is None: diff --git a/docs/src/includes/_enums.md b/docs/src/includes/_enums.md index c2b7f0caf..564b3b0b3 100644 --- a/docs/src/includes/_enums.md +++ b/docs/src/includes/_enums.md @@ -845,7 +845,7 @@ Name | Data | Description [DEATH](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.DEATH) | ON::DEATH | Runs when entering the death screen.
[SPACESHIP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.SPACESHIP) | ON::SPACESHIP | Runs when entering the olmecship cutscene after [Tiamat](#Tiamat).
[WIN](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.WIN) | ON::WIN | Runs when entering any winning cutscene, including the constellation.
-[CREDITS](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.CREDITS) | ON::CREDITS | Runs when entering the credits.
+[CREDITS](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.CREDITS) | ON::CREDITS | Runs when entering the credits screen.
[SCORES](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.SCORES) | ON::SCORES | Runs when entering the final score celebration screen of a normal or hard ending.
[CONSTELLATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.CONSTELLATION) | ON::CONSTELLATION | Runs when entering the turning into constellation cutscene after cosmic ocean.
[RECAP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.RECAP) | ON::RECAP | Runs when entering the Dear Journal screen after final scores.
diff --git a/docs/src/includes/_events.md b/docs/src/includes/_events.md index d03a84b5c..41fa08125 100644 --- a/docs/src/includes/_events.md +++ b/docs/src/includes/_events.md @@ -130,7 +130,7 @@ Runs when entering any winning cutscene, including the constellation.
> Search script examples for [ON.CREDITS](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.CREDITS) -Runs when entering the credits.
+Runs when entering the credits screen.
## ON.SCORES diff --git a/docs/src/includes/_globals.md b/docs/src/includes/_globals.md index 9d3a08b74..3ec1908b4 100644 --- a/docs/src/includes/_globals.md +++ b/docs/src/includes/_globals.md @@ -165,17 +165,17 @@ any | set:at(int order) | Returns elements in order, it's not an index as sets d any | map:at(int order) | Returns elements in order, it's not an index as maps don't have one int | vector:find(any value) | Searches for the value in vector, returns index of the item in vector or nil if not found, only available for simple values that are comparable int | span:find(any value) | Searches for the value in span, returns index of the item in span or nil if not found, only available for simple values that are comparable -any | set:find(any value) | Searches for the value in set, returns the value itself or nil if not found, only available for simple values that are comparable +any | set:find(any key) | Searches for the value in set, returns the value itself or nil if not found, only available for simple values that are comparable any | map:find(any key) | Searches for the key in map, returns the value itself or nil if not found, only available for simple keys that are comparable nil | vector:erase(int index) | Removes element at given index, the rest of elements shift down so that the vector stays contiguous -nil | set:erase(any value) | Removes element from set -nil | map:erase(any key) | Removes element from map by key +nil | set:erase(any key) | Removes element from set +nil | map:erase(any key) | Removes element from map nil | vector:clear() | Removes all elements from vector nil | set:clear() | Removes all elements from set nil | map:clear() | Removes all elements from map nil | vector:insert(int index, any element) | Inserts element at given index, the rest of elements shift up in index -nil | set:insert(int order, any element) | The order param doesn't acutally matter and can be set to nil -nil | map:insert(any key, any value) | unsure, probably easier to just use `map[key] = value` +nil | set:insert(int order, any key) | The order param doesn't acutally matter and can be set to nil +nil | map:insert(any key, any value)? | unsure, probably easier to just use `map[key] = value` # Functions The game functions like `spawn` use [level coordinates](#get_position). Draw functions use normalized [screen coordinates](#screen_position) from `-1.0 .. 1.0` where `0.0, 0.0` is the center of the screen. diff --git a/src/game_api/script/lua_vm.cpp b/src/game_api/script/lua_vm.cpp index f6845ecc9..af85c1da5 100644 --- a/src/game_api/script/lua_vm.cpp +++ b/src/game_api/script/lua_vm.cpp @@ -2492,7 +2492,7 @@ end // WIN // Runs when entering any winning cutscene, including the constellation. // CREDITS - // Runs when entering the credits. + // Runs when entering the credits screen. // SCORES // Runs when entering the final score celebration screen of a normal or hard ending. // CONSTELLATION