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!