Attract-Mode Support > Scripting

Shuffle v2.2.0 - Loop feature now added

<< < (2/9) > >>

keilmillerjr:

--- Quote from: rand0m on June 09, 2019, 06:29:48 PM ---Thanks for the rework Keil, shuffle v2.0 is working as expected after updating the code (as listed in readme). No errors encountered atm. Any chance to get an additional feature since you are updating the code? An option to switch between default behavior (loop) and stop scrolling at end of list (No loop).

--- End quote ---

Oh yeah. I had an idea for how to accomplish that. Back to work today, for two more long days. Give me a reminder Wednesday in case I forget.

keilmillerjr:
v2.0.1
Bug Fix
Resolved issues with favorites signals

https://github.com/keilmillerjr/shuffle-module/releases/tag/v2.0.1

jedione:
any help..
i get an error on last line, last column


--- Code: ---C:\auraAM\layouts/bionic/scripts/shuffle-list.nut line = (90) column = (1) : error expression expected
Script Error in C:\auraAM\layouts/bionic/scripts/shuffle-list.nut - expression expected
--- End code ---

ohh.. here is the code...

--- Code: ---local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;


fe.load_module("shuffle");

local x = flx*0.054
##        fly*
local w = flw*0.305
local h = flh*0.120

local x1 = flx*0.000
##        fly*
local w1 = flw*0.490
local h1 = flh*0.130

// Extend the Shuffle class
class ShuffleList extends Shuffle {
function refresh() {
base.refresh();
}

// Overwrite the _refreshSelected function
function _refreshSelected(slot) {
slot.font="BebasNeue Regular.ttf";

// Overwrite the _refreshDeselected function
function _refreshDeselected(slot) {
slot.font="BebasNeue Regular.ttf";

local list = [];
list.push(fe.add_text("[Title]", x, fly*0.080, w, h));
list.push(fe.add_text("[Title]", x, fly*0.145, w, h));
list.push(fe.add_text("[Title]", x, fly*0.210, w, h));
list.push(fe.add_text("[Title]", x, fly*0.275, w, h));
list.push(fe.add_text("[Title]", x, fly*0.340, w, h));
list.push(fe.add_text("[Title]", x, fly*0.405, w, h));
list.push(fe.add_text("[Title]", x, fly*0.470, w, h));
list.push(fe.add_text("[Title]", x, fly*0.535, w, h));
list.push(fe.add_text("[Title]", x, fly*0.600, w, h));
list.push(fe.add_text("[Title]", x, fly*0.665, w, h));
list.push(fe.add_text("[Title]", x, fly*0.730, w, h));
list.push(fe.add_text("[Title]", x, fly*0.795, w, h));


/////////////////////////////////////////////////////////

//Shufffle Pow Extend the Shuffle class
class ShufflePow extends Shuffle {
function refresh() {
base.refresh();
}

// Overwrite the _refreshSelected function
function _refreshSelected(slot) {
slot.visible = true;
}

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

local pow = [];
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.090, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.156, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.222, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.286, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.352, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.416, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.482, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.546, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.612, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.678, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.744, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.810, w1, h1));



// Create an instance of the extended class
local list = ShuffleList({ slots=list });
local pow = ShufflePow({ slots=pow});

--- End code ---

keilmillerjr:

--- Quote from: jedione on June 10, 2019, 10:55:05 AM ---any help..
i get an error on last line, last column


--- Code: ---C:\auraAM\layouts/bionic/scripts/shuffle-list.nut line = (90) column = (1) : error expression expected
Script Error in C:\auraAM\layouts/bionic/scripts/shuffle-list.nut - expression expected
--- End code ---

ohh.. here is the code...

--- Code: ---local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;


fe.load_module("shuffle");

local x = flx*0.054
##        fly*
local w = flw*0.305
local h = flh*0.120

local x1 = flx*0.000
##        fly*
local w1 = flw*0.490
local h1 = flh*0.130

// Extend the Shuffle class
class ShuffleList extends Shuffle {
function refresh() {
base.refresh();
}

// Overwrite the _refreshSelected function
function _refreshSelected(slot) {
slot.font="BebasNeue Regular.ttf";

// Overwrite the _refreshDeselected function
function _refreshDeselected(slot) {
slot.font="BebasNeue Regular.ttf";

local list = [];
list.push(fe.add_text("[Title]", x, fly*0.080, w, h));
list.push(fe.add_text("[Title]", x, fly*0.145, w, h));
list.push(fe.add_text("[Title]", x, fly*0.210, w, h));
list.push(fe.add_text("[Title]", x, fly*0.275, w, h));
list.push(fe.add_text("[Title]", x, fly*0.340, w, h));
list.push(fe.add_text("[Title]", x, fly*0.405, w, h));
list.push(fe.add_text("[Title]", x, fly*0.470, w, h));
list.push(fe.add_text("[Title]", x, fly*0.535, w, h));
list.push(fe.add_text("[Title]", x, fly*0.600, w, h));
list.push(fe.add_text("[Title]", x, fly*0.665, w, h));
list.push(fe.add_text("[Title]", x, fly*0.730, w, h));
list.push(fe.add_text("[Title]", x, fly*0.795, w, h));


/////////////////////////////////////////////////////////

//Shufffle Pow Extend the Shuffle class
class ShufflePow extends Shuffle {
function refresh() {
base.refresh();
}

// Overwrite the _refreshSelected function
function _refreshSelected(slot) {
slot.visible = true;
}

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

local pow = [];
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.090, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.156, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.222, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.286, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.352, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.416, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.482, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.546, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.612, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.678, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.744, w1, h1));
pow.push(fe.add_image("artwork/favourite-off.png", x1, fly*0.810, w1, h1));



// Create an instance of the extended class
local list = ShuffleList({ slots=list });
local pow = ShufflePow({ slots=pow});

--- End code ---

--- End quote ---

I don’t know. You only posted 85 lines and the error is on line 90.

I have your theme working almost 100%. I cleaned up a lot of the code too. There is one last bug with shuffle that I need to squash. Ran out of time and will have to go back to it tomorrow after work.

jedione:
ok thanks,,,  ill wait for it,, not shure why i cant get it...seem strait up...
hmm not shure...but i look forward to using it and learning,,,,

thanks again...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version