Revert "smlua_exec_str (run Lua from string)"

This reverts commit db38b3d55d.
This commit is contained in:
Agent X 2023-03-08 19:04:32 -05:00
parent db38b3d55d
commit f7a7864c38
6 changed files with 1 additions and 49 deletions

View File

@ -8418,12 +8418,6 @@ function set_override_near(near)
-- ...
end
--- @param str string
--- @return nil
function smlua_exec_str(str)
-- ...
end
--- @param name string
--- @return integer
function smlua_model_util_get_id(name)

View File

@ -8658,26 +8658,6 @@
<br />
## [smlua_exec_str](#smlua_exec_str)
### Lua Example
`smlua_exec_str(str)`
### Parameters
| Field | Type |
| ----- | ---- |
| str | `string` |
### Returns
- None
### C Prototype
`void smlua_exec_str(const char* str);`
[:arrow_up_small:](#)
<br />
---
# functions from smlua_model_utils.h

View File

@ -1560,7 +1560,6 @@
- [set_override_far](functions-4.md#set_override_far)
- [set_override_fov](functions-4.md#set_override_fov)
- [set_override_near](functions-4.md#set_override_near)
- [smlua_exec_str](functions-4.md#smlua_exec_str)
<br />

View File

@ -7,7 +7,6 @@
#include "pc/lua/utils/smlua_audio_utils.h"
#include "pc/lua/utils/smlua_model_utils.h"
#include "pc/lua/utils/smlua_level_utils.h"
#include "pc/lua/utils/smlua_misc_utils.h"
#include "pc/djui/djui.h"
lua_State* gLuaState = NULL;
@ -53,7 +52,7 @@ static void smlua_exec_file(char* path) {
lua_pop(L, lua_gettop(L));
}
void smlua_exec_str(const char* str) {
static void smlua_exec_str(char* str) {
lua_State* L = gLuaState;
if (luaL_dostring(L, str) != LUA_OK) {
LOG_LUA("Failed to load lua string.");

View File

@ -27411,23 +27411,6 @@ int smlua_func_set_override_near(lua_State* L) {
return 1;
}
int smlua_func_smlua_exec_str(lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 1) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_exec_str", 1, top);
return 0;
}
const char* str = smlua_to_string(L, 1);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_exec_str"); return 0; }
smlua_exec_str(str);
return 1;
}
/////////////////////////
// smlua_model_utils.h //
/////////////////////////
@ -30387,7 +30370,6 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "set_override_far", smlua_func_set_override_far);
smlua_bind_function(L, "set_override_fov", smlua_func_set_override_fov);
smlua_bind_function(L, "set_override_near", smlua_func_set_override_near);
smlua_bind_function(L, "smlua_exec_str", smlua_func_smlua_exec_str);
// smlua_model_utils.h
smlua_bind_function(L, "smlua_model_util_get_id", smlua_func_smlua_model_util_get_id);

View File

@ -96,6 +96,4 @@ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);
bool course_is_main_course(u16 levelNum);
void smlua_exec_str(const char* str);
#endif