Example #1
0
        public static void AppendCustomInfo(this IMyTerminalBlock block, string message)
        {
            Action <IMyTerminalBlock, StringBuilder> action = (termBlock, builder) => builder.Append(message);

            block.AppendingCustomInfo += action;
            block.UpdateCustomInfo();
            block.AppendingCustomInfo -= action;
        }
Example #2
0
        public void StartGooeyProgramming()
        {
            Log.DebugLog("entered");

            using (MainLock.AcquireSharedUsing())
            {
                m_currentCommand = null;
                m_listCommands   = true;
                m_commandList.Clear();
                m_syntaxErrors.Clear();

                MyTerminalControls.Static.CustomControlGetter += CustomControlGetter;
                m_block.AppendingCustomInfo += m_block_AppendingCustomInfo;

                Commands = AutopilotTerminal.GetAutopilotCommands(m_block).ToString();
                foreach (ACommand comm in ParseCommands(Commands))
                {
                    m_commandList.Add(comm);
                }
                if (m_syntaxErrors.Length != 0)
                {
                    m_block.UpdateCustomInfo();
                }
                m_block.RebuildControls();
            }
        }