Esempio n. 1
0
        public void PrintLine(string line)
        {
            TextDisplay disp = console.display;

            disp.Print(line);
            disp.Print(disp.delimiter);
        }
Esempio n. 2
0
        void GetCommand()
        {
            if (console.InputInProgress())
            {
                return;                                                 // already working on it!
            }
            TextDisplay disp = console.display;

            if (disp.GetCursor().col != 0)
            {
                disp.NextLine();
            }
            string prompt = (interpreter.NeedMoreInput() ? "...]" : "]");
            Value  promptVal;

            if (env.map.TryGetValue(new ValString(
                                        interpreter.NeedMoreInput() ? "morePrompt" : "prompt"), out promptVal))
            {
                prompt = promptVal.ToString();
            }
            disp.Print(prompt);
            //autocompleter.machine = interpreter.vm;
            //console.autocompCallback = autocompleter.GetSuggestion;
            console.StartInput();
        }
Esempio n. 3
0
        void Clear()
        {
            TextDisplay disp = console.display;

            disp.Clear();
            disp.SetCursor(disp.rows - 1, 0);
        }
Esempio n. 4
0
        public Console(Shell owner)
            : base(Game1.uiViewport.Width / 2 - width / 2, Game1.uiViewport.Height / 2 - height / 2, width, height)
        {
            this.owner = owner;

            screenArea = new Rectangle(20 * drawScale, 18 * drawScale, 160 * drawScale, 120 * drawScale);       // 640x480 (VGA)!

            screenOverlay = ModEntry.helper.Content.Load <Texture2D>("assets/ScreenOverlay.png");
            screenSrcR    = new Rectangle(0, 0, 200, 160);

            innerSrcR = new Rectangle(20, 18, 160, 120);

            display             = new TextDisplay();
            display.onScrolled += NoteScrolled;
            display.backColor   = new Color(0.31f, 0.11f, 0.86f);
            display.Clear();

            var colors = new Color[] { Color.Red, Color.Yellow, Color.Green, Color.Purple };

            display.SetCursor(19, 1);
            for (int i = 0; i < 4; i++)
            {
                display.textColor = colors[i]; display.Print("*");
            }
            display.textColor = Color.Azure; display.Print(" MiniScript M-1 Home Computer ");
            for (int i = 0; i < 4; i++)
            {
                display.textColor = colors[3 - i]; display.Print("*");
            }
            display.textColor = Color.White;
            display.NextLine(); display.NextLine();
            display.PrintLine("Ready.");
            display.NextLine();

            keyBuffer = new Queue <char>();
            history   = new List <string>();

            keyWatchers = new List <KeyWatcher>()
            {
                new KeyWatcher(SButton.Left, (char)kLeftArrow),
                new KeyWatcher(SButton.Right, (char)kRightArrow),
                new KeyWatcher(SButton.Down, (char)kDownArrow),
                new KeyWatcher(SButton.Up, (char)kUpArrow),
                new KeyWatcher(SButton.Delete, (char)kFwdDelete)
            };

            whiteTex = new Texture2D(Game1.graphics.GraphicsDevice, 1, 1);
            whiteTex.SetData(new[] { Color.White });
        }