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; }
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))); } } }
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; }