Format version line automatically

This commit is contained in:
Nightkingale 2024-04-14 09:42:40 -06:00
parent 0836c5a2b6
commit 61909247df
3 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include <string>
extern const std::string VERSION_NUMBER;
extern const int BUFFER_SIZE;

View File

@ -13,6 +13,7 @@
#include "../include/unlink.hpp"
#include "../include/utils.hpp"
const std::string VERSION_NUMBER = "v1.0.0-rc1"; // The current version number of the program.
const int BUFFER_SIZE = 0x2000; // The buffer size allocated for reading and writing files.
unsigned int USER_ID; // The current user persistant ID.

View File

@ -15,7 +15,16 @@ void printMainMenu() {
OSScreenClearBufferEx(SCREEN_TV, 0x4A198500);
OSScreenClearBufferEx(SCREEN_DRC, 0x4A198500);
printOnScreen(0, "Wii U Account Swap (v1.0.0-rc1) Nightkingale");
std::stringstream versionLine; // Create a stringstream to format the version line.
versionLine << "Wii U Account Swap (" << VERSION_NUMBER << ")";
int currentLength = versionLine.str().length();
int numSpaces = 56 - currentLength - 11; // 11 is the length of " Nightkingale"
for (int i = 0; i < numSpaces; i++) {
versionLine << ' '; // Add spaces to format the version line.
}
versionLine << "Nightkingale";
printOnScreen(0, versionLine.str().c_str());
printOnScreen(1, "---------------------------------------------------------");
printOnScreen(3, "Press (A) to switch to Nintendo Network ID.");