Пример #1
0
 public void PopulateUI(CathodeString cString, cGUID paramID)
 {
     stringVal = cString;
     STRING_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     textBox1.Text = cString.value;
     //textBox1.DataBindings.Add("Text", cString.value, "");
 }
Пример #2
0
 public void PopulateUI(CathodeBool cBool, cGUID paramID)
 {
     boolVal = cBool;
     BOOL_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     checkBox1.Checked        = cBool.value;
     //checkBox1.DataBindings.Add("Checked", cBool.value, "");
 }
Пример #3
0
 public void PopulateUI(CathodeEnum cEnum, cGUID paramID)
 {
     enumVal = cEnum;
     ENUM_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     comboBox1.Text           = NodeDB.GetEnum(cEnum.enumID).Name;
     //comboBox1.Enabled = false;
     //numericUpDown8.Value = cEnum.enumIndex;
     textBox1.Text = cEnum.enumIndex.ToString();
     //numericUpDown8.DataBindings.Add("Value", cEnum.enumIndex, "");
 }
 public void PopulateUI(CathodeVector3 cVec, cGUID paramID)
 {
     vectorVal = cVec;
     VECTOR_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     POS_X_1.Value = (decimal)cVec.value.x;
     POS_Y_1.Value = (decimal)cVec.value.y;
     POS_Z_1.Value = (decimal)cVec.value.z;
     //POS_X_1.DataBindings.Add("Value", (decimal)cVec.value.X, "");
     //POS_Y_1.DataBindings.Add("Value", (decimal)cVec.value.Y, "");
     //POS_Z_1.DataBindings.Add("Value", (decimal)cVec.value.Z, "");
 }
Пример #5
0
        public static string GetEntityName(cGUID id)
        {
            string id_string         = id.ToString();
            ShortGUIDDescriptor desc = customNodeNames.FirstOrDefault(o => o.ID_cachedstring == id_string);

            if (desc == null)
            {
                return(NodeDB.GetEditorName(id));
            }
            return(desc.Description);
        }
Пример #6
0
        //Get parameter/entity name
        //We fall through to NodeDB here which means we can replace all NodeDB calls to Cathode/Editor name in the GUI app
        public static string GetParameterName(cGUID id)
        {
            string id_string         = id.ToString();
            ShortGUIDDescriptor desc = customParamNames.FirstOrDefault(o => o.ID_cachedstring == id_string);

            if (desc == null)
            {
                return(NodeDB.GetCathodeName(id, CurrentInstance.commandsPAK));
            }
            return(desc.Description);
        }
Пример #7
0
        //Add new param/node names
        public static void AddNewParameterName(cGUID id, string name)
        {
            ShortGUIDDescriptor desc = customParamNames.FirstOrDefault(o => o.ID == id);

            if (desc != null)
            {
                desc.Description = name;
            }
            else
            {
                customParamNames.Add(new ShortGUIDDescriptor {
                    ID = id, ID_cachedstring = id.ToString(), Description = name
                });
            }
        }
Пример #8
0
        //--
        public static void AddNewNodeName(cGUID id, string name)
        {
            ShortGUIDDescriptor desc = customNodeNames.FirstOrDefault(o => o.ID == id);

            if (desc != null)
            {
                desc.Description = name;
            }
            else
            {
                customNodeNames.Add(new ShortGUIDDescriptor {
                    ID = id, ID_cachedstring = id.ToString(), Description = name
                });
            }
            EditorUtils.PurgeEntityNameFromCache(id);
        }
Пример #9
0
        public void PopulateUI(CathodeResource cResource, cGUID paramID, CathodeFlowgraph selected_flowgraph)
        {
            GUID_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
            resRef = cResource;

            if (cResource.resourceID.val != null)
            {
                textBox2.Text = BitConverter.ToString(new byte[] { cResource.resourceID.val[0] });
                textBox3.Text = BitConverter.ToString(new byte[] { cResource.resourceID.val[1] });
                textBox5.Text = BitConverter.ToString(new byte[] { cResource.resourceID.val[2] });
                textBox4.Text = BitConverter.ToString(new byte[] { cResource.resourceID.val[3] });
            }

            /*
             * List<RenderableElement> redsList = new List<RenderableElement>();
             * CathodeResourceReference resRef = selected_flowgraph.resources.FirstOrDefault(o => o.resourceRefID == cResource.resourceID);
             * if (resRef == null || resRef.entryType != CathodeResourceReferenceType.RENDERABLE_INSTANCE) return;
             * for (int p = 0; p < resRef.entryCountREDS; p++) redsList.Add(redsBIN.GetRenderableElement(resRef.entryIndexREDS + p));
             * if (resRef.entryCountREDS != redsList.Count || redsList.Count == 0) return; //TODO: handle this nicer
             * CathodeEditorGUI_EditResource res_editor = new CathodeEditorGUI_EditResource(modelPAK.GetCS2s(), redsList);
             * res_editor.Show();
             * res_editor.EditComplete += new FinishedEditingIndexes(res_editor_submitted);
             */
        }
