Beispiel #1
0
    public RightClickableResult GenerateRightClickOptions()
    {
        //check if our local player can reach this
        var initiator = PlayerManager.LocalPlayerScript.pushPull;

        if (initiator == null)
        {
            return(null);
        }
        //if it's pulled by us
        if (IsPulledByClient(initiator))
        {
            //already pulled by us, but we can stop pulling
            return(RightClickableResult.Create()
                   .AddElement("StopPull", TryPullThis));
        }
        else
        {
            //check if in range for pulling
            if (PlayerScript.IsInReach(registerTile, initiator.registerTile, false) && initiator != this)
            {
                return(RightClickableResult.Create()
                       .AddElement("Pull", TryPullThis));
            }
        }

        return(null);
    }
Beispiel #2
0
        public RightClickableResult GenerateRightClickOptions()
        {
            var result = RightClickableResult.Create();

            var activateInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "ToggleActive");

            if (!WillInteract(activateInteraction, NetworkSide.Client))
            {
                return(result);
            }
            result.AddElement("Activate", () => ContextMenuOptionClicked(activateInteraction));

            var ejectInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "ToggleDoor");

            result.AddElement("Toggle Door", () => ContextMenuOptionClicked(ejectInteraction));

            var addTimeInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "AddTime");

            result.AddElement("Add 5 Sec", () => ContextMenuOptionClicked(addTimeInteraction));

            var removeTimeInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "RemoveTime");

            result.AddElement("Take 5 Sec", () => ContextMenuOptionClicked(removeTimeInteraction));

            return(result);
        }
        public RightClickableResult GenerateRightClickOptions()
        {
            var result           = RightClickableResult.Create();
            var ejectInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "Eject");

            result.AddElement("Eject", () => ContextMenuOptionClicked(ejectInteraction));
            return(result);
        }
Beispiel #4
0
    public RightClickableResult GenerateRightClickOptions()
    {
        if (string.IsNullOrEmpty(PlayerList.Instance.AdminToken))
        {
            return(null);
        }

        return(RightClickableResult.Create()
               .AddAdminElement("Smash", AdminSmash)
               .AddAdminElement("Hotspot", AdminMakeHotspot));
    }
        public RightClickableResult GenerateRightClickOptions()
        {
            var result = RightClickableResult.Create();

            if (WillInteract(HandApply.ByLocalPlayer(gameObject), NetworkSide.Client))
            {
                result.AddElement("Add Solid Plasma", RightClickInteract);
            }

            return(result);
        }
Beispiel #6
0
    public RightClickableResult GenerateRightClickOptions()
    {
        var result = RightClickableResult.Create();

        if (WillInteract(MouseDrop.ByLocalPlayer(gameObject, PlayerManager.LocalPlayer), NetworkSide.Client))
        {
            result.AddElement("Fold Up", RightClickInteract);
        }

        return(result);
    }
Beispiel #7
0
    public RightClickableResult GenerateRightClickOptions()
    {
        if (string.IsNullOrEmpty(PlayerList.Instance.AdminToken) || !KeyboardInputManager.Instance.CheckKeyAction(KeyAction.ShowAdminOptions, KeyboardInputManager.KeyEventType.Hold))
        {
            return(null);
        }

        return(RightClickableResult.Create()
               .AddAdminElement("Smash", AdminSmash)
               .AddAdminElement("Hotspot", AdminMakeHotspot));
    }
    public RightClickableResult GenerateRightClickOptions()
    {
        var result = RightClickableResult.Create();

        if (!WillInteract(ContextMenuApply.ByLocalPlayer(gameObject, null), NetworkSide.Client))
        {
            return(result);
        }

        return(result.AddElement("Flip", OnFlipClicked));
    }
