Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - enterthepuffin

Pages: [1]
1
General / Re: Layout not redrawing properly on game exit
« on: March 28, 2017, 12:37:58 AM »
Thanks! That seems to have done the trick.

2
General / Layout not redrawing properly on game exit
« on: March 27, 2017, 12:28:46 PM »
Running AM on windows 8.1. Frequently, when quitting out of an emulator (it happens with multiple emulators), my attract mode layouts will redraw so that the upper left corner fills the whole screen. It is acting like the layout.width and height have been reset to a smaller resolution, but the elements in the layout haven't. Has anyone encountered this?

I have attempted both resetting layout.width and .height AND forcing a redraw on transition.FromGame with no success. Do I need to do a different callback to redraw the layout from scratch?

3
Scripting / Re: Problem trying to parse [Favourite] Magic Token
« on: November 04, 2016, 09:15:55 PM »
Thanks so much for the help! That worked... almost. fe.game_info returns a string type, so to make it work I needed to modify your code to be:

Code: [Select]
function FavStar() {
if (fe.game_info( Info.Favourite ) == "1") return "star.png";
}
local Fav = fe.add_image("[!FavStar]", x, y, w, h);

Is there any documentation on magic functions? Do they need to be used as a parameters inside of one of fe's add_ functions in order to update dynamically?

4
Scripting / Re: Problem trying to parse [Favourite] Magic Token
« on: November 03, 2016, 11:50:41 PM »
Thanks. That works, but it doesn't update when I select a new game. It just displays the image based on the favourite flag of the game that is selected when attract mode launches. How do I get it to update dynamically as I select a new game?

Here's my attempt to implement your suggestion.

function FavStar() {
local Fav = fe.game_info( Info.Favourite );
if ( Fav == "1" )
   fe.add_image( "star.png", 220, 160, 16, 16 );
}

[!FavStar()];


5
Scripting / Problem trying to parse [Favourite] Magic Token
« on: October 22, 2016, 12:58:46 AM »
I'm trying to display an image (a small star) when a selected game is in the favorites list.

I can access and display the [Favourite] magic token, which appears to be "" or "1" depending on whether the game is in the list. Also, though it behaves like a string, I can't seem to call the .tointeger() method so that I can test it as an integer. What is the proper way to test strings in squirrel? If someone could tell me where the flaw is in either of the following bits of code, I'd be very thankful:

//Try to test as string to display image
local Fav = "[Favourite]";
if ( Fav == "1" ) fe.add_image( "star.png", 220, 160, 16, 16 );

//Try to test as integer to display image
local Fav = "[Favourite]";
local FavValue = Fav.tointeger();
if ( FavValue == 1 ) fe.add_image( "star.png", 220, 160, 16, 16 );

Am I making a bonehead syntax error? Is [Favorite] not of type string? Is there a debugger that can tell me what errors I've thrown in code?


Pages: [1]