getSettingBool() public static method

public static getSettingBool ( string key ) : bool
key string
return bool
コード例 #1
0
ファイル: MainTab.cs プロジェクト: umdez/Tibialyzer
        public void InitializeSettings()
        {
            string language = SettingsManager.getSettingString("TibialyzerLanguage");

            switch (language)
            {
            case "en-US":
                languageDropDownList.SelectedIndex = 0;
                break;

            case "nl-NL":
                languageDropDownList.SelectedIndex = 1;
                break;

            case "pl-PL":
                languageDropDownList.SelectedIndex = 2;
                break;

            case "pt-BR":
                languageDropDownList.SelectedIndex = 3;
                break;
            }
            nameListBox.Items.Clear();
            foreach (string str in SettingsManager.getSetting("Names"))
            {
                nameListBox.Items.Add(str);
            }
            nameListBox.RefreshControl();
            nameListBox.ItemsChanged += NameListBox_ItemsChanged;

            automaticallyDetectCharacterCheckbox.Checked   = SettingsManager.getSettingBool("AutomaticallyDetectCharacter");
            automaticallyDownloadAddressesCheckbox.Checked = SettingsManager.getSettingBool("AutomaticallyDownloadAddresses");

            SwitchClients(SettingsManager.getSettingString("TibiaClient"));
        }
コード例 #2
0
ファイル: MemoryReader.cs プロジェクト: umdez/Tibialyzer
        private static void UpdateHealth()
        {
            bool attributesChanged = ReadHealth();

            attributesChanged |= ReadMaxHealth();

            if (attributesChanged)
            {
                if (SettingsManager.getSettingBool("AutoScreenshotLowLife"))
                {
                    if (health < maxHealth / 10 && health > 0 && maxHealth > health)
                    {
                        lock (screenshotLock) {
                            if (!screenshotTaken)
                            {
                                ScreenshotManager.saveScreenshot("LowLife", ScreenshotManager.takeScreenshot());
                                screenshotTaken = true;
                                screenshotTimer.Start();
                            }
                        }
                    }
                }

                if (HealthChanged != null)
                {
                    var playerHealth = new PlayerHealth {
                        Health    = health,
                        MaxHealth = maxHealth
                    };
                    HealthChanged(null, playerHealth);
                }
            }
        }
コード例 #3
0
ファイル: Parser.cs プロジェクト: jpodeszwik/Tibialyzer
        public static Player parseLookPlayer(string lookMessage)
        {
            Regex levelRegex    = new Regex("\\(Level ([0-9]+)\\)");
            Regex vocationRegex = new Regex("(?:She|He) is (?:a|an) ([^.]+)");
            Match levelMatch    = levelRegex.Match(lookMessage);
            Match vocationMatch = vocationRegex.Match(lookMessage);

            if (!levelMatch.Success || !vocationMatch.Success)
            {
                return(null);
            }
            Player player = new Player();

            player.name  = parseLookItem(lookMessage).Item1;
            player.level = int.Parse(levelMatch.Groups[1].Value);
            string vocation = vocationMatch.Groups[1].Value.ToLower();

            player.SetVocation(vocation);

            if (lookMessage.Contains("He"))
            {
                player.gender = Gender.Male;
            }
            else
            {
                player.gender = Gender.Female;
            }

            if (SettingsManager.getSettingBool("GatherExtraPlayerInformation"))
            {
                player.GatherInformationOnline(false);
            }

            return(player);
        }
コード例 #4
0
        public NotificationForm()
        {
            this.ShowInTaskbar = Constants.OBSEnableWindowCapture;
            this.Name          = String.Format("Tibialyzer ({0})", FormName());

            hideWhenTibiaInactive = SettingsManager.getSettingBool("NotificationShowTibiaActive");
        }
コード例 #5
0
 public override Image GetImage()
 {
     for (int i = 3; i >= 0; i--)
     {
         if (SettingsManager.getSettingBool("OutfitGenderMale"))
         {
             if (maleImages[i] != null)
             {
                 return(maleImages[i]);
             }
             if (femaleImages[i] != null)
             {
                 return(femaleImages[i]);
             }
         }
         else
         {
             if (femaleImages[i] != null)
             {
                 return(femaleImages[i]);
             }
             if (maleImages[i] != null)
             {
                 return(maleImages[i]);
             }
         }
     }
     throw new Exception("Outfit without image");
 }
コード例 #6
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);
        }
