Merge branch 'dev' of github.com:sm64ex-coop-dev/sm64ex-coop into dev

This commit is contained in:
MysterD 2023-05-14 12:12:30 -07:00
commit 5598ac95e7
9 changed files with 50 additions and 3 deletions

View File

@ -3750,6 +3750,11 @@ function djui_hud_world_pos_to_screen_pos(pos, out)
-- ... -- ...
end end
--- @return nil
function djui_open_pause_menu()
-- ...
end
--- @param message string --- @param message string
--- @param lines integer --- @param lines integer
--- @return nil --- @return nil

View File

@ -2444,6 +2444,24 @@
<br /> <br />
## [djui_open_pause_menu](#djui_open_pause_menu)
### Lua Example
`djui_open_pause_menu()`
### Parameters
- None
### Returns
- None
### C Prototype
`void djui_open_pause_menu(void);`
[:arrow_up_small:](#)
<br />
--- ---
# functions from djui_popup.h # functions from djui_popup.h

View File

@ -735,6 +735,7 @@
- [djui_hud_set_resolution](functions-3.md#djui_hud_set_resolution) - [djui_hud_set_resolution](functions-3.md#djui_hud_set_resolution)
- [djui_hud_set_rotation](functions-3.md#djui_hud_set_rotation) - [djui_hud_set_rotation](functions-3.md#djui_hud_set_rotation)
- [djui_hud_world_pos_to_screen_pos](functions-3.md#djui_hud_world_pos_to_screen_pos) - [djui_hud_world_pos_to_screen_pos](functions-3.md#djui_hud_world_pos_to_screen_pos)
- [djui_open_pause_menu](functions-3.md#djui_open_pause_menu)
<br /> <br />

View File

@ -2426,7 +2426,7 @@ void pss_end_slide(struct MarioState *m) {
void mario_handle_special_floors(struct MarioState *m) { void mario_handle_special_floors(struct MarioState *m) {
if (!m) { return; } if (!m) { return; }
if ((m->action & ACT_GROUP_MASK) == ACT_GROUP_CUTSCENE) { if ((m->action & ACT_GROUP_MASK) == ACT_GROUP_CUTSCENE || gDjuiInMainMenu) {
return; return;
} }

View File

@ -59,7 +59,7 @@ s32 lava_boost_on_wall(struct MarioState *m) {
if (!m) { return 0; } if (!m) { return 0; }
bool allow = true; bool allow = true;
smlua_call_event_hooks_mario_param_and_int_ret_bool(HOOK_ALLOW_HAZARD_SURFACE, m, HAZARD_TYPE_LAVA_WALL, &allow); smlua_call_event_hooks_mario_param_and_int_ret_bool(HOOK_ALLOW_HAZARD_SURFACE, m, HAZARD_TYPE_LAVA_WALL, &allow);
if ((gServerSettings.enableCheats && gCheats.godMode) || (!allow)) { return FALSE; } if ((gServerSettings.enableCheats && gCheats.godMode) || (!allow) || gDjuiInMainMenu) { return FALSE; }
m->faceAngle[1] = atan2s(m->wallNormal[2], m->wallNormal[0]); m->faceAngle[1] = atan2s(m->wallNormal[2], m->wallNormal[0]);
if (m->forwardVel < 24.0f) { if (m->forwardVel < 24.0f) {

View File

@ -113,7 +113,8 @@ u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) {
if (!m) { return 0; } if (!m) { return 0; }
bool allow = true; bool allow = true;
smlua_call_event_hooks_mario_param_and_int_ret_bool(HOOK_ALLOW_HAZARD_SURFACE, m, HAZARD_TYPE_QUICKSAND, &allow); smlua_call_event_hooks_mario_param_and_int_ret_bool(HOOK_ALLOW_HAZARD_SURFACE, m, HAZARD_TYPE_QUICKSAND, &allow);
if (m->action & ACT_FLAG_RIDING_SHELL || (gServerSettings.enableCheats && gCheats.godMode && m->playerIndex == 0) || (!allow)) { extern bool gDjuiInMainMenu;
if (m->action & ACT_FLAG_RIDING_SHELL || (gServerSettings.enableCheats && gCheats.godMode && m->playerIndex == 0) || (!allow) || gDjuiInMainMenu) {
m->quicksandDepth = 0.0f; m->quicksandDepth = 0.0f;
} else { } else {
if (m->quicksandDepth < 1.1f) { if (m->quicksandDepth < 1.1f) {

View File

@ -561,3 +561,7 @@ void djui_hud_set_render_behind_hud(bool enable) {
bool djui_hud_is_pause_menu_created(void) { bool djui_hud_is_pause_menu_created(void) {
return gDjuiPanelPauseCreated; return gDjuiPanelPauseCreated;
} }
void djui_open_pause_menu(void) {
djui_panel_pause_create(NULL);
}

View File

@ -69,4 +69,6 @@ void djui_hud_set_render_behind_hud(bool enable);
bool djui_hud_is_pause_menu_created(void); bool djui_hud_is_pause_menu_created(void);
void djui_open_pause_menu(void);
#endif #endif

View File

@ -12422,6 +12422,21 @@ int smlua_func_djui_hud_world_pos_to_screen_pos(lua_State* L) {
return 1; return 1;
} }
int smlua_func_djui_open_pause_menu(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", "djui_open_pause_menu", 0, top);
return 0;
}
djui_open_pause_menu();
return 1;
}
////////////////// //////////////////
// djui_popup.h // // djui_popup.h //
////////////////// //////////////////
@ -30727,6 +30742,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "djui_hud_set_resolution", smlua_func_djui_hud_set_resolution); smlua_bind_function(L, "djui_hud_set_resolution", smlua_func_djui_hud_set_resolution);
smlua_bind_function(L, "djui_hud_set_rotation", smlua_func_djui_hud_set_rotation); smlua_bind_function(L, "djui_hud_set_rotation", smlua_func_djui_hud_set_rotation);
smlua_bind_function(L, "djui_hud_world_pos_to_screen_pos", smlua_func_djui_hud_world_pos_to_screen_pos); smlua_bind_function(L, "djui_hud_world_pos_to_screen_pos", smlua_func_djui_hud_world_pos_to_screen_pos);
smlua_bind_function(L, "djui_open_pause_menu", smlua_func_djui_open_pause_menu);
// djui_popup.h // djui_popup.h
smlua_bind_function(L, "djui_popup_create", smlua_func_djui_popup_create); smlua_bind_function(L, "djui_popup_create", smlua_func_djui_popup_create);