public bool IsSame(CGModuleSlot source, CGModuleSlot target) { return (ModuleID == source.Module.UniqueID && SlotName == source.Name && TargetModuleID == target.Module.UniqueID && TargetSlotName == target.Name); }
public static GUIStyle GetSlotLabelStyle(CGModuleSlot slot) { var st = new GUIStyle(); st.fixedHeight = 18; // Linked Slots => Bold // OnRequestProcessing => Green // Optional => Italic st.fontStyle = (slot.IsLinked) ? FontStyle.Bold : FontStyle.Normal; st.normal.textColor = new Color(1, 1, 1, 0.6f).SkinAwareColor(); bool isInput = (slot is CGModuleInputSlot); if (isInput) { var myInfo = slot.Info as InputSlotInfo; if (myInfo.Optional) { st.fontStyle = (st.fontStyle == FontStyle.Bold) ? st.fontStyle = FontStyle.BoldAndItalic : FontStyle.Italic; } if (slot.Module is IOnRequestProcessing || myInfo.RequestDataOnly) { st.normal.textColor = IOnRequestProcessingSlotColor.SkinAwareColor(); } st.alignment = TextAnchor.MiddleLeft; st.margin.left = 2; } else { if (slot.Module is IOnRequestProcessing) { st.normal.textColor = IOnRequestProcessingSlotColor.SkinAwareColor(); } st.alignment = TextAnchor.MiddleRight; st.margin.right = 2; } st.padding.bottom = 3; return(st); }
void startLinkDrag(CGModuleSlot slot) { Sel.Clear(); Canvas.LinkDragFrom = (CGModuleOutputSlot)slot; StatusBar.SetMessage("Hold <b><Ctrl></b> to quickly create & connect a module!"); }
public bool IsBetween(CGModuleSlot one, CGModuleSlot another) { return ((IsTo(one) && IsFrom(another)) || (IsTo(another) && IsFrom(one))); }
public bool IsFrom(CGModuleSlot s) { return (s.Module.UniqueID == ModuleID && s.Name == SlotName); }
public bool IsTo(CGModuleSlot s) { return (s.Module.UniqueID == TargetModuleID && s.Name == TargetSlotName); }
public CGModuleLink(CGModuleSlot source, CGModuleSlot target) : this(source.Module.UniqueID,source.Name,target.Module.UniqueID,target.Name) {}
public static GUIStyle GetSlotLabelStyle(CGModuleSlot slot) { var st = new GUIStyle(); st.fixedHeight = 18; // Linked Slots => Bold // OnRequestProcessing => Green // Optional => Italic st.fontStyle = (slot.IsLinked) ? FontStyle.Bold : FontStyle.Normal; st.normal.textColor = new Color(1,1,1,0.6f).SkinAwareColor(); bool isInput = (slot is CGModuleInputSlot); if (isInput) { var myInfo = slot.Info as InputSlotInfo; if (myInfo.Optional) { st.fontStyle = (st.fontStyle == FontStyle.Bold) ? st.fontStyle = FontStyle.BoldAndItalic : FontStyle.Italic; } if (slot.Module is IOnRequestProcessing || myInfo.RequestDataOnly) st.normal.textColor = IOnRequestProcessingSlotColor.SkinAwareColor(); st.alignment = TextAnchor.MiddleLeft; st.margin.left = 2; } else { if (slot.Module is IOnRequestProcessing) st.normal.textColor = IOnRequestProcessingSlotColor.SkinAwareColor(); st.alignment = TextAnchor.MiddleRight; st.margin.right = 2; } st.padding.bottom = 3; return st; }
void startLinkDrag(CGModuleSlot slot) { Sel.Clear(); Canvas.LinkDragFrom = (CGModuleOutputSlot)slot; StatusBar.SetMessage("Hold <b><Ctrl></b> to quickly create & connect a module!"); }