Merge branch 'coop-deluxe:main' into main

This commit is contained in:
FluffaMario 2023-12-08 23:33:00 -06:00 committed by GitHub
commit 7478a154e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 24 deletions

View file

@ -1287,7 +1287,7 @@ void cur_obj_update(void) {
} }
// handle network area timer // handle network area timer
if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE && !(gMenuMode == -1 && configSingleplayerPause)) { if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE) {
// make sure the area is valid // make sure the area is valid
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) {
goto cur_obj_update_end; goto cur_obj_update_end;
@ -1437,7 +1437,7 @@ cur_obj_update_begin:;
} }
// update network area timer // update network area timer
if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE && !(gMenuMode == -1 && configSingleplayerPause)) { if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE) {
gCurrentObject->areaTimer++; gCurrentObject->areaTimer++;
if (gCurrentObject->areaTimer < gNetworkAreaTimer) { if (gCurrentObject->areaTimer < gNetworkAreaTimer) {
goto cur_obj_update_begin; goto cur_obj_update_begin;

View file

@ -245,17 +245,10 @@ u16 level_control_timer(s32 timerOp) {
} }
u32 pressed_pause(void) { u32 pressed_pause(void) {
if (configSingleplayerPause && network_player_connected_count() == 1) { u32 dialogActive = get_dialog_id() >= 0;
// prevent softlock in singleplayer pause, by not allowing pause in transitions
if (gWarpTransition.isActive || sDelayedWarpOp != WARP_OP_NONE) {
return FALSE;
}
}
u32 val4 = get_dialog_id() >= 0;
u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0; u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0;
if (!intangible && !val4 && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE if (!intangible && !dialogActive && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE
&& (gPlayer1Controller->buttonPressed & START_BUTTON)) { && (gPlayer1Controller->buttonPressed & START_BUTTON)) {
return TRUE; return TRUE;
} }
@ -1672,13 +1665,8 @@ s32 update_level(void) {
changeLevel = play_mode_normal(); changeLevel = play_mode_normal();
break; break;
case PLAY_MODE_PAUSED: case PLAY_MODE_PAUSED:
if (!(configSingleplayerPause && network_player_connected_count() == 1 && gActiveMods.entryCount == 0)) { changeLevel = play_mode_normal();
changeLevel = play_mode_normal(); changeLevel = play_mode_paused();
}
if (sCurrPlayMode == PLAY_MODE_PAUSED) {
changeLevel = play_mode_paused();
}
break; break;
case PLAY_MODE_CHANGE_AREA: case PLAY_MODE_CHANGE_AREA:
changeLevel = play_mode_change_area(); changeLevel = play_mode_change_area();

View file

@ -30,6 +30,7 @@
#include "pc/network/network.h" #include "pc/network/network.h"
#include "pc/lua/smlua_hooks.h" #include "pc/lua/smlua_hooks.h"
#include "pc/lua/utils/smlua_misc_utils.h" #include "pc/lua/utils/smlua_misc_utils.h"
#include "first_person_cam.h"
u8 (*gContinueDialogFunction)(void) = NULL; u8 (*gContinueDialogFunction)(void) = NULL;
struct Object* gContinueDialogFunctionObject = NULL; struct Object* gContinueDialogFunctionObject = NULL;
@ -1944,7 +1945,7 @@ void obj_set_cylboard(struct Object *obj) {
void cur_obj_set_billboard_if_vanilla_cam(void) { void cur_obj_set_billboard_if_vanilla_cam(void) {
if (!o) { return; } if (!o) { return; }
if (camera_config_is_free_cam_enabled()) { if (camera_config_is_free_cam_enabled() || get_first_person_enabled()) {
o->header.gfx.node.flags &= ~GRAPH_RENDER_BILLBOARD; o->header.gfx.node.flags &= ~GRAPH_RENDER_BILLBOARD;
o->header.gfx.node.flags |= GRAPH_RENDER_CYLBOARD; o->header.gfx.node.flags |= GRAPH_RENDER_CYLBOARD;
} else { } else {

View file

@ -150,7 +150,6 @@ bool configCtxProfiler = false;
unsigned int configInterpolationMode = 1; unsigned int configInterpolationMode = 1;
unsigned int configGamepadNumber = 0; unsigned int configGamepadNumber = 0;
bool configBackgroundGamepad = true; bool configBackgroundGamepad = true;
bool configSingleplayerPause = false;
bool configDebugPrint = false; bool configDebugPrint = false;
bool configDebugInfo = false; bool configDebugInfo = false;
bool configDebugError = false; bool configDebugError = false;
@ -260,7 +259,6 @@ static const struct ConfigOption options[] = {
{.name = "coop_custom_palette_skin", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[SKIN]}, {.name = "coop_custom_palette_skin", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[SKIN]},
{.name = "coop_custom_palette_cap", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[CAP]}, {.name = "coop_custom_palette_cap", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[CAP]},
{.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar}, {.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar},
{.name = "coop_singleplayer_pause", .type = CONFIG_TYPE_BOOL , .boolValue = &configSingleplayerPause},
{.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility}, {.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility},
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups}, {.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups},
#if defined(DEVELOPMENT) #if defined(DEVELOPMENT)

View file

@ -107,7 +107,6 @@ extern bool configLuaProfiler;
extern bool configCtxProfiler; extern bool configCtxProfiler;
#endif #endif
extern unsigned int configInterpolationMode; extern unsigned int configInterpolationMode;
extern bool configSingleplayerPause;
extern bool configDebugPrint; extern bool configDebugPrint;
extern bool configDebugInfo; extern bool configDebugInfo;
extern bool configDebugError; extern bool configDebugError;

View file

@ -288,6 +288,13 @@ static void crash_handler_add_info_str(CrashHandlerText** pTextP, f32 x, f32 y,
*pTextP = pText; *pTextP = pText;
} }
static void crash_handler_add_version_str(CrashHandlerText** pTextP, f32 x, f32 y) {
CrashHandlerText* pText = *pTextP;
crash_handler_set_text(x, y, 0xFF, 0xFF, 0x00, "%s", "sm64coopdx ");
crash_handler_set_text(-1, y, 0x00, 0xFF, 0xFF, "%s", SM64COOPDX_VERSION);
*pTextP = pText;
}
static void crash_handler_add_info_int(CrashHandlerText** pTextP, f32 x, f32 y, const char* title, int value) { static void crash_handler_add_info_int(CrashHandlerText** pTextP, f32 x, f32 y, const char* title, int value) {
CrashHandlerText* pText = *pTextP; CrashHandlerText* pText = *pTextP;
crash_handler_set_text(x, y, 0xFF, 0xFF, 0x00, "%s", title); crash_handler_set_text(x, y, 0xFF, 0xFF, 0x00, "%s", title);
@ -637,7 +644,7 @@ static void crash_handler(const int signalNum, siginfo_t *info, ucontext_t *cont
} }
} }
crash_handler_add_info_str(&pText, 335, 208, "Version", get_version_local()); crash_handler_add_version_str(&pText, 335, 208);
crash_handler_add_info_str(&pText, 8, 208, "RemoteBhv", gLastRemoteBhv); crash_handler_add_info_str(&pText, 8, 208, "RemoteBhv", gLastRemoteBhv);
// sounds // sounds

View file

@ -48,7 +48,6 @@ void djui_panel_misc_create(struct DjuiBase* caller) {
djui_themes_init(); djui_themes_init();
{ {
djui_checkbox_create(body, DLANG(MISC, PAUSE_IN_SINGLEPLAYER), &configSingleplayerPause, NULL);
djui_checkbox_create(body, DLANG(MISC, DISABLE_POPUPS), &configDisablePopups, NULL); djui_checkbox_create(body, DLANG(MISC, DISABLE_POPUPS), &configDisablePopups, NULL);
djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change);