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.


Messages - stamina

Pages: [1]
1
Scripting / Re: Fixing "next/prev_letter" hanging on certain titles.
« on: January 03, 2023, 07:41:23 AM »
Hi, I also noticed buggy behaviour when using the prev/next letter custom keybindings in my gamelists.

I'm using a modified "At-the-Arcade flex" layout with a self compiled attractplus from github though. (which seems to have patched in a "case-insensitive romlist sorting" lately)

Looking at the C++ code, I found a "_sort_regexp;^(Vs\. The |The |Vs\. )" which basically chops this off game titles, before the sorting starts.

The base functionality is working fine, only displaying the "letter" images didn't account for this chopping, so I also saw several "T" images in a row, with game titles starting with "The ..."

My layout.nut fix is rather simple (just using the same regex before slicing in the first Letter image):

Code: [Select]
fe.add_ticks_callback( "letter_tick" );
function letter_tick( ttime )
{
  glob_time = ttime;
  if( glob_time - rtime > glob_delay ) {
    letters.visible = false; // hide letter search if present
  }
  if( trigger_letter == true ) {
    local firstl = fe.game_info(Info.Title).tolower();
    local ex = regexp("^vs\\. the |^the |^vs\\. ");
    local res = ex.search(firstl)
    if (res != null) {
      firstl = firstl.slice(res.end,firstl.len());
    }
    if( my_config["letters_type"] != "No" ) {
      if( my_config["letters_type"] == "Default" ) {
        letters.file_name = FeConfigDirectory + "gtc-common/letters/default/" + firstl.slice(0,1) + ".png";
      } else {//by system display name
        letters.file_name = FeConfigDirectory + "gtc-common/letters/" + fe.displays[fe.list.display_index].name + "/" + firstl.slice(0,1) + ".png";
      }
      letters.visible = true;
    }
    trigger_letter = false;
  }
}

greetz, stamina

2
Scripting / Re: Static picture with LCD marquee & multimon
« on: January 02, 2023, 01:49:37 PM »
I got a separate marquee LCD working with attract(plus).

I didn't use the MultiMon plugin (read somewhere that it was very limited/never finished), but instead added a transition callback to
my layout.nut file that (over)writes the currently selected game name to a fixed textfile.

Using something like: system("echo " + "\"" + fe.game_info(Info.Name) + "_1920720.png\" >| /home/stamina/Games/marquees/current.txt");

I've put that call on the Transition.StartLayout, Transition.ToNewList, Transition.ToNewSelection and Transition.ToGame transistions.

Then a background bash script continuously scans this textfile's modification timestamp and changes my 2nd Marquee monitor's desktop image to the currently selected game.

This is all on Arch linux, but I'm sure something similar is possible on Windows.

Bash script:
Code: [Select]
#!/bin/bash
# script to display the correct marquee image based on the game name in ~/Games/marquees/current.txt
# the feh tool is used and will just put the image fullscreen on all monitor backgrounds in X11
# created by stamina nov 2022
export DISPLAY=':0'
update_marquee () {
  marquee_file=$(</home/stamina/Games/marquees/current.txt)
  if [ -f "/home/stamina/Games/marquees/$marquee_file" ]; then
    feh --bg-fill --no-fehbg "/home/stamina/Games/marquees/$marquee_file"
  else
    # default Brugmania marquee, if file doesn't exist yet
    feh --bg-fill --no-fehbg "/home/stamina/Games/marquees/default_1920720.png"
  fi
}

marquee_file=`cat /home/stamina/Games/marquees/current.txt` 
while [ true ];
do
  inotifywait \
      -q \
      -e modify \
      ~/Games/marquees/current.txt && update_marquee
done


greetz, stamina

Pages: [1]