getSettingInt() публичный статический Метод

public static getSettingInt ( string key ) : int
key string
Результат int
Пример #1
0
        public void InitializeSettings()
        {
            this.popupAnchorBox.SelectedIndex   = Math.Min(Math.Max(SettingsManager.getSettingInt("SimpleNotificationAnchor"), 0), 3);
            this.popupXOffsetBox.Text           = SettingsManager.getSettingInt("SimpleNotificationXOffset").ToString();
            this.popupYOffsetBox.Text           = SettingsManager.getSettingInt("SimpleNotificationYOffset").ToString();
            this.notificationWidthBox.Text      = SettingsManager.getSettingInt("SimpleNotificationWidth").ToString();
            this.showCopyButtonCheckbox.Checked = SettingsManager.getSettingBool("SimpleNotificationCopyButton");

            popupSpecificItemBox.Items.Clear();
            foreach (string str in SettingsManager.getSetting("NotificationItems"))
            {
                popupSpecificItemBox.Items.Add(str);
            }
            popupSpecificItemBox.ItemsChanged += PopupSpecificItemBox_ItemsChanged;
            popupSpecificItemBox.verifyItem    = StorageManager.itemExists;
            popupSpecificItemBox.RefreshControl();

            popupConditionBox.Items.Clear();
            foreach (string str in SettingsManager.getSetting("NotificationConditions"))
            {
                popupConditionBox.Items.Add(str);
            }
            popupConditionBox.ItemsChanged += PopupConditionBox_ItemsChanged;
            popupConditionBox.verifyItem    = NotificationConditionManager.ValidCondition;
            popupConditionBox.RefreshControl();

            popupDurationSlider.Value = Math.Min(Math.Max(SettingsManager.getSettingInt("PopupDuration"), popupDurationSlider.Minimum), popupDurationSlider.Maximum);
            popupDurationHeader.Text  = String.Format("Popup Duration ({0}s)", popupDurationSlider.Value);
        }
Пример #2
0
        public void UpdateWasteForm()
        {
            Hunt hunt = HuntManager.activeHunt;

            int minheight, maxheight;

            ClearControlList(usedItemsControls, out minheight, out maxheight);

            int y = 30;

            foreach (Control c in damageControls.Count > 0 ? damageControls : (lootControls.Count > 0 ? lootControls : summaryControls))
            {
                y = Math.Max(c.Location.Y + c.Height, y);
            }

            int maxUsedItems = SettingsManager.getSettingInt("SummaryMaxUsedItems");

            if (maxUsedItems < 0)
            {
                maxUsedItems = 5;
            }
            if (maxUsedItems > 0)
            {
                int counter = 0;
                CreateHeaderLabel("Used Items", x, ref y, usedItemsControls);
                int width = 0;
                var items = new List <Tuple <Item, int> >();
                foreach (Tuple <Item, int> tpl in HuntManager.GetUsedItems(hunt))
                {
                    int amount = tpl.Item2;
                    while (amount > 0)
                    {
                        int count = Math.Min(100, amount);
                        amount -= count;
                        items.Add(new Tuple <Item, int>(tpl.Item1, count));
                        width += ImageHeight + 2;
                        if (width > ImageWidth - ImageHeight)
                        {
                            CreateItemList(items, x, ref y, usedItemsControls);
                            items.Clear();
                            width = 0;
                            if (++counter >= maxUsedItems)
                            {
                                break;
                            }
                        }
                    }
                }
                if (items.Count > 0)
                {
                    CreateItemList(items, x, ref y, usedItemsControls);
                    items.Clear();
                }
            }
            if (y != maxheight)
            {
                this.Size = new Size(ImageWidth + 10, y + 5);
            }
        }
Пример #3
0
 public static bool TrackCreature(Creature cr)
 {
     if (SettingsManager.getSettingBool("IgnoreLowExperience"))
     {
         return(cr.experience >= SettingsManager.getSettingInt("IgnoreLowExperienceValue"));
     }
     return(true);
 }
Пример #4
0
        public PopupContainer()
        {
            InitializeComponent();

            this.Size = new Size(SettingsManager.getSettingInt("SimpleNotificationWidth"), this.Size.Height);

            this.BackColor       = ContainerTransparentColor;
            this.TransparencyKey = ContainerTransparentColor;
        }