コード例 #7
0
ファイル: ScreenshotTab.cs プロジェクト: umdez/Tibialyzer
        public void InitializeSettings()
        {
            this.screenshotAdvanceCheckbox.Checked    = SettingsManager.getSettingBool("AutoScreenshotAdvance");
            this.screenshotOnRareItemCheckbox.Checked = SettingsManager.getSettingBool("AutoScreenshotItemDrop");
            this.screenshotDeathCheckbox.Checked      = SettingsManager.getSettingBool("AutoScreenshotDeath");
            this.screenshotLowLifeCheckbox.Checked    = SettingsManager.getSettingBool("AutoScreenshotLowLife");
            this.screenshotValueBox.Text = SettingsManager.getSettingString("ScreenshotRareItemValue");

            this.enableScreenshotCheckbox.Checked = SettingsManager.getSettingBool("EnableScreenshots");
            if (SettingsManager.getSettingString("ScreenshotPath") == null || !Directory.Exists(SettingsManager.getSettingString("ScreenshotPath")))
            {
                string path = Path.Combine(Directory.GetCurrentDirectory(), "Screenshots");
                SettingsManager.setSetting("ScreenshotPath", path);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
            }

            screenshotDisplayList.ReadOnly           = true;
            screenshotDisplayList.AttemptDeleteItem += ScreenshotDisplayList_AttemptDeleteItem;

            screenshotPathBox.Text = SettingsManager.getSettingString("ScreenshotPath");
            refreshScreenshots();
        }
コード例 #8
0
ファイル: CurveBar.cs プロジェクト: umdez/Tibialyzer
 public CurveBar()
 {
     MemoryReader.RegisterHealthChanged(this, (o, e) => UpdateHealth(e));
     MemoryReader.RegisterManaChanged(this, (o, e) => UpdateMana(e));
     ProcessManager.RegisterTibiaVisibilityChanged(this, (o, e) => UpdateHudVisibility(e));
     this.DoubleBuffered = true;
     alwaysShow          = SettingsManager.getSettingBool("AlwaysShowHUD");
 }
コード例 #9
0
 public static bool TrackCreature(Creature cr)
 {
     if (SettingsManager.getSettingBool("IgnoreLowExperience"))
     {
         return(cr.experience >= SettingsManager.getSettingInt("IgnoreLowExperienceValue"));
     }
     return(true);
 }
コード例 #10
0
ファイル: HUDManager.cs プロジェクト: jpodeszwik/Tibialyzer
 public static void Initialize()
 {
     foreach (string hudName in Constants.HudTypes)
     {
         if (SettingsManager.getSettingBool(hudName.Replace(" ", "") + "ShowOnStartup"))
         {
             ShowHUD(hudName);
         }
     }
 }
コード例 #11
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");
        }
コード例 #12
0
ファイル: MainForm.cs プロジェクト: jpodeszwik/Tibialyzer
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (SettingsManager.getSettingBool("ShutdownAutohotkeyOnExit"))
     {
         AutoHotkeyManager.ShutdownAutohotkey();
     }
     if (fileWriter != null)
     {
         fileWriter.Close();
     }
 }
コード例 #13
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);
 }
コード例 #14
0
        public void InitializeSettings()
        {
            displayPlayerNameCheckbox.Checked  = SettingsManager.getSettingBool("HealthListDisplayNames");
            displayPlayerImageCheckbox.Checked = SettingsManager.getSettingBool("HealthListDisplayIcons");

            nameListBox.Items.Clear();
            foreach (string str in SettingsManager.getSetting("HealthListPlayerNames"))
            {
                nameListBox.Items.Add(str);
            }
            nameListBox.RefreshControl();
            nameListBox.ItemsChanged += NameListBox_ItemsChanged;;
        }
コード例 #15
0
ファイル: HUDTab.cs プロジェクト: jpodeszwik/Tibialyzer
        public void InitializeSettings()
        {
            hudTypeList.ReadOnly = true;

            hudTypeList.Items.Clear();
            foreach (string hudName in Constants.HudTypes)
            {
                hudTypeList.Items.Add(hudName);
            }
            hudTypeList.SelectedIndex = 0;

            alwaysShowHUD.Checked = SettingsManager.getSettingBool("AlwaysShowHUD");
        }
コード例 #16
0
ファイル: StatusBar.cs プロジェクト: akalic/Tibialyzer
        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;
        }
