示例#1
0
文件: Console.cs 项目: tarsupin/Nexus
 public void Open()
 {
     UIHandler.SetMenu(this, true);
     ConsoleTrack.ResetValues();
     ConsoleTrack.PrepareTabLookup(this.consoleDict, "", this.baseHelperText);
     if (!this.beenOpened)
     {
         this.OnFirstOpen();
     }
     this.OnOpen();
 }
示例#2
0
文件: Console.cs 项目: tarsupin/Nexus
        public void SendCommand(string insText, bool setActivate = true)
        {
            if (setActivate)
            {
                ConsoleTrack.activate = true;
            }                                                             // The instruction is meant to run (rather than just reveal new text hints).
            ConsoleTrack.instructionText = insText;

            // Process the Instruction
            this.ProcessInstruction(ConsoleTrack.instructionText);

            if (ConsoleTrack.activate)
            {
                // Track Written Lines
                this.consoleLines.AddFirst(ConsoleTrack.instructionText);

                // If we're in the console save slots, save the instruction to the appropriate slot:
                if (this.lineNum > 0 && this.lineNum <= 5)
                {
                    Systems.settings.input.consoleDown[this.lineNum - 1] = ConsoleTrack.instructionText;
                    Systems.settings.input.SaveSettings();
                }

                // If there are over 20 lines, remove the last one.
                if (this.consoleLines.Count > 20)
                {
                    this.consoleLines.RemoveLast();
                }

                // Cleanup
                this.lineNum = 0;
                ConsoleTrack.ResetValues();
                ConsoleTrack.PrepareTabLookup(this.baseHelperText);
                ConsoleTrack.possibleTabs = "Options: " + String.Join(", ", this.consoleDict.Keys.ToArray());
            }
        }