From b3e518a78e1d45c827a9fbe285e41c6cfe2c32a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=C3=ABl?= <60509176+Bakoubak@users.noreply.github.com> Date: Thu, 22 Oct 2026 13:00:33 +0200 Subject: [PATCH] MainMenu: Add build number to neoLegacy name --- Minecraft.Client/Common/UI/UIScene_MainMenu.cpp | 7 +++++-- cmake/GenerateBuildVer.cmake | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index 3149f4ed..06fe83f0 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -570,7 +570,9 @@ void UIScene_MainMenu::render(S32 width, S32 height, C4JRender::eViewportType vi Font *font = pMinecraft->font; const wstring part1 = L"neo"; - const wstring part2 = L"Legacy"; + const wstring part2 = L"Legacy "; + const wstring part3 = VER_LAST_TAG; + const float scale = 0.6f; const int pad = 4; @@ -600,7 +602,7 @@ void UIScene_MainMenu::render(S32 width, S32 height, C4JRender::eViewportType vi glEnable(GL_TEXTURE_2D); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - int totalW = static_cast((font->width(part1) + font->width(part2)) * scale); + int totalW = static_cast((font->width(part1) + font->width(part2) + font->width(part3)) * scale); int tx = sw - totalW - pad; int ty = sh - static_cast(8 * scale) - pad; @@ -609,6 +611,7 @@ void UIScene_MainMenu::render(S32 width, S32 height, C4JRender::eViewportType vi glScalef(scale, scale, scale); font->drawShadow(part1, 0, 0, 0x66A254FA); font->drawShadow(part2, font->width(part1), 0, 0x66ffffff); + font->drawShadow(part3, font->width(part1) + font->width(part2), 0, 0x66ffffff); glPopMatrix(); glDepthMask(true); diff --git a/cmake/GenerateBuildVer.cmake b/cmake/GenerateBuildVer.cmake index 12668b58..d513af20 100644 --- a/cmake/GenerateBuildVer.cmake +++ b/cmake/GenerateBuildVer.cmake @@ -21,6 +21,17 @@ if(NOT rc EQUAL 0) set(GIT_SHA "unknown") endif() +# Get the latest tag, excluding dedicated server ones +execute_process( + COMMAND git describe --tags --match "v[0-9]*" --exclude "*-Dedicated-Server" + OUTPUT_VARIABLE GIT_TAG + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE rc +) +if(NOT rc EQUAL 0) + set(GIT_TAG "unknown") +endif() + # Get branch name execute_process( COMMAND git symbolic-ref --short HEAD @@ -70,6 +81,7 @@ set(_content "#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W\n" "#define VER_BRANCHVERSION_STR_W L\"${GIT_REF}\"\n" "#define VER_NETWORK VER_PRODUCTBUILD\n" + "#define VER_LAST_TAG L\"${GIT_TAG}${SUFFIX}\"\n" ) set(_tmp "${OUTPUT_FILE}.tmp")