Jump to content
LaunchBox Community Forums

Recommended Posts

Version 2

Download: LB Custom Badge.zip

How to use:

Extract it anywhere. But NOT the Launchbox/Plugins directory.

Open "LBCustomBadge.exe".

Select a tab, fill in the fields and press compile.

Note: the example images below have an "Index" option. This option is actually set by Launchbox so it has been removed from the app. 

Capture.thumb.PNG.76ab4469daa6dc5f5e7deeed0c2a219c.PNG

When you press compile a command window will pop up. If the compile is successful your command window will look something like:

Capture.thumb.PNG.91c9f4b131b0e621205044c249c6899a.PNG

If this command window contains any text that is red, it has failed to compile. I have tested about 20+ badges with no problems, if you come across any issues just reply on this thread with what options you selected.

After the text "0 warnings" and "0 errors" appear, close the command window, at which point you will find the dll in the same directory as "LBCustomBadge.exe".

Additional Apps, Controller, Custom Field, Emulator, Game, Platform: If you have used the previous version, you will already know how to use these options. If you haven't used the previous version scroll to the bottom of this post for some examples.

 

Advanced: this option uses c# code to make multi condition badges.

As an example here is how to do 2 conditions for the "Game" badge type.

We are going to display a badge for when a games playcount is above 20 and favourite equals true:

First we select the options for our playcount condition:

Capture.thumb.PNG.6b38a4cea6e98e3bed08f57a84397d2d.PNG

Then click the "Refresh" button to display the code:

Capture.thumb.PNG.15a06dcdbff586b3192d0a7ff3782901.PNG

Highlight and copy the code that is in the textbox and click on the advanced tab, paste the code into the textbox:

Capture.thumb.PNG.bf3cccc09eb25c13e426ff0dfdfc3386.PNG

As we want the playcount to be above 20 "AND" we want favourite to equal true we need to add the c# code for "AND". The c# code for "AND" is two ampersand characters "&&" . We add the two ampersands like so:

Capture.thumb.PNG.362e154b4210fa42e19cfc5df1de1944.PNG

 

NOTE:

if instead of "AND" we wanted "OR". playcount is above 20 "OR" favourite equals true. the c# code for "OR" is two bar characters "||":

Capture.thumb.PNG.1c6c27e72fc3eba2096f155ee3740909.PNG

END OF NOTE

 

Now we want to add our "favourite is true" condition so go back to the game tab, select "Favourite" from the drop down and select the true checkbox. Press refresh to display the code:

Capture.thumb.PNG.6cb86db106c6873cc61d7eee37452cc0.PNG

Copy the code thats in the textbox and paste it in the "Advanced" tab textbox:

Capture.thumb.PNG.45f72bb9530f80b954c90d3f9b868dfb.PNG

Now while still on the advanced tab press compile and you will get a badge for your 2 conditions game badge.

 

Each badge type can have vastly different code. There are to many different ways to add the code for me to explain them all. So if you want the code for a great badge idea you have what you do is... 

You tag JoeViking245 like so: @JoeViking245 and you say "please joe, give me the code for my cool badge idea" and he will reply with the code. ?

Dont be shy in asking on this thread on how to display a badge for multiple conditions. And also be warned, if you decide to create crazy looking  code like so:

Capture.thumb.PNG.546cc87b3da539b38fa375b5a62cc62c.PNG

Don't be surprised when your platform takes a long time to load.

 

Version 1

I spoke to @Mr.Laor, the poster of this thread above. He assured me no one was working on this. If any coder is working on this in the hope of getting paid, let me know and i'll happily remove this.

 

Download this: LB Custom Badge.zip

Extract it anywhere. 

Open "LB_Custom_Badge.exe".

Fill in the fields and press compile.

After you get the "compile complete" message box. Look in the same folder as "LB_Custom_Badge.exe" for a .dll file. Move that .dll into Launchbox/Plugins and restart launchbox and enable the badge.

I made this app to give myself a break from other stuff and to see if I could do it. It doesn't look pretty, it just does a job. That being said I will fix any bugs but im not looking to give anymore time adding stuff to this. What you see is what you get. 

 

Some examples on how to use this: 

Lets say you want a badge to display for the games that have a custom field named "My Opinion" and the value is "Poo":

Capture.thumb.PNG.48c13b36a896d96f1466ad3892ea202e.PNGBadge Name: This is the name that is displayed in LB:

Untitled.thumb.png.93f5ff66dbd53bbef7b6e75953e2c9e2.pngUnique Id: Give your badge a unique Id.

Image: The badge image (displayed in the red circle above). Point the path to a png or jpg. (if you press compile and you get the "compile complete" message but no dll, 1 reason could be that the image isnt a valid png or jpg, As an example dont rename a .webp to .png and try to compile, it wont work).

Index: needs to be a number. Im not entirely sure what this is for but I guess if you have multiple badges enabled, this field is what position to display the badge at?.

Badge Type: In this case we want custom field. Other choices are Game, Platform (the games platform) and Emulator (the games default emulator).

Name: The name of your custom field as it appears in LB.

Matching type: (I suck at explaining things) In this case we want a badge to display for our "My Opinion" custom field, where the Value "Equals" Poo. Matching is case sensitive. (Maybe someone else can jump in and explain this better than me ?)

Value: Your custom fields value as it appears in LB.

 

Another example:

Lets say you want to display a badge for every game that was released between 1700 and 1800 (18th century)

Capture.thumb.PNG.cc3749dff42b153421b48d0e631ed30b.PNGSo you would want to select "Game" as your badge type.

The property is the games "ReleaseDate"

and the value: You want the games release date to fall between the 31st of December 1699 (start date) and the 1st of January 1800 (end date).

 

