public static void DrawModSettingsButton(Listing_Standard listing)
        {
            var prevColor = GUI.color;

            GUI.color = ButtonColor;
            if (listing.ButtonText("HugsLib_settings_btn".Translate()))
            {
                HugsLibUtility.OpenModSettingsDialog();
            }
            GUI.color = prevColor;
        }
Example #2
0
        public static void OnGUI()
        {
            if (Event.current.type != EventType.KeyDown)
            {
                return;
            }
            var useEvent = false;

            if (HugsLibKeyBindings.PublishLogs.JustPressed && HugsLibUtility.ControlIsHeld)
            {
                if (HugsLibUtility.AltIsHeld)
                {
                    HugsLibController.Instance.LogUploader.CopyToClipboard();
                }
                else
                {
                    HugsLibController.Instance.LogUploader.ShowPublishPrompt();
                }
                useEvent = true;
            }
            if (HugsLibKeyBindings.OpenLogFile.JustPressed)
            {
                ShellOpenLog.Execute();
                useEvent = true;
            }
            if (HugsLibKeyBindings.RestartRimworld.JustPressed)
            {
                GenCommandLine.Restart();
                useEvent = true;
            }
            if (HugsLibKeyBindings.HLOpenModSettings.JustPressed)
            {
                HugsLibUtility.OpenModSettingsDialog();
                useEvent = true;
            }
            if (HugsLibKeyBindings.HLOpenUpdateNews.JustPressed)
            {
                HugsLibController.Instance.UpdateFeatures.TryShowDialog(true);
                useEvent = true;
            }
            if (useEvent)
            {
                Event.current.Use();
            }
        }