/// <summary>
        /// Define the settings you would like to use in your module.  Settings are persistent
        /// between updates to both Blish HUD and your module.
        /// </summary>
        protected override void DefineSettings(SettingCollection settings)
        {
            settings.DefineSetting("ExampleSetting.", "This is the value of the setting", "Display name of setting", "If exposed, this setting will be shown in settings with this description, automatically.");

            // Assigning the return value is the preferred way of keeping track of your settings
            _anotherExampleSetting = settings.DefineSetting("AnotherExample", true, "This setting is a bool setting.", "Settings can be many different types");
        }
Ejemplo n.º 2
0
        protected override void DefineSettings(SettingCollection settings)
        {
            _settingCursorThickness = settings.DefineSetting("CursorThickness", 3, "Cursor Thickness");
            _settingCursorThickness.SetRange(2, 10);
            _settingCursorThickness.SettingChanged += UpdateCursorThickness;

            _settingSkipUpdates = settings.DefineSetting("SkipUpdates", 10, "Stabilisation", "Higher settings help prevent the cursor from jumping when releasing RMB but may cause a stutter instead.");
            _settingSkipUpdates.SetRange(0, 20);
        }
Ejemplo n.º 3
0
        private void DefineSettings(SettingCollection settings)
        {
            this.UserLocale    = settings.DefineSetting("AppCulture", GetGw2LocaleFromCurrentUICulture(), Strings.GameServices.OverlayService.Setting_AppCulture_DisplayName, Strings.GameServices.OverlayService.Setting_AppCulture_Description);
            this.StayInTray    = settings.DefineSetting("StayInTray", true, Strings.GameServices.OverlayService.Setting_StayInTray_DisplayName, Strings.GameServices.OverlayService.Setting_StayInTray_Description);
            this.ShowInTaskbar = settings.DefineSetting("ShowInTaskbar", false, Strings.GameServices.OverlayService.Setting_ShowInTaskbar_DisplayName, Strings.GameServices.OverlayService.Setting_ShowInTaskbar_Description);

            this.ShowInTaskbar.SettingChanged += ShowInTaskbarOnSettingChanged;
            this.UserLocale.SettingChanged    += UserLocaleOnSettingChanged;

            ApplyInitialSettings();
        }
Ejemplo n.º 4
0
        protected override void DefineSettings(SettingCollection settings)
        {
            _settingCompassSize    = settings.DefineSetting("CompassSize", 0.5f, "Compass Size", "Size of the compass elements.");
            _settingCompassRadius  = settings.DefineSetting("CompassRadius", 0f, "Compass Radius", "Radius of the compass.");
            _settingVerticalOffset = settings.DefineSetting("VerticalOffset", VERTICALOFFSET_MIDDLE, "Vertical Offset", "How high to offset the compass off the ground.");

            _settingCompassSize.SetRange(0.1f, 2f);
            _settingCompassRadius.SetRange(0f, 4f);
            _settingVerticalOffset.SetRange(0f, VERTICALOFFSET_MIDDLE * 2);

            _settingCompassSize.SettingChanged += UpdateBillboardSize;
        }
Ejemplo n.º 5
0
        private void DefineSettings(SettingCollection settings)
        {
            this.UserLocale    = settings.DefineSetting("AppCulture", GetGw2LocaleFromCurrentUICulture(), Strings.GameServices.OverlayService.Setting_AppCulture_DisplayName, Strings.GameServices.OverlayService.Setting_AppCulture_Description);
            this.StayInTray    = settings.DefineSetting("StayInTray", true, Strings.GameServices.OverlayService.Setting_StayInTray_DisplayName, Strings.GameServices.OverlayService.Setting_StayInTray_Description);
            this.ShowInTaskbar = settings.DefineSetting("ShowInTaskbar", false, Strings.GameServices.OverlayService.Setting_ShowInTaskbar_DisplayName, Strings.GameServices.OverlayService.Setting_ShowInTaskbar_Description);

            // TODO: See https://github.com/blish-hud/Blish-HUD/issues/282
            this.UserLocale.SetExcluded(Locale.Chinese);

            this.ShowInTaskbar.SettingChanged += ShowInTaskbarOnSettingChanged;
            this.UserLocale.SettingChanged    += UserLocaleOnSettingChanged;

            ApplyInitialSettings();
        }
