コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            theme       t      = (theme)cbTheme.SelectedItem;
            ThemeEditor editor = new ThemeEditor(db, t);

            editor.Show();
        }
コード例 #2
0
 public void close_edit(object sender, FormClosingEventArgs e)
 {
     themeeditor = null;                    // called when editor closes
     SetEntryThemeComboBox();
     comboBoxTheme.Enabled   = true;        // no doing this while theme editor is open
     buttonSaveTheme.Enabled = true;
 }
コード例 #3
0
        private void Initialize()
        {
            var updateChapter = Task.Run(async() =>
            {
                DataSource.Initialize(Environment.GetCommandLineArgs());
                var updated = await DataSource.SetChapter(DataSource.Path); // Self-initialize
                WindowTitle = $"{DataSource.Title}  -  Minimal CS Manga Reader";
                if (updated)
                {
                    // Refresh from source instead of ViewModel since it's not initialized yet
                    _activeIndex = DataSource.ChapterList.Count > 0 && Config.OpenChapterOnLoadChoice == Enums.OpenChapterOnLoad.Last ? DataSource.ChapterList.Count - 1 : 0;
                    ActiveIndex  = _activeIndex;
                }
            });

            ThemeEditor.ModifyTheme(Config.Theme);
            ThemeEditor.ChangePrimaryColor(Config.AccentColor);
            ImageMargin          = $"0,0,0,{ImageMarginSetter}";
            ZoomScale            = _zoomScaleSetter == 100 ? 1 : Math.Round(_zoomScaleSetter / 99.999999999999, 3);
            ActiveBackgroundView = Config.Background;
            IsScrollBarVisible   = Config.IsScrollBarVisible;
            _scrollIncrement     = Config.ScrollIncrement;
            ScrollIncrement      = _scrollIncrement.ToString();
            _imageMarginSetter   = Config.ImageMargin;
            ActiveBackgroundView = Config.Background;
            updateChapter.Wait();
        }
コード例 #4
0
 public string Update(string Catguid, ThemeEditor themeEditor)
 {
     Core.Managers.ThemeManager.BuildThemeEditor(themeEditor);
     if (Core.Managers.ThemeManager.Update(Catguid, themeEditor))
     {
         return(Core.Managers.ThemeManager.GetMarkUp(AppFactory.Identifier.setting_settings.ToString(), Catguid));
     }
     else
     {
         return("Failed");
     }
 }
コード例 #5
0
        private void SetUnderlineColor(ThemeEditor themeEditor)
        {
            var underlineColor = themeEditor.BottomLineColor.ToAndroid();

            if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                Control.BackgroundTintList = ColorStateList.ValueOf(underlineColor);
            }
            else
            {
                Control.Background.SetColorFilter(underlineColor, PorterDuff.Mode.SrcAtop);
            }
        }
コード例 #6
0
        private void extButtonEdit_Click(object sender, EventArgs e)
        {
            ThemeEditor te = new ThemeEditor();

            te.InitForm(Theme.Current);

            var res = te.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                Theme.Current = te.Theme;
                Theme.Current.ApplyStd(this);
                labelName.Text = Theme.Current.Name;
            }
        }
コード例 #7
0
        public MenuWindow(Core core, SettingsContainer settingsContainer, Dictionary <string, FontContainer> fonts)
        {
            this.core          = core;
            _settingsContainer = settingsContainer;
            _CoreSettings      = settingsContainer.CoreSettings;
            Fonts       = fonts;
            themeEditor = new ThemeEditor(_CoreSettings);

            /*Input.RegisterKey(Keys.F12);
             * Input.ReleaseKey += (sender, keys) =>
             * {
             *  if (keys== SettingsCoreSettings.MainMenuKeyToggle.Value)
             *  {
             *      Enable = !Enable;
             *  }
             * };*/

            CoreSettingsDrawers = new List <ISettingsHolder>();

            SettingsParser.Parse(_CoreSettings, CoreSettingsDrawers);
            Selected     = CoreSettings;
            CoreSettings = () =>
            {
                foreach (var drawer in CoreSettingsDrawers)
                {
                    drawer.Draw();
                }
            };
            _index   = -1;
            Selected = CoreSettings;


            Core.DebugInformations.CollectionChanged += OnDebugInformationsOnCollectionChanged;
            debugInformation = new DebugInformation("DebugWindow", false);
            OpenWindow       = Windows.MainDebugs;
            WindowsName      = Enum.GetValues(typeof(Windows));
            OnWindowChange  += () =>
            {
                MoreInformation = null;
                selectedName    = "";
            };
            Input.RegisterKey(_CoreSettings.MainMenuKeyToggle);
            _CoreSettings.MainMenuKeyToggle.OnValueChanged += () =>
            {
                Input.RegisterKey(_CoreSettings.MainMenuKeyToggle);
            };
        }
