Difference between revisions of "Theme"

From BotF2-Wiki
Jump to: navigation, search
(Screens)
(WPF)
Line 66: Line 66:
  
 
*http://wpftutorial.net/GeometryTransformer.html
 
*http://wpftutorial.net/GeometryTransformer.html
 +
 +
= WPF Drawing =
 +
 +
*Path Markup Syntax https://msdn.microsoft.com/de-de/library/ms752293%28v=vs.110%29.aspx
 +
** F1 specifies the Nonzero fill rule.
 +
** M startPoint
 +
** L endPoint
 +
** H x    Creates a horizontal line between the current point and the specified x-coordinate. H 90 is an example of a valid horizontal line command.
 +
** v y    Creates a vertical line between the current point and the specified y-coordinate. v 90 is an example of a valid vertical line command.
 +
**  C controlPoint1 controlPoint2 endPoint  Creates a cubic Bezier curve between the current point and the specified end point by using the two specified control points (controlPoint1 and controlPoint2). C 100,200 200,400 300,200 is an example of a valid curve command.

Revision as of 15:19, 28 February 2016

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:

\Mainline\SupremacyClient\themes\Default.xaml

  • 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

  • \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

  • \Mainline\SupremacyClient\ClientApp.xaml
   <ResourceDictionary Source="themes/Default.xaml"/>

MusicPack

(done by Hannes)

WEB Links

WPF Drawing

  • Path Markup Syntax https://msdn.microsoft.com/de-de/library/ms752293%28v=vs.110%29.aspx
    • F1 specifies the Nonzero fill rule.
    • M startPoint
    • L endPoint
    • H x Creates a horizontal line between the current point and the specified x-coordinate. H 90 is an example of a valid horizontal line command.
    • v y Creates a vertical line between the current point and the specified y-coordinate. v 90 is an example of a valid vertical line command.
    • C controlPoint1 controlPoint2 endPoint Creates a cubic Bezier curve between the current point and the specified end point by using the two specified control points (controlPoint1 and controlPoint2). C 100,200 200,400 300,200 is an example of a valid curve command.