Пример #5
0
        public static void ShowSuspendedWindow(bool alwaysShow = false)
        {
            lock (suspendedLock) {
                if (window != null)
                {
                    window.Close();
                    window = null;
                }
                Screen  screen;
                Process tibia_process = ProcessManager.GetTibiaProcess();
                if (tibia_process == null)
                {
                    screen = Screen.FromControl(MainForm.mainForm);
                }
                else
                {
                    screen = Screen.FromHandle(tibia_process.MainWindowHandle);
                }
                window = new AutoHotkeySuspendedMode(alwaysShow);
                int position_x = 0, position_y = 0;

                int suspendedX = SettingsManager.getSettingInt("SuspendedNotificationXOffset");
                int suspendedY = SettingsManager.getSettingInt("SuspendedNotificationYOffset");

                int xOffset = suspendedX < 0 ? 10 : suspendedX;
                int yOffset = suspendedY < 0 ? 10 : suspendedY;
                int anchor  = SettingsManager.getSettingInt("SuspendedNotificationAnchor");
                switch (anchor)
                {
                case 3:
                    position_x = screen.WorkingArea.Right - xOffset - window.Width;
                    position_y = screen.WorkingArea.Bottom - yOffset - window.Height;
                    break;

                case 2:
                    position_x = screen.WorkingArea.Left + xOffset;
                    position_y = screen.WorkingArea.Bottom - yOffset - window.Height;
                    break;

                case 0:
                    position_x = screen.WorkingArea.Left + xOffset;
                    position_y = screen.WorkingArea.Top + yOffset;
                    break;

                default:
                    position_x = screen.WorkingArea.Right - xOffset - window.Width;
                    position_y = screen.WorkingArea.Top + yOffset;
                    break;
                }

                window.StartPosition = FormStartPosition.Manual;
                window.SetDesktopLocation(position_x, position_y);
                window.TopMost = true;
                window.Show();
            }
        }
Пример #6
0
        private static void MainScanTimer()
        {
            ScanMemoryInternal();
            int scanSpeed = SettingsManager.getSettingInt("ScanSpeed") * 5 + 1;

            if (scanSpeed != mainScanTimer.Interval)
            {
                mainScanTimer.Interval = scanSpeed;
            }
        }
Пример #7
0
        private static void ScanMissingChunksTimer()
        {
            ReadMemoryManager.ScanMissingChunks();
            int scanSpeed = SettingsManager.getSettingInt("ScanSpeed") * 15 + 1;

            if (scanSpeed != missingChunkScanTimer.Interval)
            {
                missingChunkScanTimer.Interval = scanSpeed;
            }
        }
Пример #8
0
        public void refreshDamageChart()
        {
            foreach (Control c in controlList)
            {
                c.Dispose();
                Controls.Remove(c);
            }

            controlList.Clear();
            if (graph)
            {
                this.mChart.Visible = true;
                this.mChart.Series[0].Points.Clear();
                int max = SettingsManager.getSettingInt("MaxDamageChartPlayers");
                for (int i = 0; i < damageDealt.Count; i++)
                {
                    if (max > 0 && i >= max)
                    {
                        break;
                    }
                    DamageObject p          = damageDealt[i];
                    double       percentage = p.percentage;
                    DataPoint    point      = new DataPoint();
                    point.XValue     = percentage;
                    point.YValues    = new double[1];
                    point.YValues[0] = p.totalDamage;
                    point.AxisLabel  = p.name;
                    point.LegendText = p.name;
                    point.Label      = Math.Round(percentage, 1).ToString() + "%";
                    this.mChart.Series[0].Points.Add(point);
                }
                this.mChart.ApplyPaletteColors();
                for (int i = 0; i < damageDealt.Count; i++)
                {
                    if (max > 0 && i >= max)
                    {
                        break;
                    }
                    DamageObject p = damageDealt[i];
                    p.color = this.mChart.Series[0].Points[i].Color;
                }
                this.Size = new Size(GetWidth(), (int)(GetWidth() * 0.9));
            }
            else
            {
                this.mChart.Series[0].Points.Clear();
                this.mChart.Visible = false;
                int newWidth = 0;
                int y        = UIManager.DisplayCreatureAttributeList(Controls, damageDealt.ToList <TibiaObject>(), 5, 25, out newWidth, null, controlList, 0, 20, null, null, null, sortFunction, sortedHeader, desc, null, null, false, this.Size.Width - 20);

                this.Size = new Size(GetWidth(), Math.Max(startY, 25 + y));
            }
            refreshTimer();
        }
