コード例 #1
0
        public void OV_Update()
        {
            bool flag = !DrawUtilities.ShouldRun();

            if (!flag)
            {
                bool flag2 = OptimizationVariables.MainPlayer.stance.stance != EPlayerStance.DRIVING && OptimizationVariables.MainPlayer.stance.stance != EPlayerStance.SITTING && !OptimizationVariables.MainPlayer.life.isDead && !OptimizationVariables.MainPlayer.workzone.isBuilding;
                if (flag2)
                {
                    bool flag3 = Time.realtimeSinceStartup - OV_PlayerInteract.lastInteract > 0.1f;
                    if (flag3)
                    {
                        int  num   = 0;
                        bool flag4 = InteractionOptions.InteractThroughWalls && !PlayerCoroutines.IsSpying;
                        if (flag4)
                        {
                            bool flag5 = !InteractionOptions.NoHitBarricades;
                            if (flag5)
                            {
                                num |= RayMasks.BARRICADE;
                            }
                            bool flag6 = !InteractionOptions.NoHitItems;
                            if (flag6)
                            {
                                num |= RayMasks.ITEM;
                            }
                            bool flag7 = !InteractionOptions.NoHitResources;
                            if (flag7)
                            {
                                num |= RayMasks.RESOURCE;
                            }
                            bool flag8 = !InteractionOptions.NoHitStructures;
                            if (flag8)
                            {
                                num |= RayMasks.STRUCTURE;
                            }
                            bool flag9 = !InteractionOptions.NoHitVehicles;
                            if (flag9)
                            {
                                num |= RayMasks.VEHICLE;
                            }
                            bool flag10 = !InteractionOptions.NoHitEnvironment;
                            if (flag10)
                            {
                                num |= (RayMasks.LARGE | RayMasks.MEDIUM | RayMasks.ENVIRONMENT | RayMasks.GROUND);
                            }
                        }
                        else
                        {
                            num = RayMasks.PLAYER_INTERACT;
                        }
                        OV_PlayerInteract.lastInteract = Time.realtimeSinceStartup;
                        float num2 = (InteractionOptions.InteractThroughWalls && !PlayerCoroutines.IsSpying) ? 20f : 4f;
                        PhysicsUtility.raycast(new Ray(Camera.main.transform.position, Camera.main.transform.forward), out OV_PlayerInteract.hit, (OptimizationVariables.MainPlayer.look.perspective == EPlayerPerspective.THIRD) ? (num2 + 2f) : num2, num, QueryTriggerInteraction.UseGlobal);
                    }
                    Transform transform = (!(OV_PlayerInteract.hit.collider != null)) ? null : OV_PlayerInteract.hit.collider.transform;
                    bool      flag11    = transform != OV_PlayerInteract.focus;
                    if (flag11)
                    {
                        bool flag12 = OV_PlayerInteract.focus != null && PlayerInteract.interactable != null;
                        if (flag12)
                        {
                            InteractableDoorHinge componentInParent = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            bool flag13 = componentInParent != null;
                            if (flag13)
                            {
                                HighlighterTool.unhighlight(componentInParent.door.transform);
                            }
                            else
                            {
                                HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                            }
                        }
                        OV_PlayerInteract.focus         = null;
                        OV_PlayerInteract.target        = null;
                        OV_PlayerInteract.interactable  = null;
                        OV_PlayerInteract.interactable2 = null;
                        bool flag14 = transform != null;
                        if (flag14)
                        {
                            OV_PlayerInteract.focus         = transform;
                            OV_PlayerInteract.interactable  = OV_PlayerInteract.focus.GetComponentInParent <Interactable>();
                            OV_PlayerInteract.interactable2 = OV_PlayerInteract.focus.GetComponentInParent <Interactable2>();
                            bool flag15 = PlayerInteract.interactable != null;
                            if (flag15)
                            {
                                OV_PlayerInteract.target = PlayerInteract.interactable.transform.FindChildRecursive("Target");
                                bool flag16 = PlayerInteract.interactable.checkInteractable();
                                if (flag16)
                                {
                                    bool isEnabled = PlayerUI.window.isEnabled;
                                    if (isEnabled)
                                    {
                                        bool flag17 = PlayerInteract.interactable.checkUseable();
                                        if (flag17)
                                        {
                                            Color green;
                                            bool  flag18 = !PlayerInteract.interactable.checkHighlight(out green);
                                            if (flag18)
                                            {
                                                green = Color.green;
                                            }
                                            InteractableDoorHinge componentInParent2 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                                            bool flag19 = componentInParent2 != null;
                                            if (flag19)
                                            {
                                                HighlighterTool.highlight(componentInParent2.door.transform, green);
                                            }
                                            else
                                            {
                                                HighlighterTool.highlight(PlayerInteract.interactable.transform, green);
                                            }
                                        }
                                        else
                                        {
                                            Color red = Color.red;
                                            InteractableDoorHinge componentInParent3 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                                            bool flag20 = componentInParent3 != null;
                                            if (flag20)
                                            {
                                                HighlighterTool.highlight(componentInParent3.door.transform, red);
                                            }
                                            else
                                            {
                                                HighlighterTool.highlight(PlayerInteract.interactable.transform, red);
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    OV_PlayerInteract.target       = null;
                                    OV_PlayerInteract.interactable = null;
                                }
                            }
                        }
                    }
                }
                else
                {
                    bool flag21 = OV_PlayerInteract.focus != null && PlayerInteract.interactable != null;
                    if (flag21)
                    {
                        InteractableDoorHinge componentInParent4 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                        bool flag22 = componentInParent4 != null;
                        if (flag22)
                        {
                            HighlighterTool.unhighlight(componentInParent4.door.transform);
                        }
                        else
                        {
                            HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                        }
                    }
                    OV_PlayerInteract.focus         = null;
                    OV_PlayerInteract.target        = null;
                    OV_PlayerInteract.interactable  = null;
                    OV_PlayerInteract.interactable2 = null;
                }
                bool isDead = OptimizationVariables.MainPlayer.life.isDead;
                if (!isDead)
                {
                    bool flag23 = PlayerInteract.interactable != null;
                    if (flag23)
                    {
                        EPlayerMessage message;
                        string         text;
                        Color          color;
                        bool           flag24 = PlayerInteract.interactable.checkHint(out message, out text, out color) && !PlayerUI.window.showCursor;
                        if (flag24)
                        {
                            bool flag25 = PlayerInteract.interactable.CompareTag("Item");
                            if (flag25)
                            {
                                PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color, new object[]
                                {
                                    ((InteractableItem)PlayerInteract.interactable).item,
                                    ((InteractableItem)PlayerInteract.interactable).asset
                                });
                            }
                            else
                            {
                                PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color, new object[0]);
                            }
                        }
                    }
                    else
                    {
                        bool flag26 = OV_PlayerInteract.purchaseAsset != null && OptimizationVariables.MainPlayer.movement.purchaseNode != null && !PlayerUI.window.showCursor;
                        if (flag26)
                        {
                            PlayerUI.hint(null, EPlayerMessage.PURCHASE, string.Empty, Color.white, new object[]
                            {
                                OV_PlayerInteract.purchaseAsset.itemName,
                                OptimizationVariables.MainPlayer.movement.purchaseNode.cost
                            });
                        }
                        else
                        {
                            bool flag27 = OV_PlayerInteract.focus != null && OV_PlayerInteract.focus.CompareTag("Enemy");
                            if (flag27)
                            {
                                Player player = DamageTool.getPlayer(OV_PlayerInteract.focus);
                                bool   flag28 = player != null && player != Player.player && !PlayerUI.window.showCursor;
                                if (flag28)
                                {
                                    PlayerUI.hint(null, EPlayerMessage.ENEMY, string.Empty, Color.white, new object[]
                                    {
                                        player.channel.owner
                                    });
                                }
                            }
                        }
                    }
                    EPlayerMessage message2;
                    float          data;
                    bool           flag29 = PlayerInteract.interactable2 != null && PlayerInteract.interactable2.checkHint(out message2, out data) && !PlayerUI.window.showCursor;
                    if (flag29)
                    {
                        PlayerUI.hint2(EPlayerMessage.ENEMY, (!OV_PlayerInteract.isHoldingKey) ? 0f : ((Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown) / this.salvageTime), 1f);
                    }
                    bool flag30 = (OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.DRIVING || OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.SITTING) && !Input.GetKey(KeyCode.LeftShift);
                    if (flag30)
                    {
                        bool keyDown = Input.GetKeyDown(KeyCode.F1);
                        if (keyDown)
                        {
                            this.hotkey(0);
                        }
                        bool keyDown2 = Input.GetKeyDown(KeyCode.F2);
                        if (keyDown2)
                        {
                            this.hotkey(1);
                        }
                        bool keyDown3 = Input.GetKeyDown(KeyCode.F3);
                        if (keyDown3)
                        {
                            this.hotkey(2);
                        }
                        bool keyDown4 = Input.GetKeyDown(KeyCode.F4);
                        if (keyDown4)
                        {
                            this.hotkey(3);
                        }
                        bool keyDown5 = Input.GetKeyDown(KeyCode.F5);
                        if (keyDown5)
                        {
                            this.hotkey(4);
                        }
                        bool keyDown6 = Input.GetKeyDown(KeyCode.F6);
                        if (keyDown6)
                        {
                            this.hotkey(5);
                        }
                        bool keyDown7 = Input.GetKeyDown(KeyCode.F7);
                        if (keyDown7)
                        {
                            this.hotkey(6);
                        }
                        bool keyDown8 = Input.GetKeyDown(KeyCode.F8);
                        if (keyDown8)
                        {
                            this.hotkey(7);
                        }
                        bool keyDown9 = Input.GetKeyDown(KeyCode.F9);
                        if (keyDown9)
                        {
                            this.hotkey(8);
                        }
                        bool keyDown10 = Input.GetKeyDown(KeyCode.F10);
                        if (keyDown10)
                        {
                            this.hotkey(9);
                        }
                    }
                    bool keyDown11 = Input.GetKeyDown(ControlsSettings.interact);
                    if (keyDown11)
                    {
                        OV_PlayerInteract.lastKeyDown  = Time.realtimeSinceStartup;
                        OV_PlayerInteract.isHoldingKey = true;
                    }
                    bool flag31 = Input.GetKeyDown(ControlsSettings.inspect) && ControlsSettings.inspect != ControlsSettings.interact && OptimizationVariables.MainPlayer.equipment.canInspect;
                    if (flag31)
                    {
                        OptimizationVariables.MainPlayer.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[0]);
                    }
                    bool flag32 = OV_PlayerInteract.isHoldingKey;
                    if (flag32)
                    {
                        bool keyUp = Input.GetKeyUp(ControlsSettings.interact);
                        if (keyUp)
                        {
                            OV_PlayerInteract.isHoldingKey = false;
                            bool showCursor = PlayerUI.window.showCursor;
                            if (showCursor)
                            {
                                bool flag33 = OptimizationVariables.MainPlayer.inventory.isStoring && OptimizationVariables.MainPlayer.inventory.shouldInteractCloseStorage;
                                if (flag33)
                                {
                                    PlayerDashboardUI.close();
                                    PlayerLifeUI.open();
                                }
                                else
                                {
                                    bool active = PlayerBarricadeSignUI.active;
                                    if (active)
                                    {
                                        PlayerBarricadeSignUI.close();
                                        PlayerLifeUI.open();
                                    }
                                    else
                                    {
                                        bool active2 = PlayerBarricadeStereoUI.active;
                                        if (active2)
                                        {
                                            PlayerBarricadeStereoUI.close();
                                            PlayerLifeUI.open();
                                        }
                                        else
                                        {
                                            bool active3 = PlayerBarricadeLibraryUI.active;
                                            if (active3)
                                            {
                                                PlayerBarricadeLibraryUI.close();
                                                PlayerLifeUI.open();
                                            }
                                            else
                                            {
                                                bool active4 = PlayerBarricadeMannequinUI.active;
                                                if (active4)
                                                {
                                                    PlayerBarricadeMannequinUI.close();
                                                    PlayerLifeUI.open();
                                                }
                                                else
                                                {
                                                    bool active5 = PlayerNPCDialogueUI.active;
                                                    if (active5)
                                                    {
                                                        bool dialogueAnimating = PlayerNPCDialogueUI.dialogueAnimating;
                                                        if (dialogueAnimating)
                                                        {
                                                            PlayerNPCDialogueUI.skipText();
                                                        }
                                                        else
                                                        {
                                                            bool dialogueHasNextPage = PlayerNPCDialogueUI.dialogueHasNextPage;
                                                            if (dialogueHasNextPage)
                                                            {
                                                                PlayerNPCDialogueUI.nextPage();
                                                            }
                                                            else
                                                            {
                                                                PlayerNPCDialogueUI.close();
                                                                PlayerLifeUI.open();
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        bool active6 = PlayerNPCQuestUI.active;
                                                        if (active6)
                                                        {
                                                            PlayerNPCQuestUI.closeNicely();
                                                        }
                                                        else
                                                        {
                                                            bool active7 = PlayerNPCVendorUI.active;
                                                            if (active7)
                                                            {
                                                                PlayerNPCVendorUI.closeNicely();
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                bool flag34 = OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.DRIVING || OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.SITTING;
                                if (flag34)
                                {
                                    VehicleManager.exitVehicle();
                                }
                                else
                                {
                                    bool flag35 = OV_PlayerInteract.focus != null && PlayerInteract.interactable != null;
                                    if (flag35)
                                    {
                                        bool flag36 = PlayerInteract.interactable.checkUseable();
                                        if (flag36)
                                        {
                                            PlayerInteract.interactable.use();
                                        }
                                    }
                                    else
                                    {
                                        bool flag37 = OV_PlayerInteract.purchaseAsset != null;
                                        if (flag37)
                                        {
                                            bool flag38 = OptimizationVariables.MainPlayer.skills.experience >= OptimizationVariables.MainPlayer.movement.purchaseNode.cost;
                                            if (flag38)
                                            {
                                                OptimizationVariables.MainPlayer.skills.sendPurchase(OptimizationVariables.MainPlayer.movement.purchaseNode);
                                            }
                                        }
                                        else
                                        {
                                            bool flag39 = ControlsSettings.inspect == ControlsSettings.interact && OptimizationVariables.MainPlayer.equipment.canInspect;
                                            if (flag39)
                                            {
                                                OptimizationVariables.MainPlayer.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[0]);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            bool flag40 = Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown > this.salvageTime;
                            if (flag40)
                            {
                                OV_PlayerInteract.isHoldingKey = false;
                                bool flag41 = !PlayerUI.window.showCursor && PlayerInteract.interactable2 != null;
                                if (flag41)
                                {
                                    PlayerInteract.interactable2.use();
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        public void OV_Update()
        {
            if (!DrawUtilities.ShouldRun())
            {
                return;
            }
            if (Player.player.stance.stance != EPlayerStance.DRIVING)
            {
                if (Player.player.stance.stance != EPlayerStance.SITTING)
                {
                    if (!Player.player.life.isDead && !Player.player.workzone.isBuilding)
                    {
                        if (Time.realtimeSinceStartup - OV_PlayerInteract.lastInteract > 0.1f)
                        {
                            int num = 0;
                            if (InteractionOptions.InteractThroughWalls && !PlayerCoroutines.IsSpying)
                            {
                                if (!InteractionOptions.NoHitBarricades)
                                {
                                    num |= RayMasks.BARRICADE;
                                }
                                if (!InteractionOptions.NoHitItems)
                                {
                                    num |= RayMasks.ITEM;
                                }
                                if (!InteractionOptions.NoHitResources)
                                {
                                    num |= RayMasks.RESOURCE;
                                }
                                if (!InteractionOptions.NoHitStructures)
                                {
                                    num |= RayMasks.STRUCTURE;
                                }
                                if (!InteractionOptions.NoHitVehicles)
                                {
                                    num |= RayMasks.VEHICLE;
                                }
                                if (!InteractionOptions.NoHitEnvironment)
                                {
                                    num |= (RayMasks.LARGE | RayMasks.MEDIUM | RayMasks.ENVIRONMENT | RayMasks.GROUND);
                                }
                            }
                            else
                            {
                                num = RayMasks.PLAYER_INTERACT;
                            }
                            OV_PlayerInteract.lastInteract = Time.realtimeSinceStartup;
                            float num2 = (!InteractionOptions.InteractThroughWalls || PlayerCoroutines.IsSpying) ? 4f : 20f;
                            PhysicsUtility.raycast(new Ray(OptimizationVariables.MainCam.transform.position, OptimizationVariables.MainCam.transform.forward), out OV_PlayerInteract.hit, (Player.player.look.perspective == EPlayerPerspective.THIRD) ? (num2 + 2f) : num2, num, QueryTriggerInteraction.UseGlobal);
                        }
                        Transform transform = (!(OV_PlayerInteract.hit.collider != null)) ? null : OV_PlayerInteract.hit.collider.transform;
                        if (!(transform != OV_PlayerInteract.focus))
                        {
                            goto IL_39E;
                        }
                        if (OV_PlayerInteract.focus != null && PlayerInteract.interactable != null)
                        {
                            InteractableDoorHinge componentInParent = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            if (componentInParent != null)
                            {
                                HighlighterTool.unhighlight(componentInParent.door.transform);
                            }
                            else
                            {
                                HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                            }
                        }
                        OV_PlayerInteract.focus         = null;
                        OV_PlayerInteract.target        = null;
                        OV_PlayerInteract.interactable  = null;
                        OV_PlayerInteract.interactable2 = null;
                        if (!(transform != null))
                        {
                            goto IL_39E;
                        }
                        OV_PlayerInteract.focus         = transform;
                        OV_PlayerInteract.interactable  = OV_PlayerInteract.focus.GetComponentInParent <Interactable>();
                        OV_PlayerInteract.interactable2 = OV_PlayerInteract.focus.GetComponentInParent <Interactable2>();
                        if (!(PlayerInteract.interactable != null))
                        {
                            goto IL_39E;
                        }
                        OV_PlayerInteract.target = PlayerInteract.interactable.transform.FindChildRecursive("Target");
                        if (!PlayerInteract.interactable.checkInteractable())
                        {
                            OV_PlayerInteract.target       = null;
                            OV_PlayerInteract.interactable = null;
                            goto IL_39E;
                        }
                        if (!PlayerUI.window.isEnabled)
                        {
                            goto IL_39E;
                        }
                        if (!PlayerInteract.interactable.checkUseable())
                        {
                            Color color = Color.red;
                            InteractableDoorHinge componentInParent2 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            if (componentInParent2 != null)
                            {
                                HighlighterTool.highlight(componentInParent2.door.transform, color);
                                goto IL_39E;
                            }
                            HighlighterTool.highlight(PlayerInteract.interactable.transform, color);
                            goto IL_39E;
                        }
                        else
                        {
                            Color color;
                            if (!PlayerInteract.interactable.checkHighlight(out color))
                            {
                                color = Color.green;
                            }
                            InteractableDoorHinge componentInParent3 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            if (componentInParent3 != null)
                            {
                                HighlighterTool.highlight(componentInParent3.door.transform, color);
                                goto IL_39E;
                            }
                            HighlighterTool.highlight(PlayerInteract.interactable.transform, color);
                            goto IL_39E;
                        }
                    }
                }
            }
            if (OV_PlayerInteract.focus != null && PlayerInteract.interactable != null)
            {
                InteractableDoorHinge componentInParent4 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                if (componentInParent4 != null)
                {
                    HighlighterTool.unhighlight(componentInParent4.door.transform);
                }
                else
                {
                    HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                }
            }
            OV_PlayerInteract.focus         = null;
            OV_PlayerInteract.target        = null;
            OV_PlayerInteract.interactable  = null;
            OV_PlayerInteract.interactable2 = null;
IL_39E:
            if (!Player.player.life.isDead)
            {
                EPlayerMessage message;
                string         text;
                Color          color2;
                if (!(PlayerInteract.interactable != null))
                {
                    if (OV_PlayerInteract.purchaseAsset != null && Player.player.movement.purchaseNode != null && !PlayerUI.window.showCursor)
                    {
                        PlayerUI.hint(null, EPlayerMessage.PURCHASE, string.Empty, Color.white, new object[]
                        {
                            OV_PlayerInteract.purchaseAsset.itemName,
                            Player.player.movement.purchaseNode.cost
                        });
                    }
                    else if (OV_PlayerInteract.focus != null && OV_PlayerInteract.focus.CompareTag("Enemy"))
                    {
                        Player player = DamageTool.getPlayer(OV_PlayerInteract.focus);
                        if (player != null && player != Player.player && !PlayerUI.window.showCursor)
                        {
                            PlayerUI.hint(null, EPlayerMessage.ENEMY, string.Empty, Color.white, new object[]
                            {
                                player.channel.owner
                            });
                        }
                    }
                }
                else if (PlayerInteract.interactable.checkHint(out message, out text, out color2) && !PlayerUI.window.showCursor)
                {
                    if (!PlayerInteract.interactable.CompareTag("Item"))
                    {
                        PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color2, Array.Empty <object>());
                    }
                    else
                    {
                        PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color2, new object[]
                        {
                            ((InteractableItem)PlayerInteract.interactable).item,
                            ((InteractableItem)PlayerInteract.interactable).asset
                        });
                    }
                }
                EPlayerMessage message2;
                float          data;
                if (PlayerInteract.interactable2 != null && PlayerInteract.interactable2.checkHint(out message2, out data) && !PlayerUI.window.showCursor)
                {
                    PlayerUI.hint2(message2, (!OV_PlayerInteract.isHoldingKey) ? 0f : ((Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown) / this.salvageTime), data);
                }
                if ((Player.player.stance.stance == EPlayerStance.DRIVING || Player.player.stance.stance == EPlayerStance.SITTING) && !Input.GetKey(KeyCode.LeftShift))
                {
                    if (Input.GetKeyDown(KeyCode.F1))
                    {
                        this.hotkey(0);
                    }
                    if (Input.GetKeyDown(KeyCode.F2))
                    {
                        this.hotkey(1);
                    }
                    if (Input.GetKeyDown(KeyCode.F3))
                    {
                        this.hotkey(2);
                    }
                    if (Input.GetKeyDown(KeyCode.F4))
                    {
                        this.hotkey(3);
                    }
                    if (Input.GetKeyDown(KeyCode.F5))
                    {
                        this.hotkey(4);
                    }
                    if (Input.GetKeyDown(KeyCode.F6))
                    {
                        this.hotkey(5);
                    }
                    if (Input.GetKeyDown(KeyCode.F7))
                    {
                        this.hotkey(6);
                    }
                    if (Input.GetKeyDown(KeyCode.F8))
                    {
                        this.hotkey(7);
                    }
                    if (Input.GetKeyDown(KeyCode.F9))
                    {
                        this.hotkey(8);
                    }
                    if (Input.GetKeyDown(KeyCode.F10))
                    {
                        this.hotkey(9);
                    }
                }
                if (Input.GetKeyDown(ControlsSettings.interact))
                {
                    OV_PlayerInteract.lastKeyDown  = Time.realtimeSinceStartup;
                    OV_PlayerInteract.isHoldingKey = true;
                }
                if (Input.GetKeyDown(ControlsSettings.inspect))
                {
                    if (ControlsSettings.inspect != ControlsSettings.interact)
                    {
                        if (Player.player.equipment.canInspect)
                        {
                            Player.player.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, Array.Empty <object>());
                        }
                    }
                }
                if (OV_PlayerInteract.isHoldingKey)
                {
                    if (!Input.GetKeyUp(ControlsSettings.interact))
                    {
                        if (Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown > this.salvageTime)
                        {
                            OV_PlayerInteract.isHoldingKey = false;
                            if (!PlayerUI.window.showCursor && PlayerInteract.interactable2 != null)
                            {
                                PlayerInteract.interactable2.use();
                            }
                        }
                    }
                    else
                    {
                        OV_PlayerInteract.isHoldingKey = false;
                        if (!PlayerUI.window.showCursor)
                        {
                            if (Player.player.stance.stance != EPlayerStance.DRIVING)
                            {
                                if (Player.player.stance.stance != EPlayerStance.SITTING)
                                {
                                    if (OV_PlayerInteract.focus != null && PlayerInteract.interactable != null)
                                    {
                                        if (PlayerInteract.interactable.checkUseable())
                                        {
                                            PlayerInteract.interactable.use();
                                            return;
                                        }
                                        return;
                                    }
                                    else if (OV_PlayerInteract.purchaseAsset == null)
                                    {
                                        if (ControlsSettings.inspect != ControlsSettings.interact)
                                        {
                                            return;
                                        }
                                        if (Player.player.equipment.canInspect)
                                        {
                                            Player.player.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, Array.Empty <object>());
                                            return;
                                        }
                                        return;
                                    }
                                    else
                                    {
                                        if (Player.player.skills.experience >= Player.player.movement.purchaseNode.cost)
                                        {
                                            Player.player.skills.sendPurchase(Player.player.movement.purchaseNode);
                                            return;
                                        }
                                        return;
                                    }
                                }
                            }
                            VehicleManager.exitVehicle();
                            return;
                        }
                        if (Player.player.inventory.isStoring && Player.player.inventory.shouldInteractCloseStorage)
                        {
                            PlayerDashboardUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeSignUI.active)
                        {
                            PlayerBarricadeSignUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeStereoUI.active)
                        {
                            PlayerBarricadeStereoUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeLibraryUI.active)
                        {
                            PlayerBarricadeLibraryUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeMannequinUI.active)
                        {
                            PlayerBarricadeMannequinUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerNPCDialogueUI.active)
                        {
                            if (PlayerNPCDialogueUI.dialogueAnimating)
                            {
                                PlayerNPCDialogueUI.skipText();
                                return;
                            }
                            if (PlayerNPCDialogueUI.dialogueHasNextPage)
                            {
                                PlayerNPCDialogueUI.nextPage();
                                return;
                            }
                            PlayerNPCDialogueUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        else
                        {
                            if (PlayerNPCQuestUI.active)
                            {
                                PlayerNPCQuestUI.closeNicely();
                                return;
                            }
                            if (PlayerNPCVendorUI.active)
                            {
                                PlayerNPCVendorUI.closeNicely();
                                return;
                            }
                        }
                    }
                }
                return;
            }
        }