Ejemplo n.º 1
0
        protected override void onShown(EventArgs args)
        {
            base.onShown(args);
            if (firstShow)
            {
                firstShow = false;
                EditInterface editInterface = new EditInterface("Debug Visualizers");
                foreach (var debugInterface in pluginManager.DebugInterfaces)
                {
                    EditInterface        debugEditInterface = new EditInterface(debugInterface.Name);
                    EditablePropertyInfo propertyInfo       = new EditablePropertyInfo();
                    propertyInfo.addColumn(new EditablePropertyColumn("Name", true));
                    propertyInfo.addColumn(new EditablePropertyColumn("Value", false));
                    debugEditInterface.setPropertyInfo(propertyInfo);

                    debugEditInterface.addEditableProperty(new CallbackEditableProperty <bool>("Enabled",
                                                                                               () => debugInterface.Enabled, v => debugInterface.Enabled = v, canParseBool, bool.Parse));

                    debugEditInterface.addEditableProperty(new CallbackEditableProperty <bool>("Depth Testing",
                                                                                               () => debugInterface.DepthTesting, v => debugInterface.DepthTesting = v, canParseBool, bool.Parse));

                    foreach (var entry in debugInterface.Entries)
                    {
                        debugEditInterface.addEditableProperty(new CallbackEditableProperty <bool>(entry.Text,
                                                                                                   () => entry.Enabled, value => entry.Enabled = value, canParseBool, bool.Parse));
                    }

                    editInterface.addSubInterface(debugEditInterface);
                }

                objectEditor.EditInterface = editInterface;

                createDebugVisualizers();
            }
        }
Ejemplo n.º 2
0
        public EditInterface getEditInterface()
        {
            if (editInterface == null)
            {
                editInterface = new EditInterface(name + " Behavior Manager");

                phasesEditInterface = new EditInterface("Update Phases",
                                                        uiCallback =>
                {
                    addUpdatePhase(new BehaviorUpdatePhase());
                },
                                                        (uiCallback, property) =>
                {
                    removeUpdatePhase((BehaviorUpdatePhase)property);
                }, null);
                EditablePropertyInfo propertyInfo = new EditablePropertyInfo();
                propertyInfo.addColumn(new EditablePropertyColumn("Name", false));
                phasesEditInterface.setPropertyInfo(propertyInfo);
                foreach (var phase in updatePhases)
                {
                    addPhaseProperty(phase);
                }

                editInterface.addSubInterface(phasesEditInterface);
            }
            return(editInterface);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Get the EditInterface.
 /// </summary>
 /// <returns>The EditInterface.</returns>
 public EditInterface getEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = new EditInterface(name + " Subscene", addBinding, removeBinding, () =>
         {
             if (bindings.Any(b => b.SimElementManager == null))
             {
                 throw new ValidationException("Empty binding found. Please fill out all bindings or remove the empty listings.");
             }
         });
         EditablePropertyInfo propertyInfo = new EditablePropertyInfo();
         propertyInfo.addColumn(new EditablePropertyColumn("Name", false));
         propertyInfo.addColumn(new EditablePropertyColumn("Type", true));
         editInterface.setPropertyInfo(propertyInfo);
         foreach (SimSubSceneBinding binding in bindings)
         {
             editInterface.addEditableProperty(binding);
         }
     }
     return(editInterface);
 }