コード例 #8
0
            private static string GetSubCategoryEditClick(ThemeEditor item, bool developerMode, string Guid)
            {
                StringBuilder sb = new StringBuilder();

                sb.Append("<div class=\"dropdown float-right dropbtn\">");
                sb.Append("<a id=\"dropdownMenuLink\" class=\"dropdownmenu\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"><em class=\"fas fa-ellipsis-v\"></em></a>");
                sb.Append("<div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuLink\">");
                sb.Append("<a class=\"dropdown-item box-icon\" ng-click=\"OpenPopUp('edit/" + Guid + "/" + item.Guid + "')\"><em class=\"fas fa-cog mr-xs\"></em><span>Settings</span></a>");
                if (developerMode)
                {
                    sb.Append("<hr class=\"small\" />");
                    sb.Append("<a class=\"dropdown-item box-icon\" ng-click=\"DeleteSubCategory('" + item.Category + "','" + item.Title + "')\"><em class=\"fas fa-trash mr-xs\"></em><span>Delete</span></a>");
                }
                sb.Append("</div>");
                sb.Append("</div>");
                return(sb.ToString());
            }
コード例 #9
0
        public void button_edittheme_Click(object sender, EventArgs e)
        {
            if (themeeditor == null)                    // no theme editor, make one..
            {
                themeeditor = new ThemeEditor();
                themeeditor.InitForm(_discoveryForm);
                themeeditor.FormClosing += close_edit;  // lets see when it closes

                comboBoxTheme.Enabled   = false;        // no doing this while theme editor is open
                buttonSaveTheme.Enabled = false;

                themeeditor.Show();                     // run form
            }
            else
            {
                themeeditor.BringToFront();             // its up, make it at front to show it
            }
        }
コード例 #10
0
            public static bool Update(string categoryGuid, ThemeEditor themeEditor)
            {
                try
                {
                    if (string.IsNullOrEmpty(themeEditor.Guid))
                    {
                        themeEditor.Guid = Guid.NewGuid().ToString();
                    }
                    ThemeEditorWrapper ThemeEditorWrapper = GetThemeEditors(PortalSettings.Current.PortalId, categoryGuid);
                    if (ThemeEditorWrapper != null && ThemeEditorWrapper.ThemeEditors != null)
                    {
                        int         index = -1;
                        ThemeEditor existingThemeEditor = GetThemeEditor(ThemeEditorWrapper.ThemeEditors, themeEditor.Guid, ref index);
                        if (existingThemeEditor != null && index >= 0)
                        {
                            ThemeEditorWrapper.ThemeEditors[index] = themeEditor;
                        }
                        else
                        {
                            ThemeEditorWrapper.ThemeEditors.Add(themeEditor);
                        }
                    }
                    else
                    {
                        if (ThemeEditorWrapper == null)
                        {
                            ThemeEditorWrapper = new ThemeEditorWrapper();
                        }

                        ThemeEditorWrapper.ThemeEditors = new List <ThemeEditor>
                        {
                            themeEditor
                        };
                    }
                    UpdateThemeEditorJson(categoryGuid, ThemeEditorWrapper);
                    return(true);
                }
                catch (Exception ex) { DotNetNuke.Services.Exceptions.Exceptions.LogException(ex); return(false); }
            }
コード例 #11
0
        internal static List <IUIData> GetData(Dictionary <string, string> parameters)
        {
            Dictionary <string, IUIData> Settings = new Dictionary <string, IUIData>();

            string CatGuid  = string.Empty;
            string Guid     = string.Empty;
            string Category = string.Empty;
            string Type     = string.Empty;

            if (parameters.Count > 0)
            {
                if (parameters.ContainsKey("catguid"))
                {
                    CatGuid = parameters["catguid"];
                }

                if (parameters.ContainsKey("guid"))
                {
                    Guid = parameters["guid"];
                }

                if (parameters.ContainsKey("cat"))
                {
                    Category = parameters["cat"];
                }

                if (parameters.ContainsKey("type"))
                {
                    Type = parameters["type"];
                }
            }

            ThemeEditor te = Core.Managers.ThemeManager.GetThemeEditor(CatGuid, Guid);

            Settings.Add("ThemeEditor", new UIData {
                Name = "ThemeEditor", Options = te ?? new ThemeEditor()
            });
            Settings.Add("ControlTypes", new UIData {
                Name = "ControlTypes", Options = Core.Managers.ThemeManager.GetControlTypes()
            });
            Settings.Add("IsNew", new UIData {
                Name = "IsNew", Value = string.IsNullOrEmpty(Guid) ? "true" : "false"
            });
            Settings.Add("Fonts", new UIData {
                Name = "Fonts", OptionsText = "Name", OptionsValue = "Value", Options = Core.Managers.ThemeManager.GetDDLFonts(CatGuid), Value = "0"
            });
            Settings.Add("Category", new UIData {
                Name = "Category", Value = Category
            });
            Settings.Add("Type", new UIData {
                Name = "Type", Value = Type
            });

            bool DeveloperMode = true;
            ThemeEditorWrapper themeEditorWrapper = Core.Managers.ThemeManager.GetThemeEditors(PortalSettings.Current.PortalId, CatGuid);

            if (themeEditorWrapper != null)
            {
                DeveloperMode = themeEditorWrapper.DeveloperMode;
            }

            Settings.Add("DeveloperMode", new UIData {
                Name = "DeveloperMode", Value = DeveloperMode.ToString().ToLower()
            });
            Settings.Add("CatGuid", new UIData {
                Name = "CatGuid", Value = CatGuid
            });
            return(Settings.Values.ToList());
        }