Beispiel #9
0
    public RightClickableResult GenerateRightClickOptions()
    {
        var result = RightClickableResult.Create();

        if (WillInteract(HandApply.ByLocalPlayer(gameObject), NetworkSide.Client))
        {
            var optionName = IsClosed ? "Open" : "Close";
            result.AddElement("OpenClose", RightClickInteract, nameOverride: optionName);
        }

        return(result);
    }
        public RightClickableResult GenerateRightClickOptions()
        {
            var result = RightClickableResult.Create();

            if (WillInteract(HandApply.ByLocalPlayer(gameObject), NetworkSide.Client))
            {
                // TODO: Make this contexual if holding a welder or wrench
                var optionName = IsOpen ? "Close" : "Open";
                result.AddElement("OpenClose", RightClickInteract, nameOverride: optionName);
            }

            return(result);
        }
Beispiel #11
0
    /// <summary>
    /// Anything with PlayerMove can be cuffed and uncuffed. Might make sense to seperate that into its own behaviour
    /// </summary>
    /// <returns>The menu including the uncuff action if applicable, otherwise null</returns>
    public RightClickableResult GenerateRightClickOptions()
    {
        var initiator = PlayerManager.LocalPlayerScript.playerMove;

        if (IsCuffed && initiator != this)
        {
            var result = RightClickableResult.Create();
            result.AddElement("Uncuff", TryUncuffThis);
            return(result);
        }

        return(null);
    }
Beispiel #12
0
    public RightClickableResult GenerateRightClickOptions()
    {
        //would the interaction validate locally?
        var valid = WillInteract(HandApply.ByLocalPlayer(gameObject), NetworkSide.Client);

        if (valid)
        {
            return(RightClickableResult.Create()
                   .AddElement("PickUp", RightClickInteract));
        }

        return(null);
    }
Beispiel #13
0
        public RightClickableResult GenerateRightClickOptions()
        {
            var result = RightClickableResult.Create();

            var activateInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "Open/Close");

            if (!WillInteract(activateInteraction, NetworkSide.Client))
            {
                return(result);
            }
            result.AddElement("Open/Close", () => ContextMenuOptionClicked(activateInteraction));

            return(result);
        }
Beispiel #14
0
    // This region (Interaction-RightClick) shouldn't exist once TODO in class summary is done.
    #region Interaction-RightClick

    public RightClickableResult GenerateRightClickOptions()
    {
        RightClickableResult result = RightClickableResult.Create();

        if (drawerState == DrawerState.Open)
        {
            return(result);
        }
        if (!accessRestrictions.CheckAccess(PlayerManager.LocalPlayer))
        {
            return(result);
        }

        return(result.AddElement("Activate Ignition", RightClickInteract));
    }
Beispiel #15
0
    public RightClickableResult GenerateRightClickOptions()
    {
        var result = RightClickableResult.Create()
                     //contents can always be viewed
                     .AddElement("Contents", LogReagents);

        //Pour / add can only be done if in reach
        if (PlayerScript.IsInReach(registerTile, PlayerManager.LocalPlayerScript.registerTile, false))
        {
            result.AddElement("PourOut", RemoveSome)
            .AddElement("AddTo", AddTo);
        }

        return(result);
    }
        public RightClickableResult GenerateRightClickOptions()
        {
            var result            = RightClickableResult.Create();
            var detachInteraction = ContextMenuApply.ByLocalPlayer(gameObject, null);

            if (WillInteract(detachInteraction, NetworkSide.Client) == false)
            {
                return(result);
            }
            if (noteText.IsNullOrEmpty())
            {
                return(result);
            }

            return(result.AddElement("Detach note", () => OnDetachClicked(detachInteraction)));
        }
Beispiel #17
0
        // This region (Interaction-RightClick) shouldn't exist once TODO in class summary is done.
        #region Interaction-RightClick

        public RightClickableResult GenerateRightClickOptions()
        {
            RightClickableResult result = RightClickableResult.Create();

            if (drawerState == DrawerState.Open)
            {
                return(result);
            }
            if (!accessRestrictions.CheckAccess(PlayerManager.LocalPlayer))
            {
                return(result);
            }
            var cremateInteraction = ContextMenuApply.ByLocalPlayer(gameObject, null);

            if (!WillInteract(cremateInteraction, NetworkSide.Client))
            {
                return(result);
            }

            return(result.AddElement("Activate", () => OnCremateClicked(cremateInteraction)));
        }
