Jump to content
LaunchBox Community Forums

ProgField: Custom Fields API for BigBox Themes


Recommended Posts

ProgField is a Custom Fields API for BigBox Themes. It exposes the Custom Fields data and allows theme designers to display them on their themes.

It also allows some additional controls for visibility settings, which is its most exciting part!

I don't have a premium license, so please understand that it only has been tested under my buddy's arcade cabinet (he runs Windows 10 64bit). I couldn't perform an extensive testing. However, it has been working great so far and and it can't really have any fatal bugs.

I bring my laptop to my buddy's house every weekend and test new features. If you find any bugs, please let me know and I'll make sure to test them on the weekends.

 

Usage:

1. At the top of any XAML file, inside (not under) the <UserControl node, add:

xmlns:prgf="clr-namespace:ProgField;assembly=ProgFields"

2. Somewhere early in the script (XAML), add:

<prgf:P x:Name="PF" />

 

Dynamic Visibility Control

ProgField allows the theme designer to only display an element based on its data. The supported controls are:

  • INTEGER COMPARISON: If the field value is greater/less than the specified amount, it will return "Visible" for visibility. Otherwise "Collapsed" to hide the element.
    Usage for greater than: {Binding ElementName=PF, Path=game.verify[customfieldname:+specifiedAmount]}
    Usage for less than: {Binding ElementName=PF, Path=game.verify[customfieldname:-specifiedAmount]}

    If the value of the custom field is zero, it will always return "Collapsed". To override this behavior, use:
    {Binding ElementName=PF, Path=game.verify[customfieldname:+specifiedAmount,0]}
    {Binding ElementName=PF, Path=game.verify[customfieldname:-specifiedAmount,0]}


    e.g. Visibility="{Binding ElementName=PF, Path=game.verify[cc:-2]}"
    This will only return "Visible" if the value of the custom field "cc" is less than 2, but not 0. "cc" field is used to indicate how many continues (or coins) it was used to clear the game.
     
  • STRING COMPARISON: If the field value is equal to the specified string, it will return "Visible", otherwise "Collapsed".
    Usage: {Binding ElementName=PF, Path=game.verify[customfieldname:=specifiedString]}
     
  • PROGRESSION CHECK:
    In the custom field value, it should be formatted as "x/y", where x is the progress and y is the maximum possible progress.
    In the theme XAML, the designer can specify an integer and if x is bigger than the integer OR, the x is at the maximum possible progress even though it's smaller than the specified integer, it will return "Visible", otherwise "Collapsed".
    Usage: {Binding ElementName=PF, Path=game.verify[customfieldname:/specifiedInteger]}

    e.g. Visibility="{Binding ElementName=PF, Path=game.verify[difficultyClear:/3]}"
    This indicates that this element ("HARD" = 3) will be only displayed when the user beats the game on HARD. However, if the game only has two difficulty levels, the end-user might put "0/2" in their custom field named difficultyClear.
    If the user puts "2/2" as a value, then ProgField will treat it as 3/3 as it is maxed out, and show the element.


Simple Custom Field Value Display

If you wish to simply display a value of a custom field, you can do this as well.

Usage:

{Binding ElementName=PF, Path=game.field[fieldName].Value}

 

The original purpose was to add medals or progression milestones to custom themes. For arcade players, clearing with less continues matter. Clearing with higher difficulties matter, and custom themes can now display it, if the player achieves this.

I wish to also add more dynamic support like leaderboards, but due to my limited access to the premium version I don't think I can program something bigger scale. I will however still gladly take feedbacks!

I'm still open to many suggestions and if it's something I can test for half an hour a week and push it to the main release, I'll gladly add them for you.

Let me know if you encounter any bugs!

Edited by dillabon
Link to comment
Share on other sites

  • 2 weeks later...

Hi Dillabon,

Do you have an example XAML file regarding displaying the value of a custom field? I'm trying to add one to my Wheel4GamesView but keep getting 'cannot create unknown type {clr:namespace ProgField}' when launching into the theme. Do I need to download and run something for this to work, only I've not noticed any accompanying files...? I'm on Windows 10 64 Bit.

My custom field is called 'Controls1' and the value is text. Just need to display it to the left of my games view.

Many thanks,

Link to comment
Share on other sites

Thanks for the reply MC.

Could you point me in the right direction? I've been staring at this for a while now (bit of a novice I'm afraid).

I've attached a copy of the file I'm working with. You'll see reference to Dillabon's code within.

Many thanks for your assistance.

 

Edited by Mr_Moon
Resolved
Link to comment
Share on other sites

Did you put the plugin in the plugin folder of your theme?

You can ignore the error. To remove the error requires importing the plugin into your visual studio workspace.

That said, based on your code, I don't see anywhere where you're actually asking to display the custom field value.

 

Where is your 

{Binding ElementName=PF, Path=game.field[fieldName].Value}
Link to comment
Share on other sites

15 hours ago, Mr_Moon said:

Hi Dillabon,

Do you have an example XAML file regarding displaying the value of a custom field? I'm trying to add one to my Wheel4GamesView but keep getting 'cannot create unknown type {clr:namespace ProgField}' when launching into the theme. Do I need to download and run something for this to work, only I've not noticed any accompanying files...? I'm on Windows 10 64 Bit.

My custom field is called 'Controls1' and the value is text. Just need to display it to the left of my games view.

Many thanks,

I just took a look at your XAML file and nothing seems to be out of order.
Makes sure ProgFields.dll is in your LaunchBox's "Plugins" folder, and your custom field's name is exactly "Controls1", without spaces.

Also, ProgFields will not work properly when the user is aggressively changing selections if the theme element that contains ProgFields value is animated (transitions).
I've noted this on the latest 8.0 beta topic, but Jason hasn't responded to it yet. The transition system in BigBox has a bug that needs to be fixed for plugins, so there is nothing I can do at this point.

Link to comment
Share on other sites

Hi Guys,

Thanks again for your time on this matter.

Dillabon - good to know the code is correct at least!

I think the issue is that I don't have the plugin! - (the ProgFields.dll file that Dillabon mentions). Where do I find this? I cannot see it anywhere to download it. Apologies if this is a stupid question but I've checked the obvious places... (this thread, and the downloads section). Are you able to post a link to this?

Many thanks,

Link to comment
Share on other sites

  • 2 months later...
  • 9 months later...
On 1/8/2018 at 11:53 PM, dillabon said:

ProgField is a Custom Fields API for BigBox Themes. It exposes the Custom Fields data and allows theme designers to display them on their themes.

I can't find it either :( Is this still not supported natively in Bigbox? Is there another plugin that can' show custom fields?

Edited by Blazer
Link to comment
Share on other sites

  • 3 years later...

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...