Author Topic: [ListSize] [Resolved]  (Read 5244 times)

Wenzon

  • Full Member
  • ***
  • Posts: 59
    • View Profile
[ListSize] [Resolved]
« 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.
« Last Edit: September 25, 2019, 11:14:56 AM by Wenzon »

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [ListSize]
« Reply #1 on: September 15, 2019, 04:43:59 AM »
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.  :-[
Nacer a los 15 años Una novela de iOtero

Wenzon

  • Full Member
  • ***
  • Posts: 59
    • View Profile
Re: [ListSize]
« Reply #2 on: September 15, 2019, 09:55:44 AM »
I hope you can understand with my bad English. ;D
 Below is the code and the image.


Code: [Select]
//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.

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [ListSize]
« Reply #3 on: September 15, 2019, 10:32:54 AM »
I need to see your attract.cfg, i think i already know what it is...
My english is very bad, i am from Spain.
Nacer a los 15 años Una novela de iOtero

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: [ListSize]
« Reply #4 on: September 16, 2019, 06:28:48 PM »
just a guess but,
 is-int this,,,

     in_cycle             yes
   in_menu            no


in the am, config....?

« Last Edit: September 16, 2019, 06:30:31 PM by jedione »
help a friend....

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [ListSize]
« Reply #5 on: September 17, 2019, 06:51:00 AM »
just a guess but,
 is-int this,,,

     in_cycle             yes
   in_menu            no


in the am, config....?


You have already spoiled my surprise  :'(
Nacer a los 15 años Una novela de iOtero

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: [ListSize]
« Reply #6 on: September 17, 2019, 10:07:48 AM »
I think you can´t use magic tokens for this purpose.
I suppose you need to create a function with "fe.CurrentList"

Code: [Select]
#### `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)
« Last Edit: September 17, 2019, 01:03:57 PM by qqplayer »

Wenzon

  • Full Member
  • ***
  • Posts: 59
    • View Profile
Re: [ListSize]
« Reply #7 on: September 17, 2019, 10:21:53 AM »
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.

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: [ListSize]
« Reply #8 on: September 17, 2019, 11:36:24 AM »
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.

« Last Edit: September 17, 2019, 01:05:34 PM by qqplayer »

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: [ListSize]
« Reply #9 on: September 18, 2019, 03:08:56 AM »
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...
Nacer a los 15 años Una novela de iOtero

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: [ListSize]
« Reply #10 on: September 18, 2019, 03:50:37 PM »
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.


Code: [Select]
//
//


 ::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" );

//
//

Wenzon

  • Full Member
  • ***
  • Posts: 59
    • View Profile
Re: [ListSize]
« Reply #11 on: September 23, 2019, 12:12:36 PM »
Quote from: qqplayer
This works, just need to set the right position and color.

That's easy.  :)

Quote from: qqplayer
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.



qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: [ListSize]
« Reply #12 on: September 24, 2019, 02:58:02 PM »
Just replace 'size' with 'index '
Something like this, cant test atm

Code: [Select]
//
//


 ::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  ;)

Code: [Select]
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...
« Last Edit: September 24, 2019, 03:00:15 PM by qqplayer »

Wenzon

  • Full Member
  • ***
  • Posts: 59
    • View Profile
Re: [ListSize]
« Reply #13 on: September 25, 2019, 11:13:30 AM »
Just replace 'size' with 'index '
Something like this, cant test atm

Code: [Select]
//
//


 ::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  ;)

Code: [Select]
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