} // PropagateCounterparts // Recurse through a branch and attach the highlighter function to each part. public void HighlighterHook(Part AttachedPart) { // Remove the highlighter whenever called. Prevents highlighter stacking. AttachedPart.RemoveOnMouseEnter(ActivateHighlight); AttachedPart.RemoveOnMouseExit(DeactivateHighlight); if (true == DebugHighlightActive) { AttachedPart.AddOnMouseEnter(ActivateHighlight); AttachedPart.AddOnMouseExit(DeactivateHighlight); } if (null == AttachedPart.children) { return; } for (int IndexChildren = 0; IndexChildren < AttachedPart.children.Count; IndexChildren++) { HighlighterHook(AttachedPart.children[IndexChildren]); } }
public void Highlight(bool val) { // Set the variable to mark if this part is SUPPOSED to be hightlighted or not. this.highlighted = val; if (this.highlighted) { this.SetHighlighting(); // Set up an event handler to handle the mouse being moved away from this part while it is supposed to be being highlighted. Part.OnActionDelegate OnMouseExit = MouseExit; part.AddOnMouseExit(OnMouseExit); } else { // Remove the event handler that picks up on the mouse being moved away from the part when it is highlighted. Part.OnActionDelegate OnMouseExit = MouseExit; part.RemoveOnMouseExit(OnMouseExit); part.SetHighlightDefault(); this.part.SetHighlight(false); } }
// Recurse through a branch and attach the highlighter function to each part. public void HighlighterHook(Part AttachedPart) { //if (AttachedPart = null) { return; } // Remove the highlighter whenever called. Prevents highlighter stacking. AttachedPart.RemoveOnMouseEnter(ActivateHighlight); AttachedPart.RemoveOnMouseExit(DeactivateHighlight); if (true == DebugHighlightActive) { AttachedPart.AddOnMouseEnter(ActivateHighlight); AttachedPart.AddOnMouseExit(DeactivateHighlight); } if (null == AttachedPart.children) { return; } for (int IndexChildren = 0; IndexChildren < AttachedPart.children.Count; IndexChildren++) { HighlighterHook(AttachedPart.children[IndexChildren]); } }