Ejemplo n.º 6
0
        public void RegisterKey(string name, string apiKey)
        {
            SettingEntry <string> registeredKey = _apiKeyRepository.DefineSetting(name, "");

            registeredKey.Value = apiKey;

            UpdateCharacterList(registeredKey);
        }
Ejemplo n.º 7
0
 protected override void DefineSettings(SettingCollection settings)
 {
     settings.DefineSetting("HideInWvW", false, "Hide Detailed Location while in WvW", "Prevents people on Discord from being able to see closest landmark details while you're in WvW.");
 }
Ejemplo n.º 8
0
 protected override void DefineSettings(SettingCollection settingsManager)
 {
     _settingShowNotificationWhenLandmarkIsCopied = settingsManager.DefineSetting("ShowNotificationOnCopy", true, "Show Notification When Landmark is Copied", "If checked, a notification will be displayed in the center of the screen confirming the landmark was copied.");
     _settingHideWindowAfterSelection             = settingsManager.DefineSetting("HideWindowOnSelection", true, "Hide Window After Selection", "If checked, the landmark search window will automatically hide after a landmark is selected from the results.");
 }
Ejemplo n.º 9
0
 private void DefineSettings(SettingCollection settings)
 {
     _userLocale = settings.DefineSetting("AppCulture", GetGw2LocaleFromCurrentUICulture(), "Application & API Language", "Determines the language used when displaying Blish HUD text and when requests are made to the GW2 web API.");
     _stayInTray = settings.DefineSetting("StayInTray", true, "Minimize to tray when Guild Wars 2 Closes", "If true, Blish HUD will automatically minimize when GW2 closes and will continue running until GW2 is launched again.\nYou can also use the Blish HUD icon in the tray to launch Guild Wars 2.");
 }
Ejemplo n.º 10
0
 private void DefineSettings(SettingCollection settings)
 {
     _moduleStates       = settings.DefineSetting(MODULESTATES_CORE_SETTING, new Dictionary <string, ModuleState>());
     _exportedOnVersions = settings.DefineSetting(EXPORTED_VERSION_SETTING, new List <string>());
 }
Ejemplo n.º 11
0
 protected override void DefineSettings(SettingCollection settingsManager)
 {
     settingBackgroundPlayback = settingsManager.DefineSetting <bool>("backgroundPlayback", false, "No background playback", "Stop key emulation when GW2 is in the background");
 }
Ejemplo n.º 12
0
 /// <inheritdoc />
 protected override void DefineSettings(SettingCollection settings)
 {
     _showToolbox = settings.DefineSetting("ShowToolbox", false);
 }
