UnlimitedHugs / RimworldHugsLib

A lightweight shared library for Rimworld modding.
Other
245 stars 59 forks source link

Add restart option to QuickStart button #36

Closed FluffierThanThou closed 7 years ago

FluffierThanThou commented 7 years ago

I ran into some issues while trying to create a pull request, but would you consider changing QuickStartController.DrawDebugToolbarButton to be


        internal static void DrawDebugToolbarButton(WidgetRow widgets)
        {
            if (widgets.ButtonIcon(quickstartIconTex,
                "Open the quickstart settings.\n\nThis lets you automatically generate a map or load an existing save when the game is started.\nShift-click to quick-generate a new map.\nCtrl-click to restart RimWorld.")
            )
            {
                var stack = Find.WindowStack;
                if (HugsLibUtility.ShiftIsHeld)
                {
                    stack.TryRemove(typeof(Dialog_QuickstartSettings));
                    InitateMapGeneration();
                }
                else if (HugsLibUtility.ControlIsHeld)
                {
                    GenCommandLine.Restart();
                }
                else
                {
                    if (stack.IsOpen<Dialog_QuickstartSettings>())
                    {
                        stack.TryRemove(typeof(Dialog_QuickstartSettings));
                    }
                    else
                    {
                        stack.Add(new Dialog_QuickstartSettings());
                    }
                }
            }
        }

That would make me a happy kitten! 😹

UnlimitedHugs commented 7 years ago

I could do that, though there is already a key binding you can assign to restart the game. Would that work for you?

FluffierThanThou commented 7 years ago

There is? That would work too, I just thought the little button would be a logical place to add such a thing. Nice work on it btw ;).