Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - arthurvalenca

Pages: [1] 2
1
General / [HELP] Custom overlay Menu
« on: March 14, 2021, 07:46:55 AM »
Hello everyone, I would like to know if there is any way to transform the default configuration menu, which comes in the AM, in a personalized menu, I know that Favorites, Tag's and Exit Attractmode can, but I have been breaking my head for many days and not I can come up with a solution, could someone help?


this works well with Favorites, Tags and Exit AttractMode.

Code: [Select]
##########################
## Menu Overall Surface ##
##########################

local overlaySurface = fe.add_surface(flw,flh);
overlaySurface.visible = false;

// translucent background
local overlayBackground = overlaySurface.add_image("images/overlaymenu/black.png",flx*0.0,fly*0.0,flw,flh);
overlayBackground.alpha = 240;

// create extra surface for the menu
local overlayMenuSur = overlaySurface.add_surface(flx*0.600,fly*0.800);
overlayMenuSur.set_pos(flw*0.290,flh*0.210); //tamanho da caixa
overlayMenuSur.add_image("images/overlaymenu/menuframe.png",flx*0.060,fly*0.085,flw*0.300,flh*0.250); // Add the menu frame

local overlay_lb = overlayMenuSur.add_listbox(flx*0.065,fly*0.100,flw*0.291,flh*0.200); //Add the listbox
overlay_lb.rows = 3; // the listbox will have 6 slots
overlay_lb.charsize  = 32;
overlay_lb.font="Geforce Bold";
overlay_lb.set_rgb( 128, 128, 128 );
overlay_lb.align = Align.Centre;
//overlay_lb.sel_style = Style.Bold;
overlay_lb.set_sel_rgb( 111, 174, 0 );
overlay_lb.set_selbg_rgb( 0, 0, 0 );

local overlayMenuTitle = overlayMenuSur.add_text("",flx*0.010,fly*-0.125,flw*0.400,flh*0.35); //Add the menu title
overlayMenuTitle.charsize=35;
overlayMenuTitle.style = Style.Bold;
overlayMenuTitle.set_rgb(255,255,255);

local overlayBartop = overlaySurface.add_image("images/overlaymenu/arrow.gif"); //add the bartop picutre
overlayBartop.set_pos(flx*0.385,fly*0.385,flw*0.035,flh*0.050);

// Show the up time
local ut = overlaySurface.add_text( "ELASPED TIME: ", flx*0.512, fly*0.515, flw*0.100, flh*0.024 );
ut.set_rgb( 190, 190, 190 );
ut.align = Align.Right;
ut.charsize=12;

local ut = overlaySurface.add_text( "", flx*0.607, fly*0.515, flw*0.055, flh*0.024 );
ut.set_rgb( 255, 165, 0 );
ut.align = Align.Left;
ut.charsize= 14;
ut.font = "Geforce Light";




2
General / [HELP] Function Switch Case
« on: February 20, 2021, 05:48:12 AM »
Hello, I need help basically what i would like to do and when i press the key up or down change the platform in attractmode and when change the platform the code by [DisplayName] show the background image referring to the selected platform, could someone help me with this code


Code: [Select]
function on_signal( sig ){

switch ( sig )
{
case "up":
fe.signal( "prev_display" );
return true;

case "down":
fe.signal( "next_display" );
return true;
}
return false;
}
fe.add_signal_handler(this, "on_signal");

##########################################################################################

function layout_transitions(ttype, var, ttime) {
switch(ttype)
{
case Transition.ToNewList:
            switch ([DisplayName])
            {
case "Arcade":

local ar = fe.add_image ( "images/arcade.png", flx*0.0, fly*0.0, flw, flh );

break;

case "Sega Genesis":

local sg = fe.add_image ( "images/sega genesis.png", flx*0.0, fly*0.0, flw, flh );

break;
}
}
return false;
}

3
Scripting / [Script] Create a quick favorite list
« on: January 21, 2021, 04:17:56 AM »
Here is a script that will help many people to easily and quickly create the list of favorites with file backup, this script was developed by a member of the forum "StackOverflow BR" All credits of the script to the friend "It Wasn't Me", basically you should copy the code below and save it as .bat or .cmd, change to the path of your "Romlists", where the .tag files are stored and execute the script.

Original Version Full Speed Link:

https://pt.stackoverflow.com/a/491128/131559



Code: [Select]
@echo off

set /a "_tag=0"
set /a "_num=0"