Ejemplo n.º 13
0
        private Panel BuildSettingPanel(Rectangle panelBounds)
        {
            var etPanel = new Panel()
            {
                CanScroll = false,
                Size      = panelBounds.Size
            };

            var ddSortMethod = new Dropdown()
            {
                Location = new Point(etPanel.Right - 150 - Dropdown.Standard.ControlOffset.X, Dropdown.Standard.ControlOffset.Y),
                Width    = 150,
                Parent   = etPanel,
            };

            int topOffset = ddSortMethod.Bottom + Panel.MenuStandard.ControlOffset.Y;

            var menuSection = new Panel {
                Title      = "Event Categories",
                ShowBorder = true,
                Size       = Panel.MenuStandard.Size - new Point(0, topOffset + Panel.MenuStandard.ControlOffset.Y),
                Location   = new Point(Panel.MenuStandard.PanelOffset.X, topOffset),
                Parent     = etPanel
            };

            var eventPanel = new FlowPanel()
            {
                FlowDirection  = ControlFlowDirection.LeftToRight,
                ControlPadding = new Vector2(8, 8),
                Location       = new Point(menuSection.Right + Panel.MenuStandard.ControlOffset.X, menuSection.Top),
                Size           = new Point(ddSortMethod.Right - menuSection.Right - Control.ControlStandard.ControlOffset.X, menuSection.Height),
                CanScroll      = true,
                Parent         = etPanel
            };

            GameService.Overlay.QueueMainThreadUpdate((gameTime) => {
                var searchBox = new TextBox()
                {
                    PlaceholderText = "Event Search",
                    Width           = menuSection.Width,
                    Location        = new Point(ddSortMethod.Top, menuSection.Left),
                    Parent          = etPanel
                };

                searchBox.TextChanged += delegate(object sender, EventArgs args) {
                    eventPanel.FilterChildren <DetailsButton>(db => db.Text.ToLower().Contains(searchBox.Text.ToLower()));
                };
            });

            foreach (var meta in Meta.Events)
            {
                var setting = _watchCollection.DefineSetting("watchEvent:" + meta.Name, true);

                meta.IsWatched = setting.Value;

                var es2 = new DetailsButton {
                    Parent           = eventPanel,
                    BasicTooltipText = meta.Category,
                    Text             = meta.Name,
                    IconSize         = DetailsIconSize.Small,
                    ShowVignette     = false,
                    HighlightType    = DetailsHighlightType.LightHighlight,
                    ShowToggleButton = true
                };

                if (meta.Texture.HasTexture)
                {
                    es2.Icon = meta.Texture;
                }

                var nextTimeLabel = new Label()
                {
                    Size                = new Point(65, es2.ContentRegion.Height),
                    Text                = meta.NextTime.ToShortTimeString(),
                    BasicTooltipText    = GetTimeDetails(meta),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Middle,
                    Parent              = es2,
                };

                Adhesive.Binding.CreateOneWayBinding(() => nextTimeLabel.Height, () => es2.ContentRegion, (rectangle => rectangle.Height), true);

                if (!string.IsNullOrEmpty(meta.Wiki))
                {
                    var glowWikiBttn = new GlowButton {
                        Icon             = GameService.Content.GetTexture("102530"),
                        ActiveIcon       = GameService.Content.GetTexture("glow-wiki"),
                        BasicTooltipText = "Read about this event on the wiki.",
                        Parent           = es2,
                        GlowColor        = Color.White * 0.1f
                    };

                    glowWikiBttn.Click += delegate {
                        if (UrlIsValid(meta.Wiki))
                        {
                            Process.Start(meta.Wiki);
                        }
                    };
                }

                if (!string.IsNullOrEmpty(meta.Waypoint))
                {
                    var glowWaypointBttn = new GlowButton {
                        Icon             = GameService.Content.GetTexture("waypoint"),
                        ActiveIcon       = GameService.Content.GetTexture("glow-waypoint"),
                        BasicTooltipText = $"Nearby waypoint: {meta.Waypoint}",
                        Parent           = es2,
                        GlowColor        = Color.White * 0.1f
                    };

                    glowWaypointBttn.Click += delegate {
                        System.Windows.Forms.Clipboard.SetText(meta.Waypoint);

                        ScreenNotification.ShowNotification("Waypoint copied to clipboard.");
                    };
                }

                var toggleFollowBttn = new GlowButton()
                {
                    Icon             = _textureWatch,
                    ActiveIcon       = _textureWatchActive,
                    BasicTooltipText = "Click to toggle tracking for this event.",
                    ToggleGlow       = true,
                    Checked          = meta.IsWatched,
                    Parent           = es2,
                };

                toggleFollowBttn.Click += delegate {
                    meta.IsWatched = toggleFollowBttn.Checked;
                    setting.Value  = toggleFollowBttn.Checked;
                };

                meta.OnNextRunTimeChanged += delegate {
                    UpdateSort(ddSortMethod, EventArgs.Empty);

                    nextTimeLabel.Text             = meta.NextTime.ToShortTimeString();
                    nextTimeLabel.BasicTooltipText = GetTimeDetails(meta);
                };

                _displayedEvents.Add(es2);
            }

            // Add menu items for each category (and built-in categories)
            var eventCategories = new Menu {
                Size           = menuSection.ContentRegion.Size,
                MenuItemHeight = 40,
                Parent         = menuSection,
                CanSelect      = true
            };

            List <IGrouping <string, Meta> > submetas = Meta.Events.GroupBy(e => e.Category).ToList();

            var evAll = eventCategories.AddMenuItem(EC_ALLEVENTS);

            evAll.Select();
            evAll.Click += delegate {
                eventPanel.FilterChildren <DetailsButton>(db => true);
            };

            foreach (IGrouping <string, Meta> e in submetas)
            {
                var ev = eventCategories.AddMenuItem(e.Key);
                ev.Click += delegate {
                    eventPanel.FilterChildren <DetailsButton>(db => string.Equals(db.BasicTooltipText, e.Key));
                };
            }

            // TODO: Hidden events/timers to be added later
            //eventCategories.AddMenuItem(EC_HIDDEN);

            // Add dropdown for sorting events
            ddSortMethod.Items.Add(DD_ALPHABETICAL);
            ddSortMethod.Items.Add(DD_NEXTUP);

            ddSortMethod.ValueChanged += delegate(object sender, ValueChangedEventArgs args) {
                switch (args.CurrentValue)
                {
                case DD_ALPHABETICAL:
                    eventPanel.SortChildren <DetailsButton>((db1, db2) => string.Compare(db1.Text, db2.Text, StringComparison.CurrentCultureIgnoreCase));
                    break;

                case DD_NEXTUP:
                    break;
                }
            };

            ddSortMethod.SelectedItem = DD_NEXTUP;
            //UpdateSort(ddSortMethod, EventArgs.Empty);

            return(etPanel);
        }
 protected override void DefineSettings(SettingCollection settings)
 {
     favorites = settings.DefineSetting("favorites", new List <string>());
 }
