Beispiel #1
0
        /// <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);
            }
        }
Beispiel #2
0
    /// <summary>
    /// Called when clicking other player's slot
    /// </summary>
    /// <param name="slot">clicket slot</param>
    public void TryInteract(PlayerExaminationWindowSlot slot)
    {
        ItemSlot playerSlot = CurrentOpenStorage.GetNamedItemSlot(slot.UI_ItemSlot.NamedSlot);

        if (slot.IsObscured || slot.IsPocket)
        {
            // when player clicks on obscured slot/pocket second time
            if (slot.IsQuestionMarkActive)
            {
                InteractWithOtherPlayersSlot(playerSlot);
            }
            // when player clicks on obscured slot/pocket first time
            else
            {
                if (playerSlot.IsOccupied)
                {
                    slot.SetQuestionMarkActive(true);
                }
                else
                {
                    slot.SetQuestionMarkActive(false);
                }
            }
        }
        else
        {
            InteractWithOtherPlayersSlot(playerSlot);
        }
    }