//------------------------------------------------------------------------/ // Methods: Selection //------------------------------------------------------------------------/ private Color GetColor(TriggerBase triggerBase, TriggerSystem.ConnectionStatus status) { Color color = Color.white; switch (target.connectionDisplay) { case TriggerSystem.ConnectionDisplay.Selection: { switch (status) { case TriggerSystem.ConnectionStatus.Connected: color = connectedColor; break; case TriggerSystem.ConnectionStatus.Disconnected: //color = Color.white; break; case TriggerSystem.ConnectionStatus.Selected: //color = connectedColor; color = selectedColor; break; case TriggerSystem.ConnectionStatus.Disjoint: color = disconnectedColor; break; default: break; } } break; case TriggerSystem.ConnectionDisplay.Grouping: { //int colorIndex = -1; if (status == TriggerSystem.ConnectionStatus.Selected) { color = selectedColor; } if (connectivityGroups.ContainsKey(triggerBase)) { int colorIndex = connectivityGroups[triggerBase]; color = StratusGUIStyles.Colors.GetDistinct(colorIndex); } } break; } return(color); }
private TriggerSystem.ConnectionStatus GetStatus(Triggerable triggerable) { TriggerSystem.ConnectionStatus status = TriggerSystem.ConnectionStatus.Disconnected; if (selected) { if (selected == triggerable) { status = TriggerSystem.ConnectionStatus.Selected; } else if (selectedTrigger && connectedTriggerables.ContainsKey(triggerable) && connectedTriggerables[triggerable]) { status = TriggerSystem.ConnectionStatus.Connected; } } if (!IsConnected(triggerable) && selected != triggerable) { status = TriggerSystem.ConnectionStatus.Disjoint; } return(status); }
private void DrawTriggerable(Triggerable triggerable) { TriggerSystem.ConnectionStatus status = TriggerSystem.ConnectionStatus.Disconnected; if (selected) { if (selected == triggerable) { status = TriggerSystem.ConnectionStatus.Selected; } else if (selectedTrigger && connectedTriggerables.ContainsKey(triggerable) && connectedTriggerables[triggerable]) { status = TriggerSystem.ConnectionStatus.Connected; } } if (!IsConnected(triggerable) && selected != triggerable) { status = TriggerSystem.ConnectionStatus.Disjoint; } Color color = GetColor(triggerable, status); Draw(triggerable, color, SelectTriggerable, RemoveTriggerable, SetTriggerableContextMenu); }