Example #1
0
        /// <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
            if (XMLManager.XmlFileExist(colorName, texturesPath))
            {
                // Set custom color
                if (XMLManager.GetString(colorName, "customtext", texturesPath) == "true")
                {
                    button.Label.TextColor = XMLManager.GetColor(colorName, texturesPath);
                }
                // Disable text. This is useful if text is drawn on texture
                else if (XMLManager.GetString(colorName, "customtext", texturesPath) == "notext")
                {
                    button.Label.Text = "";
                }
            }
        }