예제 #1
0
 public XmlUIManager(FreelancerGame game, string apiname, object api, string src)
 {
     Game         = game;
     this.apiname = apiname;
     this.api     = api;
     xml          = XInterface.Load(src);
     defaultFont  = game.Fonts.GetSystemFont("Arial");
     foreach (var fnt in game.GameData.Ini.Fonts.UIFonts)
     {
         uiFonts.Add(fnt.Nickname, game.Fonts.GetSystemFont(fnt.Font));
     }
     if (xml.ResourceFiles != null)
     {
         foreach (var file in xml.ResourceFiles)
         {
             game.ResourceManager.LoadResourceFile(game.GameData.ResolveDataPath(file.Substring(2)));
         }
     }
     DoStyles(xml);
     LoadScene(xml.DefaultScene);
     game.Mouse.MouseDown    += Mouse_MouseDown;
     game.Mouse.MouseUp      += Mouse_MouseUp;
     game.Keyboard.TextInput += Keyboard_TextInput;
     game.Keyboard.KeyDown   += Keyboard_KeyDown;
 }
예제 #2
0
 void DoStyles(XInterface x)
 {
     if (x.Styles != null)
     {
         styles.AddRange(x.Styles);
     }
     if (x.Includes != null)
     {
         foreach (var inc in x.Includes)
         {
             DoStyles(XInterface.Load(Game.GameData.GetInterfaceXml(inc.File)));
         }
     }
 }
예제 #3
0
 public XmlUIManager(FreelancerGame game, string apiname, object api, string src)
 {
     Game         = game;
     this.apiname = apiname;
     this.api     = api;
     xml          = XInterface.Load(src);
     Font         = game.Fonts.GetSystemFont("Agency FB");
     if (xml.ResourceFiles != null)
     {
         foreach (var file in xml.ResourceFiles)
         {
             game.ResourceManager.LoadResourceFile(game.GameData.ResolveDataPath(file.Substring(2)));
         }
     }
     DoStyles(xml);
     LoadScene(xml.DefaultScene);
     game.Mouse.MouseDown += Mouse_MouseDown;
     game.Mouse.MouseUp   += Mouse_MouseUp;
 }