Пример #1
0
        public DebugMenuState()
            : base("DebugMenu")
        {
            GuiWindow window = new GuiWindow(400, 500, "DEBUG");

            Add(window, 0, 0);

            int buttonIndex = 0;

            GuiButton testSerializationButton = new GuiButton("Serialization", -1);

            window.Add(testSerializationButton, 0, 50 + 40 * buttonIndex++);

            GuiButton ResetButton = new GuiButton("Reset", -1);

            ResetButton.ColorTransform = ColorTransform.BlackAndWhite;
            ResetButton.Color          = new Color(1f, 0.4f, 0.3f);
            window.Add(ResetButton, 0, 50 + 40 * buttonIndex++);

            testSerializationButton.OnMouseClicked += delegate {
                testDataSerialization();
            };

            ResetButton.OnMouseClicked += delegate {
                CoM.ConfirmAction(performGameReset, "Are you sure you want to reset the game?");
            };

            window.Add(Util.CreateBackButton(), 0, -10);
        }