/// <summary> /// Called when clicking other player's slot /// </summary> /// <param name="slot">clicket slot</param> public void TryInteract(PlayerExaminationWindowSlot slot) { var targetSlot = CurrentOpenStorage.GetNamedItemSlot(slot.UI_ItemSlot.NamedSlot); if (slot.IsObscured || slot.IsPocket) { // when player clicks on obscured slot/pocket second time if (slot.IsQuestionMarkActive) { InteractWithOtherPlayersSlot(targetSlot); } // when player clicks on obscured slot/pocket first time else { slot.SetQuestionMarkActive(targetSlot.IsOccupied); } } else { if (KeyboardInputManager.IsShiftPressed() && targetSlot.Item != null) { RequestExamineMessage.Send(targetSlot.Item.GetComponent <NetworkIdentity>().netId); return; } InteractWithOtherPlayersSlot(targetSlot); } }
public void OnClick() { if (!PlayerList.Instance.IsClientAdmin) { return; } //If shift is pressed, don't check anything, just send Examine on contained item if any. if (KeyboardInputManager.IsShiftPressed() && ui_itemSlot.Item != null) { RequestExamineMessage.Send(ui_itemSlot.Item.GetComponent <NetworkIdentity>().netId); return; } var adminHand = AdminManager.Instance.LocalAdminGhostStorage.GetNamedItemSlot(NamedSlot.ghostStorage01); if (ui_itemSlot.ItemSlot != adminHand) { if (ui_itemSlot.Item == null) { if (adminHand.Item) { AdminInventoryTransferMessage.Send(adminHand, ui_itemSlot.ItemSlot); } } else { if (adminHand.Item == null) { AdminInventoryTransferMessage.Send(ui_itemSlot.ItemSlot, adminHand); } } } }
public void OnClick() { //If shift is pressed, don't check anything, just send Examine on contained item if any. if (KeyboardInputManager.IsShiftPressed() && itemSlot.Item != null) { RequestExamineMessage.Send(itemSlot.Item.GetComponent<NetworkIdentity>().netId); return; } SoundManager.Play(SingletonSOSounds.Instance.Click01); //if there is an item in this slot, try interacting. if (itemSlot.Item != null) { itemSlot.TryItemInteract(); } //otherwise, try switching hands to this hand if this is our own hand slot and not already active else if (itemSlot == UIManager.Hands.LeftHand && UIManager.Hands.CurrentSlot != itemSlot) { UIManager.Hands.SetHand(false); } else if (itemSlot == UIManager.Hands.RightHand && UIManager.Hands.CurrentSlot != itemSlot) { UIManager.Hands.SetHand(true); } else { //otherwise, try just interacting with the blank slot (which will transfer the item itemSlot.TryItemInteract(); } }
public static void Send(uint targetNetId) { var msg = new RequestExamineMessage() { examineTarget = targetNetId }; msg.Send(); }
public static void Send(uint targetNetId, Vector3 mousePos) { var msg = new RequestExamineMessage() { examineTarget = targetNetId, mousePosition = mousePos }; msg.Send(); }
public static void Send(uint targetNetId) { // TODO: Log something? var msg = new RequestExamineMessage() { examineTarget = targetNetId }; msg.Send(); }
public void OnClick() { // If shift is pressed, don't check anything, just send Examine on contained item if any. if (KeyboardInputManager.IsShiftPressed() && itemSlot.Item != null) { RequestExamineMessage.Send(itemSlot.Item.GetComponent <NetworkIdentity>().netId); return; } _ = SoundManager.Play(CommonSounds.Instance.Click01); // if there is an item in this slot, try interacting. itemSlot.TryItemInteract(); }
private void OnExamine() { RequestExamineMessage.Send(GetComponent <NetworkIdentity>().netId); }
private void OnExamine() { RequestExamineMessage.Send(netId); }