rem *Place " " Place the path of your romlist folder.

cd /d "D:\AM-2.6.1\Romlists"

setlocal EnableDelayedExpansion

echo==========================================================
echo=    AM Favorites Romlist Generator Script for Windows
echo=      Created by - It Wasn't Me - StackOverflow BR   
echo==========================================================

if not exist .\favorites.txt (
     
      set /p "'= - Cretating .\Favorites.txt File.."<nul
      echo\
     
    )  else (
   
      set /p "'= - Backing up your old Favorites.txt: "<nul
      move /y .\Favorites.txt .\Favorites.txt.backup 2>nul >nul
      if %errorlevel% equ 0 echo\Done^!!
    )
     
echo/- Gathering list of your Favorites: Tags-Files

(echo #Name;Title;Emulator;CloneOf;Year;Manufacturer;Category;Players;Rotation;Control;Status;DisplayCount;DisplayType;AltRomname;AltTitle;Extra;Buttons;Series;Language;Region;Rating) > Favorites.txt

for %%G in (*.tag)do (
     
     set /a "_tag+=1"
     
     for /f useback^delims^= %%i in (`more "%%~G"`)do (
     
         set/p "'=- ROM Found in File %%~nxG: %%~i"<nul
         echo=
         
         find "%%~i;" <"%%~nG.txt" >>".\Favorites.txt"
         if %errorlevel% equ 0 set /a "_num=!_num!+1"
         
        )
    )

set /a "_num=!_num! + 1000"
set /a "_tag=!_tag! + 1000"

call echo/- Romlist Files [tag=txt]: !_tag:~-3!
echo/- Favorites added to Disc: !_num:~-3!
echo/- ROMlist .\Favorites.txt: New

endlocal
echo/- is Done!.. & timeout 5|findstr /ec:\.\Favorites\.txt "%~f0"
goto :EOF

4
General / [HELP] Create Favorites List batch file
« on: January 16, 2021, 09:18:30 PM »
At times I tried to use this script but I was unsuccessful, I configured the path it asks for and put it in the romlist folder, but when I try to create a list from that .bat it reads Arcade.tag it writes inside a Favorites.txt file but when he goes to read the next EX platform: Sega Genesis.tag or Super Nintendo.tag he returns me a message:

Error:
Code: [Select]
   AM favorites romlist generator script for Windows
==========================================================
- Backing up old Favorites.txt file
- Gathering list of favorites (tag files)
- Processing tag file: Arcade.tag
- Searching rom list: Arcade.txt for rom: 64street
- Favorites.txt romlist generated. 1 romlists read, 1 favorites written to disk
- Done

Add a display in Attract Mode and set its romlist to the newly created Favorites.txt
- Processing tag file: Sega Genesis.tag
- Searching rom list: Sega Genesis.txt for rom: Duke Nukem 3D (Brazil)
FINDSTR: could not open Nukem
FINDSTR: could not open 3D
FINDSTR: could not open (Brazil)
FINDSTR: could not open Nukem
FINDSTR: could not open 3D

.bat:
Code: [Select]
@echo off
setlocal EnableDelayedExpansion EnableExtensions
rem ================================================================================
rem This script basically does the same thing as DM's favorites romlist generator
rem but on Windows [Shouts to him for the pi version ;)].
rem How it works:
rem It grabs all the (tagged) favorites from every tag file, searches for them
rem through all the romlists, then generates a romlist called Favorites.txt
rem Written by Steve Sherrod, 05/20/17, as part of project HyperPie Expanded
rem ================================================================================

rem Default path (on windows). This should point to your attract modes romlists dir
cd "D:\AM\romlists\"

echo ==========================================================
echo     AM favorites romlist generator script for Windows
echo ==========================================================

sleep 1

echo - Backing up old Favorites.txt file

rem remove the old Favorites.txt and create the backup
if exist Favorites.txt (
move /y Favorites.txt Favorites.txt.backup
)

echo - Gathering list of favorites (tag files)

set /a numfavorites=0
set /a romlist=0

