Beispiel #1
0
            public void Load(string fileName, DomNode node)
            {
                foreach (DomNode child in node)
                {
                    switch (child.Name.ToLower())
                    {
                    case "color": Color = UIDefaults.LoadColor(fileName, child, Color4.White); break;

                    case "font": Font = UIDefaults.LoadFont(fileName, child); break;
                    }
                }
            }
Beispiel #2
0
            public void Load(string fileName, DomNode node)
            {
                foreach (DomNode child in node)
                {
                    switch (child.Name.ToLower())
                    {
                    case "background": Background = UIDefaults.LoadBackground(fileName, child); break;

                    case "border": Border = UIDefaults.LoadBorder(fileName, child); break;
                    }
                }
            }
Beispiel #3
0
            public void Load(string fileName, DomNode node)
            {
                string relName;

                foreach (DomNode child in node)
                {
                    relName = String.Format("{0}~{1}", fileName, child.Name);
                    switch (child.Name.ToLower())
                    {
                    case "states": States.Load(relName, child); break;

                    case "font": Font = UIDefaults.LoadFont(fileName, child); break;
                    }
                }
            }
Beispiel #4
0
 static UI()
 {
     Defaults = new UIDefaults();
     GameDebugger.EngineLog(LogLevel.Debug, "Trying to load UI defaults from '{0}'", GameConfig.UIDefaultsFile.ToPath());
     try {
         Defaults.Load(GameConfig.UIDefaultsFile.ToPath());
         GameDebugger.EngineLog(LogLevel.Debug, "UI defaults loaded successfully");
     }
     catch (FileNotFoundException) {
         GameDebugger.EngineLog(LogLevel.Debug, "UI defaults file is not found.");
         GameDebugger.EngineLog(LogLevel.Debug, "Using hardcoded UI defaults.");
     }
     catch (Exception ex) {
         GameDebugger.EngineLog(LogLevel.Debug, "Error while trying to load UI defaults: {0}", ex.ToString());
         GameDebugger.EngineLog(LogLevel.Debug, "Using hardcoded UI defaults.");
     }
 }
Beispiel #5
0
            public void Load(string fileName, DomNode node)
            {
                foreach (DomNode child in node)
                {
                    switch (child.Name.ToLower())
                    {
                    case "menu-background": Background = UIDefaults.LoadBackground(fileName, child); break;

                    case "menu-border": Border = UIDefaults.LoadBorder(fileName, child); break;

                    case "menu-padding": MenuPadding.Load(fileName, child); break;

                    case "item-padding": ItemPadding.Load(fileName, child); break;

                    case "item-spacing": ItemSpacing.Load(fileName, child); break;

                    case "separator": Separator = UIDefaults.LoadBackground(fileName, child); break;

                    case "item-states": ItemStates.Load(fileName, child); break;

                    case "font": Font = UIDefaults.LoadFont(fileName, child); break;
                    }
                }
            }