Пример #1
0
    public override string GetNumber(string message)
    {
        string result = string.Empty;

        // Experimental code (not based on NAGI)
        bool inputEditDisabled = !this.InputEditEnabled;

        this.EnableInput();
        this.SoundManager.StopPlaying();

        var inputBox = new InputBoxControl(this.Interpreter)
        {
            Title         = message + "\n\n",
            Text          = string.Empty,
            Width         = 25,
            MaxTextLength = 25,
        };

        if (inputBox.DoModal())
        {
            result = inputBox.Text;
        }

        if (inputEditDisabled)
        {
            this.DisableInput();
        }

        this.RedrawInput();

        return(result);
    }
Пример #2
0
    private void InputBoxPollStart(string text)
    {
        bool inputEditDisabled = !this.InputEditEnabled;

        this.EnableInput();
        this.SoundManager.StopPlaying();

        var inputBox = new InputBoxControl(this.Interpreter)
        {
            Title = UserInterface.InputBox,
            Text  = text,
        };

        bool result = inputBox.DoModal();

        if (inputEditDisabled)
        {
            this.DisableInput();
        }

        if (result)
        {
            this.Input         = inputBox.Text;
            this.InputPrevious = this.Input;
            this.Interpreter.ParseText(this.Input);
            this.Input = string.Empty;
            this.RedrawInput();
        }
    }
Пример #3
0
    public override string GetString(string message, int maxLength, byte row, byte column)
    {
        string result = string.Empty;

        // Experimental code (not based on NAGI)
        // TODO: Looks like V3 games do not use input box for get.string
        // (based on kq4 and gr)
        bool inputDisabled = !this.InputEditEnabled;

        this.EnableInput();
        this.SoundManager.StopPlaying();

        var inputBox = new InputBoxControl(this.Interpreter)
        {
            Title         = message + "\n\n",
            Text          = string.Empty,
            Width         = 25,
            MaxTextLength = maxLength,
        };

        if (inputBox.DoModal())
        {
            result = inputBox.Text;
        }

        if (inputDisabled)
        {
            this.DisableInput();
        }

        this.RedrawInput();

        return(result);
    }
Пример #4
0
    public bool DoModal()
    {
        string error;

        do
        {
            var inputBox = new InputBoxControl(this.Interpreter)
            {
                Title = this.Title,
                Text  = this.FolderPath,
            };

            if (inputBox.DoModal())
            {
                if (Directory.Exists(inputBox.Text))
                {
                    this.FolderPath = inputBox.Text;
                    return(true);
                }

                error = string.Format(CultureInfo.CurrentCulture, UserInterface.SavePathDoesNotExistFormat, inputBox.Text);
            }
            else
            {
                this.FolderPath = string.Empty;
                return(false);
            }
        }while (this.Interpreter.Prompt(error));

        this.FolderPath = string.Empty;
        return(false);
    }