Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Scripting / Re: System List possible?
« Last post by dukpoki on May 18, 2018, 09:21:33 AM »
@dukpoki Is gaving me an error , "the index -2 does not exist"

Here's a full sample code that should work if you follow the template.  You have to of course, adjust/add more systems accordingly to the total amount on your setup as this code only for a total of 5 systems.  To do that, you simply add/insert more "case" systems along with the "break".  A good rule of thumb is to alphabetize it as AM automatically assigns display numbers that way.  Also make sure your systems listed in your attract.cfg are in alphabetical order as well.  And finally make sure the first 2 and last 2 systems on the list have the same +/- displaytotal in the corresponding lines.  So if you are adding more systems then delete the +displaytotal's I have in Atomiswave & Dreamcast and also the -displaytotal's in Genesis & Mame.  Then once you've added all your systems apply those +/- exactly in the same order/way.

Code: [Select]

local displaytotal = fe.displays.len();  //the total system number

 ::OBJECTS <- {

system1= fe.add_text("",47,48,300,40)
system2= fe.add_text("",47,90,300,40)
system3= fe.add_text("",47,132,300,40)
system4= fe.add_text("",47,174,300,40)
system5= fe.add_text("",47,216,300,40)

}


function transition_callback(ttype, var, ttime)
{
    switch ( ttype )
    {
        case Transition.ToNewList:
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.FromOldSelection:
            switch ( fe.list.name )
            {             
case "Atomiswave":
local display1 = fe.displays[fe.list.display_index - 2 + displaytotal].name;
local display2 = fe.displays[fe.list.display_index - 1 + displaytotal].name;
                local display3 = fe.displays[fe.list.display_index].name;
                local display4 = fe.displays[fe.list.display_index + 1].name;
local display5 = fe.displays[fe.list.display_index + 2].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
break;

        case "Dreamcast":
local display1 = fe.displays[fe.list.display_index -2 + displaytotal].name;
local display2 = fe.displays[fe.list.display_index - 1].name;
                local display3 = fe.displays[fe.list.display_index].name;
                local display4 = fe.displays[fe.list.display_index + 1].name;
local display5 = fe.displays[fe.list.display_index + 2].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
    break;

case "Gamecube":
local display1 = fe.displays[fe.list.display_index - 2].name;
local display2 = fe.displays[fe.list.display_index - 1].name;
                local display3 = fe.displays[fe.list.display_index].name;
                local display4 = fe.displays[fe.list.display_index + 1].name;
local display5 = fe.displays[fe.list.display_index + 2].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
break;

        case "Genesis":
local display1 = fe.displays[fe.list.display_index - 2].name;
local display2 = fe.displays[fe.list.display_index - 1].name;
                local display3 = fe.displays[fe.list.display_index].name;
                local display4 = fe.displays[fe.list.display_index + 1].name;
local display5 = fe.displays[fe.list.display_index + 2 - displaytotal].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
break;           

        case "Mame":
local display1 = fe.displays[fe.list.display_index - 2].name;
local display2 = fe.displays[fe.list.display_index - 1].name;
                local display3 = fe.displays[fe.list.display_index].name;
                local display4 = fe.displays[fe.list.display_index + 1 - displaytotal].name;
local display5 = fe.displays[fe.list.display_index + 2 - displaytotal].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
break;

            }
break;
    }

}

fe.add_transition_callback("transition_callback" );

22
Scripting / "Clickable - surface"
« Last post by qqplayer on May 18, 2018, 07:26:09 AM »
I want to create a little sub menu inside my layout.
Something like the mini nes theme.
The idea is simple.
Click "alt+down" to enter into this submenu and then navigate to one of the free icons , click enter and "search-keyboard" plugin enable . second icon - filters menu , third icon...

23
Scripting / Re: Snaps are playing upside down
« Last post by Oomek on May 18, 2018, 06:46:38 AM »
You can add a default shader and change the following line:
Code: [Select]
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);To
Code: [Select]
vec4 pixel = texture2D(texture, vec2(gl_TexCoord[0].x, 1.0 - gl_TexCoord[0].y));
Or if your theme already binds a shader find that line and replace it as well.
24
Scripting / Re: System List possible?
« Last post by qqplayer on May 18, 2018, 05:46:35 AM »
@dukpoki Is gaving me an error , "the index -2 does not exist"
25
Emulators / Re: Autoit Error
« Last post by hermine.potter on May 17, 2018, 10:55:29 PM »
you mix/mistake autoit with autohotkey.
they're two different languages, with different syntax

