Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: Wenzon on September 14, 2019, 08:39:19 PM
-
Is it possible to run [ListSize] by decreasing the number of items? For example, my theme lists 13 systems, 3 of which are not systems but options. I would like to use [ListSize] by decreasing these 3 items.
-
I have not understood you well, nor do i know where your system lists anything...
I would need to see some of the code you are using or know exactly what list you are talking about. :-[
-
I hope you can understand with my bad English. ;D
Below is the code and the image.
//Display ListEntry and ListSize info
local lels = fe.add_text( "[ListEntry]/[ListSize]", flx*0.032, fly*0.683, flw*0.25, flh*0.04 );
lels.set_rgb( 255, 255, 255 );
lels.font="LEDSCORE";
lels.charsize = 12;
lels.align = Align.Right;
For example, the magic token [ListSize] the number of items in the game list.
In the "Display Menu" atract mode lists the systems I created. It has a total of 10 systems, but I added options as "shutdown", "favorites" and "all games", the listing goes to 13 items. I would like [ListeSize] to remove these 3 items. As if subtracting [ListSize] -3 to list the 10 items. I feel very difficult in this part of script and programming language. Thanks for the help.
-
I need to see your attract.cfg, i think i already know what it is...
My english is very bad, i am from Spain.
-
just a guess but,
is-int this,,,
in_cycle yes
in_menu no
in the am, config....?
-
just a guess but,
is-int this,,,
in_cycle yes
in_menu no
in the am, config....?
You have already spoiled my surprise :'(
-
I think you can´t use magic tokens for this purpose.
I suppose you need to create a function with "fe.CurrentList"
#### `fe.CurrentList` ####
This class is a container for status information regarding the current display. The instance of this class is the fe.list object. This class cannot be otherwise instantiated in a script.
Properties:
name - Get the name of the current display.
display_index - Get the index of the current display. Use the fe.set_display() function if you want to change the current display. If this value is less than 0, then the 'Displays Menu' (with a custom layout) is currently showing.
filter_index - Get/set the index of the currently selected filter. (see fe.filters for the list of available filters).
index - Get/set the index of the currently selected game.
search_rule - Get/set the search rule applied to the current game list. If you set this and the resulting search finds no results, then the current game list remains displayed in its entirety. If there are results, then those results are shown instead, until search_rule is cleared or the user navigates away from the display/filter.
size - Get the size of the current game list. If a search rule has been applied, this will be the number of matches found (if > 0)
-
I think my explanation is a little confusing. I want the 13 item to appear on the menu. What I don't want is for the number 13 to appear instead of 10 because atract mode lists those options as items. When I use [LastSize] list the number 13. I would like to present 10 items where I circled the image written SYSTEMS.
-
I think I know exactly what you want.
I made something similar some time ago, dukpoki helped me.
http://forum.attractmode.org/index.php?topic=2250.msg15278#msg15278
You need to modify this functions with fe.CurrentList , so attrack mode will check the size of your list,rest 3 and ten, return (list -3) as the result,
If you cant make the function Ill try to make the code this weekend.
-
Wenzon, the line in which we were jedione and i, after some checks i have done, will not help you. Better try what qqplayer tells you...
-
This works, just need to set the right position and color.
I mean, you will need to show ListEntry and in this case system1 its like a fake ListSize with 3 less items.
//
//
::OBJECTS <- {
system1= fe.add_text("",0, 25, 640, 30)
}
function transition_system(ttype, var, ttime)
{
switch ( ttype )
{
case Transition.ToNewList:
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.FromOldSelection:
local display1 = fe.list.size - 3
OBJECTS.system1.msg = display1;
break;
}
}
fe.add_transition_callback("transition_system" );
//
//
-
This works, just need to set the right position and color.
That's easy. :)
I mean, you will need to show ListEntry and in this case system1 its like a fake ListSize with 3 less items.
But "ListEntry" keeps popping up at number 13. Not wanting to abuse, could you pass me another code or script using "ListEntry" as the last? ::)
Besides English, I'm horrible in programming. Thank you very much for your goodwill qqplayer.
-
Just replace 'size' with 'index '
Something like this, cant test atm
//
//
::OBJECTS2 <- {
system2= fe.add_text("",0, 25, 640, 30)
}
function transition_system2(ttype, var, ttime)
{
switch ( ttype )
{
case Transition.ToNewList:
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.FromOldSelection:
local display2 = fe.list.index - 3
OBJECTS2.system2.msg = display2;
break;
}
}
fe.add_transition_callback("transition_system2" );
//
//
P.D. Should be better create a single working function but I think this its better for you to understand how it works ;)
This class is a container for status information regarding the current display. The instance of this class is the fe.list object. This class cannot be otherwise instantiated in a script.
Properties:
name - Get the name of the current display.
display_index - Gett the index of the current display. Use the fe.set_display() function if you want to change the current display.
filter_index - Get/set the index of the currently selected filter. (see fe.filters for the list of available filters).
index - Get/set the index of the currently selected game.
search_rule - Get/set the search rule applied to the current game list. If you set this and the resulting search finds no results, then the current game list remains displayed in its entirety. If there are results, then those results are shown instead, until search_rule is cleared or the user navigates away from the display/filter.
size - Get the size of the current game list. If a search rule has been applied, this will be the number of matches found (if > 0)
So you can use all this properties depending on what you need, I mean fe.list.name, fe.list.size, fe.list.index...
-
Just replace 'size' with 'index '
Something like this, cant test atm
//
//
::OBJECTS2 <- {
system2= fe.add_text("",0, 25, 640, 30)
}
function transition_system2(ttype, var, ttime)
{
switch ( ttype )
{
case Transition.ToNewList:
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.FromOldSelection:
local display2 = fe.list.index - 3
OBJECTS2.system2.msg = display2;
break;
}
}
fe.add_transition_callback("transition_system2" );
//
//
P.D. Should be better create a single working function but I think this its better for you to understand how it works ;)
This class is a container for status information regarding the current display. The instance of this class is the fe.list object. This class cannot be otherwise instantiated in a script.
Properties:
name - Get the name of the current display.
display_index - Gett the index of the current display. Use the fe.set_display() function if you want to change the current display.
filter_index - Get/set the index of the currently selected filter. (see fe.filters for the list of available filters).
index - Get/set the index of the currently selected game.
search_rule - Get/set the search rule applied to the current game list. If you set this and the resulting search finds no results, then the current game list remains displayed in its entirety. If there are results, then those results are shown instead, until search_rule is cleared or the user navigates away from the display/filter.
size - Get the size of the current game list. If a search rule has been applied, this will be the number of matches found (if > 0)
So you can use all this properties depending on what you need, I mean fe.list.name, fe.list.size, fe.list.index...
Thank you so much! ;D