Attract-Mode Support > Scripting

advanced progres bar

(1/9) > >>

jedione:
retro fe ,,,,has it   

launch box has it...

apparently,  we have seen it in AM ,,,,  Oomek,s layout....that will never come to be..


would anyone like to give it a tackle....  i would love to try to help...

dont we deserve to on this level guys.... :D



thanks..

zpaolo11x:
Hmm I never implemented it in Arcadeflow because I don't want it to look too much like Oomek's work, but considering that I already have code to extract first letter, or decade in case the sorting is by year, or genre if the sorting is by genre, I can try and craft some simple layout using this. Some ideas from the keyboard search plugin might be useful for laying out the letters and highlighting them...

I'm not sure I'll have the time, but I'll see if I can come up with something.

zpaolo11x:
So this is the quick and dirty solution I built, based on my "gameletter" routine. Consider that my routine works for different sortings, but this layout only works if the sorting is not by category, manufacturer or year. If you want to expand it to work with all this sortings you should change the key array accordingly


--- Code: ---function gameletter( offset ) {
   if (fe.filters.len() > 0){

      if (fe.filters[fe.list.filter_index].sort_by == Info.Year){
         local s = fe.game_info( Info.Year, offset )
         return s
      }
      else if (fe.filters[fe.list.filter_index].sort_by == Info.Manufacturer){
         local s = fe.game_info( Info.Manufacturer, offset )
         return s.slice(0,1)
      }
      else if (fe.filters[fe.list.filter_index].sort_by == Info.Category){
         local s = fe.game_info( Info.Category, offset )
         if (s == "") return "?"
         s = split( s, "/" )
         return strip(s[0])
         }
      else {
         local s = fe.game_info( Info.Title, offset )
         if (s.find("The ") == 0) s = s.slice(4,s.len())
         local s2 = s.slice(0,1)
         if ("1234567890".find (s2) != null ){
            s2="#"
         }
         return s2
      }
   }
}


local flw = fe.layout.width
local flh = fe.layout.height
local gamename = fe.add_text("[Title]",0,0,flw,flh/10)
gamename.charsize = gamename.height*0.5

local accent = fe.add_text ("[!gameletter]",0,flh*0.5,flw,flh*0.25)
accent.charsize = flh*0.25

