// Token: 0x060000E3 RID: 227 RVA: 0x00011B94 File Offset: 0x0000FD94 private void UpdateCursor() { if (UIItemSlot.mDraggedItem != null && UIItemSlot.mDraggedItem.baseItem != null) { UICursor.Set(UIItemSlot.mDraggedItem.baseItem.iconAtlas as INGUIAtlas, UIItemSlot.mDraggedItem.baseItem.iconName); return; } UICursor.Clear(); }
void Clear() { Grid_N.SetActiveGrid(null); UICursor.Clear(); mIcontex.enabled = false; mIcontex.mainTexture = null; //mCurrenReq = null; mItemSample = null; }
/// <summary> /// Set the cursor to the icon of the item being dragged. /// </summary> void UpdateCursor() { if (mDraggedItem != null && mDraggedItem.baseItem != null) { UICursor.Set(mDraggedItem.baseItem.iconAtlas, mDraggedItem.baseItem.iconName); } else { UICursor.Clear(); } }
// Token: 0x06000035 RID: 53 RVA: 0x0000925C File Offset: 0x0000765C private void UpdateCursor() { if (UIItemSlot.mDraggedItem != null && UIItemSlot.mDraggedItem.baseItem != null) { UICursor.Set(UIItemSlot.mDraggedItem.baseItem.iconAtlas, UIItemSlot.mDraggedItem.baseItem.iconName); } else { UICursor.Clear(); } }
protected virtual void DoDisplayCursor(bool state) { if (state) { UICursor.Set(this.m_Sprite, this.m_Size, false, this.m_AnimatorState); } else { UICursor.Clear(); } }
//Detects the release of the mouse button public virtual void OnPointerUp(PointerEventData eventData) { if (!eventData.dragging) { Stack stack = InventoryManager.UI.stack; bool isUnstacking = stack != null && stack.item != null; //Check if we are currently unstacking the item if (isUnstacking && Container.StackOrAdd(this, stack.item)) { stack.item = null; UICursor.Clear(); } if (isUnstacking) { return; } if (Container.useButton.HasFlag((InputButton)Mathf.Clamp(((int)eventData.button * 2), 1, int.MaxValue)) && ObservedItem != null) { if (Container.UseContextMenu) { UIWidgets.ContextMenu menu = InventoryManager.UI.contextMenu; if (menu == null) { return; } menu.Clear(); if (Trigger.currentUsedTrigger != null && Trigger.currentUsedTrigger is VendorTrigger && Container.CanSellItems) { menu.AddMenuItem("Sell", Use); } else if (ObservedItem is UsableItem) { menu.AddMenuItem("Use", Use); } if (ObservedItem.MaxStack > 1 || ObservedItem.MaxStack == 0) { menu.AddMenuItem("Unstack", Unstack); } menu.AddMenuItem("Drop", DropItem); menu.Show(); } else { Use(); } } } }
void OnDeleteBtn() { if (m_SplitWnd.gameObject.activeInHierarchy) { return; } if (m_OpType == 2) { m_OpType = 0; UICursor.Clear(); } else { m_OpType = 2; UICursor.Set(mNewUIAtlas, "icodelete"); } m_OpGird = null; }
void OnSplitBtn() { if (m_SplitWnd.activeInHierarchy) { return; } if (m_OpType == 1) { m_OpType = 0; UICursor.Clear(); } else { m_OpType = 1; UICursor.Set(mNewUIAtlas, "icocai"); } m_OpGird = null; }
// Update is called once per frame void Update() { // Page Button //if (m_PageIndex == 2) // m_PageUpBtn.isEnabled = false; //else // m_PageUpBtn.isEnabled = true; //if (m_PageIndex == 0) // m_PageDownBtn.isEnabled = false; //else // m_PageDownBtn.isEnabled = true; if (Input.GetKeyDown(KeyCode.PageUp)) { BtnLeftOnClick(); } if (Input.GetKeyDown(KeyCode.PageDown)) { BtnRightOnClick(); } //lz-2016.10.26 鼠标右键点击取消操作 if ((PeInput.Get(PeInput.LogicFunction.OpenItemMenu) || Input.GetMouseButtonDown(1)) && !m_SplitWnd.activeSelf && m_OpGird == null) { m_OpType = 0; UICursor.Clear(); } switch (m_OpType) { case 1: UICursor.Set(mNewUIAtlas, "icocai"); break; case 2: UICursor.Set(mNewUIAtlas, "icodelete"); break; } }
//Detects the release of the mouse button public virtual void OnPointerUp(PointerEventData eventData) { EventSystem.current.SetSelectedGameObject(null); if (!eventData.dragging) { Stack stack = InventoryManager.UI.stack; bool isUnstacking = stack != null && stack.item != null; if (!isUnstacking && InventoryManager.Input.unstackEvent.HasFlag <Configuration.Input.UnstackInput>(Configuration.Input.UnstackInput.OnClick) && Input.GetKey(InventoryManager.Input.unstackKeyCode) && ObservedItem.Stack > 1) { Unstack(); return; } //Check if we are currently unstacking the item if (isUnstacking && Container.StackOrAdd(this, stack.item)) { stack.item = null; UICursor.Clear(); } if (isUnstacking) { return; } if (ObservedItem == null) { return; } if (Container.useButton.HasFlag((InputButton)Mathf.Clamp(((int)eventData.button * 2), 1, int.MaxValue))) { Use(); } else if (Container.UseContextMenu && Container.ContextMenuButton.HasFlag((InputButton)Mathf.Clamp(((int)eventData.button * 2), 1, int.MaxValue))) { UIWidgets.ContextMenu menu = InventoryManager.UI.contextMenu; if (menu == null) { return; } menu.Clear(); if (Trigger.currentUsedTrigger != null && Trigger.currentUsedTrigger is VendorTrigger && Container.CanSellItems) { menu.AddMenuItem("Sell", Use); } else if (ObservedItem is UsableItem) { menu.AddMenuItem("Use", Use); } if (ObservedItem.MaxStack > 1 || ObservedItem.MaxStack == 0) { menu.AddMenuItem("Unstack", Unstack); } menu.AddMenuItem("Drop", DropItem); if (ObservedItem.EnchantingRecipe != null) { menu.AddMenuItem("Enchant", delegate() { ItemContainer container = WidgetUtility.Find <ItemContainer>("Enchanting"); container.Show(); container.ReplaceItem(0, ObservedItem); }); } if (ObservedItem.CanDestroy) { menu.AddMenuItem("Destroy", DestroyItem); } for (int i = 0; i < Container.ContextMenuFunctions.Count; i++) { int cnt = i; if (!string.IsNullOrEmpty(Container.ContextMenuFunctions[cnt])) { menu.AddMenuItem(Container.ContextMenuFunctions[cnt], () => { Container.gameObject.SendMessage(Container.ContextMenuFunctions[cnt], ObservedItem, SendMessageOptions.DontRequireReceiver); }); } } menu.Show(); } } }