Пример #9
0
        public void InitializeSettings()
        {
            refreshCenterImage();

            backgroundImageScale.Value = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitBackgroundScale")));
            xOffsetBox.Text            = SettingsManager.getSettingInt("PortraitBackgroundXOffset").ToString();
            yOffsetBox.Text            = SettingsManager.getSettingInt("PortraitBackgroundYOffset").ToString();
            centerImageScale.Value     = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitCenterScale")));
            xOffsetBoxCenter.Text      = SettingsManager.getSettingInt("PortraitCenterXOffset").ToString();
            yOffsetBoxCenter.Text      = SettingsManager.getSettingInt("PortraitCenterYOffset").ToString();
        }
Пример #10
0
        public void InitializeSettings()
        {
            trackedCreatureList.ItemsChanged += TrackedCreatureList_ItemsChanged;
            trackedCreatureList.verifyItem    = StorageManager.creatureExists;

            this.displayAllItemsAsStackableCheckbox.Checked = SettingsManager.getSettingBool("StackAllItems");
            this.ignoreLowExperienceCheckbox.Checked        = SettingsManager.getSettingBool("IgnoreLowExperience");
            this.ignoreLowExperienceBox.Enabled             = this.ignoreLowExperienceCheckbox.Checked;
            this.ignoreLowExperienceBox.Text = SettingsManager.getSettingInt("IgnoreLowExperienceValue").ToString();
            this.automaticallyWriteLootToFileCheckbox.Checked = SettingsManager.getSettingBool("AutomaticallyWriteLootToFile");
        }
Пример #11
0
 public void InitializeSettings()
 {
     this.popupAnimationBox.Checked          = SettingsManager.getSettingBool("EnableSimpleNotificationAnimation");
     this.eventPopupBox.Checked              = SettingsManager.getSettingBool("EnableEventNotifications");
     this.unrecognizedPopupBox.Checked       = SettingsManager.getSettingBool("EnableUnrecognizedNotifications");
     this.copyAdvancesCheckbox.Checked       = SettingsManager.getSettingBool("CopyAdvances");
     this.popupTypeBox.SelectedIndex         = SettingsManager.getSettingBool("UseRichNotificationType") ? 1 : 0;
     this.outfitGenderCheckbox.SelectedIndex = SettingsManager.getSettingBool("OutfitGenderMale") ? 0 : 1;
     this.lookModeCheckbox.Checked           = SettingsManager.getSettingBool("LookMode");
     this.scanningSpeedTrack.Value           = Math.Min(Math.Max(SettingsManager.getSettingInt("ScanSpeed"), scanningSpeedTrack.Minimum), scanningSpeedTrack.Maximum);
     this.scanSpeedDisplayLabel.Text         = Constants.ScanSpeedText[scanningSpeedTrack.Value / 10] + String.Format("({0})", scanningSpeedTrack.Value);
 }
Пример #12
0
        public static Screen GetScreen()
        {
            Process tibia_process = ProcessManager.GetTibiaProcess();

            if (tibia_process == null || SettingsManager.getSettingInt("MonitorAnchor") == 1)
            {
                return(Screen.FromControl(MainForm.mainForm));
            }
            else
            {
                return(Screen.FromHandle(tibia_process.MainWindowHandle));
            }
        }
Пример #13
0
        public void InitializeSettings()
        {
            maxItemsDisplayedTrack.Value = Math.Min(Math.Max(SettingsManager.getSettingInt("SummaryMaxItemDrops"), maxItemsDisplayedTrack.Minimum), maxUsedItemsTrack.Maximum);
            maxCreatureKillsTrack.Value  = Math.Min(Math.Max(SettingsManager.getSettingInt("SummaryMaxCreatures"), maxCreatureKillsTrack.Minimum), maxCreatureKillsTrack.Maximum);
            maxRecentDropsTrack.Value    = Math.Min(Math.Max(SettingsManager.getSettingInt("SummaryMaxRecentDrops"), maxRecentDropsTrack.Minimum), maxRecentDropsTrack.Maximum);
            maxDamageEntryTrack.Value    = Math.Min(Math.Max(SettingsManager.getSettingInt("SummaryMaxDamagePlayers"), maxDamageEntryTrack.Minimum), maxDamageEntryTrack.Maximum);
            maxUsedItemsTrack.Value      = Math.Min(Math.Max(SettingsManager.getSettingInt("SummaryMaxUsedItems"), maxUsedItemsTrack.Minimum), maxUsedItemsTrack.Maximum);

            maxItemsDisplayedTrack_Scroll(maxItemsDisplayedTrack, null);
            maxCreatureKillsTrack_Scroll(maxCreatureKillsTrack, null);
            maxRecentDropsTrack_Scroll(maxRecentDropsTrack, null);
            maxDamageEntryTrack_Scroll(maxDamageEntryTrack, null);
            maxUsedItemsTrack_Scroll(maxUsedItemsTrack, null);
        }