local keys = null
keys = {}
local i = 0
local key_names = [ "#", "A", "B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
foreach (key, val in key_names){
   local key_obj = fe.add_text(val, i*flw/key_names.len(),flh*0.5,flw/key_names.len(),50)
   key_obj.charsize = 50
   key_obj.alpha = 128
   i++
   keys[val] <- key_obj
}

keys [gameletter(0)].alpha = 255

fe.add_transition_callback( this, "on_transition" )

function on_transition( ttype, var, ttime ) {

if (ttype == Transition.ToNewSelection){
   local l1 = gameletter(0)
   local l2 = gameletter(var)

   if (l1 != l2){
      keys [l1].alpha = 128
      keys [l2].alpha = 255
   }
}

}
--- End code ---

jedione:
ill give it a try.....after work today ,,,thanks

jedione:
so i added your code ....thanks to... shuffle module...

and this is what i got....

for starters...it loops so it gets off letter if that makes sence....

if i can get shuffle module to just go from a to z that would be good...

also the sig used is next letter....so when you do next game it is now off to..

almost like it could be fixed with a new module by kyle....hmmm

here is a quick demo just using "next letter"  then at end i screw it up to show you how it is now off.

https://youtu.be/-CiiHgsHEdw


here is the theme....code...


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


function gameletter( offset ) {
   if (fe.filters.len() > 0){

      if (fe.filters[fe.list.filter_index].sort_by == Info.Year){
         local s = fe.game_info( Info.Year, offset )
         return s
      }
      else if (fe.filters[fe.list.filter_index].sort_by == Info.Manufacturer){
         local s = fe.game_info( Info.Manufacturer, offset )
         return s.slice(0,1)
      }
      else if (fe.filters[fe.list.filter_index].sort_by == Info.Category){
         local s = fe.game_info( Info.Category, offset )
         if (s == "") return "?"
         s = split( s, "/" )
         return strip(s[0])
         }
      else {
         local s = fe.game_info( Info.Title, offset )
         if (s.find("The ") == 0) s = s.slice(4,s.len())
         local s2 = s.slice(0,1)
         if ("1234567890".find (s2) != null ){
            s2="#"
         }
         return s2
      }
   }
}



local gamename = fe.add_text("[Title]",600,400,800,50);
gamename.charsize = 50

local white = fe.add_image ("white.png",232,150,50,980);
white.set_rgb ( 0, 0, 0 );

local snap = fe.add_artwork ("snap",400,400,400,400);


//local accent = fe.add_text ("[!gameletter]",233,400,50,50);
//accent.charsize = flh*0.20





local x = flx*0.122
##        fly*
local w = flw*0.260
local h = flh*0.060

local x1 = flx*0.051
##        fly*
local w1 = flw*0.000
local h1 = flh*-0.02



## call module
#######################################
fe.load_module("shuffle");


## Extend the Shuffle class
#######################################
class ShuffleList extends Shuffle {
function update() {
base.update();
}

## Overwrite the select function
#######################################
function select(slot) {
slot.font="RLU.ttf";
slot.align = Align.Left;
slot.charsize = 27;
slot.style = Style.Bold;
//slot.set_rgb ( 255, 255, 0 );
//slot.alpha = 200;
}

## Overwrite the deselect function
#######################################
function deselect(slot) {
slot.font="RLU.ttf";
slot.align = Align.Left;
slot.charsize = 27;
slot.style = Style.Bold;
slot.set_rgb (240, 240, 240);
//slot.alpha = 200;
}
}

##Shuffle Gamelist
#######################################
local list = [];
list.push(fe.add_text("A", x, fly*0.122, w, h));
list.push(fe.add_text("B", x, fly*0.177, w, h));
list.push(fe.add_text("C", x, fly*0.232, w, h));
list.push(fe.add_text("D", x, fly*0.287, w, h));
list.push(fe.add_text("E", x, fly*0.342, w, h));
list.push(fe.add_text("F", x, fly*0.397, w, h));
list.push(fe.add_text("G", x, fly*0.452, w, h));
list.push(fe.add_text("H", x, fly*0.507, w, h));
list.push(fe.add_text("I", x, fly*0.562, w, h));
list.push(fe.add_text("J", x, fly*0.617, w, h));
list.push(fe.add_text("K", x, fly*0.672, w, h));
list.push(fe.add_text("L", x, fly*0.727, w, h));
list.push(fe.add_text("M", x, fly*0.782, w, h));
list.push(fe.add_text("N", x, fly*0.837, w, h));
list.push(fe.add_text("O", x, fly*0.892, w, h));



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

## Overwrite the select function
#######################################
function select(slot) {
slot.visible = true;
        slot.font="RLU.ttf";
slot.align = Align.Left;
slot.charsize = 27;
slot.style = Style.Bold;
slot.set_rgb ( 0, 255, 0 );
}

## Overwrite the select function
#######################################
function deselect(slot) {
slot.visible = false;
}
}

## extended image list
#######################################
local pow = [];
pow.push(fe.add_text("[!gameletter]", x, fly*0.122, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.177, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.232, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.287, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.342, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.397, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.452, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.507, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.562, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.617, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.672, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.727, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.782, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.837, w, h));
pow.push(fe.add_text("[!gameletter]", x, fly*0.892, w, h));






## Create an instance of the extended class
#########################################

local list = ShuffleList(list, "text");
local pow = ShufflePow(pow, "text");




--- End code ---

 of coarse it need shuffle module

Navigation

[0] Message Index

[#] Next page

Go to full version