コード例 #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);
        }
コード例 #2
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);
        }
コード例 #3
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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;
                }
            }
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        ////////////////

        /// @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);
        }
コード例 #9
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);
        }