Establish sm64coopdx versioning

This commit is contained in:
Agent X 2023-11-11 13:02:23 -05:00
parent 281efe57fe
commit 11864d9018
5 changed files with 39 additions and 34 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;
}