Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic Token empty values bug #159

Closed
liquid8d opened this issue Oct 13, 2015 · 2 comments
Closed

Magic Token empty values bug #159

liquid8d opened this issue Oct 13, 2015 · 2 comments

Comments

@liquid8d
Copy link

If the magic token is empty, an error is thrown that the image/video is not available, but then grabs another random image from the same path. If the new index has a value but doesn't match, it does as expected and removes the image.

Here's an example:

local text = fe.add_text("[Title]", 0, 0, 400, 30);
local category = fe.add_text("[Category]", 0, 40, 400, 30);
text.align = category.align = Align.Left;
local image = fe.add_image("[Category].png", 0, 80, 175, 75);

Error opening input file: C:\attract-1.60\layouts/bug//layout.nut
ERROR loading video: C:\attract-1.60\layouts/bug//layout.nut

Make sure some entries have categories with matching images and some don't or use a different magic token where the value might be empty.

Expected result would be maybe to load [MagicToken].png, .jpg, etc.. - and if that doesn't exist, set it to no image.

Here's working, then non-working after scrolling back and forth through the entries:
magic-working
magic-not-working-1
magic-not-working-2

@liquid8d
Copy link
Author

I realized you can handle it yourself with functions to force something if the magic token is empty, although file_name="" still causes the same result - so perhaps something as simple as setting file_name to "" can wipe the texture?:

local image = fe.add_image("[!check_cat]", 0, 80, 175, 75);

function check_cat( offset )
{
    local cat = fe.game_info(Info.Category, offset );
    return ( cat != "" ) ? cat + ".png" : "category.png";
}

@mickelson
Copy link
Owner

Thanks for the report, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants