getSettingDouble() public static method

public static getSettingDouble ( string key ) : double
key string
return double
示例#1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            float thickness = (float)SettingsManager.getSettingDouble("CurvedBarsFontSize");

            Rectangle rect = this.DisplayRectangle;

            rect.Y     -= (rect.Width - rect.Height) / 2;
            rect.Height = rect.Width;
            rect.Width -= (int)(thickness + 2);
            rect.X     += (int)(thickness / 2 + 1);

            using (Pen pen = new Pen(Color.Black)) {
                pen.Width = thickness + 2;
                e.Graphics.DrawArc(pen, rect, 135, 90);
                e.Graphics.DrawArc(pen, rect, 45, -90);

                pen.Width = thickness;

                health = health.ClampPercentage();
                mana   = mana.ClampPercentage();

                pen.Color = StyleManager.GetHealthColor(health);
                e.Graphics.DrawArc(pen, rect, 135, 90 * health);

                pen.Color = StyleManager.ManaColor;
                e.Graphics.DrawArc(pen, rect, 45, -90 * mana);
            }
        }
示例#2
0
        public override void LoadHUD()
        {
            double fontSize = SettingsManager.getSettingDouble(GetHUD() + "FontSize");

            fontSize = fontSize < 0 ? 20 : fontSize;
            this.experienceBarLabel.Font = new System.Drawing.Font("Verdana", (float)fontSize, System.Drawing.FontStyle.Bold);
            this.RefreshHUD(100, 100, 1);
        }
示例#3
0
        public override void LoadHUD()
        {
            double fontSize = SettingsManager.getSettingDouble(GetHUD() + "FontSize");

            fontSize = fontSize < 0 ? 20 : fontSize;
            this.manaBarLabel.Font = new System.Drawing.Font("Verdana", (float)fontSize, System.Drawing.FontStyle.Bold);
            this.RefreshHUD(MemoryReader.mana, MemoryReader.maxMana);
        }
示例#4
0
        public override void LoadHUD()
        {
            double fontSize = SettingsManager.getSettingDouble(GetHUD() + "FontSize");

            fontSize = fontSize < 0 ? 20 : fontSize;
            baseFont = new System.Drawing.Font("Verdana", (float)fontSize, System.Drawing.FontStyle.Bold);
            this.RefreshHUD();
            this.Load += HealthList_Load;
        }
示例#5
0
        public override void LoadHUD()
        {
            double fontSize = SettingsManager.getSettingDouble(GetHUD() + "FontSize");

            fontSize = fontSize < 0 ? 20 : fontSize;
            this.experienceBarLabel.Font = new System.Drawing.Font("Verdana", (float)fontSize, System.Drawing.FontStyle.Bold);
            this.RefreshHUD(new PlayerExperience {
                Experience = MemoryReader.experience, Level = MemoryReader.level
            });
        }
示例#6
0
        public override void LoadHUD()
        {
            double fontSize = SettingsManager.getSettingDouble(GetHUD() + "FontSize");

            fontSize = fontSize < 0 ? 20 : fontSize;
            this.healthBarLabel.Font = new System.Drawing.Font("Verdana", (float)fontSize, System.Drawing.FontStyle.Bold);

            this.healthBarLabel.reverse    = reverseBar;
            this.healthBarLabel.centerText = centerText;

            this.RefreshHUD(MemoryReader.health, MemoryReader.maxHealth);
        }
