Beispiel #1
0
        /// <summary>
        /// Fills in the defined color keys of the opened simulation
        /// </summary>
        public static void UpdateColorKeys(TextEdit textEdit, IProcessingData processingData)
        {
            textEdit.ClearColors();
            List <string> booleanInputKeys = processingData.InputRegisters.BooleanKeys;

            foreach (string key in booleanInputKeys)
            {
                textEdit.AddKeywordColor(key, BooleanInputColor);
            }
            foreach (string key in St.Boolean.Constant.Values)
            {
                textEdit.AddKeywordColor(key, BooleanInputColor);
            }
            List <string> booleanOutputKeys = processingData.OutputRegisters.BooleanKeys;

            foreach (string key in booleanOutputKeys)
            {
                textEdit.AddKeywordColor(key, BooleanOutputColor);
            }

            List <string> IntegerInputKeys = processingData.InputRegisters.IntegerKeys;

            foreach (string key in IntegerInputKeys)
            {
                textEdit.AddKeywordColor(key, IntegerInputColor);
            }
            // Godot already forces integer static inputs and colors them. (They can not be deleted so far)
            textEdit.AddColorOverride("number_color", IntegerInputColor);
            List <string> IntegerOutputKeys = processingData.OutputRegisters.IntegerKeys;

            foreach (string key in IntegerOutputKeys)
            {
                textEdit.AddKeywordColor(key, IntegerInputColor);
            }
        }
        /// <summary>
        /// Fills in the defined color keys of the opened simulation
        /// </summary>
        public static void UpdateColorKeys(TextEdit textEdit, IProcessingData data)
        {
            textEdit.ClearColors();
            List <string> booleanKeys = data.InputRegisters.BooleanKeys;

            foreach (string key in booleanKeys)
            {
                textEdit.AddKeywordColor(key, BooleanInputColor);
            }
            foreach (string key in St.Boolean.Constant.Values)
            {
                textEdit.AddKeywordColor(key, BooleanInputColor);
            }
            foreach (string key in St.Boolean.LogicalCombination.Values)
            {
                textEdit.AddKeywordColor(key, BooleanCommandColor);
            }
            foreach (string key in St.Boolean.LogicalInverter.Values)
            {
                textEdit.AddKeywordColor(key, BooleanCommandColor);
            }
            List <string> IntegerKeys = data.InputRegisters.IntegerKeys;

            foreach (string key in IntegerKeys)
            {
                textEdit.AddKeywordColor(key, IntegerInputColor);
            }
            // Godot already forces integer static inputs and colors them. (They can not be deleted so far)
            textEdit.AddColorOverride("number_color", IntegerInputColor);
            foreach (string key in St.Boolean.RelationalOperation.Values)
            {
                textEdit.AddKeywordColor(key, IntegerCommandColor);
            }

            // Godot forces member variable color according to member_variable_color
            // Godot also forces the "class" color and access without any known possibility to change or override them.
            textEdit.AddColorOverride("member_variable_color", IntegerInputColor);
            foreach (string key in data.IntVariables)
            {
                textEdit.AddKeywordColor(key, StepInputColor);
            }
        }