Example #1
0
 public bool IsSame(CGModuleSlot source, CGModuleSlot target)
 {
     return (ModuleID == source.Module.UniqueID &&
             SlotName == source.Name &&
             TargetModuleID == target.Module.UniqueID &&
             TargetSlotName == target.Name);
 }
Example #2
0
        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);
        }
Example #3
0
 void startLinkDrag(CGModuleSlot slot)
 {
     Sel.Clear();
     Canvas.LinkDragFrom = (CGModuleOutputSlot)slot;
     StatusBar.SetMessage("Hold <b><Ctrl></b> to quickly create & connect a module!");
 }
Example #4
0
 public bool IsBetween(CGModuleSlot one, CGModuleSlot another)
 {
     return ((IsTo(one) && IsFrom(another)) ||
            (IsTo(another) && IsFrom(one)));
 }
Example #5
0
 public bool IsFrom(CGModuleSlot s)
 {
     return (s.Module.UniqueID == ModuleID && s.Name == SlotName);
 }
Example #6
0
 public bool IsTo(CGModuleSlot s)
 {
     return (s.Module.UniqueID == TargetModuleID && s.Name == TargetSlotName);
 }
Example #7
0
 public CGModuleLink(CGModuleSlot source, CGModuleSlot target) : this(source.Module.UniqueID,source.Name,target.Module.UniqueID,target.Name) {}
Example #8
0
        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;
        }
Example #9
0
 void startLinkDrag(CGModuleSlot slot)
 {
     Sel.Clear();
     Canvas.LinkDragFrom = (CGModuleOutputSlot)slot;
     StatusBar.SetMessage("Hold <b><Ctrl></b> to quickly create & connect a module!");
 }