コード例 #17
0
        public static ReadMemoryResults ReadMemory()
        {
            ReadMemoryResults results = null;
            SYSTEM_INFO       sys_info;

            GetSystemInfo(out sys_info);

            IntPtr proc_min_address = sys_info.minimumApplicationAddress;
            IntPtr proc_max_address = sys_info.maximumApplicationAddress;

            long proc_min_address_l = (long)proc_min_address;
            long proc_max_address_l = (long)proc_max_address;

            Process[] processes = ProcessManager.GetTibiaProcesses();
            if (processes == null || processes.Length == 0)
            {
                return(null);
            }

            results = new ReadMemoryResults();
            skipDuplicateCommands = (FlashClient || !SettingsManager.getSettingBool("ScanInternalTabStructure")) && SettingsManager.getSettingBool("SkipDuplicateCommands");
            Dictionary <int, HashSet <long> > newWhitelistedAddresses = null;

            Interlocked.Exchange(ref newWhitelistedAddresses, whiteListedAddresses);

            if (ProcessManager.TibiaClientType == "Tibia11")
            {
                ReadTibia11Tabs(results);
            }
            else
            {
                foreach (Process process in processes)
                {
                    if (!FlashClient && SettingsManager.getSettingBool("ScanInternalTabStructure"))
                    {
                        ReadMemoryInternal(process, results);
                        UseInternalScan = true;
                    }
                    else
                    {
                        ReadMemoryWhiteList(process, newWhitelistedAddresses, FlashClient, results);
                        UseInternalScan = false;
                    }
                    process.Dispose();
                }
            }
            FinalCleanup(results);
            return(results);
        }
コード例 #18
0
ファイル: SettingsTab.cs プロジェクト: akalic/Tibialyzer
 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");
 }
コード例 #19
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);
        }
コード例 #20
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");
 }
コード例 #21
0
ファイル: MainTab.cs プロジェクト: villor/Tibialyzer
        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;
        }
コード例 #22
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");
        }
コード例 #23
0
ファイル: NotificationsTab.cs プロジェクト: umdez/Tibialyzer
        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");
        }
コード例 #24
0
ファイル: AutoHotkeyTab.cs プロジェクト: villor/Tibialyzer
        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();
        }
コード例 #25
0
ファイル: MainForm.cs プロジェクト: umdez/Tibialyzer
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (SettingsManager.getSettingBool("ShutdownAutohotkeyOnExit"))
     {
         AutoHotkeyManager.ShutdownAutohotkey();
     }
     // create backup of settings on successful shutdown
     if (SettingsManager.getSettingBool("AutomaticSettingsBackup"))
     {
         SettingsManager.CreateBackup();
     }
     if (fileWriter != null)
     {
         fileWriter.Close();
     }
     ProcessManager.Stop();
 }
コード例 #26
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;
        }
コード例 #27
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));
        }
コード例 #28
0
ファイル: HUDTab.cs プロジェクト: jpodeszwik/Tibialyzer
        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
        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());
            }
        }
コード例 #30
0
        public static IEnumerable <string> UpdateCommands(Dictionary <string, List <Tuple <string, string> > > newCommands)
        {
            string extraPlayer = SettingsManager.getSettingBool("AutomaticallyDetectCharacter") ? MemoryReader.PlayerName : null;

            lock (totalCommands) {
                foreach (KeyValuePair <string, List <Tuple <string, string> > > kvp in newCommands)
                {
                    string t = kvp.Key;
                    List <Tuple <string, string> > currentCommands = kvp.Value;
                    if (!totalCommands.ContainsKey(t))
                    {
                        totalCommands[t] = new List <Tuple <string, string> >();
                    }
                    if (currentCommands.Count > totalCommands[t].Count)
                    {
                        List <Tuple <string, string> > unseenCommands = new List <Tuple <string, string> >();
                        List <Tuple <string, string> > commandsList   = totalCommands[t].ToList(); // create a copy of the list
                        foreach (Tuple <string, string> command in currentCommands)
                        {
                            if (!totalCommands[t].Contains(command))
                            {
                                unseenCommands.Add(command);
                                string player = command.Item1;
                                string cmd    = command.Item2;
                                if (SettingsManager.getSetting("Names").Contains(player) || (extraPlayer != null && player.Equals(extraPlayer, StringComparison.InvariantCultureIgnoreCase)))
                                {
                                    yield return(cmd);
                                }
                            }
                            else
                            {
                                totalCommands[t].Remove(command);
                            }
                        }
                        commandsList.AddRange(unseenCommands);
                        totalCommands[t] = commandsList;
                    }
                }
            }
            yield break;
        }