Author Topic: default "overview" ?  (Read 1083 times)

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
default "overview" ?
« on: November 01, 2018, 05:46:44 PM »
ya know  in your theme,   you can set default pic, like snap.png
and it will show up if it cant find the right one or missing...

is their a way to have a default overview?    i tryed   overview.txt and put in the theme
but no go...i also tryed puting like snes.txt in the scraper file of the emulator...

would be nice... ;)
help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 888
    • View Profile
Re: default "overview" ?
« Reply #1 on: November 01, 2018, 06:59:51 PM »
Create a magic function, test if info.overview is an empty string, and return a string based on results.

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: default "overview" ?
« Reply #2 on: November 01, 2018, 07:26:58 PM »
i know what your saying, but dont know how to do it,,,,

sorry it seem alot of us here depend on you few...i would love to take my skills to the next level

but dont know were to start,, most of the stuff i have learned..  have been from other peep code :'(

would love to get to the next level  1 up.. thanks   

but i will try. ok

i see the magic func.and use them,,   but how to creat a new one i thought was embedded in AM.exe?

is there a way to make your own,
« Last Edit: November 01, 2018, 07:30:46 PM by jedione »
help a friend....

Giacomo1982

  • Full Member
  • ***
  • Posts: 74
    • View Profile
Re: default "overview" ?
« Reply #3 on: November 02, 2018, 01:46:42 AM »
Hi jedione, to increase your coding skills you have to read the squirrel documentation
http://www.squirrel-lang.org/squirreldoc/

Squirrel is very similar to C++ and Java so reading a book of C++ or Java is a good thing.

Inside my HUD there are many functions that write a message "MISSING" if there's no data.
« Last Edit: November 02, 2018, 01:48:47 AM by Giacomo1982 »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 888
    • View Profile
Re: default "overview" ?
« Reply #4 on: November 02, 2018, 02:24:07 AM »
i know what your saying, but dont know how to do it,,,,

sorry it seem alot of us here depend on you few...i would love to take my skills to the next level

but dont know were to start,, most of the stuff i have learned..  have been from other peep code :'(

would love to get to the next level  1 up.. thanks   

but i will try. ok

i see the magic func.and use them,,   but how to creat a new one i thought was embedded in AM.exe?

is there a way to make your own,

Your magic function will be preprended with an apostrophe like [!overviewFormat]. Untested I’m on iPhone -

Code: [Select]
function overviewFormat() {
  fe.game_info(Info.Overview) == “” ? return “;(” : return fe.game_info(Info.Overview);
}

Depending on what you want to send, you might want to break it down into a local variable.

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: default "overview" ?
« Reply #5 on: November 02, 2018, 06:53:34 AM »
when i drop that code in the theme, it just breaks it.
help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 888
    • View Profile
Re: default "overview" ?
« Reply #6 on: November 02, 2018, 01:03:55 PM »
when i drop that code in the theme, it just breaks it.

It’s a start. You need to debug it yourself. I did it from memory on iPhone on workday. Have the function print to terminal. If you can’t get it, I’ll test tomorrow. I have weekend off. Need to spend tonight fixing starter solenoid wire on my truck.

Giacomo1982

  • Full Member
  • ***
  • Posts: 74
    • View Profile
Re: default "overview" ?
« Reply #7 on: November 03, 2018, 02:43:29 PM »
Usually I use this function:

function extra_text( index_offset, var ) {
   local text = fe.game_info(Info.Extra, 0);
   if (text != "") return text.toupper();
   else return "MISSING EXTRA";
}

local extra = fe.add_text ( "[!extra_text]", 0, 0, flw, flh );



But I don't know why it doesn't work with Overview, when it miss, returns the previuos Overview

maybe keilmillerjr can tell me why :)
« Last Edit: November 03, 2018, 02:46:09 PM by Giacomo1982 »

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: default "overview" ?
« Reply #8 on: November 03, 2018, 03:18:04 PM »
Usually I use this function:

function extra_text( index_offset, var ) {
   local text = fe.game_info(Info.Extra, 0);
   if (text != "") return text.toupper();
   else return "MISSING EXTRA";
}

local extra = fe.add_text ( "[!extra_text]", 0, 0, flw, flh );



But I don't know why it doesn't work with Overview, when it miss, returns the previuos Overview

maybe keilmillerjr can tell me why :)

thanks for your go...im thinking it is just not hard coded to do so?   but thanks

kind of like how you can set an mp3 in the sound option's for "enter"  but not have a .mp4 or .png for a fade into game....
« Last Edit: November 03, 2018, 05:26:01 PM by jedione »
help a friend....

rand0m

  • Sr. Member
  • ****
  • Posts: 197
    • View Profile
Re: default "overview" ?
« Reply #9 on: January 26, 2019, 10:23:10 PM »
Usually I use this function:

function extra_text( index_offset, var ) {
   local text = fe.game_info(Info.Extra, 0);
   if (text != "") return text.toupper();
   else return "MISSING EXTRA";
}

local extra = fe.add_text ( "[!extra_text]", 0, 0, flw, flh );



But I don't know why it doesn't work with Overview, when it miss, returns the previuos Overview

maybe keilmillerjr can tell me why :)

thanks for your go...im thinking it is just not hard coded to do so?   but thanks

kind of like how you can set an mp3 in the sound option's for "enter"  but not have a .mp4 or .png for a fade into game....

Following code will work with missing overviews, can't be placed as a default missing placeholder like artwork but you can return text/ picture for missing overviews and overviews which are not empty will be utilized as normal:
Code: [Select]
//Missing Overview Function
function missing_oview()
{
if (fe.game_info( Info.Overview ) == "") return "Overview for This Game is Not available";
else if (fe.game_info( Info.Overview ) != "") return "[Overview]";
}
local missing_oview = fe.add_text("[!missing_oview]", 1200, 776, 580, 246);
missing_oview.font= "Roboto-Medium.ttf";
missing_oview.align = Align.TopLeft;
missing_oview.word_wrap = true;
missing_oview.charsize = 22;
missing_oview.set_rgb(119, 121, 129);

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: default "overview" ?
« Reply #10 on: January 27, 2019, 07:11:20 AM »
Solved......   :)
help a friend....

rand0m

  • Sr. Member
  • ****
  • Posts: 197
    • View Profile
Re: default "overview" ?
« Reply #11 on: January 28, 2019, 06:40:06 AM »
Solved......   :)
Guess I spoke too soon  :-[ its not updating i.e. after finding an overview which exists it is not listing the message for missing overviews. I think transition new selection has to be utilized so it updates but its the only custom magic token which is showing this behavior!

jedione

  • Hero Member
  • *****
  • Posts: 674
  • punktoe
    • View Profile
Re: default "overview" ?
« Reply #12 on: January 28, 2019, 06:48:26 AM »
Dam.....
So their is hope... Though... Maybe a little twee king...
help a friend....

rand0m

  • Sr. Member
  • ****
  • Posts: 197
    • View Profile
Re: default "overview" ?
« Reply #13 on: January 28, 2019, 09:08:35 PM »
This code from Oomek works a bit better:
Code: [Select]
function missing_oview()
{
   local oview = fe.game_info( Info.Overview );
    if (oview == "") return "Overview for This Game is Not Available";
    else return oview;
}
local miss_oview = fe.add_text("[!missing_oview]", 1200, 776, 580, 246);

i.e. Last code didn't show anything on empty strings when it found a non-empty string. This code shows the last non-empty string on all entries. I think [Overview] is  a unique case.