Jump to content
LaunchBox Community Forums

Major Theming Changes for Big Box 9.4


Jason Carr

Recommended Posts

Hello theme developers! First off, thank you all so much for all the amazing Big Box themes you've created so far; I hope that these changes prove to be useful for you guys.

Please know that none of these changes should break any existing themes. All themes should be upgraded automatically when starting up Big Box 9.4-beta-5 or later. I've worked hard to ensure that all themes, even back to the very first themes from 2016, will continue to work.

In a nutshell, here are the theming changes for Big Box 9.4:

  • Styles XAML files are no longer supported (they're automatically migrated to the Views files)
  • Platform-specific XAML files are now supported (much like the new Startup themes)
  • Due to a recently discovered performance issue, HelperControl:TotalGamesCount has been replaced with a new GamesCount property

Styles XAML Files No Longer Supported

In the past, the previous code allowed for occasional theme conflicts when switching between themes. If you've ever seen a particular styling from one theme end up in another, then you've noticed this in the past. This was caused by theme styles not getting fully reset to defaults before applying the new styles, which was a rare problem, but it did happen between particular themes. We've simplified themes going forward so that styles cannot be shared between themes, which should eliminate this as a problem as well as make things a little bit more straightforward for new theme developers.

By Styles XAML files, we're referring to any files in the Styles subfolder of themes. Upon startup of Big Box 9.4-beta-5 or later, you'll notice that these Styles XAML files are removed and the contents of them are automatically migrated to the Views XAML files that use them. If you used any styles in your themes, you'll notice that the views that use them will have a new <UserControl.Resources> section near the top of the XAML. The entire <Style> elements are just copied over from the style XAML file into the view files that use them.

The one disadvantage of this is of course duplicated code, but I believe the added simplicity and reduced confusion outweigh that disadvantage. Let me know if anyone finds any themes that do not migrate properly to this new model.

Update (2019-02-05): This strategy has changed slightly. Please see here:

Platform-Specific XAML Files

This should prove to be an exciting addition, especially for themes like CoverBox or Unified Refried which currently require using a separate theme for each platform. Instead of requiring many different themes, these themes can now be combined into a single theme with different XAML for each platform.

New folders can be created inside a theme's Views folder for each type of games view, with XAML files inside that are named to match a particular platform. For example, you could create a new file like this:

LaunchBox\Themes\My Custom Theme\Views\WheelGamesView\Nintendo Entertainment System.xaml

This new XAML file would then be used as the WheelGamesView for the Nintendo Entertainment System platform. If a custom platform file does not exist like the above, then of course Big Box will revert to the default WheelGamesView.xaml file directly in the Views folder. Let me know if anyone has any questions or runs into any issues with this new addition.

HelperControl.TotalGamesCount Replaced

It recently came to our attention that this particular piece of functionality in the HelperControl has been causing performance issues with the new nesting features, so instead I've added a new GamesCount property to the platform filters views.

Upon startup of Big Box 9.4-beta-5 or later, themes will be upgraded to replace the <HelperControl:TotalGamesCount> elements with elements like this instead:

<TextBlock Text="{Binding GamesCount}" />

All formatting and child properties from the previous <HelperControl:TotalGamesCount> element will be applied to the new TextBlock element, so everything should work exactly the same without introducing performance issues.

Once again, thank you all and let me know if you have any questions or run into any issues with the new features. The Documentation.pdf file in the LaunchBox\Themes folder has been updated as well.

@faeran @Mr. RetroLust @RetroHumanoid @wallmachine @eatkinola @bbweiners @keltoigael @Jack. @y2guru @whoozwah @SNAK3ATER @Rincewind @CriticalCid @shro2016 @broskiplays @Grila @NJDave71 @Hexxxer @PhillsDoodles @Zombeaver @Omen @Cookz718 @viking @OrochiMishima @nosh @ea4492 @Maddoc1007 @vsilvalopes @damageinc86 @walter10h @skainlurmis @Scottad @Nyny77 @Sithel @Akezhar @Thanos Reigns

  • Like 11
  • Thanks 1
  • Game On 1
Link to comment
Share on other sites

23 minutes ago, Mr. RetroLust said:

Awesome @Jason Carr I was just working on a new theme and riddled how I would do such thing as platform specific and there you are! ? Seen this @Kondorito? :)

