コード例 #1
0
        public static void FilleCommandBufferWithFileSystem(FillBufferFileSystemOptions option)
        {
            var commandBuffer = DataHolder.TerminalData.AvailableCommands;
            var data          = DataHolder.DeviceData.CurrentDevice.FileSystem;

            SList.Clear(commandBuffer);

            var currentDir = data.CurrentDir;

            if (option == FillBufferFileSystemOptions.IncludeAll || option == FillBufferFileSystemOptions.IncludeDir)
            {
                if (currentDir.ParentDir != null)
                {
                    SList.Add(commandBuffer, "..");
                }

                SList.Add(commandBuffer, ".");

                var childs = GetAllAvailableChild(currentDir);
                for (int i = 0; i < childs.Count; i++)
                {
                    SList.Add(commandBuffer, childs[i].FullPath);
                }
            }

            if (option == FillBufferFileSystemOptions.IncludeAll || option == FillBufferFileSystemOptions.IncludeFile)
            {
                var files = GetAvailableFilesFromDir(currentDir);
                for (int i = 0; i < files.Count; i++)
                {
                    SList.Add(commandBuffer, files[i].FullPath);
                }
            }

            TerminalUtil.ChangeToAvailableCommandsBuffer();
        }
コード例 #2
0
        public void TabPressed()
        {
            TerminalUtil.ChangeToAvailableCommandsBuffer();

            if (Time.time - LastTabPressedTime <= DoubleTabPressedInterval)
            {
                TerminalUtil.ShowAllCommandBufferOptions();
                LastTabPressedTime = 0;
            }
            else
            {
                LastTabPressedTime = Time.time;

                var shiftPressed = Input.GetKey(KeyCode.LeftShift);
                if (shiftPressed)
                {
                    TerminalUtil.NavigateCommandBuffer(-1, true);
                }
                else
                {
                    TerminalUtil.NavigateCommandBuffer(1, true);
                }
            }
        }
コード例 #3
0
 public static void UpdateDeviceRelatedGUI()
 {
     TerminalUtil.UpdateCurrentPathLabel();
     TerminalUtil.ChangeToAvailableCommandsBuffer();
     TerminalUtil.ResetCommandBufferIndex();
 }