Theme

From BotF2-Wiki
Revision as of 18:54, 10 January 2016 by Reginald (Talk | contribs)

Jump to: navigation, search

Intro

We are still finding out how that works.

Atm we have two different ways:

  • new one (created by Hannes): defines a BasePath and a Filename in game's folder "Resources", and in the middle the players race is filled in
       private const string MusicThemeBasePath = "Resources/Themes";
       private const string MusicPackFileName = "MusicPacks.xml";

Advantage: easier to code

Disadvantage: files are separated


  • this new one is already done for \Resources\UI, but there only the *.png are included, no xaml. (Example: shipyard_dock.png for each race)
  • suggestion (by reg): doing all new stuff into \Resources\Themes, separated by played race.
  • an older option is to put all files into one folder and separate it by filename
    • examples: fed_destroyer.png, card_destroyer.png
    • another example: audio files for TaskForceOrders


Screens

In the source code (not in the game's folder) just one theme is done -> the Federation theme.

AND: Mostly it's done by xaml-files defining the design with bindings to a binded .cs-file where the code for each design object is coded.

Example: to select a ship to build...

  • ...the design is in NewShipSelectionView.xaml
  • ...but the code for double click or others is in NewShipSelectionView.xaml.cs

All relevant design objects are binded somehow to somewhere (for example to create the list which ships are buildable, depending by tech level, own race and more)


I assume it's necessary to bring theme data from repositories folder into the folder delivered with the game


Here some xaml out of repositories folder:

  • maybe for StartGame-Screen: \Mainline\SupremacyClient\themes\Default.xaml
   <ResourceDictionary Source="/SupremacyClient;component/themes/Global.xaml"/>
   <ResourceDictionary Source="/SupremacyClient;component/themes/MessageDialog.xaml"/>
   <ResourceDictionary Source="/SupremacyClient;component/themes/MenuScreen.xaml"/>


  • \Mainline\SupremacyClient\themes\Global.xaml
   <ResourceDictionary Source="pack://siteoforigin:,,,/Resources/Geometry/Glyphs.xaml" />
   <ResourceDictionary Source="pack://siteoforigin:,,,/Resources/Images/Resources/Icons.xaml" />


  • \Mainline\SupremacyClient\ClientApp.xaml

<ResourceDictionary Source="themes/Default.xaml"/>

MusicPack

(done by Hannes)

WEB Links