Yeap! Awesome changes :)

@Jason Carr, just to be sure; say I have a heavily modified xamls from a theme, these updates will be applied automatically to the theme, being inserted without messing with the rest of the code there? 

Edited by Kondorito
  • Like 1
Link to comment
Share on other sites

13 minutes ago, Kondorito said:

@Jason Carr, just to be sure; say I have a heavily modified xamls from a theme, these updates will be applied automatically to the theme, being inserted without messing with the rest of the code there? 

That is correct. It simply adds a UserControl.Resources section if necessary, and adds the relevant styles there.

  • Like 1
  • Game On 1
Link to comment
Share on other sites

I just put out beta 7 to fix an issue with themes that use an existing <ResourceDictionary> tag inside of the <UserControl.Resources> tag in the views. Fundamental and Retrotastic (and possibly some others) were configured that way and it was breaking the upgrade process for those themes.

All should be fixed now, but unfortunately if you had previously run beta 5 or beta 6 of Big Box with those themes included, they were upgraded improperly so you'll need to re-download them from the forums.

Let me know if anyone sees any additional issues with any other themes.

  • Thanks 1
Link to comment
Share on other sites

@Jason Carr This is amazing...and I cannot wait to test this out! 

Unfortunately, I literally just broke down my arcade cabinet last night,to prepare for our move to the big place in February :( ,but,at least we finally can get out of this shoe-box we have been living in since July.

As soon as I am back up and running,I can update the theme,and push the update to the forums....I seriously can't wait!

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

Just now, RetroHumanoid said:

@Jason Carr This is amazing...and I cannot wait to test this out! 

Unfortunately, I literally just broke down my arcade cabinet last night,to prepare for our move to the big place in February :( ,but,at least we finally can get out of this shoe-box we have been living in since July.

As soon as I am back up and running,I can update the theme,and push the update to the forums....I seriously can't wait!

Awesome, thank you as always @RetroHumanoid. Have a safe and painless move and enjoy the new place. :)

Link to comment
Share on other sites

13 minutes ago, Undertherainbow said:

Hey!

I have only tested unified redux in 9.4-7

but

<HelperControl:TotalGamesCount FontFamily="{StaticResource FontBebasNeue}" FontSize="40" Foreground="White" DockPanel.Dock="Left"  />

doesnt line of code seem to be updated to new style?

Do you mean that it isn't updating for you? I just tested Unified Redux and it appears to be updating automatically just fine. The above line is replaced with this:

<TextBlock Text="{Binding GamesCount}" FontFamily="{StaticResource FontBebasNeue}" FontSize="50" Foreground="White" DockPanel.Dock="Left"  />

 

Link to comment
Share on other sites

3 minutes ago, Jason Carr said:

Do you mean that it isn't updating for you? I just tested Unified Redux and it appears to be updating automatically just fine. The above line is replaced with this:


<TextBlock Text="{Binding GamesCount}" FontFamily="{StaticResource FontBebasNeue}" FontSize="50" Foreground="White" DockPanel.Dock="Left"  />

 

Its alright, i just noticed ur post about redownloading theme if used with beta 5 and 6

i think i did that. its alright now.  I have to check my own theme tho.. i didnt had backups .. nor did i publish it.. i hope i didnt made a mess for my self

 

performance is OK! when loading themes. no more delays. Good Job

Edited by Undertherainbow
Link to comment
Share on other sites

2 minutes ago, Undertherainbow said:

Its alright, i just noticed ur post about redownloading theme if used with beta 5 and 6

i think i did that. its alright now.  I have to check my own theme tho.. i didnt had backups .. nor did i publish it.. i hope i didnt made a mess for my self

Most likely it's fine. If you do run into issues, let me know. It's never a good idea to run betas without backups, but in this case it should be a relatively easy fix if you've ended up with a broken theme.

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