Display the correct version in the menu

This commit is contained in:
Maschell 2022-09-18 00:29:12 +02:00
parent ff27273a02
commit 9a69476bb1
6 changed files with 21 additions and 15 deletions

View File

@ -18,6 +18,13 @@ jobs:
needs: clang-format
steps:
- uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./src/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary
run: |
docker build . -t builder

View File

@ -26,6 +26,13 @@ jobs:
needs: clang-format
steps:
- uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
cat <<EOF > ./src/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary
run: |
docker build . -t builder

View File

@ -17,7 +17,7 @@ CRLayerHandle contentLayerHandle __attribute__((section(".data"))) = 0;
INITIALIZE_PLUGIN() {
// But then use libcontentredirection instead.
ContentRedirectionStatus error;
if ((error = ContentRedirection_Init()) != CONTENT_REDIRECTION_RESULT_SUCCESS) {
if ((error = ContentRedirection_InitLibrary()) != CONTENT_REDIRECTION_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Failed to init ContentRedirection. Error %d", error);
OSFatal("Failed to init ContentRedirection.");
}

View File

@ -1,15 +1,3 @@
#pragma once
/* Main */
#ifdef __cplusplus
extern "C" {
#endif
#include <nsysnet/socket.h>
#include <stdint.h>
#ifdef __cplusplus
}
#endif
#endif
#define VERSION "v0.1"

View File

@ -1,4 +1,6 @@
#include "modpackSelector.h"
#include "main.h"
#include "version.h"
#include <cstdarg>
#include <cstdio>
#include <cstring>
@ -114,7 +116,7 @@ void HandleMultiModPacks(uint64_t titleID) {
if (initScreen) {
OSScreenClearBufferEx(SCREEN_TV, 0);
OSScreenClearBufferEx(SCREEN_DRC, 0);
console_print_pos(x_offset, -1, " -- SDCafiine plugin %s by Maschell --");
console_print_pos(x_offset, -1, "SDCafiine plugin " VERSION VERSION_EXTRA);
console_print_pos(x_offset, 1, "Select your options and press A to launch.");
console_print_pos(x_offset, 2, "Press B to launch without mods");
int y_offset = 4;

2
src/version.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#define VERSION_EXTRA ""