Пример #14
0
 public void InitializeSettings()
 {
     this.popupAnimationBox.Checked                   = SettingsManager.getSettingBool("EnableSimpleNotificationAnimation");
     this.eventPopupBox.Checked                       = SettingsManager.getSettingBool("EnableEventNotifications");
     this.unrecognizedPopupBox.Checked                = SettingsManager.getSettingBool("EnableUnrecognizedNotifications");
     this.copyAdvancesCheckbox.Checked                = SettingsManager.getSettingBool("CopyAdvances");
     this.popupTypeBox.SelectedIndex                  = SettingsManager.getSettingBool("UseRichNotificationType") ? 1 : 0;
     this.outfitGenderCheckbox.SelectedIndex          = SettingsManager.getSettingBool("OutfitGenderMale") ? 0 : 1;
     this.lookModeCheckbox.Checked                    = SettingsManager.getSettingBool("LookMode");
     this.scanningSpeedTrack.Value                    = Math.Min(Math.Max(SettingsManager.getSettingInt("ScanSpeed"), scanningSpeedTrack.Minimum), scanningSpeedTrack.Maximum);
     this.scanSpeedDisplayLabel.Text                  = Constants.ScanSpeedText[scanningSpeedTrack.Value / 10] + String.Format("({0})", scanningSpeedTrack.Value);
     this.experienceComputationDropdown.SelectedIndex = SettingsManager.getSettingString("ExperiencePerHourCalculation") == "TibiaStyle" ? 0 : 1;
     this.scanEntireMemoryDropdown.SelectedIndex      = SettingsManager.getSettingBool("ScanInternalTabStructure") ? 0 : 1;
     this.skipDuplicateLootCheckbox.Checked           = SettingsManager.getSettingBool("SkipDuplicateLoot");
 }
Пример #15
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");
        }
Пример #16
0
        public void InitializeSettings()
        {
            notificationTypeList.ReadOnly = true;

            notificationTypeList.Items.Clear();
            foreach (string str in Constants.NotificationTypes)
            {
                notificationTypeList.Items.Add(str);
            }
            notificationTypeList.SelectedIndex = 0;

            Constants.MaximumNotificationDuration = notificationDurationBox.Maximum;

            monitorAnchorDropdown.SelectedIndex = SettingsManager.getSettingInt("MonitorAnchor");
            hideWhenTibiaMinimized.Checked      = SettingsManager.getSettingBool("NotificationShowTibiaActive");
        }
Пример #17
0
        public static void StartScanning()
        {
            scanTimer          = new System.Timers.Timer(10000);
            scanTimer.Elapsed += StuckScanning;

            int initialScanSpeed = SettingsManager.getSettingInt("ScanSpeed") * 15 + 1;

            missingChunkScanTimer = new SafeTimer(initialScanSpeed, ScanMissingChunksTimer);
            missingChunkScanTimer.Start();

            initialScanSpeed = SettingsManager.getSettingInt("ScanSpeed") * 5 + 1;
            mainScanTimer    = new SafeTimer(initialScanSpeed, MainScanTimer);
            mainScanTimer.Start();

            currentState = ScanningState.NoTibia;
        }
Пример #18
0
        public SimpleTextNotification(Image image, string title, string text, double extraTime = 0, int widthOffset = 0)
        {
            this.InitializeComponent();

            this.Size = new Size(SettingsManager.getSettingInt("SimpleNotificationWidth"), this.Size.Height);

            this.notificationImage.Image = image == null?StyleManager.GetImage("defaulticon.png") : image;

            this.titleLabel.Text       = title;
            this.textLabel.Text        = text;
            this.textLabel.MaximumSize = new System.Drawing.Size(this.Size.Width - textLabel.Location.X, 0);

            this.textLabel.MaximumSize = new Size(this.textLabel.MaximumSize.Width - widthOffset, 0);

            this.InitializeSimpleNotification();
        }