Beispiel #18
0
        // This region (Interaction-RightClick) shouldn't exist once TODO in class summary is done.
        #region Interaction-RightClick

        public RightClickableResult GenerateRightClickOptions()
        {
            RightClickableResult result = RightClickableResult.Create();

            if (drawerState == DrawerState.Open)
            {
                return(result);
            }

            /* --ACCESS REWORK--
             *  TODO Remove the AccessRestriction check when we finish migrating!
             *
             */

            if (accessRestrictions)
            {
                if (accessRestrictions.CheckAccess(PlayerManager.LocalPlayer) == false)
                {
                    return(result);
                }
            }
            else if (clearanceCheckable)
            {
                if (clearanceCheckable.HasClearance(PlayerManager.LocalPlayer) == false)
                {
                    return(result);
                }
            }

            var cremateInteraction = ContextMenuApply.ByLocalPlayer(gameObject, null);

            if (!WillInteract(cremateInteraction, NetworkSide.Client))
            {
                return(result);
            }

            return(result.AddElement("Activate", () => OnCremateClicked(cremateInteraction)));
        }
        public RightClickableResult GenerateRightClickOptions()
        {
            var result = RightClickableResult.Create();

            var activateInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "Activate");

            if (!WillInteract(activateInteraction, NetworkSide.Client))
            {
                return(result);
            }
            result.AddElement("Activate", () => ContextMenuOptionClicked(activateInteraction));

            var switchModeInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "Switch Mode");

            result.AddElement("Switch Mode", () => ContextMenuOptionClicked(switchModeInteraction));

            var ejectInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "Eject Beaker");

            result.AddElement("Eject Beaker", () => ContextMenuOptionClicked(ejectInteraction));


            return(result);
        }
Beispiel #20
0
        public RightClickableResult GenerateRightClickOptions()
        {
            var result = RightClickableResult.Create();

            if (!WillInteract(ContextMenuApply.ByLocalPlayer(gameObject, null), NetworkSide.Client))
            {
                return(result);
            }

            var stopTimerInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "StopTimer");

            result.AddElement("Stop Timer", () => ContextMenuOptionClicked(stopTimerInteraction));

            var addTimeInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "AddTime");

            result.AddElement("Add 1 Min", () => ContextMenuOptionClicked(addTimeInteraction));

            var removeTimeInteraction = ContextMenuApply.ByLocalPlayer(gameObject, "RemoveTime");

            result.AddElement("Take 1 Min", () => ContextMenuOptionClicked(removeTimeInteraction));

            return(result);
        }
Beispiel #21
0
    public RightClickableResult GenerateRightClickOptions()
    {
        if (!canPickup)
        {
            return(null);
        }
        var interaction = HandApply.ByLocalPlayer(gameObject);

        if (interaction.TargetObject != gameObject)
        {
            return(null);
        }
        if (interaction.HandObject != null)
        {
            return(null);
        }
        if (!Validations.CanApply(interaction, NetworkSide.Client, true, ReachRange.Standard, isPlayerClick: false))
        {
            return(null);
        }

        return(RightClickableResult.Create()
               .AddElement("PickUp", RightClickInteract));
    }
Beispiel #22
0
 public RightClickableResult GenerateRightClickOptions()
 {
     return(RightClickableResult.Create()
            .AddElement("Examine", OnExamine));
 }
 public RightClickableResult GenerateRightClickOptions()
 {
     return(RightClickableResult.Create()
            .AddAdminElement("Respawn", AdminRespawn));
 }
Beispiel #24
0
 public RightClickableResult GenerateRightClickOptions()
 {
     return(RightClickableResult.Create()
            .AddAdminElement("Smash", AdminSmash)
            .AddAdminElement("Hotspot", AdminMakeHotspot));
 }