This commit is contained in:
altalk23 2023-02-26 16:28:28 +03:00
commit 8fc8413298
3 changed files with 17 additions and 0 deletions

View file

@ -17,6 +17,15 @@ else()
set(PROJECT_VERSION_SUFFIX "")
endif()
# https://stackoverflow.com/a/63924044/9124836
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GEODE_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
# Package info file for internal representation
configure_file(resources/mod.json.in ${CMAKE_CURRENT_SOURCE_DIR}/resources/mod.json)
file(READ resources/mod.json LOADER_MOD_JSON)

View file

@ -7,6 +7,7 @@ static constexpr const char* LOADER_VERSION_STR = "@PROJECT_VERSION@@PROJECT_VER
static constexpr int LOADER_VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
static constexpr int LOADER_VERSION_MINOR = @PROJECT_VERSION_MINOR@;
static constexpr int LOADER_VERSION_PATCH = @PROJECT_VERSION_PATCH@;
static constexpr const char* LOADER_COMMIT_HASH = "@GEODE_COMMIT_HASH@";
static constexpr geode::VersionInfo LOADER_VERSION = {
@PROJECT_VERSION_MAJOR@,
@PROJECT_VERSION_MINOR@,

View file

@ -366,6 +366,13 @@ bool LocalModInfoPopup::init(Mod* mod, ModListLayer* list) {
m_updateVersionLabel->setPosition(winSize.width / 2 + 35.f, winSize.height / 2 + 75.f);
m_mainLayer->addChild(m_updateVersionLabel);
}
} else {
auto* label = CCLabelBMFont::create(LOADER_COMMIT_HASH, "chatFont.fnt");
label->setAnchorPoint(ccp(1, 0));
label->setScale(0.775f);
label->setPosition(winSize.width - 1.f, 1.f);
label->setOpacity(89);
m_mainLayer->addChild(label);
}
// issue report button