Пример #10
0
 public void PopulateUI_Int(CathodeInteger cInt, cGUID paramID)
 {
     isIntInput = true;
     intVal     = cInt;
     NUMERIC_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     textBox1.Text = cInt.value.ToString();
 }
Пример #11
0
 public void PopulateUI_Float(CathodeFloat cFloat, cGUID paramID)
 {
     floatVal = cFloat;
     NUMERIC_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     textBox1.Text = cFloat.value.ToString();
 }
        private void button1_Click(object sender, EventArgs e)
        {
            if (param_name.Text == "")
            {
                return;
            }
            cGUID thisParamID = Utilities.GenerateGUID(param_name.Text);

            foreach (CathodeLoadedParameter param in node.parameters)
            {
                if (param.paramID == thisParamID)
                {
                    MessageBox.Show("This parameter already exists on the entity!");
                    return;
                }
            }

            CathodeParameter thisParam = null;

            switch ((CathodeDataType)param_datatype.SelectedIndex)
            {
            case CathodeDataType.POSITION:
                thisParam = new CathodeTransform();
                break;

            case CathodeDataType.FLOAT:
                thisParam = new CathodeFloat();
                break;

            case CathodeDataType.FILEPATH:
            case CathodeDataType.STRING:
                thisParam = new CathodeString();
                break;

            case CathodeDataType.SPLINE_DATA:
                thisParam = new CathodeSpline();
                break;

            case CathodeDataType.ENUM:
                thisParam = new CathodeEnum();
                ((CathodeEnum)thisParam).enumID = new cGUID("4C-B9-82-48");     //ALERTNESS_STATE is the first alphabetically
                break;

            case CathodeDataType.SHORT_GUID:
                thisParam = new CathodeResource();
                ((CathodeResource)thisParam).resourceID = new cGUID("00-00-00-00");
                break;

            case CathodeDataType.BOOL:
                thisParam = new CathodeBool();
                break;

            case CathodeDataType.DIRECTION:
                thisParam = new CathodeVector3();
                break;

            case CathodeDataType.INTEGER:
                thisParam = new CathodeInteger();
                break;
            }
            node.parameters.Add(new CathodeLoadedParameter(thisParamID, thisParam));

            //If this parameter doesn't come up in the CATHODE string table, add it to our own
            if (NodeDB.GetCathodeName(thisParamID) == thisParamID.ToString())
            {
                NodeDBEx.AddNewParameterName(thisParamID, param_name.Text);
            }

            this.Close();
        }
Пример #13
0
 public void PopulateUI(CathodeSpline cSpline, cGUID paramID)
 {
     UNIMPLEMENTED_VARIABLE_TYPE.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     //todo: dynamically populate UI
 }
 public void PopulateUI(CathodeTransform cTrans, cGUID paramID)
 {
     transformVal = cTrans;
     POSITION_VARIABLE_DUMMY.Text = NodeDBEx.GetParameterName(paramID) + " (" + paramID.ToString() + ")";
     POS_X.Value = (decimal)cTrans.position.x;
     POS_Y.Value = (decimal)cTrans.position.y;
     POS_Z.Value = (decimal)cTrans.position.z;
     ROT_X.Value = (decimal)cTrans.rotation.x;
     ROT_Y.Value = (decimal)cTrans.rotation.y;
     ROT_Z.Value = (decimal)cTrans.rotation.z;
     //POS_X.DataBindings.Add("Value", (decimal)cTrans.position.X, "");
     //POS_Y.DataBindings.Add("Value", (decimal)cTrans.position.Y, "");
     //POS_Z.DataBindings.Add("Value", (decimal)cTrans.position.Z, "");
     //ROT_X.DataBindings.Add("Value", (decimal)cTrans.rotation.X, "");
     //ROT_Y.DataBindings.Add("Value", (decimal)cTrans.rotation.Y, "");
     //ROT_Z.DataBindings.Add("Value", (decimal)cTrans.rotation.Z, "");
 }