Skip to content

Commit

Permalink
Format version line automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightkingale committed Apr 14, 2024
1 parent 0836c5a commit 6190924
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>


extern const std::string VERSION_NUMBER;

extern const int BUFFER_SIZE;

Expand Down
1 change: 1 addition & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion source/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 6190924

Please sign in to comment.