[debug menu] new: show mod version

fallback to git info if not builded for a specific version
This commit is contained in:
Robin C. Ladiges 2024-05-15 22:15:49 +02:00
parent ef9b629e3a
commit 90a34e8f87
No known key found for this signature in database
GPG key ID: B494D3DF92661B99
3 changed files with 17 additions and 3 deletions

View file

@ -57,7 +57,7 @@ runs:
-u `id -u`:`id -g` \ -u `id -u`:`id -g` \
-v "/$PWD/":/app/ \ -v "/$PWD/":/app/ \
-e ISEMU=${{ (inputs.emu != 'Switch' && '1') || '0' }} \ -e ISEMU=${{ (inputs.emu != 'Switch' && '1') || '0' }} \
${{ (steps.env.outputs.version != '' && format('-e BUILDVER={0}', steps.env.outputs.version)) || '' }} \ ${{ (steps.env.outputs.version != '' && format('-e BUILDVERSTR={0}', steps.env.outputs.version)) || '' }} \
smoo-build-env \ smoo-build-env \
; ;
cp -r ./romfs/ ./starlight_patch_100/atmosphere/contents/0100000000010000/. cp -r ./romfs/ ./starlight_patch_100/atmosphere/contents/0100000000010000/.

View file

@ -3,9 +3,17 @@
.PHONY: all clean starlight send .PHONY: all clean starlight send
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_REV := ${GIT_BRANCH}-${GIT_COMMIT}
ifneq (,$(strip $(shell git status --porcelain 2>/dev/null)))
GIT_REV := $(GIT_REV)-dirty
endif
SMOVER ?= 100 SMOVER ?= 100
BUILDVER ?= 101 BUILDVER ?= 101
BUILDVERSTR ?= 1.0.1 BUILDVERSTR ?= $(GIT_REV)
IP ?= 10.0.0.221 # ftp server ip (usually is switch's local IP) IP ?= 10.0.0.221 # ftp server ip (usually is switch's local IP)
DEBUGLOG ?= 0 # defaults to disable debug logger DEBUGLOG ?= 0 # defaults to disable debug logger
SERVERIP ?= 0.0.0.0 # put debug logger server IP here SERVERIP ?= 0.0.0.0 # put debug logger server IP here

View file

@ -137,6 +137,12 @@ void drawMainHook(HakoniwaSequence *curSequence, sead::Viewport *viewport, sead:
socket->getRecvMaxCount() socket->getRecvMaxCount()
); );
#if EMU
gTextWriter->printf("Mod version: %s for Emulators\n", TOSTRING(BUILDVERSTR));
#else
gTextWriter->printf("Mod version: %s for Switch\n", TOSTRING(BUILDVERSTR));
#endif
al::Scene *curScene = curSequence->curScene; al::Scene *curScene = curSequence->curScene;
if (curScene && isInGame) { if (curScene && isInGame) {