I made this function , the final goal is to show a "pdfIcon" when you have the game manual on the selected folder "pdffilepath"
// pdfIcon
local pdffilepath="H://Attract//layouts//Basic//pdf//";
local game_name = fe.game_info(Info.Name);
local pdffile = pdffilepath + game_name + config["extension"];
local littlepngicon = fe.add_image( "manual.png", 0, 0, 200, 200);
fe.load_module("file");
function file_exist(pdffile)
{
print(pdffilepath + game_name + config["extension"]);
try {file(pdffile, "r" );return true;}catch(e){return false;}
}
if (file_exist(pdffile)) littlepngicon.visible=true
else littlepngicon.visible=false;
Thanks to Daimon , Oomek and the other people who helped with the code.
As I said , only works when I start the frontend, If I start AM and the last selected game has the pdf manual the icon shows.
But when I move between the diferent games it doesnt change.
I mean if appears when I start the f.e. keeps showing all the time and if I selected a game who doesnt have the pdf manual - close A.M. - and open it again the icon is gone and doesnt shows anymore even if I move to a game who has the pdf manual.
Any help?