Пример #19
0
 public void InitializeSettings()
 {
     this.enablePopupAnimationsCheckbox.Checked         = SettingsManager.getSettingBool("EnableSimpleNotificationAnimation");
     this.popupOnEventCheckbox.Checked                  = SettingsManager.getSettingBool("EnableEventNotifications");
     this.unrecognizedPopupCheckbox.Checked             = SettingsManager.getSettingBool("EnableUnrecognizedNotifications");
     this.copyAdvancesCheckbox.Checked                  = SettingsManager.getSettingBool("CopyAdvances");
     this.defaultOutfitGenderDropDownList.SelectedIndex = SettingsManager.getSettingBool("OutfitGenderMale") ? 0 : 1;
     this.viewLookedAtObjectsCheckbox.Checked           = SettingsManager.getSettingBool("LookMode");
     this.scanningSpeedTrack.Value        = Math.Min(Math.Max(SettingsManager.getSettingInt("ScanSpeed"), scanningSpeedTrack.Minimum), scanningSpeedTrack.Maximum);
     this.scanningSpeedDisplayHeader.Text = Constants.ScanSpeedText[scanningSpeedTrack.Value / 10] + String.Format("({0})", scanningSpeedTrack.Value);
     this.experienceComputationDropDownList.SelectedIndex = SettingsManager.getSettingString("ExperiencePerHourCalculation") == "TibiaStyle" ? 0 : 1;
     this.scanInternalTabsCheckbox.Checked           = SettingsManager.getSettingBool("ScanInternalTabStructure");
     this.skipDuplicateLootCheckbox.Checked          = SettingsManager.getSettingBool("SkipDuplicateLoot");
     this.skipDuplicateCommandsCheckbox.Checked      = SettingsManager.getSettingBool("SkipDuplicateCommands");
     this.extraPlayerLookInformationCheckbox.Checked = SettingsManager.getSettingBool("GatherExtraPlayerInformation");
 }
Пример #20
0
        public void InitializeSettings()
        {
            this.stackAllItemsCheckbox.Checked     = SettingsManager.getSettingBool("StackAllItems");
            this.ignoreLowExperienceButton.Checked = SettingsManager.getSettingBool("IgnoreLowExperience");
            this.ignoreLowExperienceBox.Enabled    = this.ignoreLowExperienceButton.Checked;
            this.ignoreLowExperienceBox.Text       = SettingsManager.getSettingInt("IgnoreLowExperienceValue").ToString();
            this.saveAllLootCheckbox.Checked       = SettingsManager.getSettingBool("AutomaticallyWriteLootToFile");

            nameListBox.Items.Clear();
            foreach (string str in SettingsManager.getSetting("Names"))
            {
                nameListBox.Items.Add(str);
            }
            nameListBox.RefreshControl();
            nameListBox.ItemsChanged += NameListBox_ItemsChanged;
        }
Пример #21
0
        public override void LoadHUD()
        {
            pictureBox           = new PictureBox();
            pictureBox.Location  = new Point(0, 0);
            pictureBox.Size      = new Size(this.Width, this.Height);
            pictureBox.BackColor = StyleManager.TransparencyKey;
            this.Controls.Add(pictureBox);

            try {
                string backgroundLocation = SettingsManager.getSettingString("PortraitBackgroundImage");
                if (backgroundLocation != null)
                {
                    backgroundImage = Image.FromFile(backgroundLocation);
                }
                else
                {
                    backgroundImage = StyleManager.GetImage("defaultportrait-blue.png").Clone() as Image;
                }
            } catch {
                backgroundImage = StyleManager.GetImage("defaultportrait-blue.png").Clone() as Image;
            }

            try {
                string centerLocation = SettingsManager.getSettingString("PortraitCenterImage");
                if (centerLocation != null)
                {
                    centerImage = Image.FromFile(centerLocation);
                }
                else
                {
                    centerImage = null;
                }
            } catch {
                centerImage = null;
            }


            backgroundOffset = new Point(SettingsManager.getSettingInt("PortraitBackgroundXOffset"), SettingsManager.getSettingInt("PortraitBackgroundYOffset"));
            centerOffset     = new Point(SettingsManager.getSettingInt("PortraitCenterXOffset"), SettingsManager.getSettingInt("PortraitCenterYOffset"));

            backgroundScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitBackgroundScale")));
            centerScale     = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitCenterScale")));

            RefreshHUD(1, 1);

            this.Load += Portrait_Load;
        }
