Exemple #1
0
        ////////////////

        public override void ProcessTriggers(TriggersSet triggersSet)
        {
//DataStore.Add( DebugHelpers.GetCurrentContext()+"_"+this.player.name+":"+this.player.whoAmI+"_A", 1 );
            var mymod = (ModHelpersMod)this.mod;

            try {
                if (mymod.ControlPanelHotkey != null && mymod.ControlPanelHotkey.JustPressed)
                {
                    if (mymod.Config.DisableControlPanelHotkey)
                    {
                        Main.NewText("Control panel hotkey disabled.", Color.Red);
                    }
                    else
                    {
                        if (mymod.ControlPanel != null)
                        {
                            if (mymod.ControlPanel.IsOpen)
                            {
                                ControlPanelTabs.CloseDialog();
                            }
                            else
                            {
                                ControlPanelTabs.OpenTab(UIControlPanel.DefaultTabName);
                            }
                        }
                    }
                }
            } catch (Exception e) {
                LogHelpers.Warn("(1) - " + e.ToString());
                return;
            }

            try {
                if (mymod.DataDumpHotkey != null && mymod.DataDumpHotkey.JustPressed)
                {
                    string fileName;
                    if (DataDumper.DumpToFile(out fileName))
                    {
                        string msg = "Dumped latest debug data to log file " + fileName;

                        Main.NewText(msg, Color.Azure);
                        LogHelpers.Log(msg);
                    }
                }
            } catch (Exception e) {
                LogHelpers.Warn("(2) - " + e.ToString());
                return;
            }

            try {
                if (mymod.CustomHotkeys != null)
                {
                    mymod.CustomHotkeys.ProcessTriggers(triggersSet);
                }
            } catch (Exception e) {
                LogHelpers.Warn("(3) - " + e.ToString());
                return;
            }
//DataStore.Add( DebugHelpers.GetCurrentContext()+"_"+this.player.name+":"+this.player.whoAmI+"_B", 1 );
        }
Exemple #2
0
        ////////////////

        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            var mymod = ModControlPanelMod.Instance;
            var cp    = ModContent.GetInstance <UIControlPanel>();

            try {
                if (mymod.ControlPanelHotkey != null && mymod.ControlPanelHotkey.JustPressed)
                {
                    if (cp != null)
                    {
                        if (cp.IsOpen)
                        {
                            ControlPanelTabs.CloseDialog();
                        }
                        else
                        {
                            ControlPanelTabs.OpenTab(UIControlPanel.DefaultTabName);
                        }
                    }
                }
            } catch (Exception e) {
                LogLibraries.Warn("(1) - " + e.ToString());
                return;
            }
        }
        ////////////////

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (this.AwaitingReport || this.CurrentModListItem == null || !ModFeaturesHelpers.HasGithub(this.CurrentModListItem.Mod))
            {
                this.DisableIssueInput();
            }
            else
            {
                this.EnableIssueInput();
            }

            if (this.ResetIssueInput)
            {
                this.ResetIssueInput = false;
                this.IssueTitleInput.SetText("");
                this.IssueBodyInput.SetText("");
            }

            if (this.RequestClose)
            {
                this.RequestClose = false;
                ControlPanelTabs.CloseDialog();
                return;
            }

            this.UpdateElements();
        }
Exemple #4
0
        ////////////////

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (this.RequestClose)
            {
                this.RequestClose = false;

                ControlPanelTabs.CloseDialog();

                return;
            }
        }
Exemple #5
0
        ////////////////

        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            var mymod = (PlayerStatisticsMod)this.mod;

            try {
                if (mymod.ControlPanelHotkey != null && mymod.ControlPanelHotkey.JustPressed)
                {
                    if (ControlPanelTabs.IsDialogOpen())
                    {
                        ControlPanelTabs.CloseDialog();
                    }
                    else
                    {
                        ControlPanelTabs.OpenTab(PlayerStatisticsMod.ControlPanelName);
                    }
                }
            } catch { }
        }