Beispiel #1
0
        public void setMaterialName(string newName)
        {
            GuiTreeViewCtrl matLibTree = this.findObjectByInternalName("matLibTree", true);
            SimObject       mat        = this["activeMat"];

            if (mat.internalName != newName)
            {
                SimObject existingMat = ((SimSet)"TerrainMaterialSet").findObjectByInternalName(newName, true);
                if (existingMat.isObject())
                {
                    messageBox.MessageBoxOK("Error", "There already is a terrain material called '" + newName + "'.");
                }
                else
                {
                    mat.setInternalName(newName);
                    matLibTree.buildVisibleTree(false);
                }
            }
        }
Beispiel #2
0
        public static void InspectApply()
        {
            GuiInspector    InspectFields             = "InspectFields";
            GuiTextEditCtrl InspectObjectName         = "InspectObjectName";
            GuiTextEditCtrl InspectObjectInternalName = "InspectObjectInternalName";

            SimObject obj = InspectObjectName["refObj"];

            if (!obj.isObject())
            {
                return;
            }

            // Update name and internal name
            obj.setName(InspectObjectName.getValue());
            obj.setInternalName(InspectObjectInternalName.getValue());

            // Update inspected object information.
            InspectFields.inspect(obj);
        }