gamesmame

Untitled

May 21st, 2025
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.13 KB | None | 0 0
  1. ///////////////////////////////////////////////////
  2. //
  3. // Attract-Mode Frontend - DAVBARC MINI NES LAYOUT
  4. //
  5. ///////////////////////////////////////////////////
  6.  
  7. class UserConfig {
  8. </ label="Grid Artwork", help="The artwork to display in the grid", options="snap,marquee,flyer,wheel", order=1 />
  9. art="flyer";
  10.  
  11. </ label="Entries", help="The number of entries to show for each filter", options="1,2,3,4,5,6,7,8", order=2 />
  12. entries="6";
  13.  
  14. </ label="Filters", help="The number of filters to show", options="1,2,3,4,5,6,7,8", order=3 />
  15. filters="1";
  16.  
  17. </ label="Flow Direction", help="Select the flow direction for entries", options="Horizontal,Vertical", order=4 />
  18. flow="Horizontal";
  19.  
  20. </ label="Preserve Aspect Ratio", help="Preserve artwork aspect ratio", options="Yes,No", order=5 />
  21. aspect_ratio="Yes";
  22.  
  23. </ label="Transition Time", help="The amount of time (in milliseconds) that it takes to scroll to another grid entry", order=6 />
  24. ttime="0";
  25. }
  26.  
  27. function debug(msg) {
  28. ::print(msg + "\n")
  29. }
  30.  
  31. fe.layout.width = 1920;
  32. fe.layout.height = 1080;
  33.  
  34. dofile(fe.script_dir + "ui/conveyor_davbarc.nut");
  35.  
  36. fe.load_module( "animate");
  37.  
  38. local animate_overlay_in = {property = "y",start = 701,end = 350,pulse = false,time = 150,delay = 350,tween = Tween.Linear,loop = true,easing=Easing.Out};
  39. local animate_overlay_infade = {property = "alpha",start = 0,end = 255,pulse = true,time = 150,delay = 50,tween = Tween.Linear,easing=Easing.Out};
  40. local animate_overlay_out = {property = "y",start = 350,end = 701,pulse = false,time = 150,tween = Tween.Linear,easing=Easing.Out};
  41. local animate_overlay_outfade = {property = "alpha",start = 255,end = 0,pulse = false,time = 150,delay = 350,tween = Tween.Linear,easing=Easing.Out};
  42. //debug("PATH: "+fe.script_dir);
  43.  
  44. local my_config = fe.get_config();
  45.  
  46. const TOP_SPACE = 30;
  47. const BOTTOM_SPACE = 300;
  48. const PAD = 50;
  49. local sel_index = 1;
  50. local x_dim;
  51. local y_dim;
  52. enum TState { None, Next, Prev };
  53.  
  54. local transition_state = TState.None;
  55. local filters = [];
  56. local f_labels = [];
  57. local ftr_count = my_config["filters"].tointeger();
  58. local ftr_index = ftr_count / 2;
  59. local old_ftr_index = ftr_index;
  60. local sel_count = my_config["entries"].tointeger();
  61. local actualindex=sel_index;
  62. local transition_ms = 150;
  63. local submenu=false;
  64. local submenuBig=false;
  65. local SUBMENUNUMBER=1;
  66. local boxswitch="";
  67. local framexposition=null;
  68. local menuleftright=null;
  69. local boxcordvalue=null;
  70. local bigmenuOpen=false;
  71. local clone_strip_Gameback=null;
  72. local Favorite_estate=false;
  73. local timeframefav=100;
  74. local wingstate=false;
  75. local bgdefault=false;
  76. local infofilt=true;
  77. local stateinfofilt=false;
  78. local stateinfofiltFix=false;
  79. //FONDOS
  80.  
  81. local bg00 = fe.add_image( "systems/[DisplayName].png", 0, 0, 1920, 1080 ); //BACKGROUND 00 con lineas arriba y abajo
  82. local bg02 = fe.add_image( "ui/bkg-02.png", 190, 225, 1539, 81 ); //BACKGROUND 02 INPUT TEXT
  83. local bgicons = fe.add_image( "ui/bgicons.png", 672, 40, 0, 0 ); //FONDO DE LA APP
  84.  
  85. local hbtn=397;
  86. local vbtn=895;
  87. local fbtn=35;
  88.  
  89. local btnBase = fe.add_image( "ui/bkg-btn.png", hbtn, vbtn, 0, 0 ); //TEXTO START-SELECT BG
  90. local btntext = fe.add_image( "ui/bkg-btn-text.png", hbtn, vbtn, 0, 0 ); //TEXTO START-SELECT
  91. local btnUp=fe.add_text("Menu",hbtn+35,vbtn +3,200,fbtn);
  92. local btnDown=fe.add_text("Extra info",hbtn+240,vbtn +3,200,fbtn);
  93. local btnSelect=fe.add_text("Toggle Favorite",hbtn+558,vbtn +3,260,fbtn);
  94. local btnStart=fe.add_text("Start Game",hbtn+920,vbtn +3,200,fbtn);
  95.  
  96. local displaynameDef=fe.add_text("[DisplayName]",0,950,1920,60);
  97. displaynameDef.visible=false;
  98. displaynameDef.set_rgb(255,255,255);
  99. displaynameDef.font="joy"
  100. //STRIPS
  101. local strip_Gameback;
  102. local strip_flyer;
  103. local new_label;
  104. local playerImg;
  105.  
  106. btnUp.align = Align.Left
  107. btnDown.align = Align.Left
  108. btnSelect.align = Align.Left
  109. btnStart.align = Align.Left
  110.  
  111. local logo = fe.add_image("", fe.layout.width/2.7, fe.layout.height/ 28, fe.layout.width/3.9, fe.layout.height/7);
  112. logo.trigger = Transition.EndNavigation;
  113. logo.preserve_aspect_ratio = "yes";
  114.  
  115. function favorito_state(){
  116. return fe.game_info(Info.Favourite)
  117. }
  118. fe.add_transition_callback("transition_callback" );
  119. //FONDOS FIN
  120. x_dim = fe.layout.width / sel_count+65; //espacio entre frame que selecciona 65ok
  121. y_dim = ( fe.layout.height - TOP_SPACE - BOTTOM_SPACE ) / ftr_count;
  122.  
  123. for ( local i=0; i<ftr_count; i++ )
  124. {
  125. strip_Gameback = SimpleArtStripB("ui/gamefc.png",sel_count,-195,340,fe.layout.width+392,414,PAD-50 );
  126. strip_Gameback.transition_ms = transition_ms;
  127. strip_Gameback.set_selection( 0 );
  128. strip_Gameback.video_flags = Vid.NoAudio;
  129. strip_Gameback.preserve_aspect_ratio = "yes";
  130.  
  131. local temp = i - ftr_index;
  132. if ( temp != 0 )
  133. {
  134. strip_Gameback.filter_offset = temp;
  135. new_label.filter_offset = temp;
  136. strip_Gameback.enabled = false;
  137. }
  138.  
  139. filters.push( strip_Gameback );
  140. f_labels.push( new_label );
  141.  
  142. }
  143.  
  144.  
  145. local framein = fe.add_image( "ui/selectboxin.png", 0, 20, 378, 414 ); //IMAGEN INTERNA DE LA CAJA
  146. local snapswitch="flyer";
  147.  
  148. for ( local i=0; i<ftr_count; i++ )
  149. {
  150. strip_flyer = SimpleArtStrip(snapswitch,sel_count,-194,336,fe.layout.width+390,348,46 );
  151. strip_flyer.transition_ms = transition_ms;
  152. strip_flyer.set_selection( 0 );
  153. strip_flyer.video_flags = Vid.NoAudio;
  154. strip_flyer.preserve_aspect_ratio = "yes";
  155.  
  156. playerImg = SimpleArtStripB("ui/[Players]P.png",sel_count,-75,680,fe.layout.width+390,48,PAD-50 );
  157. playerImg.set_selection( 0 );
  158. playerImg.video_flags = Vid.NoAudio;
  159. playerImg.preserve_aspect_ratio = "yes";
  160. playerImg.transition_ms = transition_ms;
  161. }
  162.  
  163. local frame = fe.add_image( "ui/selectboxout.png", 0, 20, 379, 414 ); //IMAGEN EXTERNA DE LA CAJA
  164. local bgicons = fe.add_image( "ui/icons.png", 672, 40, 576, 104 ); //FONDO DE LA APP
  165. //STRIP MINI
  166. local strip_Mini = SimpleArtStripMini( "flyer", 30, 210, 790, 1500, 70, 1 );
  167. strip_Mini.transition_ms = transition_ms;
  168. strip_Mini.set_selection( 12 );
  169. strip_Mini.video_flags = Vid.NoAudio;
  170. strip_Mini.preserve_aspect_ratio = "yes";
  171.  
  172. local animate_flyingwingsup = {when = Transition.StartLayout, property = "y", start = 770,end = 745,pulse = false,loop=false,time = 1000,delay=0,tween = Tween.Linear,easing=Easing.Out,};
  173. local animate_flyingwingsdown = {when = Transition.StartLayout, property = "y",start = 745,end = 770,pulse = false,time = 1000,loop=false,delay=1000,loop=true,tween = Tween.Linear,easing=Easing.Out,};
  174. //sprite animation - use a spritesheet to animate specific frames of the sprite sheet
  175.  
  176. local wingsfull = fe.add_image("ui/wingsfull.png", 60, 7612, 351, 261 );
  177. local wingscloud = fe.add_image("ui/cloud.png", 120, 720, 222, 285 );
  178.  
  179. local snapwings = fe.add_artwork("snap", 145, 1245, 181, 136 );
  180.  
  181. wingsfull.visible=true
  182. snapwings.visible=true
  183. wingscloud.visible=false
  184. local arrowsprite = fe.add_image("ui/arrow.png", 50, 50, 45, 28 );
  185.  
  186. function animWings(){
  187. if (wingstate==false)
  188. {
  189. wingsfull.visible=true
  190. snapwings.visible=true
  191. local animate_overlay_inX = {property = "y",start = 1200,end = 760,pulse = true,time = 500,delay = 150,tween = Tween.Linear,easing=Easing.Out};
  192. animation.add( PropertyAnimation( wingsfull, animate_overlay_inX ) );
  193. local animate_overlay_inXsnap = {property = "y",start = 1245,end = 805,pulse = true,time = 500,delay = 150,tween = Tween.Linear,easing=Easing.Out};
  194. animation.add( PropertyAnimation( snapwings, animate_overlay_inXsnap ) );
  195. wingstate=true;
  196. }else{
  197. local animate_overlay_inX = {property = "y",start = 760,end = 1200,pulse = true,time = 1,delay = 1,tween = Tween.Linear,easing=Easing.Out};
  198. animation.add( PropertyAnimation( wingsfull, animate_overlay_inX ) );
  199. local animate_overlay_inXsnap = {property = "y",start = 805,end = 1245,pulse = true,time = 1,delay = 1,tween = Tween.Linear,easing=Easing.Out};
  200. animation.add( PropertyAnimation( snapwings, animate_overlay_inXsnap ) );
  201. wingstate=false;
  202. actcloud()
  203. wingstate=false;
  204. }
  205.  
  206. }
  207.  
  208. local sprite_cfg = {when = When.Always,width = 351,height=261,frame = 0,time = 4000,order = [ 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0 ],loop = true,}
  209. local sprite_cfg_cl = {when = When.Always,width = 222,height=285,frame = 4,time = 300,order = [ 0, 1, 2, 3, 4 ],loop = false,}
  210.  
  211. animation.add( SpriteAnimation( wingsfull, sprite_cfg ) );
  212. function actcloud(){
  213. wingscloud.visible=true
  214. animation.add( SpriteAnimation( wingscloud, sprite_cfg_cl) );
  215. }
  216.  
  217.  
  218. local sprite_arrow = {when = When.Always,width = 46,height=27,frame = 0,time = 400,order = [ 0, 1, 2, 1],loop = true,}
  219. animation.add( SpriteAnimation( arrowsprite, sprite_arrow ) );
  220.  
  221. //WINGS ANIMATION
  222. local textfilter = fe.add_text( "[FilterName]", 810, 150, 300, 40 );
  223. textfilter.font="joy";
  224. textfilter.visible=false;
  225.  
  226. local infofilter_bubble=fe.add_image("ui/infofilter_bubble.png", 1930, 55, 0, 0 )
  227. local frame_texts = fe.add_text( "[FilterName] [ListEntry]/[ListSize]", 1930, 67, 445, 33 );
  228. frame_texts.font="joy";
  229. frame_texts.align = Align.Centre;
  230.  
  231. function infofilter_toggle(){
  232. if (infofilt==true)
  233. {
  234. local animate_infofilter_bubble = {property = "x",start = 1920,end = 1450,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  235. local animate_infofilter_bubbletext = {property = "x",start = 1920,end = 1470,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  236.  
  237. animation.add( PropertyAnimation( infofilter_bubble, animate_infofilter_bubble ) );
  238. animation.add( PropertyAnimation( frame_texts, animate_infofilter_bubbletext ) );
  239. infofilt=false;
  240. }else{
  241. local animate_infofilter_bubble = {property = "x",start = 1450,end = 1920,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  242. local animate_infofilter_bubbletext = {property = "x",start = 1470,end = 1920,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  243.  
  244. animation.add( PropertyAnimation( infofilter_bubble, animate_infofilter_bubble ) );
  245. animation.add( PropertyAnimation( frame_texts, animate_infofilter_bubbletext ) );
  246.  
  247. infofilt=true;
  248. }
  249. }
  250.  
  251. local name_label = fe.add_text( "[Title]", 0, 235, fe.layout.width, fe.layout.height / 20 );
  252. name_label.set_rgb (0,0,0);
  253.  
  254. //favoritos
  255. local fav_bubble = fe.add_image( "ui/fav.png", 0, 0, 0, 0 ); //IMAGEN FAVORITOS
  256. fav_bubble.visible=false;
  257. local fav_bubble_texts_line1 = fe.add_text( "[Title]", 0, 0, 500, 35);
  258. local fav_bubble_texts_line2 = fe.add_text( "asdasd", 0, 0, 500, 28);
  259. fav_bubble_texts_line1.visible=false;
  260. fav_bubble_texts_line2.visible=false;
  261.  
  262. fav_bubble_texts_line1.set_rgb(0,0,0)
  263. fav_bubble_texts_line1.font="joy";
  264. fav_bubble_texts_line1.align = Align.Left;
  265. fav_bubble_texts_line1.word_wrap=false;
  266.  
  267. fav_bubble_texts_line2.set_rgb(0,0,0)
  268. fav_bubble_texts_line2.font="joy";
  269. fav_bubble_texts_line2.align = Align.Left;
  270.  
  271. //favoritos
  272.  
  273. function favorito_toggle(){
  274. bubbletog(true)
  275. strip_Gameback.transition_ms=0;
  276. strip_Mini.transition_ms=0;
  277. strip_flyer.transition_ms=0;
  278. playerImg.transition_ms=0;
  279.  
  280. filters[ftr_index].enabled=false;
  281. fe.list.index += sel_index - filters[ftr_index].selection_index;
  282.  
  283. foreach ( f in filters )
  284. f.set_selection( sel_index );
  285. actualindexfunc()
  286. //debug("transition_ms = "+transition_ms)
  287. hms()
  288. Favorite_estate=true;
  289.  
  290. update_frame();
  291. filters[ftr_index].enabled=true;
  292.  
  293. fe.signal("add_favourite");
  294. if (fe.game_info(Info.Favourite)!="1")
  295. {
  296. debug("AGREGADO a favoritos"+fe.game_info(Info.Favourite))
  297. fav_bubble_texts_line2.msg = "ADDED TO FAVORITES";
  298.  
  299. }else if(fe.game_info(Info.Favourite)=="1"){
  300. debug("QUITADO de favoritos"+fe.game_info(Info.Favourite))
  301. fav_bubble_texts_line2.msg = "DELETED FROM FAVORITES"
  302. }
  303. }
  304.  
  305. local bigmenuimg = fe.add_image("systems/[DisplayName]-menu.png",0,1080);
  306. local textOverview = fe.add_text( "[Overview]", 90, 3970, 1300, 350 );
  307.  
  308. local totaltimeplayed = fe.add_text( "[!hms]", 1460, 1940, 300, 42 );
  309. totaltimeplayed.font="joy" ;
  310. totaltimeplayed.visible=true;
  311. totaltimeplayed.set_rgb(100,100,100);
  312.  
  313. function hms(){
  314. local segstr=0;
  315. local segstr=fe.game_info(Info.PlayedTime,actualindex)
  316.  
  317. local seg=0;
  318.  
  319. local i=0
  320. local h=0
  321. local m=0
  322. local s=0
  323.  
  324. for (i = 0; i < seg; ++i)
  325. {
  326. if (s<60)
  327. {
  328. s=s+1
  329. }else{
  330. s=0
  331. if (m<60){
  332. m++
  333. }else{
  334. m=0
  335. h++
  336. }
  337.  
  338. }
  339. }
  340.  
  341. if (h<10){h="0"+h}
  342. if (m<10){m="0"+m}
  343. if (s<10){s="0"+s}
  344.  
  345. local totaltime=h+":"+m+":"+s+" "+actualindex;
  346. totaltimeplayed.msg = totaltime;
  347. }
  348.  
  349. function update_filters()
  350. {
  351. for ( local i=0; i<filters.len(); i++ )
  352. {
  353. foreach ( o in filters[i].m_objs )
  354. o.m_obj.rawset_filter_offset( i - ftr_index );
  355.  
  356. f_labels[i].filter_offset = i - ftr_index;
  357. }
  358.  
  359. foreach ( f in filters )
  360. f.enabled = false;
  361. filters[ftr_index].enabled = true;
  362.  
  363. transition_state = TState.None;
  364. fe.list.filter_index += ftr_index - old_ftr_index;
  365. old_ftr_index = ftr_index;
  366. }
  367.  
  368. function update_audio()
  369. {
  370. foreach ( f in filters )
  371. {
  372. foreach ( o in f.m_objs )
  373. o.m_obj.video_flags = Vid.NoAudio;
  374. }
  375.  
  376. filters[ftr_index].m_objs[sel_index].m_obj.video_flags = 0;
  377. }
  378. // Overall Surface
  379. local overlaySurface = fe.add_surface(800,243);
  380. overlaySurface.set_pos(0,701);
  381. overlaySurface.alpha = 0;
  382. function update_frame()
  383. {
  384. //FRAME IN
  385. framein.x = x_dim * sel_index - 190;
  386. framein.y = TOP_SPACE + y_dim * ftr_index+310;
  387. //FAV BUBBLE
  388. fav_bubble.x = x_dim * sel_index - 315;
  389. fav_bubble.y = 250;
  390.  
  391. fav_bubble_texts_line1.x = x_dim * sel_index - 200;
  392. fav_bubble_texts_line1.y = 285;
  393.  
  394. fav_bubble_texts_line2.x = x_dim * sel_index - 195;
  395. fav_bubble_texts_line2.y = 325;
  396.  
  397. hms()
  398.  
  399. //FRAME OUT
  400. frame.x = x_dim * sel_index - 189;
  401. frame.y = TOP_SPACE + y_dim * ftr_index+310;
  402.  
  403. if (submenu==false)
  404. {
  405. if (boxswitch=="left"){framexposition=frame.x+385}
  406. if (boxswitch=="right"){framexposition=frame.x-385}
  407.  
  408. if (Favorite_estate==true)
  409. {
  410. timeframefav=1;
  411. Favorite_estate=false;
  412. }else{
  413. timeframefav=100;
  414. }
  415. local animate_overlay_inX = {property = "x",start = framexposition,end = frame.x,pulse = false,time = timeframefav,delay = 50,tween = Tween.Linear,easing=Easing.Out};
  416. animation.add( PropertyAnimation( frame, animate_overlay_inX ) );
  417.  
  418. }
  419. //POS FLECHA
  420. arrowsprite.x = 829 + sel_index*47.5;
  421. arrowsprite.y = TOP_SPACE + y_dim * ftr_index+730;
  422.  
  423. frame_texts.filter_offset
  424.  
  425. = name_label.filter_offset
  426. = filters[ftr_index].m_objs[0].m_obj.filter_offset;
  427.  
  428. frame_texts.index_offset
  429. = textOverview.index_offset
  430. = totaltimeplayed.index_offset
  431. = snapwings.index_offset
  432. = name_label.index_offset
  433. = sel_index - filters[ftr_index].selection_index;
  434.  
  435. update_audio();
  436. }
  437.  
  438. update_frame();
  439. function actualindexfunc(){
  440. strip_Gameback.set_selection( actualindex );
  441. strip_flyer.set_selection( actualindex );
  442. playerImg.set_selection( actualindex );
  443. strip_Mini.set_selection( 12+actualindex );
  444.  
  445. strip_Gameback.transition_ms=transition_ms;
  446. strip_Mini.transition_ms=transition_ms;
  447. strip_flyer.transition_ms=transition_ms;
  448. playerImg.transition_ms=transition_ms;
  449.  
  450. }
  451. fe.add_signal_handler( "on_signal" );
  452.  
  453. function boxcord(){
  454. if (sel_index==1){boxcordvalue=200}
  455. if (sel_index==2){boxcordvalue=585}
  456. if (sel_index==3){boxcordvalue=970}
  457. if (sel_index==4){boxcordvalue=1355}
  458. }
  459.  
  460. function bubbletog(s){
  461. fav_bubble.visible=s;
  462. fav_bubble_texts_line1.visible=s;
  463. fav_bubble_texts_line2.visible=s;
  464. }
  465.  
  466.  
  467. function moveupcursor(){
  468. boxcord()
  469. frame.file_name = "ui/selectboxmini.png";
  470. local animate_overlay_in_minibox = {property = "y",start = 400,end = 40,time = 150,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  471. local animate_overlay_in_minibox_w = {property = "width",start = 378,end = 130,time = 150,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  472. local animate_overlay_in_minibox_h = {property = "height",start = 414,end = 100,time = 150,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  473.  
  474. //framein.visible=false;
  475. animation.add( PropertyAnimation( frame, animate_overlay_in_minibox_h ) );
  476. animation.add( PropertyAnimation( frame, animate_overlay_in_minibox_w ) );
  477. animation.add( PropertyAnimation( frame, animate_overlay_in_minibox ) );
  478.  
  479. }
  480. function moveDowncursor(){
  481. frame.file_name = "ui/selectboxout.png";
  482. btnDown.x=637
  483.  
  484. btnUp.msg="Menu"
  485. btnDown.msg="Extra info"
  486. btnSelect.msg="Toggle Favorite"
  487. btnStart.msg="Start Game"
  488. btnBase.file_name="ui/bkg-btn.png";
  489. btntext.file_name="ui/bkg-btn-text.png";
  490.  
  491. local animate_overlay_in_mibox_w = {property = "width",start = 230,end = 378,time = 150,delay = 100,tween = Tween.Linear,easing=Easing.Out};
  492. local animate_overlay_in_mibox_h = {property = "height",start = 300,end = 414,time = 150,delay = 100,tween = Tween.Linear,easing=Easing.Out};
  493. animation.add( PropertyAnimation( frame, animate_overlay_in_mibox_w ) );
  494. animation.add( PropertyAnimation( frame, animate_overlay_in_mibox_h ) );
  495. }
  496.  
  497.  
  498. local snapwingsclone = fe.add_clone( snapwings);
  499. snapwingsclone.x=1434;
  500. snapwingsclone.width=327;
  501. snapwingsclone.height=306;
  502.  
  503. textOverview.set_rgb(0,0,0);
  504. textOverview.word_wrap=true;
  505. textOverview.charsize =20;
  506. textOverview.font="joy"
  507. textOverview.height=200;
  508. textOverview.align=Align.Left;
  509.  
  510. local wheelbigmenu = fe.add_image("",780,970,0,0);
  511.  
  512. function bigmenu(){
  513. if (bigmenuOpen==false)
  514. {
  515. //debug("big menu click if "+bigmenuOpen)
  516. bigmenuimg.visible=true;
  517. bigmenuOpen=true;
  518.  
  519. local animate_bigmenuimg_up = {property = "y",start = 1080,end = 515,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  520. local animate_snapbigmenu_up = {property = "y",start = 1280,end = 670,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  521. local animate_textOverview = {property = "y",start = 1280,end = 670,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  522. local animate_wheelbigmenu = {property = "y",start = 1280,end = 580,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  523. local animate_totaltimeplayed = {property = "y",start = 1280,end = 975,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  524.  
  525. animation.add( PropertyAnimation( bigmenuimg, animate_bigmenuimg_up ) );
  526. animation.add( PropertyAnimation( snapwingsclone, animate_snapbigmenu_up ) );
  527. animation.add( PropertyAnimation( textOverview, animate_textOverview ) );
  528. animation.add( PropertyAnimation( totaltimeplayed, animate_totaltimeplayed) );
  529. }else{
  530. //debug("big menu click else "+bigmenuOpen)
  531. bigmenuOpen=false
  532. local animate_bigmenuimg_up = {property = "y",start = 550,end = 1080,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  533. local animate_snapbigmenu_up = {property = "y",start = 670,end = 1280,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  534. local animate_textOverview = {property = "y",start = 670,end = 1280,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  535. local animate_wheelbigmenu = {property = "y",start = 1280,end = 670,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  536. local animate_totaltimeplayed = {property = "y",start = 975,end = 1280,time = 300,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  537.  
  538. animation.add( PropertyAnimation( bigmenuimg, animate_bigmenuimg_up ) );
  539. animation.add( PropertyAnimation( snapwingsclone, animate_snapbigmenu_up ) );
  540. animation.add( PropertyAnimation( textOverview, animate_textOverview ) );
  541. animation.add( PropertyAnimation( totaltimeplayed, animate_totaltimeplayed) );
  542. }
  543. }
  544. local submenu_bubble = fe.add_image( "ui/submenu_bubble.png", 0, 140, 0, 0 ); //IMAGEN FAVORITOS
  545. submenu_bubble.visible=false;
  546. local submenu_bubble_text=fe.add_text("Menu",0,170,260,40);
  547. submenu_bubble_text.set_rgb(0,0,0);
  548. submenu_bubble_text.align = Align.Centre;
  549. submenu_bubble_text.visible=false;
  550.  
  551.  
  552. function submenuposition(){
  553. //debug("SUBMENUNUMBER "+SUBMENUNUMBER)
  554. submenu_bubble_text.visible=true;
  555. submenu_bubble.visible=true;
  556.  
  557. btnDown.x=740
  558. btnBase.file_name="ui/bkg-btntog.png";
  559. btntext.file_name="ui/bkg-btn-texttog.png";
  560.  
  561. if (SUBMENUNUMBER==1){frame.x = 680;
  562. submenu_bubble.x = 615;
  563. submenu_bubble_text.x = 615;
  564. submenu_bubble_text.msg = "Systems"
  565. btnUp.msg="Game List"
  566. btnDown.msg="Menu"
  567. btnSelect.msg="Previous System"
  568. btnStart.msg="Next System";
  569. if (stateinfofiltFix==false)
  570. {
  571. if (infofilt==false)
  572. {
  573. stateinfofilt=false;
  574. infofilter_toggle()
  575. }
  576. }
  577.  
  578. }
  579. if (SUBMENUNUMBER==2){frame.x = 825;
  580. submenu_bubble.x = 760;
  581. submenu_bubble_text.x = 760;
  582. submenu_bubble_text.msg = "Config"
  583. btnUp.msg="Game List"
  584. btnDown.msg="Configure"
  585. btnSelect.msg="---"
  586. btnStart.msg="---"
  587. if (stateinfofiltFix==false)
  588. {
  589. if (infofilt==false)
  590. {
  591. stateinfofilt=false;
  592. infofilter_toggle()
  593. }
  594. }
  595. }
  596. if (SUBMENUNUMBER==3){frame.x = 970;
  597. submenu_bubble.x = 905;
  598. submenu_bubble_text.x = 905;
  599. submenu_bubble_text.msg = "Filters"
  600. btnUp.msg="Game List"
  601. btnDown.msg="Menu"
  602. btnSelect.msg="Previous Filter"
  603. btnStart.msg="Next Filter";
  604. if (stateinfofiltFix==false)
  605. {
  606. infofilt=true;
  607. stateinfofilt=true;
  608. infofilter_toggle()
  609. }
  610. }
  611. if (SUBMENUNUMBER==4){frame.x = 1110;
  612. submenu_bubble.x = 1045;
  613. submenu_bubble_text.x = 1045;
  614. submenu_bubble_text.msg = "Mini snap"
  615. btnUp.msg="Game List"
  616. btnDown.msg="Last game"
  617. btnSelect.msg="Toggle Snap"
  618. btnStart.msg="Filter info";
  619. if (stateinfofiltFix==false)
  620. {
  621. if (infofilt==false)
  622. {
  623. stateinfofilt=false;
  624. infofilter_toggle()
  625. }
  626. }
  627. }
  628.  
  629. if (boxswitch=="left"){menuleftright=frame.x+145}
  630. if (boxswitch=="right"){menuleftright=frame.x-145}
  631.  
  632. local animate_overlay_in_minibox = {property = "x",start = menuleftright,end = frame.x,time = 100,delay = 0,tween = Tween.Linear,loop = true,easing=Easing.Out};
  633. animation.add( PropertyAnimation( frame, animate_overlay_in_minibox ) );
  634. frame.width=130;
  635. frame.height=104;
  636.  
  637. }
  638.  
  639. function on_signal( sig )
  640. {
  641.  
  642. local frameXrestore=frame.x;
  643. local frameYrestore=frame.y;
  644. local frameWrestore=frame.width;
  645. local frameHrestore=frame.height;
  646.  
  647. switch ( sig )
  648. {
  649.  
  650. case "up":
  651. bubbletog(false)
  652. if (bigmenuOpen==true)
  653. {
  654. bigmenu()
  655. }else{
  656.  
  657. if (submenu==false)
  658. {
  659. submenu=true;
  660. //debug("press up - sel_index:"+sel_index)
  661. submenuposition()
  662. moveupcursor()
  663. }
  664. }
  665. break;
  666.  
  667. case "down":
  668. //debug("press down - submenu state:"+submenu)
  669. bubbletog(false)
  670. submenu_bubble_text.visible=false;
  671. submenu_bubble.visible=false;
  672.  
  673. if (submenu==true)
  674. {
  675. submenu=false;
  676. frame.x = frameXrestore;
  677. frame.y = frameYrestore;
  678. update_frame()
  679. moveDowncursor()
  680.  
  681. framein.visible=true;
  682. if (stateinfofilt==true)
  683. {
  684. stateinfofilt=false;
  685. infofilter_toggle()
  686. }
  687.  
  688. }else{
  689. if (bigmenuOpen==false)
  690. {
  691. bigmenu()
  692. }
  693. }
  694.  
  695. break;
  696. case "left":
  697.  
  698. bubbletog(false)
  699. framein.alpha=0;
  700. boxswitch="left";
  701. if (submenu==false)
  702. {
  703. if ( sel_index > 1 )
  704. {
  705. sel_index--;
  706. actualindex=sel_index
  707. local animate_overlay_framein = {property = "alpha",start = 0,end = 255,pulse = false,time = 500,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  708. animation.add( PropertyAnimation( framein, animate_overlay_framein ) );
  709. update_frame();
  710. }
  711. else
  712. {
  713. fe.signal( "prev_game" );
  714. actualindex=sel_index
  715. framein.alpha=255;
  716. update_frame()
  717. }
  718. //debug("FRAMEX L= "+frame.x+" Y "+frame.y)
  719. }else{
  720. if (SUBMENUNUMBER>1)
  721. {
  722. SUBMENUNUMBER--;
  723. submenuposition()
  724. //debug("FRAMEX L= "+frame.x+" Y "+frame.y)
  725. }
  726. }
  727.  
  728. return true;
  729. case "right":
  730. bubbletog(false)
  731. boxswitch="right";
  732. if (submenu==false)
  733. {
  734. if ( sel_index < sel_count - 2 )
  735. {
  736. sel_index++;
  737. update_frame();
  738. actualindex=sel_index
  739. local animate_overlay_framein = {property = "alpha",start = 0,end = 255,pulse = false,time = 500,delay = 0,tween = Tween.Linear,easing=Easing.Out};
  740. animation.add( PropertyAnimation( framein, animate_overlay_framein ) );
  741. hms()
  742. }
  743. else
  744. {
  745. fe.signal( "next_game" );
  746. actualindex=sel_index
  747. update_frame()
  748. }
  749. //debug("FRAMEX R= "+frame.x+" Y "+frame.y)
  750. }else{
  751. if (SUBMENUNUMBER<4)
  752. {
  753. SUBMENUNUMBER++;
  754. submenuposition()
  755. //debug("FRAMEX R= "+frame.x+" Y "+frame.y)
  756. }
  757. }
  758. return true;
  759.  
  760. case "next_game":
  761.  
  762. break;
  763. case "prev_game":
  764.  
  765. break;
  766. case "next_filter":
  767. case "prev_filter":
  768. case "exit":
  769. case "exit_no_menu":
  770. break;
  771.  
  772. case "replay_last_game":
  773.  
  774. break;
  775.  
  776. case "custom6":
  777. actcloud()
  778. break;
  779.  
  780. case "custom1": //BUTTON B
  781. if (submenu==true){
  782. if (SUBMENUNUMBER==1)
  783. {
  784. fe.signal("prev_display")
  785. //debug("DENTRO DE CUSTOM3, IF 1 next_list")
  786. break;
  787. }
  788. if (SUBMENUNUMBER==2)
  789. {
  790. //debug("DENTRO DE CUSTOM3, IF 2")
  791. break;
  792. }
  793. if (SUBMENUNUMBER==3)
  794. {
  795. fe.signal("prev_filter")
  796. //debug("DENTRO DE CUSTOM3, IF 3")
  797. break;
  798. }
  799. if (SUBMENUNUMBER==4)
  800. {
  801. animWings()
  802. //debug("DENTRO DE CUSTOM3, IF 4"+mmm)
  803. break;
  804. }
  805. }else{
  806. //fe.signal("prev_letter")
  807. }
  808. break;
  809. case "custom2": //BUTTON A
  810. if (submenu==true){
  811. if (SUBMENUNUMBER==1)
  812. {
  813. fe.signal("next_display")
  814. //debug("DENTRO DE CUSTOM3, IF 1 next_list")
  815. break;
  816. }
  817. if (SUBMENUNUMBER==2)
  818. {
  819. //debug("DENTRO DE CUSTOM3, IF 2")
  820. break;
  821. }
  822. if (SUBMENUNUMBER==3)
  823. {
  824. fe.signal("next_filter")
  825. //debug("DENTRO DE CUSTOM3, IF 3")
  826. break;
  827. }
  828. if (SUBMENUNUMBER==4)
  829. {
  830. if (stateinfofiltFix==false)
  831. {
  832. stateinfofiltFix=true
  833. infofilter_toggle()
  834. }else{
  835. stateinfofiltFix=false
  836. infofilter_toggle()
  837. }
  838. //debug("DENTRO DE CUSTOM3, IF 4"+mmm)
  839. break;
  840. }
  841. }else{
  842. //fe.signal("next_letter")
  843. }
  844. break;
  845. case "custom4": //BUTTON TESTING
  846. infofilter_toggle()
  847. break;
  848.  
  849. case "custom3": // BUTTON SELECT
  850. if (submenu==true){
  851. if (SUBMENUNUMBER==1)
  852. {
  853. fe.signal("displays_menu")
  854. //debug("DENTRO DE CUSTOM3, IF 1 next_list")
  855. break;
  856. }
  857. if (SUBMENUNUMBER==2)
  858. {
  859. fe.signal("configure")
  860. //debug("DENTRO DE CUSTOM3, IF 2")
  861. break;
  862. }
  863. if (SUBMENUNUMBER==3)
  864. {
  865. fe.signal("filters_menu")
  866. //debug("DENTRO DE CUSTOM3, IF 3")
  867. break;
  868. }
  869. if (SUBMENUNUMBER==4)
  870. {
  871. animWings()
  872.  
  873. //debug("DENTRO DE CUSTOM3, IF 4"+mmm)
  874. break;
  875. }
  876. }else{
  877. favorito_toggle()
  878. }
  879.  
  880. break;
  881. case "select":
  882.  
  883.  
  884. strip_Gameback.transition_ms=0;
  885. strip_Mini.transition_ms=0;
  886. strip_flyer.transition_ms=0;
  887. playerImg.transition_ms=0;
  888.  
  889. filters[ftr_index].enabled=false;
  890. fe.list.index += sel_index - filters[ftr_index].selection_index;
  891.  
  892. foreach ( f in filters )
  893. f.set_selection( sel_index );
  894. actualindexfunc()
  895. //debug("transition_ms = "+transition_ms)
  896.  
  897. update_frame();
  898. filters[ftr_index].enabled=true;
  899. break;
  900. }
  901.  
  902. return false;
  903. }
  904.  
  905. function principalmenupos(){
  906. clone_strip_Gameback=fe.add_clone() //check
  907.  
  908. local animate_strip_Gameback = {property = "y",start = 225,end = 150,pulse = false,time = 100,delay = 50,tween = Tween.Linear,easing=Easing.Out};
  909. local animate_principalmenuWhiteinput = {property = "y",start = 225,end = 150,pulse = false,time = 100,delay = 50,tween = Tween.Linear,easing=Easing.Out};
  910.  
  911. animation.add( PropertyAnimation( bg02, animate_principalmenuWhiteinput ) );
  912. animation.add( PropertyAnimation( clone_strip_Gameback, animate_strip_Gameback ) );
  913.  
  914. }
  915.  
  916. function shownamesystem(r,g,b,v){
  917. local systemnametext = fe.add_text( "[SystemN]", 0, 940, 1920, 70 );
  918. systemnametext.font="joy";
  919. systemnametext.align = Align.Centre;
  920. systemnametext.set_rgb (r,g,b);
  921. logo.visible=v;
  922. systemnametext.visible=v;
  923. debug(systemnametext.visible+" systemnametext: "+systemnametext)
  924. }
  925. function bgdefaultfunc(valorbool){
  926. local listnameemu= fe.list.name;
  927. if (valorbool==true)
  928. {
  929. bigmenuimg.file_name="systems/default-menu.png";
  930. bg00.file_name="systems/default.png";
  931. bgdefault=true;
  932. displaynameDef.visible=true;
  933. }else{
  934. bigmenuimg.file_name="systems/"+listnameemu+"-menu.png";
  935. bg00.file_name="systems/"+listnameemu+".png";
  936. bgdefault=false;
  937. displaynameDef.visible=false;
  938. }
  939. debug("systems/"+listnameemu+".png "+bg00.file_name)
  940. }
  941.  
  942. function transition_callback(ttype, var, ttime)
  943. {
  944.  
  945. if (bgdefault==true)
  946. {
  947. bigmenuimg.file_name="systems/default-menu.png";
  948. bg00.file_name="systems/default.png";
  949. }
  950. switch ( ttype )
  951. {
  952. case Transition.FromOldSelection:
  953. //debug("FromOldSelection")
  954. hms()
  955. break;
  956. case Transition.ToNewList:
  957. switch ( fe.list.name )
  958. {
  959. case "Playstation":
  960. bgdefaultfunc(false)
  961. btnBase.set_rgb(50,109,179);
  962. btnUp.set_rgb(50,109,179);
  963. btnDown.set_rgb(50,109,179);
  964. btnSelect.set_rgb(50,109,179);
  965. btnStart.set_rgb(50,109,179);
  966.  
  967. textfilter.set_rgb(222,0,41);
  968. frame_texts.set_rgb(222,0,41);
  969.  
  970. frame.set_rgb(0,170,158); //COLOR MARCO
  971. framein.set_rgb(0,170,158); //COLOR MARCO INTERNO
  972. arrowsprite.set_rgb(243,194,2); //COLOR FLECHA 243,194,2
  973. break;
  974. case "snes":
  975. bgdefaultfunc(false)
  976. btnBase.set_rgb(72,56,129)
  977. btnUp.set_rgb(72,56,129)
  978. btnDown.set_rgb(72,56,129)
  979. btnSelect.set_rgb(72,56,129)
  980. btnStart.set_rgb(72,56,129)
  981.  
  982. textfilter.set_rgb(172,168,218);
  983. frame_texts.set_rgb(172,168,218);
  984.  
  985. frame.set_rgb(72,56,129); //COLOR MARCO
  986. framein.set_rgb(72,56,129); //COLOR MARCO INTERNO
  987. arrowsprite.set_rgb(172,168,218);; //COLOR FLECHA
  988.  
  989. break;
  990. case "famicom":
  991. bgdefaultfunc(false)
  992. //colors
  993.  
  994. btnUp.set_rgb(154,0,0)
  995. btnDown.set_rgb(154,0,0)
  996. btnSelect.set_rgb(154,0,0)
  997. btnStart.set_rgb(154,0,0)
  998. btnBase.set_rgb(154,0,0)
  999.  
  1000. textfilter.set_rgb(154,0,0);
  1001. frame_texts.set_rgb(154,0,0);
  1002.  
  1003. frame.set_rgb(52,253,253); //COLOR MARCO
  1004. framein.set_rgb(0,121,240); //COLOR MARCO INTERNO
  1005. arrowsprite.set_rgb(65,210,254); //COLOR FLECHA
  1006.  
  1007. break;
  1008. case "Game Boy":
  1009. bgdefaultfunc(false)
  1010. //colors
  1011.  
  1012. btnUp.set_rgb(174,15,97)
  1013. btnDown.set_rgb(174,15,97)
  1014. btnSelect.set_rgb(174,15,97)
  1015. btnStart.set_rgb(174,15,97)
  1016. btnBase.set_rgb(174,15,97)
  1017.  
  1018. textfilter.set_rgb(33,33,33);
  1019. frame_texts.set_rgb(33,33,33);
  1020.  
  1021. frame.set_rgb(202, 207, 104); //COLOR MARCO
  1022. framein.set_rgb(159, 179, 2); //COLOR MARCO INTERNO
  1023. arrowsprite.set_rgb(202, 207, 104); //COLOR FLECHA
  1024. textOverview.set_rgb(33,33,33);
  1025.  
  1026. break;
  1027. case "Sega Genesis":
  1028. bgdefaultfunc(false)
  1029.  
  1030. btnUp.set_rgb(19,78,156)
  1031. btnDown.set_rgb(19,78,156)
  1032. btnSelect.set_rgb(19,78,156)
  1033. btnStart.set_rgb(19,78,156)
  1034. btnBase.set_rgb(19,78,156)
  1035.  
  1036. textfilter.set_rgb(209,209,209);
  1037. frame_texts.set_rgb(209,209,209);
  1038.  
  1039. frame.set_rgb(19,78,156); //COLOR MARCO
  1040. framein.set_rgb(0,121,240); //COLOR MARCO INTERNO
  1041. arrowsprite.set_rgb(255,0,0); //COLOR FLECHA
  1042. textOverview.set_rgb(209,209,209);
  1043. break;
  1044. default:
  1045. bgdefault=true;
  1046. bgdefaultfunc(true)
  1047. bigmenuimg.file_name="systems/default-menu.png";
  1048. bg00.file_name="systems/default.png";
  1049. //colors
  1050.  
  1051. btnUp.set_rgb(154,0,0)
  1052. btnDown.set_rgb(154,0,0)
  1053. btnSelect.set_rgb(154,0,0)
  1054. btnStart.set_rgb(154,0,0)
  1055. btnBase.set_rgb(154,0,0)
  1056.  
  1057. textfilter.set_rgb(154,0,0);
  1058. frame_texts.set_rgb(154,0,0);
  1059.  
  1060. frame.set_rgb(52,253,253); //COLOR MARCO
  1061. framein.set_rgb(0,121,240); //COLOR MARCO INTERNO
  1062. arrowsprite.set_rgb(1,1,254); //COLOR FLECHA
  1063. break;
  1064. }
  1065. break;
  1066. }
  1067. }
Add Comment
Please, Sign In to add comment