示例#7
0
        public CurvedHUD()
        {
            InitializeComponent();

            BackColor       = StyleManager.TransparencyKey;
            TransparencyKey = StyleManager.TransparencyKey;

            double opacity = SettingsManager.getSettingDouble("CurvedBarsOpacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;
        }
示例#8
0
        public StatusBar(StatusType statusType)
        {
            this.statusType = statusType;
            InitializeComponent();

            BackColor       = StyleManager.BlendTransparencyKey;
            TransparencyKey = StyleManager.BlendTransparencyKey;

            displayText = SettingsManager.getSettingBool(GetHUD() + "DisplayText");
            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;
        }
示例#9
0
        public ActualTaskHUD(TaskHUD parentHUD)
        {
            this.parentHUD       = parentHUD;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            BackColor       = StyleManager.BlendTransparencyKey;
            TransparencyKey = StyleManager.BlendTransparencyKey;

            double fontSize = SettingsManager.getSettingDouble(GetHUD() + "FontSize");

            fontSize = fontSize < 0 ? 20 : fontSize;
            font     = new System.Drawing.Font("Verdana", (float)fontSize, System.Drawing.FontStyle.Bold);

            TaskSize = SettingsManager.getSettingInt(GetHUD() + "Height");
        }
示例#10
0
        public ExperienceBar()
        {
            InitializeComponent();

            BackColor       = StyleManager.BlendTransparencyKey;
            TransparencyKey = StyleManager.BlendTransparencyKey;

            displayText = SettingsManager.getSettingBool(GetHUD() + "DisplayText");
            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;

            MemoryReader.ExperienceChanged        += (o, e) => RefreshHUD(e);
            ProcessManager.TibiaVisibilityChanged += (o, e) => UpdateVisibility(e);
        }
示例#11
0
        public HealthList()
        {
            InitializeComponent();

            this.BackColor       = StyleManager.BlendTransparencyKey;
            this.TransparencyKey = StyleManager.BlendTransparencyKey;

            displayNames    = SettingsManager.getSettingBool(GetHUD() + "DisplayNames");
            displayIcons    = SettingsManager.getSettingBool(GetHUD() + "DisplayIcons");
            displayText     = SettingsManager.getSettingBool(GetHUD() + "DisplayText");
            healthBarHeight = SettingsManager.getSettingInt(GetHUD() + "Height");
            playerBarHeight = displayNames ? healthBarHeight * 5 / 3 : healthBarHeight;

            List <string> names = SettingsManager.getSetting(GetHUD() + "PlayerNames");
            int           index = 0;

            foreach (string name in names)
            {
                if (name.Trim() == "")
                {
                    continue;
                }
                string imagePath = SettingsManager.getSettingString(GetHUD() + "Image" + index.ToString());
                Image  image     = null;
                if (imagePath != null)
                {
                    try {
                        image = Image.FromFile(imagePath);
                    } catch {
                        OutfiterOutfit outfit = new OutfiterOutfit();
                        outfit.FromString(imagePath);
                        image = outfit.GetImage();
                    }
                }
                this.players.Add(new PlayerEntry {
                    name = name, playerImage = image
                });
                index++;
            }

            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;
        }
示例#12
0
        public HealthBar()
        {
            InitializeComponent();

            BackColor       = StyleManager.BlendTransparencyKey;
            TransparencyKey = StyleManager.BlendTransparencyKey;

            displayText = SettingsManager.getSettingBool(GetHUD() + "DisplayText");
            centerText  = SettingsManager.getSettingBool(GetHUD() + "CenterText");
            reverseBar  = SettingsManager.getSettingBool(GetHUD() + "ReverseProgressBar");
            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;

            MemoryReader.RegisterHealthChanged(this, (o, e) => RefreshHUD(e));
            ProcessManager.RegisterTibiaVisibilityChanged(this, (o, e) => UpdateVisibility(e));
        }
示例#13
0
        public TaskHUD()
        {
            this.TransparencyKey = StyleManager.TransparencyKey;
            ProcessManager.TibiaVisibilityChanged += (o, e) => UpdateVisibility(e);

            this.ShowInTaskbar   = false;
            this.FormBorderStyle = FormBorderStyle.None;

            actualHUD = new ActualTaskHUD(this);
            actualHUD.ShowInTaskbar   = false;
            actualHUD.FormBorderStyle = FormBorderStyle.None;
            actualHUD.Size            = this.Size;
            actualHUD.StartPosition   = FormStartPosition.Manual;
            actualHUD.Location        = this.PointToScreen(new Point(0, 0));

            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;

            this.FormClosed += CloseActualHUD;
        }
示例#14
0
        public void initializeSettings()
        {
            SettingsManager.ApplyDefaultSettings();
            // convert legacy settings
            bool legacy = false;

            if (SettingsManager.settingExists("NotificationGoldRatio") || SettingsManager.settingExists("NotificationValue"))
            {
                // convert old notification conditions to new SQL conditions
                List <string> conditions = new List <string>();
                if (SettingsManager.settingExists("NotificationValue") && SettingsManager.getSettingBool("ShowNotificationsValue"))
                {
                    double value = SettingsManager.getSettingDouble("NotificationValue");
                    conditions.Add(String.Format("item.value >= {0}", value.ToString(CultureInfo.InvariantCulture)));
                }
                if (SettingsManager.settingExists("NotificationGoldRatio") && SettingsManager.getSettingBool("ShowNotificationsGoldRatio"))
                {
                    double value = SettingsManager.getSettingDouble("NotificationGoldRatio");
                    conditions.Add(String.Format("item.value / item.capacity >= {0}", value.ToString(CultureInfo.InvariantCulture)));
                }
                if (SettingsManager.getSettingBool("AlwaysShowLoot"))
                {
                    conditions.Add("1");
                }
                SettingsManager.removeSetting("NotificationGoldRatio");
                SettingsManager.removeSetting("NotificationValue");
                SettingsManager.removeSetting("ShowNotificationsGoldRatio");
                SettingsManager.removeSetting("ShowNotificationsValue");
                SettingsManager.removeSetting("AlwaysShowLoot");
                SettingsManager.setSetting("NotificationConditions", conditions);
                legacy = true;
            }
            if (SettingsManager.settingExists("NotificationDuration"))
            {
                int notificationLength = SettingsManager.getSettingInt("NotificationDuration") < 0 ? 30 : SettingsManager.getSettingInt("NotificationDuration");
                int anchor             = Math.Min(Math.Max(SettingsManager.getSettingInt("RichNotificationAnchor"), 0), 3);
                int xOffset            = SettingsManager.getSettingInt("RichNotificationXOffset") == -1 ? 30 : SettingsManager.getSettingInt("RichNotificationXOffset");
                int yOffset            = SettingsManager.getSettingInt("RichNotificationYOffset") == -1 ? 30 : SettingsManager.getSettingInt("RichNotificationYOffset");
                foreach (string obj in Constants.NotificationTypes)
                {
                    string settingObject = obj.Replace(" ", "");
                    SettingsManager.setSetting(settingObject + "Anchor", anchor);
                    SettingsManager.setSetting(settingObject + "XOffset", xOffset);
                    SettingsManager.setSetting(settingObject + "YOffset", yOffset);
                    SettingsManager.setSetting(settingObject + "Duration", notificationLength);
                    SettingsManager.setSetting(settingObject + "Group", 0);
                }
                SettingsManager.removeSetting("NotificationDuration");
                SettingsManager.removeSetting("RichNotificationAnchor");
                SettingsManager.removeSetting("RichNotificationXOffset");
                SettingsManager.removeSetting("RichNotificationYOffset");
                legacy = true;
            }
            if (legacy)
            {
                // legacy settings had "#" as comment symbol in AutoHotkey text, replace that with the new comment symbol ";"
                List <string> newAutoHotkeySettings = new List <string>();
                foreach (string str in SettingsManager.getSetting("AutoHotkeySettings"))
                {
                    newAutoHotkeySettings.Add(str.Replace('#', ';'));
                }
                SettingsManager.setSetting("AutoHotkeySettings", newAutoHotkeySettings);

                SettingsManager.setSetting("ScanSpeed", Math.Min(Math.Max(SettingsManager.getSettingInt("ScanSpeed") + 5, (Tabs[1] as SettingsTab).MinimumScanSpeed()), (Tabs[1] as SettingsTab).MaximumScanSpeed()));
            }

            foreach (TabInterface tab in Tabs)
            {
                tab.InitializeSettings();
            }
        }