Hi all,
I'm poking around under the hood, probably in places I shouldn't, but here are my latest questions:
I have a text item that I want to span 3 lines. Once in a while, it'll work if I feed it a string like g_name+"\n"+g_cat+"\"+g_players ; other times, AM instantly crashes. Am I doing something wrong? Here's what I really want to happen:
When switching to the next game in the list, I want its ROM name, its category, and how many players it supports listed (hence the above variables). Here's the other thing: I'd also like to get the actual text for the category and the actual integer value for how many players, but I don't know how to do that. I tried using fe.game_info(Info.Category, index_offset) and fe.game_info(Info.Players, index_offset), but that only ever returns information related to the very first ROM displayed in the layout; moving up or down changes nothing. For the number of players, at least, I'd like to add a statement that "prettifies" the count, something like this:
local num_players, g_players;
g_players=(num_players==1 ? "1 player" : num_players.tostring()+" players");
So what I need to do is find some way to get the currently displayed game's category and number of players (and name, and everything, but hey) in an object format, or find some means to expand the tokens and save the actual values into new variables.
Am I misunderstanding how fe.game_info() should work, or is there something else I need to implement to "kick it" to get updated ROM data when I switch to the previous/next game?
Oh, some notes: I have word_wrap enabled in the particular text field I'm using, and, as I said, sometimes it works, but -- and here's the head scratcher -- if the last game displayed didn't have anything in its category slot, AM would instantly die; if I disabled the newlines and category for a moment, moved up or down to a game with category information, then reenabled it, it would work! Weird!
As always, I'd appreciate any help or insight anyone can provide! Thanks!