Author Topic: Show an image if an object doesnt exists  (Read 451 times)

qqplayer

  • Sr. Member
  • ****
  • Posts: 233
    • View Profile
Show an image if an object doesnt exists
« on: October 14, 2017, 01:11:35 PM »
I`m working on a little "pdf reader" plugin.
The main idea is read our game manuals from the layout.
So I need some help to show a little png, icon or somthing when there isnt pdf manual on the respective folder.

This is how it looks.

https://www.youtube.com/watch?v=CO16rOauGgU

jedione

  • Sr. Member
  • ****
  • Posts: 439
  • punktoe
    • View Profile
Re: Show an image if an object doesnt exists
« Reply #1 on: October 14, 2017, 06:12:41 PM »
sorry im no help but,  i had to chime in and say,  this is bad ass,  cant wait to try
good out side the box idea!
help a friend....

keilmillerjr

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Show an image if an object doesnt exists
« Reply #2 on: October 14, 2017, 08:42:29 PM »
Try:

fe.load_module("file");
function file_exist(fullpathfilename)
   {
   try {file(fullpathfilename, "r" );return true;}catch(e){return false;}
   }

qqplayer

  • Sr. Member
  • ****
  • Posts: 233
    • View Profile
Re: Show an image if an object doesnt exists
« Reply #3 on: October 15, 2017, 04:03:20 AM »
« Last Edit: October 15, 2017, 09:39:10 AM by qqplayer »

keilmillerjr

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Show an image if an object doesnt exists
« Reply #4 on: October 15, 2017, 08:06:47 AM »

Well, I'm on a trip for the day so I can not provide a full example right now. However, I can tell you my approach was and maybe you get a head start.

Load file midule
Include file exists function
Create transition to new selection or filter
If file exists returns true, image path is image path
If file exists returns false, image path is ""