1 more example.

You want to display a badge for every game that uses retroarch as its default emulator.

Capture.thumb.PNG.e4cac304d90c25d3871a58680d9d3a5a.PNGYou want the "Emulator" => "ApplicationPath" => to "EndWith" => "retroarch.exe". (Again the value is case sensitive, so if your retroarch's .exe file is named "Retroarch.exe" it wont match).

 

 

Edited by jayjay
  • Like 4
  • Thanks 1
  • Haha 1
  • Unusual Gem 2
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 3 months later...
  • 1 month later...
  • 2 weeks later...

RetroAchievement Badges plugin - a complement to Custom Badges

What does this plugin do?
Adds a Badge to games that are supported by RetroAchievements.

RA.png.db6447239b9eebd82f18fb2d38007815.png

Why?
Because several people ask about getting this feature.

How to install the plugin:
1.    Download RetroAchBadge.zip
2.    UnBlock the zip file. (Hint: right click the file, select “Properties” and check the box that says ‘Unblock’ [or something like that])
3.    Click OK to close the Properties window
4.    Open the zip file
5.    Copy the folder “RetroAchBadge” to your /LaunchBox/Plugins/ folder

How to make the plugin work:
1.    Start LaunchBox
2.    Click “BADGES”
3.    Check “Enable Retroachievements”

How to add or remove the badge from a game:
1.    Right click the game and select "RetroAchievements Badge"

**** A word about Platform names: ****  (This is kind of important)
Your LaunchBox Platforms and the RetroAchievements Platforms need to have the same name.

Example:  If your Platform is named “N64” and RetroAchievements calls it “Nintendo 64”, the badges are not going to show.

The fix:  Look inside the folder “/LaunchBox/Plugins/RetroAchBadge/RetroBadge Files” and rename the folder “Nintendo 64” to “N64”.

Here are the available (30) RetroAchievement Platforms.
image.thumb.png.7f822092a63997044520c09b4630c0ca.png

Known issues:
The word “The”.  You’ll come across some games that won’t show the badge because of naming conventions.

  • Example: “The Addams Family“ is not the same as “Addams Family, The”.
  • The fix:  See “How to add or remove the badge from a game:” above.

Unknown issues:
Please let me know when you find any.

The File:  

RetroAchBadge.zip

Designed for LaunchBox 11.9 and newer.  Major contributors to the plugin are: @jayjay

  • Like 2
  • Thanks 1
  • Unusual Gem 1
Link to comment
Share on other sites

@JoeViking245
Thank you. This is really cool.
Where is stored the png file for the badge ? I would like to customize it with this one : (see attached file).
And I have some suggestions : If I understand this plugging, it doesn't auto-update, if a new game receive achievements, we need to add a text file manually.
So it's not the best I think.
If we look the LaunchBox option, there are 2 checkboxes, one for RetroAchievements, and another for Achievements, certainly for Steam (see attached file).

The tool made by
@jayjay does not have these two fields, so unfortunately we can't use them.
But with your logic we can maybe use another trick : if you look here "
yourPath\LaunchBox\Images\Cache-LB" you can see two folders : RetroAchievements and SteamAchievements.
Maybe we can find a logic with the files in these 2 folders.

What do you think ?

 

RetroAchievements.png

LaunchBox 2021-04-10 170120.png

Edited by PixelDragon
Link to comment
Share on other sites

Glad you like it!

29 minutes ago, PixelDragon said:

Where is stored the png file for the badge ?

@Krakerman  You're on it man!!!  Thanks!!    ..\LaunchBox\Images\Badges\RABadge001.png 

29 minutes ago, PixelDragon said:

if a new game receive achievements, we need to add a text file manually.
So it's not the best I think.

We're looking into auto updates.  Not sure how often they add new games to the list.  New games as opposed to new achievements for an existing game (which this plugin doesn't [won't] address).

But it's actually a lot better than you think.   When you follow Step #1 in How to add or remove the badge from a game:, it adds a text file automatically.  So the only thing manually you need to do (for now) is Step #1. :) 

Edited by JoeViking245
  • Thanks 1
Link to comment
Share on other sites

21 hours ago, PixelDragon said:

This is great, the RetroArchAchievement and the SteamAchievement badges should be part of the official release...

Thank you!!

There isn't really a 'good' way to enable a badge for achievements. I'm sure Jason and CBeatt13 have already looked into it. With Retroarch recently softening their stance on commercial apps using their code, maybe Our developers can come up with a better method. If there was a good method currently, it would probably be added already.

The method we use isn't foolproof and [at times] requires the user to manually edit the badge (i.e. the "The" issue). It's a bit too hacky to be added to a Professional (paid for) application.

Question to anyone in-the-know.... Any idea how frequently new Games (vs. achievements FOR a game) are added?

I'm sure they're "constantly adding new games".  But are we talking like 5 a day?  5 per week?  1 or 2 every couple of weeks?  

Link to comment
Share on other sites

We have been waiting for the next version of the RetroAchievements API to be built before tackling this feature. We were told it would have several features added that would make doing this sort of thing far more accurate. Once they release it we can revisit and see what we can do to facilitate the requests for better functionality.

  • Like 4
Link to comment
Share on other sites

RetroAchievement Badges official release:

 

Includes an Updater and some other refinements.  The biggest one (that you may notice) is "The".

This will now 'convert' R-Achievements "Addams Family, The"  to  "The Addams Family"  making it so the Badge now appears (without having to right-click).

Anyone who wishes to use the 'official' release and had previously installed the beta release...  Completely delete the beta release folder first!  I tried to make a seamless integration between the two, but it made things more problematic than good.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...