public static void OnGUI()
 {
     if (Event.current.type != EventType.KeyDown)
     {
         return;
     }
     if (HugsLibKeyBindings.PublishLogs.JustPressed && HugsLibUtility.ControlIsHeld)
     {
         if (HugsLibUtility.AltIsHeld)
         {
             HugsLibController.Instance.LogUploader.CopyToClipboard();
         }
         else
         {
             HugsLibController.Instance.LogUploader.ShowPublishPrompt();
         }
     }
     if (HugsLibKeyBindings.OpenLogFile.JustPressed)
     {
         ShellOpenLog.Execute();
     }
     if (HugsLibKeyBindings.RestartRimworld.JustPressed)
     {
         GenCommandLine.Restart();
     }
 }
Exemplo n.º 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();
            }
        }
 public static void OnGUI()
 {
     if (Event.current.type != EventType.KeyDown)
     {
         return;
     }
     if (HugsLibKeyBingings.PublishLogs.JustPressed && HugsLibUtility.ControlIsHeld)
     {
         HugsLibController.Instance.LogUploader.ShowPublishPrompt();
     }
     if (HugsLibKeyBingings.OpenLogFile.JustPressed)
     {
         ShellOpenLog.Execute();
     }
     if (HugsLibKeyBingings.RestartRimworld.JustPressed)
     {
         LongEventHandler.ExecuteWhenFinished(GenCommandLine.Restart);
     }
 }
 private static void AddOwnWidgets()
 {
     // publish logs button
     AddLogWindowWidget((window, area, message, row) => {
         var prevColor = GUI.color;
         GUI.color     = shareButtonColor;
         if (row.ButtonText("HugsLib_logs_shareBtn".Translate()))
         {
             HugsLibController.Instance.LogUploader.ShowPublishPrompt();
         }
         GUI.color = prevColor;
     });
     // Files drop-down menu
     AddLogWindowWidget((window, area, message, row) => {
         if (row.ButtonText("HugsLib_logs_filesBtn".Translate()))
         {
             Find.WindowStack.Add(new FloatMenu(new List <FloatMenuOption> {
                 new FloatMenuOption("HugsLib_logs_openLogFile".Translate(), () => {
                     ShellOpenLog.Execute();
                 }),
                 new FloatMenuOption("HugsLib_logs_openSaveDir".Translate(), () => {
                     ShellOpenDirectory.Execute(GenFilePaths.SaveDataFolderPath);
                 }),
                 new FloatMenuOption("HugsLib_logs_openModsDir".Translate(), () => {
                     ShellOpenDirectory.Execute(GenFilePaths.ModsFolderName);
                 })
             }));
         }
     });
     // copy button
     AddLogWindowWidget((window, area, message, row) => {
         if (message != null)
         {
             if (row.ButtonText("HugsLib_logs_copy".Translate()))
             {
                 CopyMessage(message);
             }
         }
     }, WidgetAlignMode.Right);
 }