コード例 #12
0
        public SettingViewModel(Action <SettingViewModel, bool> closeCallback, IUserConfig config)
        {
            Config                    = config ?? Locator.Current.GetService <IUserConfig>();
            ContextIntegrated         = RegistryContextManager.IsContextRegistry();
            _initialContextIntegrated = ContextIntegrated;
            FitImagesToScreen         = Config.FitImagesToScreen;
            IsScrollBarVisible        = Config.IsScrollBarVisible;
            OpenChapterOnLoad         = Config.OpenChapterOnLoadChoice;
            SelectedBackground        = Config.Background;
            SelectedTheme             = Config.Theme;

            try
            {
                SelectedInterpolationMode = Config.InterpolationMode;
                SelectedSmoothingMode     = Config.SmoothingMode;
                SelectedPixelOffsetMode   = Config.PixelOffsetMode;
            }
            catch (Exception)
            {
                SelectedInterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default;
                SelectedSmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.Default;
                SelectedPixelOffsetMode   = System.Drawing.Drawing2D.PixelOffsetMode.Default;
                Config.InterpolationMode  = SelectedInterpolationMode;
                Config.SmoothingMode      = SelectedSmoothingMode;
                Config.PixelOffsetMode    = SelectedPixelOffsetMode;
                Config.Save();
            }
            _closeCallback = closeCallback;

            Save = ReactiveCommand.Create(() =>
            {
                SaveSettings();
                _closeCallback(this, false);
            });

            SaveAndRefresh = ReactiveCommand.Create(() =>
            {
                SaveSettings();
                _closeCallback(this, true);
            });

            Close = ReactiveCommand.Create(() =>
            {
                _closeCallback(this, false);
                if (SelectedTheme != Config.Theme)
                {
                    // Restore theme
                    ThemeEditor.ModifyTheme(Config.Theme);
                }
                ThemeEditor.ChangePrimaryColor(Config.AccentColor);
            });

            SetAccentColor = ReactiveCommand.Create(() =>
            {
                InitialAccentColor = SelectedColor;
                ThemeEditor.ChangePrimaryColor(SelectedColor);
                IsPopupOpen = false;
            });

            CancelAccentColor = ReactiveCommand.Create(() =>
            {
                SelectedColor = Config.AccentColor;
                IsPopupOpen   = false;
            });

            ResetAccentColor = ReactiveCommand.Create(() =>
            {
                InitialAccentColor = Color.FromArgb(255, 154, 103, 234);
                SelectedColor      = InitialAccentColor;
                ThemeEditor.ChangePrimaryColor(InitialAccentColor);
                IsPopupOpen = false;
            });

            this.WhenValueChanged(x => x.SelectedTheme).Subscribe(x =>
            {
                ThemeEditor.ModifyTheme(x);
            });

            this.WhenAnyValue(x => x.SelectedColor).Subscribe(x =>
            {
                SelectedBrush = new SolidColorBrush(SelectedColor);
            });
        }