Пример #22
0
        public void InitializeSettings()
        {
            notificationTypeList.ReadOnly = true;

            notificationTypeList.Items.Clear();
            foreach (string str in Constants.NotificationTypes)
            {
                notificationTypeList.Items.Add(str);
            }
            notificationTypeList.SelectedIndex = 0;

            notificationDurationBox.Maximum = Constants.MaximumNotificationDuration;

            monitorAnchorDropdown.SelectedIndex       = SettingsManager.getSettingInt("MonitorAnchor");
            onlyShowWhenTibiaIsActiveCheckbox.Checked = SettingsManager.getSettingBool("NotificationShowTibiaActive");
            requireDoubleClickCheckbox.Checked        = SettingsManager.getSettingBool("NotificationDoubleClick");
        }
Пример #23
0
        public void InitializeSettings()
        {
            this.startScriptOnStartupBox.Checked  = SettingsManager.getSettingBool("StartAutohotkeyAutomatically");
            this.exitScriptOnShutdownBox.Checked  = SettingsManager.getSettingBool("ShutdownAutohotkeyOnExit");
            this.suspendedAnchorBox.SelectedIndex = Math.Min(Math.Max(SettingsManager.getSettingInt("SuspendedNotificationAnchor"), 0), 3);
            this.suspendedXOffsetBox.Text         = SettingsManager.getSettingInt("SuspendedNotificationXOffset").ToString();
            this.suspendedYOffsetBox.Text         = SettingsManager.getSettingInt("SuspendedNotificationYOffset").ToString();

            string massiveString = "";

            foreach (string str in SettingsManager.getSetting("AutoHotkeySettings"))
            {
                massiveString += str + "\n";
            }
            this.autoHotkeyGridSettings.Text = massiveString;
            (this.autoHotkeyGridSettings as RichTextBoxAutoHotkey).RefreshSyntax();
        }
Пример #24
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;
        }
Пример #25
0
        public void ShowNotification(SimpleNotification notification)
        {
            lock (notificationLock) {
                List <Control> controls = new List <Control>();
                int            x = 0, y = notifications.Count * 65;

                // background label
                Label background = new Label();
                background.Size      = notification.Size;
                background.BackColor = notification.BackColor;
                background.Location  = new Point(x, UpsideDown ? this.Size.Height - y - background.Height : y);
                background.Click    += Background_Click;
                this.Controls.Add(background);

                foreach (Control c in notification.Controls)
                {
                    controls.Add(c);
                }

                foreach (Control c in controls)
                {
                    c.Location = new Point(x + c.Location.X, background.Location.Y + c.Location.Y);
                    this.Controls.Add(c);
                    if (c.BackgroundImage == null)
                    {
                        c.BackColor = notification.BackColor;
                    }
                    if (c.Name.Length == 0)
                    {
                        c.Click += Background_Click;
                    }
                    c.BringToFront();
                }

                notifications.Add(controls);
                controls.Add(background);

                System.Timers.Timer closeTimer = new System.Timers.Timer(Math.Max(SettingsManager.getSettingInt("PopupDuration"), 1) * 1000);
                closeTimer.Elapsed  += CloseTimer_Elapsed;
                closeTimer.Enabled   = true;
                closeTimer.AutoReset = false;
            }
        }