rem loop through each tag file
for %%f in (*.tag) do (
echo - Processing tag file: %%~nf.tag
set /a numtagfiles=numtagfiles+1

rem loop through favorites stored in tag file
for /f "tokens=*" %%a in ('type "%%~nf.tag"') do (

set /a numfavorites=numfavorites+1
set favorite=%%a

echo - Searching rom list: %%~nf.txt for rom: %%a

rem loop through each rom file and parse favorited (tagged) roms
for /f "tokens=*" %%s in ('type "%%~nf.txt"') do (
set /a romlist=romlist+1
set str=%%s
rem Search current line (for current favorite substring) and if found, append it to Favorites.txt
echo."!str!" | findstr /C:%%a>nul && (
echo "!str!">>"Favorites.txt"
)
)
)

echo - Favorites.txt romlist generated. !numtagfiles! romlists read, !numfavorites! favorites written to disk
echo - Done
echo.
echo Add a display in Attract Mode and set its romlist to the newly created Favorites.txt
)


PS: At the end of the process it only generates the list of arcade favorites, the others are not generated.

Could you help me, please?

5
General / Q. Emulator RPCS3 Playstation 3
« on: September 22, 2020, 03:58:04 PM »
Hello everyone, I've been looking here on the forum for arguments for playstation 3 games on attractmode but I haven't found anything about it, the doubt is anyone would have the arguments to make available?

6
General / [HELP] Code PlayedTime no return Seconds
« on: July 17, 2020, 06:20:24 AM »
I have a problem with this code, it is returning "0 Seconds" for games that are played less than a minute, if I remove the code Seconds it returns "0 Minutes", could someone help me with this problem, or the Attract Mode does not count seconds. thank you!

PS: Hours, Minutes and No time return the correct values, the problem is in the return of the Seconds.


Code: [Select]
################## Played Time ##################

function PlayedTime( ioffset ) {
 
local pt = fe.game_info(Info.PlayedTime,ioffset);
try {
pt = pt.tointeger();
}

catch(e) {
pt = 0
}

if (pt>0) {
pt = pt/60;

if (pt>60) {
pt=pt/60;

if (pt>1) {
return pt.tostring() + " Hours" ;
}

else {
return pt.tostring() + " Hour";
}
}

else if (pt<1){
return pt.tostring() + " Seconds";
}

else {
return pt.tostring() +" Minutes";
}
}
else {
return "No Time";
}
}

7
General / [Help] ::fe.signal ("Configure / Controls")
« on: June 19, 2020, 05:37:08 AM »
Hello everyone, I have a question, I can open the main menu with this code below.
However, I would like to know if there is any code that I can directly open the "control" settings without having to go through the main menu.
Can someone help me please.

Code: [Select]
        ::fe.signal("configure");



PS:
I found this code inside fe_config.cpp


