Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Auto committed Oct 15, 2023
1 parent 8c13b96 commit e48d68c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
8 changes: 4 additions & 4 deletions docs/game_data/spel2.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions docs/parse_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def run_parse():
member_funs = {}
member_vars = []
for line in data:
#line = line.replace("*", "")
if not class_name and ("struct" in line or "class" in line):
m = re.match(r"(struct|class)\s+(\S+)", line)
if m and not line.endswith(";"):
Expand Down Expand Up @@ -381,7 +380,6 @@ def run_parse():
comment = []
data = open(file, "r").read().split("\n")
for line in data:
#line = line.replace("*", "")
m = re.search(r'lua\[[\'"]([^\'"]*)[\'"]\];', line)
if m:
events.append({"name": m.group(1), "comment": comment})
Expand All @@ -398,7 +396,6 @@ def run_parse():
comment = []
data = open(file, "r").read().split("\n")
for line in data:
#line = line.replace("*", "")
if line == "":
comment = []

Expand Down Expand Up @@ -721,7 +718,8 @@ def run_parse():
r"->([:<>\w]+){", var[1]
) # Use var[1] instead of cpp because it could be replaced on the sol::property stuff
if m_return_type:
sig = f"{m_return_type[1]} {var_name}"
type = replace_fun(m_return_type[1])
sig = f"{type} {var_name}"
vars.append(
{"name": var_name, "type": cpp, "signature": sig}
)
Expand Down Expand Up @@ -838,7 +836,6 @@ def run_parse():
comment = []
data = open(file, "r").read().split("\n")
for line in data:
#line = line.replace("*", "")
m = re.findall(r"new_usertype\<(.*?)\>", line)
if m:
type = m[0]
Expand Down
6 changes: 3 additions & 3 deletions docs/src/includes/_globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ This is run right after the entity is spawned but before and particular properti

Returns unique id for the callback to be used in [clear_screen_callback](#clear_screen_callback) or `nil` if screen_id is not valid.
Sets a callback that is called right after the screen is drawn.
<br/>The callback signature is nil render_screen([Screen](#Screen)* self, [VanillaRenderContext](#VanillaRenderContext) render_ctx)
<br/>The callback signature is nil render_screen([Screen](#Screen) self, [VanillaRenderContext](#VanillaRenderContext) render_ctx)

### set_pre_entity_spawn

Expand All @@ -314,7 +314,7 @@ In many cases replacing the intended entity won't have the indended effect or wi

Returns unique id for the callback to be used in [clear_screen_callback](#clear_screen_callback) or `nil` if screen_id is not valid.
Sets a callback that is called right before the screen is drawn, return `true` to skip the default rendering.
<br/>The callback signature is bool render_screen([Screen](#Screen)* self, [VanillaRenderContext](#VanillaRenderContext) render_ctx)
<br/>The callback signature is bool render_screen([Screen](#Screen) self, [VanillaRenderContext](#VanillaRenderContext) render_ctx)

### set_timeout

Expand Down Expand Up @@ -627,7 +627,7 @@ Get uids of matching entities overlapping with the given hitbox. Set `entity_typ

> Search script examples for [get_entity](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_entity)
#### [Entity](#Entity) get_entity(int uid)
#### [Entity](#Entity) get_entity(int uid)

Get the [Entity](#Entity) behind an uid, converted to the correct type. To see what type you will get, consult the [entity hierarchy list](https://github.com/spelunky-fyi/overlunky/blob/main/docs/entities-hierarchy.md)

Expand Down
8 changes: 4 additions & 4 deletions docs/src/includes/_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ bool | [render_inactive](https://github.com/spelunky-fyi/overlunky/search?l=Lua&
int | [texture_num](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=texture_num) |
[Entity](#Entity) | [get_entity()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_entity) |
bool | [set_normal_map_texture(TEXTURE texture_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_normal_map_texture) | 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)
std::optional&lt;[TEXTURE](#TEXTURE)&gt; | [get_second_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_second_texture) |
std::optional&lt;[TEXTURE](#TEXTURE)&gt; | [get_third_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_third_texture) |
optional&lt;[TEXTURE](#TEXTURE)&gt; | [get_second_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_second_texture) |
optional&lt;[TEXTURE](#TEXTURE)&gt; | [get_third_texture](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_third_texture) |
bool | [set_second_texture(TEXTURE texture_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_second_texture) |
bool | [set_third_texture(TEXTURE texture_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_third_texture) |
bool | [set_texture_num(int texture_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_texture_num) | Set the number of textures that may be used, need to have them set before for it to work
Expand Down Expand Up @@ -1678,8 +1678,8 @@ Used in [ScreenCharacterSelect](#ScreenCharacterSelect), [ScreenTitle](#ScreenTi
Type | Name | Description
---- | ---- | -----------
[ParticleDB](#ParticleDB) | [particle_type](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=particle_type) |
uint32_t | [particle_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=particle_count) |
uint32_t | [particle_count_back_layer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=particle_count_back_layer) |
int | [particle_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=particle_count) |
int | [particle_count_back_layer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=particle_count_back_layer) |
int | [entity_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=entity_uid) |
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) |
Expand Down
6 changes: 3 additions & 3 deletions src/game_api/script/lua_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ end
/// Check the [entity hierarchy list](https://github.com/spelunky-fyi/overlunky/blob/main/docs/entities-hierarchy.md) for what the exact ENT_TYPE's can this function affect
lua["set_contents"] = set_contents;
/// Get the Entity behind an uid, converted to the correct type. To see what type you will get, consult the [entity hierarchy list](https://github.com/spelunky-fyi/overlunky/blob/main/docs/entities-hierarchy.md)
// lua["get_entity"] = [](uint32_t uid) -> Entity* {};
// lua["get_entity"] = [](uint32_t uid) -> Entity*{};
/// NoDoc
/// Get the [Entity](#Entity) behind an uid, without converting to the correct type (do not use, use `get_entity` instead)
lua["get_entity_raw"] = get_entity_ptr;
Expand Down Expand Up @@ -1420,7 +1420,7 @@ end

/// Returns unique id for the callback to be used in [clear_screen_callback](#clear_screen_callback) or `nil` if screen_id is not valid.
/// Sets a callback that is called right before the screen is drawn, return `true` to skip the default rendering.
/// <br/>The callback signature is bool render_screen(Screen* self, VanillaRenderContext render_ctx)
/// <br/>The callback signature is bool render_screen(Screen self, VanillaRenderContext render_ctx)
lua["set_pre_render_screen"] = [](int screen_id, sol::function fun) -> sol::optional<CallbackId>
{
if (Screen* screen = get_screen_ptr(screen_id))
Expand All @@ -1444,7 +1444,7 @@ end
};
/// Returns unique id for the callback to be used in [clear_screen_callback](#clear_screen_callback) or `nil` if screen_id is not valid.
/// Sets a callback that is called right after the screen is drawn.
/// <br/>The callback signature is nil render_screen(Screen* self, VanillaRenderContext render_ctx)
/// <br/>The callback signature is nil render_screen(Screen self, VanillaRenderContext render_ctx)
lua["set_post_render_screen"] = [](int screen_id, sol::function fun) -> sol::optional<CallbackId>
{
if (Screen* screen = get_screen_ptr(screen_id))
Expand Down

0 comments on commit e48d68c

Please sign in to comment.