Merge pull request #310 from Agent-11/time

get_time()
This commit is contained in:
Agent X 2023-03-20 19:59:31 -04:00 committed by GitHub
commit 3a45334a3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 0 deletions

View file

@ -8328,6 +8328,11 @@ function get_temp_s32_pointer(initialValue)
-- ...
end
--- @return integer
function get_time()
-- ...
end
--- @param type HudDisplayValue
--- @return integer
function hud_get_value(type)

View file

@ -8335,6 +8335,24 @@
<br />
## [get_time](#get_time)
### Lua Example
`local integerValue = get_time()`
### Parameters
- None
### Returns
- `integer`
### C Prototype
`u32 get_time(void);`
[:arrow_up_small:](#)
<br />
## [hud_get_value](#hud_get_value)
### Lua Example

View file

@ -1546,6 +1546,7 @@
- [get_last_star_or_key](functions-4.md#get_last_star_or_key)
- [get_network_area_timer](functions-4.md#get_network_area_timer)
- [get_temp_s32_pointer](functions-4.md#get_temp_s32_pointer)
- [get_time](functions-4.md#get_time)
- [hud_get_value](functions-4.md#hud_get_value)
- [hud_hide](functions-4.md#hud_hide)
- [hud_is_hidden](functions-4.md#hud_is_hidden)

View file

@ -27161,6 +27161,21 @@ int smlua_func_get_temp_s32_pointer(lua_State* L) {
return 1;
}
int smlua_func_get_time(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 0) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_time", 0, top);
return 0;
}
lua_pushinteger(L, get_time());
return 1;
}
int smlua_func_hud_get_value(lua_State* L) {
if (L == NULL) { return 0; }
@ -30394,6 +30409,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "get_last_star_or_key", smlua_func_get_last_star_or_key);
smlua_bind_function(L, "get_network_area_timer", smlua_func_get_network_area_timer);
smlua_bind_function(L, "get_temp_s32_pointer", smlua_func_get_temp_s32_pointer);
smlua_bind_function(L, "get_time", smlua_func_get_time);
smlua_bind_function(L, "hud_get_value", smlua_func_hud_get_value);
smlua_bind_function(L, "hud_hide", smlua_func_hud_hide);
smlua_bind_function(L, "hud_is_hidden", smlua_func_hud_is_hidden);

View file

@ -386,3 +386,9 @@ void add_scroll_target(u32 index, const char* name, u32 offset, u32 size) {
bool course_is_main_course(u16 levelNum) {
return COURSE_IS_MAIN_COURSE(levelNum);
}
///
u32 get_time(void) {
return time(NULL);
}

View file

@ -96,4 +96,6 @@ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);
bool course_is_main_course(u16 levelNum);
u32 get_time(void);
#endif