Difference between revisions of "Theme"

From BotF2-Wiki
Jump to: navigation, search
(tried to explain how some things are done)
Line 4: Line 4:
 
Atm we have two different ways:
 
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
 
*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 MusicTheme'''BasePath''' = "Resources/Themes";
         private const string MusicPackFileName = "MusicPacks.xml";
+
         private const string MusicPack'''FileName''' = "MusicPacks.xml";
 +
 
 
Advantage: easier to code
 
Advantage: easier to code
 +
 
Disadvantage: files are separated
 
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)
 
*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.  
+
*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)
 
*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
 
*maybe for StartGame-Screen: \Mainline\SupremacyClient\themes\Default.xaml

Revision as of 16:51, 3 January 2016

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" />

MusicPack

(done by Hannes)

WEB Links