Author Topic: Shuffle v2.2.0 - Loop feature now added  (Read 1041 times)

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.1.0 - Refactoring and bug fixes
« Reply #15 on: June 15, 2019, 03:04:44 PM »
@Rand0m

I forgot, but I think fe.list.index is position in array, not relative to current. If this be the case, loop=false is definately possible. If the index is zero or the same as the list length minus 1, do no change slot. Some checks will have to be put in place to make sure that your not starting with index 0 or max in the middle of the slots. If list size is less than slots, your layout will have to adjust accordingly. Thats my brainstorming while waiting for work to start. Next day off will try to tackle.
« Last Edit: June 15, 2019, 03:07:01 PM by keilmillerjr »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #16 on: June 18, 2019, 02:16:12 AM »
v.2.2.0 is out. Updated main post. I hope you guys like the addition of the requested feature - loop!

rand0m

  • Sr. Member
  • ****
  • Posts: 238
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #17 on: June 18, 2019, 04:28:12 AM »
v.2.2.0 is out. Updated main post. I hope you guys like the addition of the requested feature - loop!

What a pleasant surprise, thanks a lot Keil! No loop is working great, one small issue is when moving back (say from SNES to Consoles) Console becomes the first item on the list (instead of arcades then computers then consoles). I think I can force it to go to first item (in this case arcades) but if it can retain the position of its parent item, it would be great.

Thanks a lot, this issue had been bugging me for ages. more power to you. I am much grateful!  ;D

If anyone wants to use the no loop, i.e. the items won't be repeated. Then, wrt to example in last page:

Code: [Select]
local list = ShuffleList({ loop=false, slots=list });
local pow = ShufflePow({ loop=false, slots=pow});
« Last Edit: June 18, 2019, 04:31:35 AM by rand0m »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #18 on: June 22, 2019, 12:42:07 AM »
Working on two things:

  • Save feature will work on a per list basis. Display name needs to be taken into account.
  • Hide option will change visibility on slots exceeding the list length, and work accordingly with or without loop enabled. It’s a possibility to have hiding work with left/right/center, but this will require more time to code.
« Last Edit: June 22, 2019, 12:51:20 AM by keilmillerjr »

iOtero

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #19 on: July 25, 2019, 10:13:23 AM »
Keil, I think that all the versions you have taken out of the Shuffle module do something that I don't like at all. It is not important, it will surely seem good to others.

But if I have a shuffle list of 24 titles, and for example, I change the filter with next_filter(), and the new list has only 5 titles, what the shuffle list does is repeat the names until the 24 slots are filled.

I think it would be better if only those 5 came out. But, or I haven't seen it, or there's no such option in the shuffle module.

This is how you want it to work, or you could set an option to work as i say?

Thank you for your time, and sorry for the inconvenience.
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

rand0m

  • Sr. Member
  • ****
  • Posts: 238
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #20 on: July 25, 2019, 11:30:06 AM »
Keil, I think that all the versions you have taken out of the Shuffle module do something that I don't like at all. It is not important, it will surely seem good to others.

But if I have a shuffle list of 24 titles, and for example, I change the filter with next_filter(), and the new list has only 5 titles, what the shuffle list does is repeat the names until the 24 slots are filled.

I think it would be better if only those 5 came out. But, or I haven't seen it, or there's no such option in the shuffle module.

This is how you want it to work, or you could set an option to work as i say?

Thank you for your time, and sorry for the inconvenience.

Code: [Select]
local list = ShuffleList({ save="Retromania", hide=true, loop=false, slots=list });
local pow = ShufflePow({ save="Retromania", hide=true, loop=false, slots=pow});

Adding hide=true will not repeat items in list.

iOtero

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #21 on: July 25, 2019, 01:03:58 PM »

Code: [Select]
local list = ShuffleList({ save="Retromania", hide=true, loop=false, slots=list });
local pow = ShufflePow({ save="Retromania", hide=true, loop=false, slots=pow});

Adding hide=true will not repeat items in list.

Thanks, but ... are you sure? Because in the documentation of shuffle 2.2.0 there is nothing about that...
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #22 on: July 25, 2019, 03:52:22 PM »

Code: [Select]
local list = ShuffleList({ save="Retromania", hide=true, loop=false, slots=list });
local pow = ShufflePow({ save="Retromania", hide=true, loop=false, slots=pow});

Adding hide=true will not repeat items in list.

Thanks, but ... are you sure? Because in the documentation of shuffle 2.2.0 there is nothing about that...

That feature isnt finished, thats why it isnt documented or in a versioned release. You can try it with the latest commit in the master branch. Ive been busy and distracted. Will get back to it at some point.
« Last Edit: July 26, 2019, 04:31:50 AM by keilmillerjr »

iOtero

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #23 on: July 26, 2019, 02:36:13 AM »
This code

Code: [Select]
fe.load_module("shuffle");

// Lista
local flxl = flx*0.0255;
local flyl = fly*0.1656;
local flwl = flw*0.2792;
local flhl = flh*0.0001;
local fhl  = flh*0.0252;
local lineas = 24;

local list = [];
for(local i=0; i<lineas; i++)
{
list.push(fe.add_text("[Title]", flxl, flyl, flwl, flhl));
flyl = flyl + fhl;
}

