From 11864d9018384022b32b85bd577ded870a047b63 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Sat, 11 Nov 2023 13:02:23 -0500 Subject: [PATCH] Establish sm64coopdx versioning --- src/game/area.c | 2 +- src/pc/crash_handler.c | 2 +- src/pc/djui/djui_panel_info.c | 13 ++---------- src/pc/djui/djui_panel_main.c | 16 ++++++-------- src/pc/network/version.c | 40 ++++++++++++++++++++++++----------- 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/game/area.c b/src/game/area.c index 288aeba2..3f0a380d 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -448,7 +448,7 @@ void render_game(void) { djui_reset_hud_params(); create_dl_ortho_matrix(); djui_gfx_displaylist_begin(); - if (!gCoopCompatibility && gServerSettings.nametags) { + if (!gCoopCompatibility && gServerSettings.nametags && !gDjuiInMainMenu) { nametags_render(); } smlua_call_event_on_hud_render_behind(djui_reset_hud_params); diff --git a/src/pc/crash_handler.c b/src/pc/crash_handler.c index 2c8bc9bf..3babdd45 100644 --- a/src/pc/crash_handler.c +++ b/src/pc/crash_handler.c @@ -301,7 +301,7 @@ static CRASH_HANDLER_TYPE crash_handler(EXCEPTION_POINTERS *ExceptionInfo) { #elif __linux__ static void crash_handler(const int signalNum, siginfo_t *info, ucontext_t *context) { #endif - printf("game crashed! preparing crash screen...\n"); + printf("Game crashed! preparing crash screen...\n"); memset(sCrashHandlerText, 0, sizeof(sCrashHandlerText)); CrashHandlerText *pText = &sCrashHandlerText[0]; gDjuiDisabled = true; diff --git a/src/pc/djui/djui_panel_info.c b/src/pc/djui/djui_panel_info.c index 5f04d9ee..e38fb856 100644 --- a/src/pc/djui/djui_panel_info.c +++ b/src/pc/djui/djui_panel_info.c @@ -24,20 +24,11 @@ FluffaMario: Model Designer\n\ \n\ Contributors:\n\ ArcticJaguar725: Fixing a sound engine bug\n\ -Isaac: Loading screen initially on sm64coopdx\n\ -iZePlayzYT: Improving chat initially on sm64coopdx\n\ +Isaac: Loading screen testing initially on sm64coopdx\n\ \n\ -It is recommended you download the sm64coopdx repository if you want to make mods or DynOS Packs.\n\ -\n\ -OS: %s\n\ Renderer: %s\n\ -sm64coopdx Version: %s\n\ -sm64ex-coop Version: %s\n\ Build Type: %s", - get_os_name(), RAPI_NAME, - SM64COOPDX_VERSION, - get_version_local(), #ifdef DEVELOPMENT "Development" #else @@ -48,7 +39,7 @@ Build Type: %s", struct DjuiText* text = djui_text_create(body, sInfo); const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; djui_base_set_location(&text->base, 0, 0); - djui_base_set_size(&text->base, (DJUI_DEFAULT_PANEL_WIDTH * theme->panels.widthMultiplier) - 64, 670); + djui_base_set_size(&text->base, (DJUI_DEFAULT_PANEL_WIDTH * theme->panels.widthMultiplier) - 64, 480); djui_base_set_color(&text->base, 220, 220, 220, 255); djui_text_set_drop_shadow(text, 64, 64, 64, 100); djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); diff --git a/src/pc/djui/djui_panel_main.c b/src/pc/djui/djui_panel_main.c index 7a117585..15c59acf 100644 --- a/src/pc/djui/djui_panel_main.c +++ b/src/pc/djui/djui_panel_main.c @@ -46,15 +46,13 @@ void djui_panel_main_create(struct DjuiBase* caller) { djui_base_set_location(&button4->base, 0, -30.0f); } - if (gCoopCompatibility) { - char version[MAX_VERSION_LENGTH + 15]; - snprintf(version, MAX_VERSION_LENGTH + 15, "sm64ex-coop %s", get_version_local()); - struct DjuiText* footer = djui_text_create(&panel->base, version); - djui_base_set_size_type(&footer->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_size(&footer->base, 1.0f, 1.0f); - djui_base_set_color(&footer->base, 50, 50, 50, 255); - djui_text_set_alignment(footer, DJUI_HALIGN_CENTER, DJUI_VALIGN_BOTTOM); - } + char version[MAX_VERSION_LENGTH]; + snprintf(version, MAX_VERSION_LENGTH, "%s", get_version_local()); + struct DjuiText* footer = djui_text_create(&panel->base, version); + djui_base_set_size_type(&footer->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); + djui_base_set_size(&footer->base, 1.0f, 1.0f); + djui_base_set_color(&footer->base, 50, 50, 50, 255); + djui_text_set_alignment(footer, DJUI_HALIGN_RIGHT, DJUI_VALIGN_BOTTOM); } djui_panel_add(caller, panel, NULL); diff --git a/src/pc/network/version.c b/src/pc/network/version.c index 02de50de..2e5ba92b 100644 --- a/src/pc/network/version.c +++ b/src/pc/network/version.c @@ -7,19 +7,27 @@ static char sVersionString[MAX_VERSION_LENGTH] = { 0 }; static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 }; const char* get_version(void) { + if (gCoopCompatibility) { #if defined(VERSION_US) - if (MINOR_VERSION_NUMBER > 0) { - snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER); - } else { - snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d", VERSION_TEXT, VERSION_NUMBER); - } + if (MINOR_VERSION_NUMBER > 0) { + snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER); + } else { + snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d", VERSION_TEXT, VERSION_NUMBER); + } #else - if (MINOR_VERSION_NUMBER > 0) { - snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, VERSION_REGION); - } else { - snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d %s", VERSION_TEXT, VERSION_NUMBER, VERSION_REGION); - } + if (MINOR_VERSION_NUMBER > 0) { + snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, VERSION_REGION); + } else { + snprintf(sVersionString, MAX_VERSION_LENGTH, "%s%d %s", VERSION_TEXT, VERSION_NUMBER, VERSION_REGION); + } #endif + } else { +#if defined(VERSION_US) + snprintf(sVersionString, MAX_VERSION_LENGTH, "%s", SM64COOPDX_VERSION); +#else + snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %s", SM64COOPDX_VERSION, VERSION_REGION); +#endif + } return sVersionString; } @@ -28,11 +36,19 @@ const char* get_version_local(void) { return get_version(); } + if (gCoopCompatibility) { #if defined(VERSION_US) - snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s%d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER); + snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s%d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER); #else - snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s%d.%d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER, VERSION_REGION); + snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s%d.%d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER, VERSION_REGION); #endif + } else { +#if defined(VERSION_US) + snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s", SM64COOPDX_VERSION); +#else + snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s %s", VERSION_TEXT, SM64COOPDX_VERSION, VERSION_REGION); +#endif + } return sLocalVersionString; }