Example #1
0
 private void onInstanceFileRemoved(InstanceFileInterface fileInterface)
 {
     if (editInterface != null)
     {
         editInterface.removeSubInterface(fileInterface);
     }
 }
Example #2
0
 private void onInstanceFileAdded(InstanceFileInterface fileInterface)
 {
     if (editInterface != null)
     {
         editInterface.addSubInterface(fileInterface, fileInterface.getEditInterface());
     }
 }
Example #3
0
 private void processInstanceSelection(EditInterface editInterface)
 {
     if (editInterface.hasEditableProperties())
     {
         InstanceFileInterface instanceFile = editInterface.getEditableProperties().First() as InstanceFileInterface;
         if (instanceFile != null)
         {
             if (AddSelectable.HeldDown)
             {
                 controller.SelectionController.addSelectedObject(instanceFile);
             }
             else if (RemoveSelectable.HeldDown)
             {
                 controller.SelectionController.removeSelectedObject(instanceFile);
             }
             else
             {
                 controller.SelectionController.setSelectedObject(instanceFile);
             }
         }
         else
         {
             controller.SelectionController.clearSelection();
         }
     }
     else
     {
         controller.SelectionController.clearSelection();
     }
 }
Example #4
0
        private void destroySimObjectCallback(EditUICallback callback)
        {
            EditInterface selected = callback.getSelectedEditInterface();

            if (selected.hasEditableProperties())
            {
                InstanceFileInterface instanceFile = this.editInterface.resolveSourceObject <InstanceFileInterface>(selected);
                removeInstanceFile(instanceFile.Name);
            }
        }
Example #5
0
        public void removeInstanceFile(String instanceName)
        {
            InstanceFileInterface fileInterface = instanceFiles[instanceName];

            fileInterface.Deleted = true;
            fileInterface.Dispose();
            instanceFiles.Remove(instanceName);
            deletedInstances.Add(fileInterface);
            onInstanceFileRemoved(fileInterface);
        }
Example #6
0
        public void addInstance(Instance instance)
        {
            InstanceFileInterface fileInterface = new InstanceFileInterface(instance.Name, AnomalyIcons.Instance, InstanceWriter.Instance.getInstanceFileName(this, instance.Name), this, instance);

            if (instancesDisplayed)
            {
                fileInterface.createInstance(simObjectController);
            }
            instanceFiles.Add(instance.Name, fileInterface);
            onInstanceFileAdded(fileInterface);
        }
Example #7
0
        private void renameSimObjectCallback(EditUICallback callback)
        {
            callback.getInputString("Enter a name.", delegate(String input, ref String errorPrompt)
            {
                if (input == null || input == "")
                {
                    errorPrompt = "Please enter a non empty name.";
                    return(false);
                }
                if (this.instanceFiles.ContainsKey(input))
                {
                    errorPrompt = "That name is already in use. Please provide another.";
                    return(false);
                }

                InstanceFileInterface instanceFile = callback.getSelectedEditInterface().getEditableProperties().First() as InstanceFileInterface;
                SimObjectDefinition sourceObject   = instanceFile.Instance.Definition;
                SimObjectDefinition simObject      = copySaver.copyObject(sourceObject) as SimObjectDefinition;
                simObject.Name = input;
                createInstance(simObject);
                removeInstanceFile(instanceFile.Name);
                return(true);
            });
        }