Exemplo n.º 1
0
 /// <summary>
 /// Helper used to restore this slot's color from a
 /// drag-related highlighted state to whatever it should
 /// be otherwise. The color restored to usually depends
 /// on if it has an item stored in it currently.
 /// </summary>
 /// <param name="defaultViewColor">The default color for slots when nothing is stored and the slot has no special state.</param>
 public void AssignHighlighting(PGIView view)
 {
     if (view == null)
     {
         return;
     }
     if (Blocked)
     {
         HighlightColor = view.BlockedColor;
     }
     else if (Item != null)
     {
         HighlightColor = Item.Highlight;
     }
     else
     {
         HighlightColor = view.NormalColor;
     }
     if (view.BlockDisabledCells)
     {
         var pos = view.GetSlotLocation(this);
         if (view.Model.IsCellDisabled(pos.X, pos.Y))
         {
             HighlightColor = view.BlockedColor;
         }
     }
 }
Exemplo n.º 2
0
 void HandleViewUpdated(PGIView view)
 {
     if (View != null && CorrespondingCell != null)
     {
         CorrespondingCell.Blocked       = this.Blocked;
         CorrespondingCell.SkipAutoEquip = this.SkipAutoEquip;
     }
 }
        protected override void OnEnable()
        {
            TargetView = target as PGIView;

            //we need to do this because CustomEditor is kinda dumb
            //and won't expose the type we passed to it. Plus relfection
            //can't seem to get at the data either.
            EditorTargetType = typeof(PGIView);
            base.OnEnable();
        }
Exemplo n.º 4
0
 void HandleViewUpdate(PGIView view)
 {
     if (view.Model != null)
     {
         var slot = GetComponent <PGISlot>();
         var cell = slot.CorrespondingCell;
         if (cell != null)
         {
             cell.SkipAutoEquip = slot.SkipAutoEquip;
         }
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Helper used to restore this slot's color from a
 /// drag-related highlighted state to whatever it should
 /// be otherwise. The color restored to usually depends
 /// on if it has an item stored in it currently.
 /// </summary>
 /// <param name="defaultViewColor">The default color for slots when nothing is stored and the slot has no special state.</param>
 public void AssignHighlighting(PGIView view)
 {
     if (view == null)
     {
         return;
     }
     if (Blocked)
     {
         HighlightColor = view.BlockedColor;
     }
     else if (Item != null)
     {
         HighlightColor = Item.Highlight;
     }
     else
     {
         HighlightColor = view.NormalColor;
     }
 }
Exemplo n.º 6
0
        void OnEnable()
        {
            OldDragState      = ShoppersView.DisableDragging;
            OldDropState      = ShoppersView.DisableDropping;
            OldWorldDropState = ShoppersView.DisableWorldDropping;

            ShoppersView.DisableDragging      = true;
            ShoppersView.DisableDropping      = true;
            ShoppersView.DisableWorldDropping = true;
            var menu = ShoppersViewRoot.GetComponentInChildren <MenuEventHandlers>();

            menu.ChangeMenuState(true);

            ShopViewRoot.SetActive(true);
            ShopView = ShopViewRoot.GetComponentInChildren <PGIView>();


            ShoppersView.OnClickSlot.AddListener(ProcessSale);
            ShopView.OnClickSlot.AddListener(ProcessSale);
        }
Exemplo n.º 7
0
 void OnEnable()
 {
     RectTrans = transform as RectTransform;
     UpdateView();
     View = _View;
 }
Exemplo n.º 8
0
 void Start()
 {
     View = GetComponent <PGIView>();
 }