Пример #26
0
        public void UpdateDamageForm()
        {
            Hunt hunt = HuntManager.activeHunt;

            int minheight, maxheight;

            ClearControlList(damageControls, out minheight, out maxheight);
            int y = minheight;

            y = 30;
            foreach (Control c in lootControls.Count > 0 ? lootControls : summaryControls)
            {
                y = Math.Max(c.Location.Y + c.Height, y);
            }

            int maxDamage = SettingsManager.getSettingInt("SummaryMaxDamagePlayers");

            if (maxDamage < 0)
            {
                maxDamage = 5;
            }
            if (maxDamage > 0 && ScanningManager.lastResults != null)
            {
                CreateHeaderLabel("Damage Dealt", x, ref y, damageControls);
                var dps         = ScanningManager.lastResults.DamagePerSecond;
                var damageDealt = DamageChart.GenerateDamageInformation(dps, "").Item2;
                for (int i = 0; i < damageDealt.Count; i++)
                {
                    damageDealt[i].color = Constants.DamageChartColors[i % Constants.DamageChartColors.Count];
                }
                int counter = 0;
                foreach (DamageObject obj in damageDealt)
                {
                    CreateSummaryLabel(obj.name, String.Format("{0:0.0}%", obj.percentage), x, ref y, obj.color, damageControls);
                    if (++counter >= maxDamage)
                    {
                        break;
                    }
                }
            }
            UpdateWasteForm();
        }
Пример #27
0
        protected void InitializeSimpleNotification(bool movement = true, bool destroy = true, double extraTime = 0)
        {
            this.Click += c_Click;
            foreach (Control c in this.Controls)
            {
                c.Click += c_Click;
            }

            this.animations = SettingsManager.getSettingBool("EnableSimpleNotificationAnimation");

            if (movement)
            {
                moveTimer = new SafeTimer(1, MoveTimer_Elapsed);
                moveTimer.Start();
            }
            if (destroy)
            {
                System.Threading.Tasks.Task.Delay((int)((Math.Max(SettingsManager.getSettingInt("PopupDuration"), 1) + extraTime) * 1000)).ContinueWith(x => CloseNotification());
            }
        }
Пример #28
0
        private void hudTypeList_SelectedIndexChanged(object sender, EventArgs e)
        {
            selectedHUDLabel.Text            = hudTypeList.Items[hudTypeList.SelectedIndex].ToString();
            MainForm.prevent_settings_update = true;
            string hudName = getSelectedHudName();

            hudXOffsetBox.Text          = SettingsManager.getSettingString(hudName + "XOffset");
            hudYOffsetBox.Text          = SettingsManager.getSettingString(hudName + "YOffset");
            hudAnchorBox.SelectedIndex  = SettingsManager.getSettingInt(hudName + "Anchor");
            hudWidthBox.Text            = SettingsManager.getSettingString(hudName + "Width");
            hudHeightBox.Text           = SettingsManager.getSettingString(hudName + "Height");
            showHudOnStartupBox.Checked = SettingsManager.getSettingBool(hudName + "ShowOnStartup");
            fontSizeBox.Text            = SettingsManager.getSettingString(hudName + "FontSize");
            hudOpacityBox.Text          = SettingsManager.getSettingString(hudName + "Opacity");
            displayHUDTextBox.Checked   = SettingsManager.getSettingBool(hudName + "DisplayText");

            advancedOptionsButton.Visible = hudName == "HealthList" || hudName == "Portrait";

            MainForm.prevent_settings_update = false;
        }
Пример #29
0
        private void changeSize(int modification)
        {
            int max_x = SettingsManager.getSettingInt("LootFormWidth");

            if (max_x < minLootWidth)
            {
                max_x = minLootWidth;
            }
            max_x += modification;
            if (max_x < minLootWidth)
            {
                max_x = minLootWidth;
            }
            SettingsManager.setSetting("LootFormWidth", (max_x).ToString());
            this.SuspendForm();
            this.RefreshLoot();
            this.ResumeForm();
            this.Refresh();
            this.refreshTimer();
        }
Пример #30
0
        private void applyNotificationSettingsToAllButton_Click(object sender, EventArgs e)
        {
            string selectedSettingObject = selectedNotificationObject();

            int anchor             = Math.Max(Math.Min(SettingsManager.getSettingInt(selectedSettingObject + "Anchor"), 3), 0);
            int xOffset            = SettingsManager.getSettingInt(selectedSettingObject + "XOffset");
            int yOffset            = SettingsManager.getSettingInt(selectedSettingObject + "YOffset");
            int notificationLength = SettingsManager.getSettingInt(selectedSettingObject + "Duration");
            int groupnr            = Math.Max(Math.Min(SettingsManager.getSettingInt(selectedSettingObject + "Group"), 9), 0);
            int sliderValue        = Math.Max(Math.Min(notificationLength, notificationDurationBox.Maximum), notificationDurationBox.Minimum);

            foreach (string str in Constants.NotificationTypes)
            {
                string settingObject = str.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", groupnr);
            }
        }