Recent Posts

Pages: [1] 2 3 ... 10
1
Scripting / Re: advanced progres bar
« Last post by jedione on Today at 07:10:34 PM »
sent, test theme.... ;)
2
General / [HELP] Scroll UP - Scroll Down manual History.dat Info
« Last post by arthurvalenca on Today at 05:03:55 PM »
Hello everyone, I need some help so I can scroll the history.dat text up and down when it is displayed in the menu using the arrow keys, would anyone have any idea how to do it, below I leave the code I'm using to the text appears.

Code:
Code: [Select]
class UserConfig {
</ label="Preview Buttom", help="Input that triggers a search", options="custom1,custom2,custom3,custom4,custom5,custom6", order=5 /> preview="custom2";
}

local my_config = fe.get_config();

# Resolução #
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;


fe.load_module("fade");
fe.load_module( "animate" );


::OBJECTS <- {

bg_black = fe.add_image ("images/popup/black.png",0,0,flw, flh),
game_flyer = fe.add_artwork("wheel",flx*0.360, fly*0.400, flw*0.280, flh*0.190),
game_desc = fe.add_text("[!get_hisinfo]",flx*0.245, fly*0.300, flw*0.500, flh*0.720),
game_desc1 = fe.add_text("[Overview]",flx*0.245, fly*0.300, flw*0.500, flh*0.720),

}

OBJECTS.bg_black.alpha = 240;

OBJECTS.game_desc.word_wrap = true;
OBJECTS.game_desc.font = "Geforce Light";
OBJECTS.game_desc.align = Align.Centre;
OBJECTS.game_desc.word_wrap = true;
OBJECTS.game_desc.charsize = 35;

OBJECTS.game_desc1.word_wrap = true;
OBJECTS.game_desc1.font = "Geforce Light";
OBJECTS.game_desc1.align = Align.Centre;
OBJECTS.game_desc1.word_wrap = true;
OBJECTS.game_desc1.charsize = 35;

OBJECTS.bg_black.visible=false;
OBJECTS.game_flyer.visible=false;
OBJECTS.game_desc.visible=false;
OBJECTS.game_desc1.visible=false;

class displayPreview{

_trigger="Custom1";

constructor()
{
fe.add_signal_handler( this, "on_signal" )
_trigger=fe.get_config()["preview"].tolower();
}

function on_signal( signal )
{
if ( signal == _trigger )
{
local previewClick = fe.add_sound("images/popup/start.mp3")
previewClick.playing=true
display_preview();
return true;
}
return false;
}
}

displayPreview();

function display_preview()
{

if (OBJECTS.bg_black.visible == false) {

OBJECTS.bg_black.visible=true;
OBJECTS.game_flyer.visible=true;
OBJECTS.game_desc.visible=true;
OBJECTS.game_desc1.visible=true;

local shrink_bg_black = {
    property = "scale", start = 0.1 end = 1.0, time = 500 tween = Tween.Quad,
 }

local move_game_flyer_y = {
    property = "y", start = fly*2 end = fly*0.00, time = 450
 } 

local move_game_desc_y = {
    property = "y", start = fly*2 end = fly*0.190, time = 600
 }

local move_game_desc1_y = {
    property = "y", start = fly*2 end = fly*0.190, time = 600
 } 

animation.add( PropertyAnimation( OBJECTS.bg_black, shrink_bg_black ) );
animation.add( PropertyAnimation( OBJECTS.game_flyer, move_game_flyer_y ) );
animation.add( PropertyAnimation( OBJECTS.game_desc, move_game_desc_y ) );
animation.add( PropertyAnimation( OBJECTS.game_desc1, move_game_desc1_y ) );

}

else if (OBJECTS.bg_black.visible == true) {

OBJECTS.bg_black.visible=false;
OBJECTS.game_flyer.visible=false;
OBJECTS.game_desc.visible=false;
OBJECTS.game_desc1.visible=false;
 }
}

Thanks!!!
3
Scripting / Re: advanced progres bar
« Last post by arthurvalenca on Today at 04:38:53 PM »
ill add a  working one, and send it to ya..tonight

jedione thanks !
enjoying your work
4
Scripting / Re: advanced progres bar
« Last post by jedione on Today at 04:04:17 PM »
ill add a  working one, and send it to ya..tonight
5
Scripting / Re: advanced progres bar
« Last post by arthurvalenca on Today at 02:53:53 PM »
This is my code contribution.

There's a "gameletter" function that acts differently if the list is sorted by name or manufacturer (returns the first letter), by category (returns the main category) or by year (returns the decade in the form 198x).

There is a routine in the on_transition section that, when transitioning to a new list, dynamically builds a table of "sort items" that are letters or years or categories according to the sort order, and changes it every time so the list is always consistent with the sort order. A small tweak can be done to space each "section" proportionally to the number of games in that slot but if there are few games then the category name will not fit, so I let it out

Code: [Select]
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 x0 = 0

      foreach (key in tableorder){
         local key_obj = fe.add_text(key,x0,flh*0.5,flw/tableorder.len(),50)
         key_obj.charsize = 50
         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++
         x0 = x0 + flw/tableorder.len()
         keys[key] <- key_obj
      }

      keys [gameletter(0)].alpha = 255
   }

}


with this code I'm getting this error in layout, could anyone help?

Code: [Select]
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 x0 = 0

      foreach (key in tableorder){
         local key_obj = fe.add_text(key,x0,flh*0.5,flw/tableorder.len(),50)
         key_obj.charsize = 50
         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++
         x0 = x0 + flw/tableorder.len()
         keys[key] <- key_obj
      }

      keys [gameletter(0)].alpha = 255
   }

}

log:

Code: [Select]
Attract-Mode v2.6.0 (Windows, SFML 2.5.1 +SWF +7z +Curl)
avcodec 58.54.100 / avformat 58.29.100 / swscale 5.5.100 / avutil 56.31.100 / swresample 3.5.100

Config: D:\am\attract.cfg

*** Initializing display: 'Arcade'
 - Loaded master romlist 'Arcade' in 179 ms (2665 entries kept, 0 discarded)
 - Constructed 1 filters in 0 ms (2665 comparisons)
 - Loaded layout: D:\am\layouts/Novo/ (layout.nut)

AN ERROR HAS OCCURED [null cannot be used as index]

CALLSTACK
*FUNCTION [on_transition()] D:\am\layouts/Novo/layout.nut line [667]

LOCALS
[keys] NULL
[flh] 1080
[flw] 1920
[err] "the index 'null' does not exist"
[s] NULL
[i] 0
[tableletter] TABLE
[tableorder] ARRAY
[ttime] 50
[var] 0
[ttype] 6
[this] TABLE
Script Error in transition function: on_transition - null cannot be used as index
 - Constructed 1 filters in 0 ms (3 comparisons)
 - Loaded layout: D:\am\layouts/Novo Menu/ (layout.nut)

*** Initializing display: 'Arcade'
 - Loaded master romlist 'Arcade' in 72 ms (2665 entries kept, 0 discarded)
 - Constructed 1 filters in 0 ms (2665 comparisons)
 - Loaded layout: D:\am\layouts/Novo/ (layout.nut)

AN ERROR HAS OCCURED [null cannot be used as index]

CALLSTACK
*FUNCTION [on_transition()] D:\am\layouts/Novo/layout.nut line [667]

LOCALS
[keys] NULL
[flh] 1080
[flw] 1920
[err] "the index 'null' does not exist"
[s] NULL
[i] 0
[tableletter] TABLE
[tableorder] ARRAY
[ttime] 1
[var] 0
[ttype] 6
[this] TABLE
Script Error in transition function: on_transition - null cannot be used as index
 ! Unexpectedly lost focus to: None
 ! Unexpectedly lost focus to: SnippingTool.exe (7364)
 ! Unexpectedly lost focus to: SnippingTool.exe (7364)
 - Constructed 1 filters in 0 ms (3 comparisons)
 - Loaded layout: D:\am\layouts/Novo Menu/ (layout.nut)



6
Themes / Re: Arcadeflow theme v 6.0 [Release] Updated 2 December 2019
« Last post by yxiie on Today at 01:36:56 PM »
You can try an older version of Arcadeflow to see if it's better.

I have tried 5.4 and it took only 4 seconds to load the same romlist.
7
Themes / Re: Arcadeflow theme v 6.0 [Release] Updated 2 December 2019
« Last post by Yaron2019 on Today at 12:29:54 PM »
I have added large romlist as an attachment to this post. Let me know if you need anything else.

I have found the problem: "Weekend Pussy Hunt 03"  ;D  ;D

8
Themes / Re: Arcadeflow theme v 6.0 [Release] Updated 2 December 2019
« Last post by zpaolo11x on Today at 11:06:38 AM »
I have added large romlist as an attachment to this post. Let me know if you need anything else.

Thank you, with Arcadeflow 6.0 I have a 18 second "boot" delay, which is a bit too much admittedly. It seems that Arcadeflow up to 5.4 was much faster, I'll check what changed meanwhile. You can try an older version of Arcadeflow to see if it's better.

The culprit seems to bee the sorting algorithm, that's the main change between 5.4 and 5.5...
9
Scripting / Re: filter to text script help
« Last post by jedione on Today at 11:01:22 AM »
dude you always come through..

thanks for the help..ill try it when i get off work :)
10
Scripting / Re: filter to text script help
« Last post by qqplayer on Today at 09:39:58 AM »
''filter_offset''

http://forum.attractmode.org/index.php?topic=1517.0


Code: [Select]
// Category
local categoryW = floor( bth * 2.5 )
local categoryH = floor( bth * 0.25 )
local categoryX = floor(( flw - crw ) * 0.5 - categoryW * 0.5 + flx)
local categoryY = floor( bth * 0.5 ) - floor( categoryH * 0.5 )
local category = fe.add_text("[FilterName]", categoryX, categoryY, categoryW, categoryH )
category.align = Align.Centre
category.filter_offset = 0
category.style = Style.Regular
category.charsize = floor(category.height * 1000/701)
category.font = "BebasNeueBold.otf"

local categoryLeft = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryLeft.align = Align.Centre
categoryLeft.filter_offset = -1
categoryLeft.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryLeft.style = Style.Regular
categoryLeft.charsize = floor(category.height * 1000/700)
categoryLeft.font = "BebasNeueBook.otf"

local categoryRight = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryRight.align = Align.Centre
categoryRight.filter_offset = 1
categoryRight.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryRight.style = Style.Regular
categoryRight.charsize = floor(category.height * 1000/701)
categoryRight.font = "BebasNeueBook.otf"

local categoryLeft2 = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryLeft2.align = Align.Centre
categoryLeft2.filter_offset = -2
categoryLeft2.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryLeft2.style = Style.Regular
categoryLeft2.charsize = floor(category.height * 1000/701)
categoryLeft2.alpha = 0
categoryLeft2.font = "BebasNeueBook.otf"

local categoryRight2 = fe.add_text("[FilterName]", 0, categoryY, categoryW, categoryH )
categoryRight2.align = Align.Centre
categoryRight2.filter_offset = 2
categoryRight2.set_rgb(selRGB[0],selRGB[1],selRGB[2])
categoryRight2.style = Style.Regular
categoryRight2.charsize = floor(category.height * 1000/701)
categoryRight2.alpha = 0
categoryRight2.font = "BebasNeueBook.otf"
Pages: [1] 2 3 ... 10