Beispiel #1
0
            bool configSetSlider(string key, string value, Configuration.Options options)
            {
                switch (value.ToLower())
                {
                case "top":
                case "t":
                    sliderOrientation_ = SliderOrientation.Top;
                    break;

                case "left":
                case "l":
                    sliderOrientation_ = SliderOrientation.Left;
                    break;

                case "bottom":
                case "b":
                    sliderOrientation_ = SliderOrientation.Bottom;
                    break;

                case "right":
                case "r":
                    sliderOrientation_ = SliderOrientation.Right;
                    break;

                default:
                    log(Console.LogType.Error, $"Invalid slider orientation '{value}'");
                    return(false);
                }

                sliderWidth_ = options.asFloat(0, 0.03f);
                sliderColor_ = options.asColor(1, Color.WhiteSmoke);
                return(true);
            }
Beispiel #2
0
                bool configBorder(string key, string value, Configuration.Options options)
                {
                    // border:style:size:spacing:type:color

                    //string prefix = "VIS_Icon_Border";
                    graphic_.RenderData.BorderIcon = Icon.getIcon($"VIS_Icon_Border{value}");
                    if (graphic_.RenderData.BorderIcon == null)
                    {
                        graphic_.log(Console.LogType.Error, $"Invalid border icon '{value}'");
                        return(false);
                    }
                    graphic_.RenderData.BorderName = value;

                    graphic_.BorderSize    = options.asFloat(0, Default.BorderSize);
                    graphic_.BorderSpacing = options.asFloat(1, Default.BorderSpacing);

                    ValueType vt;

                    if (!toValueType(options[2], out vt, Default.ValueType))
                    {
                        return(false);
                    }
                    graphic_.BorderSizeType = vt;

                    graphic_.RenderData.BorderColor = options.asColor(3, Default.BorderColor);
                    return(true);
                }
 bool configFont(string key, string value, Configuration.Options options)
 {
     container_.Font      = value != string.Empty ? value : Default.Font;
     container_.FontSize  = options.asFloat(0, Default.FontSize);
     container_.FontColor = options.asColor(1, Default.FontColor);
     return(true);
 }
Beispiel #4
0
 bool configFont(string key, string value, Configuration.Options options)
 {
     gfx_.font_           = value != string.Empty ? value : Default.Font;
     gfx_.fontSize_       = options.asFloat(0, 0f);
     gfx_.Color           = options.asColor(1, Default.FontColor);
     gfx_.useDefaultFont_ = false;
     return(true);
 }
Beispiel #5
0
            bool configBatteryColors(string key, string value, Configuration.Options options)
            {
                switch (value.ToLower())
                {
                case "onoff":
                    borderColors_[0] = options.asColor(0, Color.Red);
                    break;

                case "load":
                    borderColors_[1] = options.asColor(0, Color.Red);
                    borderColors_[2] = options.asColor(1, Color.Green);
                    break;

                case "mode":
                    borderColors_[3] = options.asColor(0, new Color(254, 69, 7));
                    borderColors_[4] = options.asColor(1, Color.Blue);
                    break;

                case "bar":
                    barColors_[0] = options.asColor(0, Color.Red);
                    barColors_[1] = options.asColor(1, Color.Green);
                    break;

                default:
                    return(false);
                }

                return(true);
            }
Beispiel #6
0
 protected virtual bool configGradient(string key, string value, Configuration.Options options)
 {
     if (options.Count == 1)
     {
         float threshold = Configuration.asFloat(value, 0f);
         Color color     = options.asColor(0, Default.Color);
         graphic_.addGradientColor(threshold, color);
         return(true);
     }
     return(false);
 }
            bool configIcon(string key, string value, Configuration.Options options)
            {
                iconName_ = value;
                icon_     = Icon.getIcon(iconName_);

                if (options.Count >= 1)
                {
                    iconColor_    = options.asColor(0, Template.FontColor);
                    iconUseColor_ = true;
                }
                else
                {
                    iconUseColor_ = false;
                }

                return(true);
            }