Author Topic: Attract-Mode BUG: Listbox not fade correctly.  (Read 467 times)

iOtero

  • Sr. Member
  • ****
  • Posts: 236
    • View Profile
Attract-Mode BUG: Listbox not fade correctly.
« on: July 17, 2018, 10:33:53 AM »
I use this code to fade a listbox after 3.5 seconds:

Code: [Select]
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;

// Listbox
if(my_config["wheel_type"] == "listbox")
{
::OBJECTS <- {lbx = fe.add_listbox(flx*0.76, fly*0.33, flw*0.20, flh*0.64)}
OBJECTS.lbx.rows = 21;
OBJECTS.lbx.charsize = 24;
OBJECTS.lbx.align = Align.Centre;
OBJECTS.lbx.selbg_alpha = 0;
OBJECTS.lbx.set_selbg_rgb(255,255,255);
OBJECTS.lbx.set_rgb(0,0,0);
OBJECTS.lbx.set_sel_rgb(255,255,255);

// Fade Listbox
local move_lbx1 = { when = Transition.ToNewSelection, property = "alpha", start = 0, end = 255, time = 1} 
local move_lbx2 = { when = When.ToNewSelection, property = "alpha", start = 255, end = 0, time = 2500, delay = 3500} 
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx1));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx2));
}

But it does not fade correctly.

The rest of the listbox fades correctly, but the selected field in the listbox remains visible.

It seems totally an Attract-Mode bug.

Does anyone know why this happens?

Is there any solution?

Edit: The bug has been confirmed in "Bug Reports" by Oomek. As soon as there is a solution, I will communicate it here.
« Last Edit: August 29, 2018, 05:09:43 AM by iOtero »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

Oomek

  • Sr. Member
  • ****
  • Posts: 239
    • View Profile
Re: Possible Attract-Mode BUG: Listbox not fade correctly.
« Reply #1 on: July 19, 2018, 06:53:44 AM »
Most likely you forgot to add sel_alpha property to the list

iOtero

  • Sr. Member
  • ****
  • Posts: 236
    • View Profile
Re: Possible Attract-Mode BUG: Listbox not fade correctly.
« Reply #2 on: July 20, 2018, 05:04:35 AM »
Most likely you forgot to add sel_alpha property to the list

I've added all options:

Code: [Select]

::OBJECTS <- {lbx = fe.add_listbox(flx*0.76, fly*0.33, flw*0.20, flh*0.64)}
OBJECTS.lbx.rows = 21;
OBJECTS.lbx.charsize = font_list_size;
OBJECTS.lbx.align = my_align;
OBJECTS.lbx.alpha = 255;
OBJECTS.lbx.bg_alpha = 0;
OBJECTS.lbx.sel_alpha = 255;
OBJECTS.lbx.selbg_alpha = 0;
OBJECTS.lbx.set_rgb(0,0,0);
OBJECTS.lbx.set_bg_rgb(255,255,255);
OBJECTS.lbx.set_sel_rgb(255,255,255);
OBJECTS.lbx.set_selbg_rgb(255,255,255);

and problem remain the same.


« Last Edit: July 20, 2018, 12:08:27 PM by zlagos »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

iOtero

  • Sr. Member
  • ****
  • Posts: 236
    • View Profile
Re: Attract-Mode BUG: Listbox not fade correctly.
« Reply #3 on: July 23, 2018, 11:01:03 AM »
In "Bug Reports" they have closed the thread.
I read it and they had found the problem and Mickelson said he was going to correct it.
I have downloaded the dabone's nightly of 07_24_2018 (http://forum.attractmode.org/index.php?topic=2324.0) and it is not fixed.
We will have to wait.
« Last Edit: July 24, 2018, 07:23:21 AM by zlagos »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

Oomek

  • Sr. Member
  • ****
  • Posts: 239
    • View Profile
Re: Attract-Mode BUG: Listbox not fade correctly.
« Reply #4 on: July 24, 2018, 11:20:26 AM »
It fades fine when I've tried with the code below:

Code: [Select]
local flw = fe.layout.width
local flh = fe.layout.height

local snap = fe.add_artwork( "snap", 0, 0, flw, flh )
local lb = fe.add_listbox( 0, 0, flw, flh )
lb.set_bg_rgb( 100,100,100)
lb.bg_alpha = 255;

function tick( ttime ){
local f = (cos( ttime * 0.002 ) + 1) * 127
lb.alpha = f
lb.bg_alpha = f
lb.selbg_alpha = f
lb.sel_alpha = f
}
fe.add_ticks_callback( "tick" )

Would you be more speciffic and provide an example code of when it's not fading?


