Example #1
0
        public override void OnContexualize(string uiClassName, string contextName)
        {
            base.OnContexualize(uiClassName, contextName);

            var recomWidgetCtx = new WidgetMenuContext(this.RecommendsList, false);
            var dlWidgetCtx    = new WidgetMenuContext(this.DownloadButton, false);

            MenuContextService.AddMenuContext(uiClassName, contextName + " Recommendations List", recomWidgetCtx);
            MenuContextService.AddMenuContext(uiClassName, contextName + " Download Button", dlWidgetCtx);
        }
Example #2
0
        public static void Initialize()
        {
            if (ModHelpersMod.Config.DisableModMenuUpdates)
            {
                return;
            }

            var ctx = new ModUpdatesMenuContext(MenuUIDefinition.UIMods, "ModHelpers: Mod Updates");

            MenuContextService.AddMenuContext(ctx);
        }
Example #3
0
        ////////////////

        public static void Initialize()
        {
            if (ModHelpersMod.Instance.Config.DisableModRecommendations)
            {
                return;
            }

            var ctx = new ModRecommendsMenuContext();

            MenuContextService.AddMenuContext("UIModInfo", "ModHelpers: Mod Recommendations", ctx);
        }
        public static void Initialize()
        {
            if (ModHelpersMod.Instance.Config.DisableModTags)
            {
                return;
            }

            var ctx = new ModBrowserTagsMenuContext();

            MenuContextService.AddMenuContext("UIModBrowser", "ModHelpers: Mod Browser", ctx);
        }
Example #5
0
        public static void Initialize()
        {
            if (ModHelpersMod.Instance.Config.DisableModMenuUpdates)
            {
                return;
            }

            var ctx = new ModUpdatesMenuContext();

            MenuContextService.AddMenuContext("UIMods", "ModHelpers: Mod Updates", ctx);
        }
