Jump to content
LaunchBox Community Forums

Klopjero

Members
  • Posts

    777
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by Klopjero

  1. 9 minutes ago, gspawn said:

    I converted it from png I think, is it yours? I thought Viking's. If yours is, I apologize for the misdirection 

    yea I made that, and no need to apologise, I thought it was great seeing it come by.

    Besides that I really do have to congratulate you with coming up with such a brilliant and effective way to solve the colorfull playlist problem.  

    congratulations!

    placing those mascottes in front of the screen or besides the keyboard or theming the console or PC to fit with that franchise is really elegant.

    • Thanks 1
  2. so what I ended up doing is just import the whole library. close LB. 

    wrote a different powershell that would add a custom field to each game that would contain the Arcade system metadata so I could build play lists that way.

     

    # TeknoParrot add customField to database
    # Author: klop
    # Updated: Extended to export LaunchBox Playlist XMLs by platform (from JSON metadata) and enrich the Platform DB with Arcade Platform info using CustomField blocks
    
    # ------------------
    # Load TeknoParrot Platform XML
    # ------------------
    $platformPath = "[path to]/LaunchBox/Data/Platforms/Teknoparrot.xml"
    [xml]$platformXml = Get-Content $platformPath
    $gameIndex = @{}
    foreach ($game in $platformXml.LaunchBox.Game) {
        $gameIndex[$game.Title] = $game
    }
    
    # Prepare for appending CustomFields after <Game> entries
    $launchBoxNode = $platformXml.SelectSingleNode("/LaunchBox")
    
    # ------------------
    # Process each game and read associated JSON metadata
    # ------------------
    $metadataPath = "[path to tekno parrot]\Metadata" # Path to teknoparrot
    $groupedGames = @{}
    
    foreach ($game in $gameIndex.Values) {
        $applicationPath = $game.ApplicationPath
        if (-not $applicationPath) { continue }
    
        $profileName = [System.IO.Path]::GetFileNameWithoutExtension($applicationPath)
        $jsonFilePath = Join-Path $metadataPath "$profileName.json"
    
        if (Test-Path $jsonFilePath) {
            try {
                $json = Get-Content $jsonFilePath | ConvertFrom-Json
                $platformName = $json.platform
    
                # Add custom field as a sibling of <Game> under root
                $customFieldNode = $platformXml.CreateElement("CustomField")
                
                $gameIdNode = $platformXml.CreateElement("GameID")
                $gameIdNode.InnerText = $game.ID
                $customFieldNode.AppendChild($gameIdNode) | Out-Null
    
                $nameNode = $platformXml.CreateElement("Name")
                $nameNode.InnerText = "Arcade Platform"
                $customFieldNode.AppendChild($nameNode) | Out-Null
    
                $valueNode = $platformXml.CreateElement("Value")
                $valueNode.InnerText = $platformName
                $customFieldNode.AppendChild($valueNode) | Out-Null
    
                $launchBoxNode.AppendChild($customFieldNode) | Out-Null
    
                # Group by platform for playlist creation
                if (-not $groupedGames.ContainsKey($platformName)) {
                    $groupedGames[$platformName] = @()
                }
                $groupedGames[$platformName] += $game
            }
            catch {
                Write-Warning "Failed to parse JSON: $jsonFilePath"
            }
        }
        else {
            Write-Warning "Missing JSON for: $profileName"
        }
    }
    
    # ------------------
    # Save updated Platform DB with ArcadePlatform entries
    # ------------------
    $platformXml.Save($platformPath)
    Write-Host "Updated Teknoparrot.xml with Arcade Platform custom fields."
    
    # ------------------
    # Create a LaunchBox Playlist XML for each platform group
    # ------------------
    foreach ($platformName in $groupedGames.Keys) {
        $playlistGames = $groupedGames[$platformName]
        $playlistId = [guid]::NewGuid().ToString()
        $playlistXml = New-Object xml
        $root = $playlistXml.CreateElement("LaunchBox")
        $playlistXml.AppendChild($root) | Out-Null
    
        # Playlist metadata
        $playlist = $playlistXml.CreateElement("Playlist")
        $root.AppendChild($playlist) | Out-Null
        $playlist.AppendChild($playlistXml.CreateElement("PlaylistId")).InnerText = $playlistId
        $playlist.AppendChild($playlistXml.CreateElement("Name")).InnerText = $platformName
        $playlist.AppendChild($playlistXml.CreateElement("NestedName")).InnerText = $platformName
        $playlist.AppendChild($playlistXml.CreateElement("IncludeWithPlatforms")).InnerText = "false"
        $playlist.AppendChild($playlistXml.CreateElement("IsAutogenerated")).InnerText = "false"
    
        # Add games to playlist
        $i = 0
        foreach ($game in $playlistGames) {
            $pg = $playlistXml.CreateElement("PlaylistGame")
            $root.AppendChild($pg) | Out-Null
            $pg.AppendChild($playlistXml.CreateElement("GameId")).InnerText = $game.ID
            $pg.AppendChild($playlistXml.CreateElement("GameTitle")).InnerText = $game.Title
            $pg.AppendChild($playlistXml.CreateElement("GameFileName")).InnerText = [System.IO.Path]::GetFileName($game.ApplicationPath)
            $pg.AppendChild($playlistXml.CreateElement("GamePlatform")).InnerText = "Teknoparrot"
            $pg.AppendChild($playlistXml.CreateElement("ManualOrder")).InnerText = "$i"
            $i++
        }
    
        # Save
        $safeName = ($platformName -replace '[^a-zA-Z0-9_\- ]', '_')
        $playlistOutputPath = "[path to launchbox]/Playlists/$safeName.xml" #it also generates extra playlistst
        $playlistXml.Save($playlistOutputPath)
    
        Write-Host "Playlist '$platformName' created at $playlistOutputPath"
    }

    this is isnt the solution for the helpful unhelpful behavior when your importing Teknoparrot though

  3. I thought I found the issue...  I had declared the TP\userprofiles folder as the games folder for the system. but that wasn't it either

     

  4. I'm having a difficult time importing my setup teknoparrot games. 

    I use my sorting script that sorts the games into folders named after PC Arcade system, so i can add the games to LB by selecting the XML's and dropping them into LB and have it do it's thing. 
    This would work for most of my systems, but for some reason LB decides that it will import all the setup games from the [TP folder]\userprofiles folder instead.

    which is neat, but not what i want. 

    I'm assuming that it has to do with build in logic,
    I also assume that the XML files have been parsed by the import as it reads the game name and not the file name.

    somehow even if I'm not telling LB what I'm importing by not telling what type of game files I want it to import, or declare a default emulator for it, it will read the XML's and return to the TP\USERPROFILES folder. 

    This would be so awesome if it would also give me the option to sort the games into seperate platforms or generate the playlists for those platforms, but right now It frustrates me.

    any suggestions ? 
     

    • Like 1
  5. The one thing I sometimes miss in BB are the Transition animations that HS has between bespoke game themes, those were awesome. the dropping bombs or just the HS logo swishing in and out. 

    What I dont miss : 

    XML based databases
    Gatekeeping
    Snobbery
    Elitism

     

    • Like 1
  6. Starting of, the view has been my main opening view for bigbox since it was introduced. i like it very much. 

    however, Some more control over de Game discovery view would be nice.
    it would be awesome if two things would be taken into consideration. 

    1. give user created playlists a row, that could be switched on or off in the options menu

    2. give users the ability to either show platform or platform category row.

    anyway 
     

    • Like 1
  7. On 5/3/2024 at 11:20 PM, RetroFanZ said:

    hey i' looking for some collections logos please

    Aleste Collection

    Darius Collection

    Mortal Kombat Collection

    Mega Man X

    Mega Man Zero

    Mega Man Legends

    Mega Man Star Force

    Mega Man World

    Mega Man Battle Network 

    Thx for the help ;)

    I see you're scratching off, just so I understand Mega man world... are those the Gameboy / genesis games ? 

  8. On 5/3/2024 at 11:20 PM, RetroFanZ said:

    hey i' looking for some collections logos please

    Aleste Collection

    Darius Collection

    Mortal Kombat Collection

    Mega Man X

    Mega Man Zero

    Mega Man Legends

    Mega Man Star Force

    Mega Man World

    Mega Man Battle Network 

    Thx for the help ;)

    Already made Mortal kombat and megaman collections. 

    Darius Collection.png

    Aleste Collection logo.png

    Darius Collection.png

    Aleste Collection.png

    • Like 2
×
×
  • Create New...