sleep command autoit
sleep command autohotkey
26
Themes / Re: Attract Mode theme conversion - Big Box Unified
« Last post by bundangdon on May 17, 2018, 07:12:04 PM »
Nicely done! Thank you for sharing this  :D
27
Themes / Re: Put a random icon on the screen.
« Last post by keilmillerjr on May 17, 2018, 05:30:43 PM »
Solved:

Code: [Select]
local my_film = randInt(6);
my_film = my_film.tostring() + ".png";
local film = fe.add_image("posters/films/" + my_film, 0, 0, 0, 0);

Thank you very much.

I didn’t test it, but something like this might be easier than numeric file names. Try it and let me know if it works. You can have file names such as „Predator.png“. Include the file extension in the array if they vary, but it’s good practice to have everything uniform if you can.
Code: [Select]
fe.load_module("helpers-module");

local films = [
  "Predator",
  "The Terminator",
  "Total Recall",
]

local film = fe.add_image("posters/films/" + films[randInt(films.len())] + ".png", 0, 0, 0, 0);
film.preserve_aspect_ratio = true;
film.trigger = Transition.EndNavigation;
28
General / Re: [Solved] Windows 10 Spring Update 1803 broke Attract Mode
« Last post by Oomek on May 17, 2018, 03:24:16 PM »
A quick follow up. If you see simillar symptoms, disable Focus Assist in Windows Settigs->System
If you have no scanlines in mame disable shader cache in your GPU settings.
Clean install of GPU drivers also helps.
29
Themes / Re: Put a random icon on the screen.
« Last post by zlagos on May 17, 2018, 02:54:23 PM »
Solved:

Code: [Select]
local my_film = randInt(6);
my_film = my_film.tostring() + ".png";
local film = fe.add_image("posters/films/" + my_film, 0, 0, 0, 0);

Thank you very much.
30
Scripting / Re: System List possible?
« Last post by dukpoki on May 17, 2018, 01:25:18 PM »
Got it working.

Code: [Select]

 ::OBJECTS <- {

system1= fe.add_text("",47,48,300,40)
system2= fe.add_text("",47,90,300,40)
system3= fe.add_text("",47,132,300,40)
system4= fe.add_text("",47,174,300,40)
system5= fe.add_text("",47,222,300,40)

}

function transition_callback(ttype, var, ttime)
{
    switch ( ttype )
    {
        case Transition.ToNewList:
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.FromOldSelection:
            switch ( fe.list.name )
            {             
case "Atomiswave":
local display1 = fe.displays[fe.list.display_index - 2].name;
local display2 = fe.displays[fe.list.display_index - 1].name; //previous display
        local display3 = fe.displays[fe.list.display_index].name; //current display
        local display4 = fe.displays[fe.list.display_index + 1].name; //next display
local display5 = fe.displays[fe.list.display_index + 2].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
OBJECTS.frame.file_name = "images/frames/Default_frame.png";
break;

        case "Dreamcast":
local display1 = fe.displays[fe.list.display_index - 2].name;
local display2 = fe.displays[fe.list.display_index - 1].name; //previous display
        local display3 = fe.displays[fe.list.display_index].name; //current display
        local display4 = fe.displays[fe.list.display_index + 1].name; //next display
local display5 = fe.displays[fe.list.display_index + 2].name;
OBJECTS.system1.msg = display1;
OBJECTS.system2.msg = display2;
OBJECTS.system3.msg = display3;
OBJECTS.system4.msg = display4;
OBJECTS.system5.msg = display5;
        OBJECTS.frame.file_name = "images/frames/Default_frame.png";

        break;
            }
break;
    }

}

fe.add_transition_callback("transition_callback" );


Make sure to add all your systems/displays by adding more "cases".

EDIT:  Has problems with the beginning and the end of the list.  I'm not sure how to make it loop.  Will research.

EDIT 2:  Found a very rough workaround.  You have to subtract or add the total index number which you can use fe.displays.len() to find.
So for example if you have a list of 10 systems then for the first system you need to -2, -1, 0, +1, +2 but make sure the first two formulas you are adding 10 to it.  So the formula will be (-2 + 10) and (-1 + 10).  That way the end result is the number that is at the end of the list 8 and 9 respectively and not negative numbers.  Because you the display index will never be a negative number.

For example i am doing this:
Code: [Select]
                local displaytotal = fe.displays.len();

//excerpt code below
case "Atomiswave":
local display1 = fe.displays[fe.list.display_index - 2 + displaytotal].name;
local display2 = fe.displays[fe.list.display_index - 1 + displaytotal].name;
                local display3 = fe.displays[fe.list.display_index].name;
                local display4 = fe.displays[fe.list.display_index + 1].name;
local display5 = fe.displays[fe.list.display_index + 2].name;
break;
Pages: 1 2 [3] 4 5 ... 10