class ShuffleList extends Shuffle
{
function _refreshSelected(slot)
{
slot.align = Align.Left;
slot.charsize = fuente_selec;
slot.set_rgb(Rd,Gd,Bd);
}

function _refreshDeselected(slot)
{
slot.align = Align.Left;
slot.charsize = fuente_peque;
slot.set_rgb(Rl,Gl,Bl);
}
}

local list = ShuffleList({ save="barrika beach", hide=true, loop=false, slots=list, reset=true });

Display this:
« Last Edit: July 26, 2019, 02:40:55 AM by iOtero »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #24 on: July 26, 2019, 04:39:16 AM »
iOtero - try the latest commit in the master branch. As for the animation you want, i would use a surface. You need to use ticks to keep track of time and transitions. Understanding the concept can be kind of hard at first. Unless the animation library provides something. Im not sure.

iOtero

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #25 on: July 26, 2019, 04:51:09 AM »
iOtero - try the latest commit in the master branch. As for the animation you want, i would use a surface. You need to use ticks to keep track of time and transitions. Understanding the concept can be kind of hard at first. Unless the animation library provides something. Im not sure.

Thanks Kiel, I have already solved the animation with a surface. I made a silly mistake when positioning the surface.  :-[

I will try what you tell me with latest commit.

Checked, it works fine whenever loop = false. If I put loop = true, the list goes well, but the pow gets out of control. Thanks.

Error message:

Code: [Select]

AN ERROR HAS OCCURED [indexing integer with string]

CALLSTACK
*FUNCTION [_transitions()] E:\pi\attract\modules\shuffle.nut line [171]

LOCALS
[ttime] 0
[var] 0
[ttype] 7
[this] INSTANCE
Script Error in transition function: _transitions - indexing integer with string

AN ERROR HAS OCCURED [indexing integer with string]

CALLSTACK
*FUNCTION [_transitions()] E:\pi\attract\modules\shuffle.nut line [171]

LOCALS
[ttime] 0
[var] 0
[ttype] 7
[this] INSTANCE
Script Error in transition function: _transitions - indexing integer with string

AN ERROR HAS OCCURED [indexing integer with string]

CALLSTACK
*FUNCTION [_transitions()] E:\pi\attract\modules\shuffle.nut line [171]

LOCALS
[ttime] 0
[var] 0
[ttype] 7
[this] INSTANCE
Script Error in transition function: _transitions - indexing integer with string

« Last Edit: July 26, 2019, 05:33:17 AM by iOtero »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

iOtero

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #26 on: September 14, 2019, 10:23:24 AM »
Keil, there is a bug that I get using this module, you can see it in the 01:55 minute of this video:

https://www.youtube.com/watch?v=q4Rp2SoTB-o

When i change Category, the pointer stays out of the list and does not move if the following list has fewer lines...

The code used is as follows:

Code: [Select]
// Lista
local flxl = flx*0.0155;
local flyl = fly*0.1908;
local flwl = flw*0.2832;
local flhl = flh*0.0001;
local fhl  = flh*0.0305;
local lineas = 20;

local lista = [];

for(local i=0; i<lineas; i++)
{
lista.push(fe.add_text("[Title]", flxl, flyl, flwl, flhl));
flyl = flyl + fhl;
}

class ShuffleList extends Shuffle
{
function _refreshSelected(slot)
{
slot.align = Align.Left;
slot.charsize = fuente_peque;
}

function _refreshDeselected(slot)
{
slot.align = Align.Left;
slot.charsize = fuente_peque;
}
}

local lista = ShuffleList({hide=true, loop=false, slots=lista, reset=false });

// Marcador
local flxp = flx*0.0078;
local flyp = fly*0.1735;
local flwp = flw*0.0125;
local flhp = flh*0.042;

local marcador = [];

for(local i=0; i<lineas; i++)
{
marcador.push(fe.add_image("objs/flecha.png", flxp, flyp, flwp, flhp));
flyp = flyp + fhl;
}

class ShuffleMarcador extends Shuffle
{
function _refreshSelected(slot)
{
slot.visible = true;
}

function _refreshDeselected(slot)
{
slot.visible = false;
}
}

local marcador = ShuffleMarcador({hide=true, loop=false, slots=marcador, reset=false});
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #27 on: September 14, 2019, 10:38:10 AM »
Good find iOtero. I have logic for new list, but not filters. Currently working on a new project. Transferring everything to gitlab group and started a wiki. Will put this on my list to do afterwards. Thank you!

Wiki is http://arcademvs.org if you want to check it out. Going to have an attract section for setting up filters and displays eventually. I think a few people here could help me with the displays section.
« Last Edit: September 15, 2019, 05:41:39 AM by keilmillerjr »

iOtero

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #28 on: September 15, 2019, 04:46:08 AM »
When i give the link to arcademvs he tells me this:

arcademvs.com
2019 Copyright. All Rights Reserved.
The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois).
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 968
    • View Profile
Re: Shuffle v2.2.0 - Loop feature now added
« Reply #29 on: September 15, 2019, 05:42:10 AM »
When i give the link to arcademvs he tells me this:

arcademvs.com
2019 Copyright. All Rights Reserved.
The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois).


arcademvs.org - I made a mistake.