public override void DoWindowContents(Rect inRect)
        {
            if (KeyBindingDefOf.Dev_ToggleDebugInspector.KeyDownEvent)
            {
                Event.current.Use();
                this.Close(true);
            }
            Text.Font = GameFont.Tiny;
            WidgetRow widgetRow = new WidgetRow(0f, 0f, UIDirection.RightThenUp, 99999f, 4f);

            widgetRow.ToggleableIcon(ref this.fullMode, TexButton.InspectModeToggle, "Toggle deep inspection mode for things on the map.", null, null);
            widgetRow.ToggleableIcon(ref DebugViewSettings.writeCellContents, TexButton.InspectModeToggle, "Toggle shallow inspection for things on the map.", null, null);
            if (widgetRow.ButtonText("Visibility", "Toggle what information should be reported by the inspector.", true, false))
            {
                Find.WindowStack.Add(new Dialog_DebugSettingsMenu());
            }
            if (widgetRow.ButtonText("Column Width +", "Make the columns wider.", true, false))
            {
                this.columnWidth += 20f;
                this.columnWidth  = Mathf.Clamp(this.columnWidth, 200f, 1600f);
            }
            if (widgetRow.ButtonText("Column Width -", "Make the columns narrower.", true, false))
            {
                this.columnWidth -= 20f;
                this.columnWidth  = Mathf.Clamp(this.columnWidth, 200f, 1600f);
            }
            inRect.yMin += 30f;
            Listing_Standard listing_Standard = new Listing_Standard(GameFont.Tiny);

            listing_Standard.ColumnWidth = Mathf.Min(this.columnWidth, inRect.width);
            listing_Standard.Begin(inRect);
            string[] array = this.debugStringBuilder.ToString().Split(new char[]
            {
                '\n'
            });
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string label = array2[i];
                listing_Standard.Label(label, -1f, null);
                listing_Standard.Gap(-9f);
            }
            listing_Standard.End();
            if (Event.current.type == EventType.Repaint)
            {
                this.debugStringBuilder = new StringBuilder();
                this.debugStringBuilder.Append(this.CurrentDebugString());
            }
        }
Пример #2
0
        public override void DoWindowContents(Rect inRect)
        {
            if (KeyBindingDefOf.Dev_ToggleDebugInspector.KeyDownEvent)
            {
                Event.current.Use();
                Close();
            }
            Text.Font = GameFont.Tiny;
            WidgetRow widgetRow = new WidgetRow(0f, 0f);

            widgetRow.ToggleableIcon(ref fullMode, TexButton.InspectModeToggle, "Toggle deep inspection mode for things on the map.");
            widgetRow.ToggleableIcon(ref DebugViewSettings.writeCellContents, TexButton.InspectModeToggle, "Toggle shallow inspection for things on the map.");
            if (widgetRow.ButtonText("Visibility", "Toggle what information should be reported by the inspector."))
            {
                Find.WindowStack.Add(new Dialog_DebugSettingsMenu());
            }
            if (widgetRow.ButtonText("Column Width +", "Make the columns wider."))
            {
                columnWidth += 20f;
                columnWidth  = Mathf.Clamp(columnWidth, 200f, 1600f);
            }
            if (widgetRow.ButtonText("Column Width -", "Make the columns narrower."))
            {
                columnWidth -= 20f;
                columnWidth  = Mathf.Clamp(columnWidth, 200f, 1600f);
            }
            inRect.yMin += 30f;
            Listing_Standard listing_Standard = new Listing_Standard(GameFont.Tiny);

            listing_Standard.ColumnWidth = Mathf.Min(columnWidth, inRect.width);
            listing_Standard.Begin(inRect);
            string[] array  = debugStringBuilder.ToString().Split('\n');
            string[] array2 = array;
            foreach (string label in array2)
            {
                listing_Standard.Label(label);
                listing_Standard.Gap(-9f);
            }
            listing_Standard.End();
            if (Event.current.type == EventType.Repaint)
            {
                debugStringBuilder = new StringBuilder();
                debugStringBuilder.Append(CurrentDebugString());
            }
        }
Пример #3
0
        private void DrawButtons()
        {
            WidgetRow widgetRow = new WidgetRow();

            if (widgetRow.ButtonIcon(TexButton.ToggleLog, "Open the debug log."))
            {
                ToggleLogWindow();
            }
            if (widgetRow.ButtonIcon(TexButton.ToggleTweak, "Open tweakvalues menu.\n\nThis lets you change internal values."))
            {
                ToggleTweakValuesMenu();
            }
            if (widgetRow.ButtonIcon(TexButton.OpenPackageEditor, "Open the package editor.\n\nThis lets you edit game data while the game is running."))
            {
                OpenPackageEditor();
            }
            if (widgetRow.ButtonIcon(TexButton.OpenInspectSettings, "Open the view settings.\n\nThis lets you see special debug visuals."))
            {
                ToggleDebugSettingsMenu();
            }
            if (widgetRow.ButtonIcon(TexButton.OpenDebugActionsMenu, "Open debug actions menu.\n\nThis lets you spawn items and force various events."))
            {
                ToggleDebugActionsMenu();
            }
            if (widgetRow.ButtonIcon(TexButton.OpenDebugActionsMenu, "Open debug logging menu."))
            {
                ToggleDebugLogMenu();
            }
            if (widgetRow.ButtonIcon(TexButton.OpenInspector, "Open the inspector.\n\nThis lets you inspect what's happening in the game, down to individual variables."))
            {
                ToggleDebugInspector();
            }
            if (Current.ProgramState == ProgramState.Playing)
            {
                if (widgetRow.ButtonIcon(TexButton.ToggleGodMode, "Toggle god mode.\n\nWhen god mode is on, you can build stuff instantly, for free, and sell things that aren't yours."))
                {
                    ToggleGodMode();
                }
                if (DebugSettings.godMode)
                {
                    Text.Font = GameFont.Tiny;
                    Widgets.Label(new Rect(0f, 25f, 200f, 100f), "God mode");
                }
                bool toggleable = Prefs.PauseOnError;
                widgetRow.ToggleableIcon(ref toggleable, TexButton.TogglePauseOnError, "Pause the game when an error is logged.");
                Prefs.PauseOnError = toggleable;
            }
        }