This is really weird.
I want certain game details returned in uppercase text. I discovered the toupper() function, but when running magic token text through a magic token function (e.g., [!getTitle]), sometimes it looks like it works, other times it returns a bunch of weird junk: an odd mixture of "magic-less" token parts and who knows what else.
Here's what I've coded:
function getTitle () { return fe.game_info(Info.Title).toupper(); }
function getMfr () { return fe.game_info(Info.Manufacturer).toupper(); }
function getPlayedTime () { return fe.game_info(Info.PlayedTime).toupper(); }
function getName () { return fe.game_info(Info.Name).toupper(); }
function getEmu () { return fe.game_info(Info.Emulator).toupper(); }
function getStatus () {
if (fe.game_info(Info.Status).len() < 1) {
return "";
}
else {
return "; " + fe.game_info(Info.Status).toupper();
}
}
And here's the line where I'm trying to populate my text instance:
local _gameInfo = fe.add_text("[!getTitle]\n© [Year] [!getMfr]\n[Players] PLAYER(S)\nPLAYED FOR [!getPlayedTime]\n[!getName]; [!getEmu][!getStatus]", 228, 880, 704, 136);
I tried adjusting the line breaks, adding whitespace, etc., but the fact is, it just doesn't work as-is. I'm not sure if I'm missing something or if there's a hiccup with getting the "processed" text from the magic token function(s).
If there's a simpler way to do this, I'm all ears. I tried chaining .toupper() directly to my tokenized string, but that just returned an uppercase version of the untranslated tokens. :shrug:
Here's a pic of some of the results (attached). Thanks for any help!