/// <summary> /// Import custom texture and label settings for buttons /// </summary> /// <param name="button">Button</param> /// <param name="colorName">Name of texture</param> static public void SetCustomButton(ref Button button, string colorName) { // Load texture button.BackgroundTexture = LoadCustomTexture(colorName); button.BackgroundTexture.filterMode = (FilterMode)DaggerfallUnity.Settings.GUIFilterMode; // Load settings from Xml string path = Path.Combine(texturesPath, colorName); if (XMLManager.XmlFileExists(path)) { var xml = new XMLManager(path); string value; if (xml.TryGetString("customtext", out value)) { if (value == "true") // Set custom color for text { button.Label.TextColor = xml.GetColor(button.Label.TextColor); } else if (value == "notext") // Disable text. This is useful if text is drawn on texture { button.Label.Text = string.Empty; } } } }