コード例 #13
0
            public static void BuildThemeEditor(ThemeEditor themeEditor)
            {
                List <ThemeEditorControl> NewControls = new List <ThemeEditorControl>();

                foreach (dynamic control in themeEditor.Controls)
                {
                    if (control.Type == "Slider")
                    {
                        Slider slider = JsonConvert.DeserializeObject <Slider>(control.ToString());
                        if (slider != null)
                        {
                            if (string.IsNullOrEmpty(slider.Guid))
                            {
                                slider.Guid = Guid.NewGuid().ToString();
                            }

                            NewControls.Add(slider);
                        }
                    }
                    else if (control.Type == "Dropdown")
                    {
                        Dropdown dropdown = JsonConvert.DeserializeObject <Dropdown>(control.ToString());
                        if (dropdown != null)
                        {
                            if (string.IsNullOrEmpty(dropdown.Guid))
                            {
                                dropdown.Guid = Guid.NewGuid().ToString();
                            }

                            NewControls.Add(dropdown);
                        }
                    }
                    else if (control.Type == "Color Picker")
                    {
                        ColorPicker colorPicker = JsonConvert.DeserializeObject <ColorPicker>(control.ToString());
                        if (colorPicker != null)
                        {
                            if (string.IsNullOrEmpty(colorPicker.Guid))
                            {
                                colorPicker.Guid = Guid.NewGuid().ToString();
                            }

                            NewControls.Add(colorPicker);
                        }
                    }
                    else
                    {
                        Fonts fonts = JsonConvert.DeserializeObject <Fonts>(control.ToString());
                        if (fonts != null)
                        {
                            if (string.IsNullOrEmpty(fonts.Guid))
                            {
                                fonts.Guid = Guid.NewGuid().ToString();
                            }

                            NewControls.Add(fonts);
                        }
                    }
                }
                themeEditor.Controls = new List <dynamic>();
                themeEditor.Controls.AddRange(NewControls);
            }
コード例 #14
0
        public MainMenuWindow(CoreSettings settings, SettingsHub settingsHub)
        {
            Settings    = settings;
            SettingsHub = settingsHub;
            Instance    = this;

            //https://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version-number-visual-studio
            Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            //DateTime buildDate = new DateTime(2000, 1, 1).AddDays(version.Build).AddSeconds(version.Revision * 2);
            PoeHUDVersion = $"v{version.Major}.{version.Minor}.{version.Build}";

            if (Settings.MenuWindowSize == ImGuiVector2.Zero)
            {
                Settings.MenuWindowSize  = new ImGuiVector2(500, 800);
                Settings.MenuWindowPos.X = GameController.Instance.Window.GetWindowRectangle().X - Settings.MenuWindowSize.X / 2;
            }

            CoreMenu = new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Core", settingsHub.MenuSettings)
            };
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Health bars", settingsHub.HealthBarSettings),
                Childs = new List <InbuildPluginMenu>()
                {
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Players", settingsHub.HealthBarSettings.Players)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Minions", settingsHub.HealthBarSettings.Minions)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("NormalEnemy", settingsHub.HealthBarSettings.NormalEnemy)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("MagicEnemy", settingsHub.HealthBarSettings.MagicEnemy)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("RareEnemy", settingsHub.HealthBarSettings.RareEnemy)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("UniqueEnemy", settingsHub.HealthBarSettings.UniqueEnemy)
                    },
                }
            });

            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Advanced Tooltip", settingsHub.AdvancedTooltipSettings),
                Childs = new List <InbuildPluginMenu>()
                {
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Item level", settingsHub.AdvancedTooltipSettings.ItemLevel)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Item mods", settingsHub.AdvancedTooltipSettings.ItemMods)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Weapon Dps", settingsHub.AdvancedTooltipSettings.WeaponDps)
                    },
                }
            });

            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Item alert", settingsHub.ItemAlertSettings),
                Childs = new List <InbuildPluginMenu>()
                {
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Border Settings", settingsHub.ItemAlertSettings.BorderSettings)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Quality Armour Settings", settingsHub.ItemAlertSettings.QualityItems.Armour)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Quality Flask", settingsHub.ItemAlertSettings.QualityItems.Flask)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Quality SkillGem", settingsHub.ItemAlertSettings.QualityItems.SkillGem)
                    },
                    new InbuildPluginMenu()
                    {
                        Plugin = new PluginHolder("Quality Weapon", settingsHub.ItemAlertSettings.QualityItems.Weapon)
                    }
                }
            });

            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Xph & area", settingsHub.XpRateSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Preload alert", settingsHub.PreloadAlertSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Monster alert", settingsHub.MonsterTrackerSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Monster kills", settingsHub.KillCounterSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Show dps", settingsHub.DpsMeterSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Map Icons", settingsHub.MapIconsSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Map Icons Size", settingsHub.PoiTrackerSettings)
            });
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = new PluginHolder("Perfomance", settingsHub.PerformanceSettings)
            });



            var themeEditorDraw = new ThemeEditor();

            themeEditorDraw.CanBeEnabledInOptions = false;
            CoreMenu.Childs.Add(new InbuildPluginMenu()
            {
                Plugin = themeEditorDraw
            });
        }
コード例 #15
0
    public static void ShowEditor()
    {
        ThemeEditor editor = GetWindow <ThemeEditor>();

        editor.Show();
    }