Just a few changes allow to place the letter strip in vertical, although there are still some issues in this old code related to games with "The" or "Vs." in the name...
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 )
s = s.slice (0,3)+"x"
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]\n[SortValue]",0,0,flw,flh/10)
gamename.charsize = gamename.height*0.25
local accent = fe.add_text ("[!gameletter]",0,flh*0.5,flw,flh*0.25)
accent.charsize = flh*0.25
local keys = null
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
}
}
if (ttype == Transition.ToNewList){
local tableorder = []
local tableletter = {}
for (local i = 0 ; i < fe.list.size ; i++){
local s = (gameletter (i-fe.list.index))
try { tableletter[s]++ }
catch (err) {
tableletter[s] <- 1
tableorder.push (s)
}
}
keys = {}
local i = 0
local y0 = 0
foreach (key in tableorder){
local key_obj = fe.add_text(key,0,y0,50,flh/tableorder.len())
key_obj.charsize = 25
key_obj.alpha = ((tableletter[key] > 0) ? 128 : 0)
key_obj.set_bg_rgb (100+50*(i%2),100+50*(i%2),100+50*(i%2))
i++
y0 = y0 + flh/tableorder.len()
keys[key] <- key_obj
}
keys [gameletter(0)].alpha = 255
}
}