Code: [Select]
void FeInputSelMenu::get_options( FeConfigContext &ctx )
{
ctx.set_style( FeConfigContext::EditList, "Configure / Controls" );
ctx.fe_settings.get_input_mappings( m_mappings );

std::vector < FeMapping >::iterator it;
for ( it=m_mappings.begin(); it != m_mappings.end(); ++it )
{
std::string value, orstr;
ctx.fe_settings.get_resource( "OR", orstr );
std::vector < std::string >::iterator iti;
for ( iti=(*it).input_list.begin(); iti != (*it).input_list.end(); ++iti )
{
if ( iti > (*it).input_list.begin() )
{
value += " ";
value += orstr;
value += " ";
}

value += (*iti);
}

8
General / [HELP] Info Tags
« on: June 14, 2020, 08:11:50 AM »
Hello everyone, I need help with the code below, in the general settings I have the option to select whether I want to confirm favorites or not, but for the add tag function I don't have this option when I press add tag it opens a window for me to choose the tag I want to add, well in my case I only have a single "Completed" tag, can you help me with the code below that when I click on add tat it adds the tag without having to select in the window?

Code: [Select]
function Complete(){
if (fe.game_info( Info.Tags ) == ";Completed;"){
return "images/completed.png";
}
else if (fe.game_info( Info.Tags ) != ";Completed;"){
return "images/null.png";
}

}

local complete = fe.add_image( "[!Complete]", flx * 0.558, fly*0.352, flw * 0.027, flh * 0.035 );
complete.zorder = 4;

9
General / [HELP] Function Control
« on: May 31, 2020, 07:46:26 PM »
Hello All, i'm using a module that I found here in the group "AM Controls Module v1.0", I'm modifying it to work as I want, an example when I'm in the layout and press "Enter - select" it opens the menu on the left side, scroll until down in "Launch" I press "Enter" again it simply closes the menu and does not start the game, could someone help me with this code, what I would like to do and when selecting the game the menu appears and after pressing " Enter "the game starts from the menu and not directly from the layout.

Code: [Select]
function control_signals( signal ){

if (signal == "select"){

if (menu.visible) hide_menu();
else show_menu();
return true;

}

else if ( signal == "back" ){

if (manager.enabled) hide_menu();
else if (menu.visible) menu_hide(); else return
return true;
}
return false;
}

10
General / [HELP] Snaps Skew
« on: January 05, 2020, 10:06:07 AM »
Hi all friends, I am developing a theme in a cabinet where the lower parts of the video are bigger than the top, I am trying to use the code "Skew" to adjust the image but when I use it in the negative and positive sense I do not have the expected result, as shown in the image below, could someone help me with a solution?

Code: [Select]
##Cab Snap
local snap = fe.add_artwork( "snap", flx*0.549, fly*0.2425, flw*0.353, flh*0.420 );
snap.skew_x = -29;
snap.skew_x = 29;


11
General / [HELP] Scroll UP - Scroll Down manual History.dat Info
« on: December 07, 2019, 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!!!

12
General / [HELP] Snaps Mute
« on: December 03, 2019, 09:21:35 AM »
Hello everyone I have a code that I will put below, but I have difficulty leaving the videos mute, would anyone have any idea for me to be able to mute?

Code: [Select]
###########
## Snaps ##
###########

::OBJECTS1 <- {
artwork_videotheme = fe.add_artwork("snap", x*0.396, y*0.1675, w*0.2085, h*0.510),
}

OBJECTS1.artwork_videotheme.visible=false;

::videoSound <- Vid.NoAudio;
OBJECTS1.artwork_videotheme.video_flags = Vid.NoAudio;

local settings = {
   delay_timer = 0,
   play_delay = 1600,
   stop_play = 235000,
}

function on_transition_videotheme( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition.StartLayout:
  case Transition.ToNewSelection:
  case Transition.ToNewList:
  case Transition.EndNavigation:
        OBJECTS1.artwork_videotheme.video_flags = Vid.NoAutoStart;
        settings.delay_timer = fe.layout.time;
        OBJECTS1.artwork_videotheme.visible=false;
       break;
  }
 return false;
}

fe.add_transition_callback( "on_transition_videotheme" );

function on_tick_videotheme(tick_time) {
   if ( !OBJECTS1.artwork_videotheme.video_playing && tick_time - settings.delay_timer >= settings.play_delay ) {
   
        OBJECTS1.artwork_videotheme.video_playing = true;
       
        ::videoSound <- Vid.Default;
        OBJECTS1.artwork_videotheme.video_flags = Vid.Default;       
       
        OBJECTS1.artwork_videotheme.visible=true;
       
        OBJECTS1.artwork_videotheme.alpha = 0
        local alpha_artwork_videotheme_0 = {
        property = "alpha", start = 0 end = 255, time = 2000 easing = Easing.Out,
        }
 
        animation.add( PropertyAnimation( OBJECTS1.artwork_videotheme, alpha_artwork_videotheme_0 ) );
       
    }
   
    else if ( tick_time - settings.delay_timer >= settings.stop_play ) {
       
        OBJECTS1.artwork_videotheme.visible=false;
       
    }   
}

fe.add_ticks_callback(this, "on_tick_videotheme");

13
General / I need help with carrier.nut
« on: July 19, 2019, 11:35:55 AM »
Hello everyone, I am developing a new theme that uses the carrier.nut module, the theme works very well, but I would like to add a code that when the game is selected it enlarges the selected image, same as the arcade flow theme, someone would have any idea how to create this process?


14
General / [HELP] Delay to start snap
« on: June 22, 2019, 10:46:00 PM »
hello everyone, I need some help to put a delay to start the videos with the surface, someone would have some idea to help me

I'm trying to add the delay in this code:

Code: [Select]
local surface = fe.add_surface( 640, 480 );
local artwork = FadeArt( "snap", 80, 0, 480, 650, surface, );
artwork.trigger = Transition.EndNavigation;
artwork.preserve_aspect_ratio = false;
surface.set_pos( x*0.325, y*0.240, w*0.350, h*0.650 );

15
General / [HELP] Wait 10 seconds for the emulator to start
« on: November 04, 2018, 08:32:04 AM »
Hi everyone, could any one help me I wanted to know if there is any code or argument to put emulators.cfg, so that when I start the game the emulator wait 10 seconds to start.

Pages: [1] 2