Example #6
0
        ////

        public override void OnContexualize(string uiClassName, string contextName)
        {
            base.OnContexualize(uiClassName, contextName);

            var hiddenWidgetCtx       = new WidgetMenuContext(this.HiddenPanel, false);
            var finishButtonWidgetCtx = new WidgetMenuContext(this.FinishButton, false);
            var resetButtonWidgetCtx  = new WidgetMenuContext(this.ResetButton, false);

            MenuContextService.AddMenuContext(uiClassName, contextName + " Hidden", hiddenWidgetCtx);
            MenuContextService.AddMenuContext(uiClassName, contextName + " Tag Finish Button", finishButtonWidgetCtx);
            MenuContextService.AddMenuContext(uiClassName, contextName + " Tag Reset Button", resetButtonWidgetCtx);
        }
        public static void Initialize(bool onModLoad)
        {
            if (ModHelpersMod.Config.DisableModTags)
            {
                return;
            }

            if (!onModLoad)
            {
                var ctx = new ModTagsModBrowserMenuContext(MenuUIDefinition.UIModBrowser, "ModHelpers: Mod Browser");
                MenuContextService.AddMenuContext(ctx);
            }
        }
        public override void OnContexualize(string uiClassName, string contextName)
        {
            base.OnContexualize(uiClassName, contextName);

            int i = 0;

            foreach (UITagButton button in this.TagButtons.Values)
            {
                var buttonWidgetCtx = new WidgetMenuContext(button, false);

                MenuContextService.AddMenuContext(uiClassName, contextName + " Tag " + i, buttonWidgetCtx);
                i++;
            }
        }
        ////////////////

        public override void ApplyMenuContext(MenuUIDefinition menuDef, string baseContextName)
        {
            base.ApplyMenuContext(menuDef, baseContextName);

            var finishButtonWidgetCtx = new WidgetMenuContext(menuDef,
                                                              baseContextName + " Tag Finish Button",
                                                              this.EditButton,
                                                              false);
            var hiddenWidgetCtx = new WidgetMenuContext(menuDef,
                                                        baseContextName + " Hidden",
                                                        this.HiddenPanel,
                                                        false);

            MenuContextService.AddMenuContext(hiddenWidgetCtx);
            MenuContextService.AddMenuContext(finishButtonWidgetCtx);
        }
        public override void OnContexualize(string uiClassName, string contextName)
        {
            base.OnContexualize(uiClassName, contextName);

            var blankRecomPanel    = new UIMenuPanel(UITheme.Vanilla, 198f, 132f, 202f, 40f);
            var blankDlButtonPanel = new UIMenuPanel(UITheme.Vanilla, 198f, 26f, 202f, 172f);

            //var blankButtonWidgetCtx = new WidgetMenuContext( this.BlankButton, false );
            var resetButtonWidgetCtx = new WidgetMenuContext(this.ResetButton, false);
            var blankRecomWidgetCtx  = new WidgetMenuContext(blankRecomPanel, false);
            var blankDlWidgetCtx     = new WidgetMenuContext(blankDlButtonPanel, false);

            //MenuContextService.AddMenuContext( uiClassName, contextName + " Tag Blank Button", blankButtonWidgetCtx );
            MenuContextService.AddMenuContext(uiClassName, contextName + " Tag Reset Button", resetButtonWidgetCtx);
            MenuContextService.AddMenuContext(uiClassName, contextName + " Blank Recommendations List", blankRecomWidgetCtx);
            MenuContextService.AddMenuContext(uiClassName, contextName + " Blank Download Button", blankDlWidgetCtx);
        }
        public override void OnContexualize(string uiClassName, string contextName)
        {
            if (this.DisplayInfo)
            {
                WidgetMenuContext widgetCtx;

                if (MenuContextService.GetMenuContext(uiClassName, "ModHelpers: Info Display") == null)
                {
                    widgetCtx = new WidgetMenuContext(this.InfoDisplay, false);
                    MenuContextService.AddMenuContext(uiClassName, "ModHelpers: Info Display", widgetCtx);
                }
                else
                {
                    widgetCtx        = (WidgetMenuContext)MenuContextService.GetMenuContext(uiClassName, "ModHelpers: Info Display");
                    this.InfoDisplay = (UIInfoDisplay)widgetCtx.MyElement;
                }
            }
        }
        private static void InitializeOpenConfigButton()
        {
            var button = new UITextPanelButton(UITheme.Vanilla, "Open Mod Config Folder");

            button.Top.Set(11f, 0f);
            button.Left.Set(-104f, 0.5f);
            button.Width.Set(208f, 0f);
            button.Height.Set(20f, 0f);
            button.OnClick += (UIMouseEvent evt, UIElement listeningElement) => {
                string fullpath = Main.SavePath + Path.DirectorySeparatorChar + HamstarHelpersConfigData.RelativePath;

                try {
                    Process.Start(fullpath);
                } catch (Exception) { }
            };

            var buttonWidgetCtx = new WidgetMenuContext(button, true);

            MenuContextService.AddMenuContext("UIMods", "ModHelpers: Mod Menu Config Folder Button", buttonWidgetCtx);
        }
        public static void Initialize()
        {
            if (ModHelpersMod.Config.DisableModMenuTweaks)
            {
                return;
            }

            MenuTweaksMenuContext ctx;

            ctx = new MenuTweaksMenuContext(MenuUIDefinition.UIMods, "ModHelpers: Mods Menu Tweaks");
            MenuContextService.AddMenuContext(ctx);

            ctx = new MenuTweaksMenuContext(MenuUIDefinition.UIModPacks, "ModHelpers: Mod Packs Menu Tweaks");
            MenuContextService.AddMenuContext(ctx);

            ctx = new MenuTweaksMenuContext(MenuUIDefinition.UIModSources, "ModHelpers: Mod Sources Menu Tweaks");
            MenuContextService.AddMenuContext(ctx);

            ctx = new MenuTweaksMenuContext(MenuUIDefinition.UIModConfig, "ModHelpers: Mod Config Menu Tweaks");
            MenuContextService.AddMenuContext(ctx);
        }
        ////////////////

        /// @private
        public sealed override void OnActivation(UIState ui)
        {
            var menuDef = this.MenuDefinitionOfContext;

            if (this.DisplayInfo)
            {
                WidgetMenuContext widgetCtx;

                if (MenuContextService.GetMenuContext(menuDef, "ModLibsUI: Info Display") == null)
                {
                    widgetCtx = new WidgetMenuContext(menuDef, "ModLibsUI: Info Display", this.InfoDisplay, false);
                    MenuContextService.AddMenuContext(widgetCtx);
                }
                else
                {
                    widgetCtx        = (WidgetMenuContext)MenuContextService.GetMenuContext(menuDef, "ModLibsUI: Info Display");
                    this.InfoDisplay = (UIInfoDisplay)widgetCtx.MyElement;
                }
            }

            this.OnActivationForSession(ui);
        }
Example #15
0
        ////////////////

        public virtual void ApplyMenuContext(MenuUIDefinition menuDef, string baseContextName)
        {
            var thisWidgetCtx = new WidgetMenuContext(menuDef, baseContextName + " Tags Panel", this, false);

            MenuContextService.AddMenuContext(thisWidgetCtx);

            int i = 0;

            foreach (UIMenuButton categoryButton in this.CategoryButtons.Values)
            {
                var buttonWidgetCtx = new WidgetMenuContext(menuDef,
                                                            baseContextName + " Tag Category " + i,
                                                            categoryButton,
                                                            false);
                MenuContextService.AddMenuContext(buttonWidgetCtx);
                i++;
            }

            i = 0;
            foreach (UITagMenuButton tagButton in this.TagButtons.Values)
            {
                var buttonWidgetCtx = new WidgetMenuContext(menuDef,
                                                            baseContextName + " Tag " + i,
                                                            tagButton,
                                                            false);
                MenuContextService.AddMenuContext(buttonWidgetCtx);
                i++;
            }

            var resetButtonWidgetCtx = new WidgetMenuContext(menuDef,
                                                             baseContextName + " Tag Reset Button",
                                                             this.ResetButton,
                                                             false);

            MenuContextService.AddMenuContext(resetButtonWidgetCtx);
        }