예제 #1
0
    public void Install()
    {
        DoneLabel.Hide();

        var opts = OptionOffline.Pressed ? InstallerFrontend.InstallerOptions.Offline : InstallerFrontend.InstallerOptions.None;

        if (OptionForceBackup.Pressed)
        {
            opts |= InstallerFrontend.InstallerOptions.ForceBackup;
        }
        if (OptionForceHTTP.Pressed)
        {
            opts |= InstallerFrontend.InstallerOptions.HTTP;
        }
        if (OptionLeavePatchDLLs.Pressed)
        {
            opts |= InstallerFrontend.InstallerOptions.LeavePatchDLLs;
        }
        if (OptionSkipVersionCheck.Pressed)
        {
            opts |= InstallerFrontend.InstallerOptions.SkipVersionChecks;
        }

        var inst = new InstallerFrontend(opts);

        if (inst.HasETGModInstalled(GungeonPath.Text))
        {
            ETGModWarningDialog.Popup_();
            return;
        }

        if (OptionShowLog.Pressed)
        {
            LargeImage.Hide();
            InstallLog.Show();
        }

        InstallButton.Disabled  = true;
        SettingsButton.Disabled = true;
        ExeFileButton.Disabled  = true;

        var data = new InstallThreadUserdata {
            Component = OptionComponent.Text,
            ExePath   = GungeonPath.Text,
            Frontend  = inst
        };

        InstallationDone = false;
        InstallException = null;

        InstallErrorLabel.Hide();
        InstallErrorButtons.Hide();

        var thread = new Thread(new ThreadStart(() => InstallThread(data)));

        thread.Start();
    }
예제 #2
0
        public override void _Input(InputEvent @event)
        {
            if (@event.IsActionReleased("ui_console"))
            {
                if (ConsoleVisible)
                {
                    Window.Hide();
                    ConsoleVisible = false;
                }
                else
                {
                    Window.Popup_();
                    ConsoleLine.CallDeferred("grab_focus");
                    ConsoleVisible = true;
                }
            }

            if (ConsoleVisible)
            {
                if (@event.IsActionPressed("ui_accept"))
                {
                    Sys.Ref.Shared.GetNode <InterpreterSys>().ProcessScript(ConsoleLine.Text);
                    ConsoleLine.Clear();
                }

                if (@event.IsActionPressed("ui_autofill"))
                {
                    if (Autofill.GetChildCount() != 0)
                    {
                        string Text = Autofill.GetChild <Node>(0).GetNode <Label>("Alias").Text;
                        Text                      = Text.GetPartsFromBeginToIndex('(', 0) + '(';
                        ConsoleLine.Text          = Text;
                        ConsoleLine.CaretPosition = Text.Length;
                    }
                }
            }
        }