iOtero

  • Sr. Member
  • ****
  • Posts: 236
    • View Profile
Re: Attract-Mode BUG: Listbox not fade correctly.
« Reply #5 on: July 24, 2018, 12:13:58 PM »
This code not fade selected game with this version of AM: http://forum.attractmode.org/index.php?topic=2324.0

Code: [Select]
local flw = fe.layout.width;
local flh = fe.layout.height;
local flx = fe.layout.width;
local fly = fe.layout.height;
local R = 0;
local G = 0;
local B = 0;
local Rs = 255;
local Gs = 255;
local Bs = 255;
local font_list_size = flh*0.02222222222;
local my_align = Align.Centre;
local my_delay = 3500;
local my_time = 600;

// Listbox
::OBJECTS <- {lbx = fe.add_listbox(flx*0.76, fly*0.33, flw*0.20, flh*0.64)}
OBJECTS.lbx.rows = 21;
OBJECTS.lbx.charsize = font_list_size;
OBJECTS.lbx.align = my_align;
OBJECTS.lbx.bg_alpha = 0;
OBJECTS.lbx.set_rgb(R,G,B);
OBJECTS.lbx.sel_alpha = 255;
OBJECTS.lbx.selbg_alpha = 0;
OBJECTS.lbx.set_sel_rgb(Rs,Gs,Bs);

if(my_delay>0)
{
local move_lbx3 = { when = Transition.ToNewSelection, property = "alpha", start = 0, end = 255, time = 1} 
local move_lbx4 = { when = When.ToNewSelection, property = "alpha", start = 255, end = 0, time = my_time, delay = my_delay} 
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx3));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx4));
}

I have used the help of a code that my friend qqplayer has given me to solve it:

Code: [Select]
local flw = fe.layout.width;
local flh = fe.layout.height;
local flx = fe.layout.width;
local fly = fe.layout.height;
local R = 0;
local G = 0;
local B = 0;
local Rs = 255;
local Gs = 255;
local Bs = 255;
local font_list_size = flh*0.02222222222;
local my_align = Align.Centre;
local my_delay = 3500;
local my_time = 600;

// Listbox
::OBJECTS <- {lbx = fe.add_listbox(flx*0.76, fly*0.33, flw*0.20, flh*0.64)}
OBJECTS.lbx.rows = 21;
OBJECTS.lbx.charsize = font_list_size;
OBJECTS.lbx.align = my_align;
OBJECTS.lbx.bg_alpha = 0;
OBJECTS.lbx.set_rgb(R,G,B);
OBJECTS.lbx.sel_alpha = 0;
OBJECTS.lbx.selbg_alpha = 0;
OBJECTS.lbx.set_sel_rgb(Rs,Gs,Bs);

::OBJECTSt <- {lbxtitle = fe.add_text("[Title]",flx*0.76, fly*0.6424, flw*0.20, flh*0)}
OBJECTSt.lbxtitle.charsize = font_list_size;
OBJECTSt.lbxtitle.align = my_align;
OBJECTSt.lbxtitle.bg_alpha = 255;
OBJECTSt.lbxtitle.set_rgb(Rs,Gs,Bs);

if(my_delay>0)
{
local move_lbx3 = { when = Transition.ToNewSelection, property = "alpha", start = 0, end = 255, time = 1} 
local move_lbx4 = { when = When.ToNewSelection, property = "alpha", start = 255, end = 0, time = my_time, delay = my_delay} 
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx3));
animation.add(PropertyAnimation(OBJECTS.lbx, move_lbx4));

local move_lbxtitle1 = { when = Transition.ToNewSelection, property = "alpha", start = 0, end = 255, time = 1} 
local move_lbxtitle2 = { when = When.ToNewSelection, property = "alpha", start = 255, end = 0, time = my_time, delay = my_delay} 
animation.add(PropertyAnimation(OBJECTSt.lbxtitle, move_lbxtitle1));
animation.add(PropertyAnimation(OBJECTSt.lbxtitle, move_lbxtitle2));
}

In any case, i can only get a nightly version of windows, not the ones i need from Mac or LInux, so i'll leave it with the added code, which works on all systems.
« Last Edit: July 24, 2018, 12:44:34 PM by zlagos »
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D

Oomek

  • Sr. Member
  • ****
  • Posts: 239
    • View Profile
Re: Attract-Mode BUG: Listbox not fade correctly.
« Reply #6 on: July 25, 2018, 12:49:03 PM »
I have a theory that what you are experiencing is actually an issue with the animation module that has used a loophole present in AM v2.3 as I do not see anywhere in that module any references to the sel_alpha or selbg_alpha properties.