Example #1
0
 public void ShowHirerachyDbgAction()
 {
     HostedDebugLog.Warning(this, "Part's model hierarchy:");
     DebugGui.DumpHierarchy(partModelTransform, partModelTransform);
     if (targetTransform != null)
     {
         HostedDebugLog.Warning(this, "Model hierarchy at target:");
         DebugGui.DumpHierarchy(targetTransform.root, targetTransform);
     }
 }
Example #2
0
 public void ShowHirerachyDbgAction()
 {
     if (FlightGlobals.ActiveVessel.isEVA)
     {
         var p = FlightGlobals.ActiveVessel.rootPart;
         DebugEx.Warning("Objects hierarchy in: {0}", p);
         DebugGui.DumpHierarchy(p.transform, p.transform);
     }
     else
     {
         DebugEx.Warning("The active vessel is not EVA!");
     }
 }
Example #3
0
 /// <inheritdoc/>
 public void OnGUI()
 {
     if (openGUIEvent != null && Event.current.Equals(openGUIEvent))
     {
         Event.current.Use();
         if (dlg == null)
         {
             dlg = DebugGui.MakePartDebugDialog(
                 DialogTitle, group: KISDebugAdjustableAttribute.DebugGroup);
         }
         else
         {
             DebugGui.DestroyPartDebugDialog(dlg);
             dlg = null;
         }
     }
 }
Example #4
0
 /// <inheritdoc/>
 public void OnGUI()
 {
     if (_openGuiEvent == null || !Event.current.Equals(_openGuiEvent))
     {
         return;
     }
     Event.current.Use();
     if (_dlg == null)
     {
         _dlg = DebugGui.MakePartDebugDialog(
             DialogTitle, group: KASDebugAdjustableAttribute.DebugGroup);
     }
     else
     {
         DebugGui.DestroyPartDebugDialog(_dlg);
         _dlg = null;
     }
 }
    public override IEnumerator PerformFirstPass()
    {
        Canvas   canvas = Service.Get <Canvas>();
        DebugGui componentInChildren = canvas.GetComponentInChildren <DebugGui>();

        if (componentInChildren != null)
        {
            PerformanceDisplay component = componentInChildren.GetComponent <PerformanceDisplay>();
            component.enabled = PerformanceDisplay;
            Service.Set(component);
            PrototypeDisplay      component2 = componentInChildren.GetComponent <PrototypeDisplay>();
            ContentVersionDisplay component3 = componentInChildren.GetComponent <ContentVersionDisplay>();
            component3.enabled = ContentVersionDisplay;
            component2.enabled = PrototypeDisplay;
            Service.Set(componentInChildren);
        }
        yield break;
    }
Example #6
0
        /// <summary>Creates a control, bound to a member.</summary>
        /// <param name="caption">The boolean control caption.</param>
        /// <param name="instance">The class instance that owns the member to manage.</param>
        /// <param name="fieldInfo">The field to manage.</param>
        /// <param name="propertyInfo">The property to manage.</param>
        /// <param name="onBeforeUpdate">
        /// The callback to call before changing the value. <see cref="InvalidOperationException"/> can be
        /// throws form this action to prevent the change.
        /// </param>
        /// <param name="onAfterUpdate">The callback to call when the value is changed.</param>
        public HermeticGUIControlClass(string caption, object instance,
                                       FieldInfo fieldInfo   = null, PropertyInfo propertyInfo = null,
                                       Action onBeforeUpdate = null, Action onAfterUpdate      = null)
            : base(instance, fieldInfo, propertyInfo, onBeforeUpdate, onAfterUpdate)
        {
            this.caption = caption;
            if (!GetMemberType().IsClass)
            {
                throw new ArgumentException("Unsupported type: " + GetMemberType());
            }
            var adjustables = new List <IRenderableGUIControl>();
            var obj         = GetMemberValue <object>();

            adjustableControls = new List <DebugGui.DebugMemberInfo>()
                                 .Concat(DebugGui.GetAdjustableFields(obj))
                                 .Concat(DebugGui.GetAdjustableProperties(obj))
                                 .Concat(DebugGui.GetAdjustableActions(obj))
                                 .Select(m => new StdTypesDebugGuiControl(
                                             m.attr.caption, obj,
                                             host: instance as IHasDebugAdjustables,
                                             fieldInfo: m.fieldInfo, propertyInfo: m.propertyInfo, methodInfo: m.methodInfo)
                                         )
                                 .ToArray();
        }
Example #7
0
 void Start()
 {
     debugGui = FindObjectOfType <DebugGui>();
 }