Ejemplo n.º 15
0
 protected override void DefineSettings(SettingCollection settings)
 {
     _settingCompassSize    = settings.DefineSetting("CompassSize", 0.5f, "Compass Size", "Size of the compass elements.");
     _settingCompassRadius  = settings.DefineSetting("CompassRadius", 0f, "Compass Radius", "Radius of the compass.");
     _settingVerticalOffset = settings.DefineSetting("VerticalOffset", 0f, "Vertical Offset", "How high to offset the compass off the ground.");
 }
Ejemplo n.º 16
0
 protected override void DefineSettings(SettingCollection settings)
 {
     _settingOnlyShowAtHighSpeeds = settings.DefineSetting("OnlyShowAtHighSpeeds", false, "Only Show at High Speeds", "Only show the speedometer if you're going at least 1/4 the max speed.");
     _settingShowSpeedNumber      = settings.DefineSetting("ShowSpeedNumber", false, "Show Speed Value", "Shows the speed (in approx. inches per second) above the speedometer.");
 }
Ejemplo n.º 17
0
 protected override void DefineSettings(SettingCollection settings)
 {
     _masterVolume = settings.DefineSetting("MasterVolume.", 50.0f, () => "Master Volume", () => "Is Sebastian a little to loud for you? Well you can attempt to have him sing a little less enthusiastically.");
 }
Ejemplo n.º 18
0
 private void DefineSettings(SettingCollection settings)
 {
     _apiKeyRepository = settings.DefineSetting(SETTINGS_ENTRY_APIKEYS, new Dictionary <Guid, string>());
 }
 protected override void DefineSettings(SettingCollection settings)
 {
     SeenHints = settings.DefineSetting <HashSet <int>[]>("SeenHints", new HashSet <int> [3], "PreviousHints", "Previously Seen Hints");
 }
Ejemplo n.º 20
0
 private void DefineSettings(SettingCollection settings)
 {
     settings.DefineSetting("Test hotkey", new Hotkey("Test hotkey2", "This is the description", "cate", new[] { Keys.LeftShift, Keys.LeftAlt, Keys.L }));
     settings.DefineSetting("Test hotkey2", new Hotkey("Test hotkey3", "This is thasfe description", "catase", new[] { Keys.LeftShift, Keys.LeftAlt, Keys.K }));
 }