示例#1
0
        // Token: 0x060038D2 RID: 14546 RVA: 0x0019FDC4 File Offset: 0x0019E1C4
        private static void onClickedResponseButton(SleekButton button)
        {
            byte             index            = (byte)PlayerNPCDialogueUI.responseBox.search(button);
            DialogueResponse dialogueResponse = PlayerNPCDialogueUI.responses[(int)index];
            DialogueAsset    dialogueAsset    = (DialogueAsset)Assets.find(EAssetType.NPC, dialogueResponse.dialogue);
            QuestAsset       questAsset       = (QuestAsset)Assets.find(EAssetType.NPC, dialogueResponse.quest);

            if (questAsset != null)
            {
                PlayerNPCDialogueUI.close();
                PlayerNPCQuestUI.open(questAsset, dialogueResponse, dialogueAsset, PlayerNPCDialogueUI.dialogue, (Player.player.quests.getQuestStatus(dialogueResponse.quest) != ENPCQuestStatus.READY) ? EQuestViewMode.BEGIN : EQuestViewMode.END);
            }
            else
            {
                VendorAsset vendorAsset = (VendorAsset)Assets.find(EAssetType.NPC, dialogueResponse.vendor);
                if (vendorAsset != null)
                {
                    PlayerNPCDialogueUI.close();
                    PlayerNPCVendorUI.open(vendorAsset, dialogueResponse, dialogueAsset, PlayerNPCDialogueUI.dialogue);
                }
                else
                {
                    PlayerNPCDialogueUI.registerResponse(PlayerNPCDialogueUI.dialogue, dialogueResponse);
                    if (dialogueAsset != null)
                    {
                        PlayerNPCDialogueUI.updateDialogue(dialogueAsset, PlayerNPCDialogueUI.dialogue);
                    }
                    else
                    {
                        PlayerNPCDialogueUI.close();
                        PlayerLifeUI.open();
                    }
                }
            }
        }
 // Token: 0x060038DD RID: 14557 RVA: 0x001A0D44 File Offset: 0x0019F144
 private static void onClickedAbandonButton(SleekButton button)
 {
     Player.player.quests.sendAbandonQuest(PlayerNPCQuestUI.quest.id);
     if (!Provider.isServer)
     {
         Player.player.quests.abandonQuest(PlayerNPCQuestUI.quest.id);
     }
     PlayerNPCQuestUI.closeNicely();
 }
 // Token: 0x060038D5 RID: 14549 RVA: 0x001A07A2 File Offset: 0x0019EBA2
 public static void open(QuestAsset newQuest, DialogueResponse newResponse, DialogueAsset newAcceptDialogue, DialogueAsset newDeclineDialogue, EQuestViewMode newMode)
 {
     if (PlayerNPCQuestUI.active)
     {
         return;
     }
     PlayerNPCQuestUI.active = true;
     PlayerNPCQuestUI.updateQuest(newQuest, newResponse, newAcceptDialogue, newDeclineDialogue, newMode);
     PlayerNPCQuestUI.container.lerpPositionScale(0f, 0f, ESleekLerp.EXPONENTIAL, 20f);
 }
 // Token: 0x060038D7 RID: 14551 RVA: 0x001A0808 File Offset: 0x0019EC08
 public static void closeNicely()
 {
     PlayerNPCQuestUI.close();
     if (PlayerNPCQuestUI.mode == EQuestViewMode.BEGIN)
     {
         PlayerNPCDialogueUI.open(PlayerNPCQuestUI.declineDialogue, null);
     }
     else if (PlayerNPCQuestUI.mode == EQuestViewMode.END)
     {
         PlayerNPCDialogueUI.registerResponse(PlayerNPCQuestUI.declineDialogue, PlayerNPCQuestUI.response);
         PlayerNPCDialogueUI.open(PlayerNPCQuestUI.acceptDialogue, PlayerNPCQuestUI.declineDialogue);
     }
     else if (PlayerNPCQuestUI.mode == EQuestViewMode.DETAILS)
     {
         PlayerDashboardInventoryUI.active   = false;
         PlayerDashboardCraftingUI.active    = false;
         PlayerDashboardSkillsUI.active      = false;
         PlayerDashboardInformationUI.active = true;
         PlayerDashboardUI.open();
     }
 }
 // Token: 0x060038DE RID: 14558 RVA: 0x001A0D92 File Offset: 0x0019F192
 private static void onClickedReturnButton(SleekButton button)
 {
     PlayerNPCQuestUI.closeNicely();
 }
 // Token: 0x060038DB RID: 14555 RVA: 0x001A0CCE File Offset: 0x0019F0CE
 private static void onClickedContinueButton(SleekButton button)
 {
     PlayerNPCQuestUI.close();
     PlayerNPCDialogueUI.registerResponse(PlayerNPCQuestUI.declineDialogue, PlayerNPCQuestUI.response);
     PlayerNPCDialogueUI.open(PlayerNPCQuestUI.acceptDialogue, PlayerNPCQuestUI.declineDialogue);
 }
 // Token: 0x060038DA RID: 14554 RVA: 0x001A0CBC File Offset: 0x0019F0BC
 private static void onClickedDeclineButton(SleekButton button)
 {
     PlayerNPCQuestUI.close();
     PlayerNPCDialogueUI.open(PlayerNPCQuestUI.declineDialogue, null);
 }
示例#8
0
 // Token: 0x06002C0E RID: 11278 RVA: 0x00117EA4 File Offset: 0x001162A4
 private void Update()
 {
     if (base.channel.isOwner)
     {
         if (base.player.stance.stance != EPlayerStance.DRIVING && base.player.stance.stance != EPlayerStance.SITTING && !base.player.life.isDead && !base.player.workzone.isBuilding)
         {
             if (Time.realtimeSinceStartup - PlayerInteract.lastInteract > 0.1f)
             {
                 PlayerInteract.lastInteract = Time.realtimeSinceStartup;
                 if (base.player.look.isCam)
                 {
                     PhysicsUtility.raycast(new Ray(base.player.look.aim.position, base.player.look.aim.forward), out PlayerInteract.hit, 4f, RayMasks.PLAYER_INTERACT, QueryTriggerInteraction.UseGlobal);
                 }
                 else
                 {
                     PhysicsUtility.raycast(new Ray(MainCamera.instance.transform.position, MainCamera.instance.transform.forward), out PlayerInteract.hit, (float)((base.player.look.perspective != EPlayerPerspective.THIRD) ? 4 : 6), RayMasks.PLAYER_INTERACT, QueryTriggerInteraction.UseGlobal);
                 }
             }
             if (PlayerInteract.hit.transform != PlayerInteract.focus)
             {
                 if (PlayerInteract.focus != null && PlayerInteract.interactable != null)
                 {
                     InteractableDoorHinge component = PlayerInteract.focus.GetComponent <InteractableDoorHinge>();
                     if (component != null)
                     {
                         HighlighterTool.unhighlight(PlayerInteract.focus.parent.parent);
                     }
                     else
                     {
                         HighlighterTool.unhighlight(PlayerInteract.focus);
                     }
                 }
                 PlayerInteract.focus          = null;
                 PlayerInteract.target         = null;
                 PlayerInteract._interactable  = null;
                 PlayerInteract._interactable2 = null;
                 if (PlayerInteract.hit.transform != null)
                 {
                     PlayerInteract.focus          = PlayerInteract.hit.transform;
                     PlayerInteract._interactable  = PlayerInteract.focus.GetComponent <Interactable>();
                     PlayerInteract._interactable2 = PlayerInteract.focus.GetComponent <Interactable2>();
                     if (PlayerInteract.interactable != null)
                     {
                         PlayerInteract.target = PlayerInteract.focus.FindChildRecursive("Target");
                         if (PlayerInteract.interactable.checkInteractable())
                         {
                             if (PlayerUI.window.isEnabled)
                             {
                                 if (PlayerInteract.interactable.checkUseable())
                                 {
                                     Color color;
                                     if (!PlayerInteract.interactable.checkHighlight(out color))
                                     {
                                         color = Color.green;
                                     }
                                     InteractableDoorHinge component2 = PlayerInteract.focus.GetComponent <InteractableDoorHinge>();
                                     if (component2 != null)
                                     {
                                         HighlighterTool.highlight(PlayerInteract.focus.parent.parent, color);
                                     }
                                     else
                                     {
                                         HighlighterTool.highlight(PlayerInteract.focus, color);
                                     }
                                 }
                                 else
                                 {
                                     Color color = Color.red;
                                     InteractableDoorHinge component3 = PlayerInteract.focus.GetComponent <InteractableDoorHinge>();
                                     if (component3 != null)
                                     {
                                         HighlighterTool.highlight(PlayerInteract.focus.parent.parent, color);
                                     }
                                     else
                                     {
                                         HighlighterTool.highlight(PlayerInteract.focus, color);
                                     }
                                 }
                             }
                         }
                         else
                         {
                             PlayerInteract.target        = null;
                             PlayerInteract._interactable = null;
                         }
                     }
                 }
             }
         }
         else
         {
             if (PlayerInteract.focus != null && PlayerInteract.interactable != null)
             {
                 InteractableDoorHinge component4 = PlayerInteract.focus.GetComponent <InteractableDoorHinge>();
                 if (component4 != null)
                 {
                     HighlighterTool.unhighlight(PlayerInteract.focus.parent.parent);
                 }
                 else
                 {
                     HighlighterTool.unhighlight(PlayerInteract.focus);
                 }
             }
             PlayerInteract.focus          = null;
             PlayerInteract.target         = null;
             PlayerInteract._interactable  = null;
             PlayerInteract._interactable2 = null;
         }
     }
     if (base.channel.isOwner && !base.player.life.isDead)
     {
         if (PlayerInteract.interactable != null)
         {
             EPlayerMessage message;
             string         text;
             Color          color2;
             if (PlayerInteract.interactable.checkHint(out message, out text, out color2) && !PlayerUI.window.showCursor)
             {
                 if (PlayerInteract.interactable.CompareTag("Item"))
                 {
                     PlayerUI.hint((!(PlayerInteract.target != null)) ? PlayerInteract.focus : PlayerInteract.target, message, text, color2, new object[]
                     {
                         ((InteractableItem)PlayerInteract.interactable).item,
                         ((InteractableItem)PlayerInteract.interactable).asset
                     });
                 }
                 else
                 {
                     PlayerUI.hint((!(PlayerInteract.target != null)) ? PlayerInteract.focus : PlayerInteract.target, message, text, color2, new object[0]);
                 }
             }
         }
         else if (PlayerInteract.purchaseAsset != null && base.player.movement.purchaseNode != null && !PlayerUI.window.showCursor)
         {
             PlayerUI.hint(null, EPlayerMessage.PURCHASE, string.Empty, Color.white, new object[]
             {
                 PlayerInteract.purchaseAsset.itemName,
                 base.player.movement.purchaseNode.cost
             });
         }
         else if (PlayerInteract.focus != null && PlayerInteract.focus.CompareTag("Enemy"))
         {
             Player player = DamageTool.getPlayer(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
                 });
             }
         }
         EPlayerMessage message2;
         float          data;
         if (PlayerInteract.interactable2 != null && PlayerInteract.interactable2.checkHint(out message2, out data) && !PlayerUI.window.showCursor)
         {
             PlayerUI.hint2(message2, (!PlayerInteract.isHoldingKey) ? 0f : ((Time.realtimeSinceStartup - PlayerInteract.lastKeyDown) / this.salvageTime), data);
         }
         if ((base.player.stance.stance == EPlayerStance.DRIVING || base.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))
         {
             PlayerInteract.lastKeyDown  = Time.realtimeSinceStartup;
             PlayerInteract.isHoldingKey = true;
         }
         if (Input.GetKeyDown(ControlsSettings.inspect) && ControlsSettings.inspect != ControlsSettings.interact && base.player.equipment.canInspect)
         {
             base.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[0]);
         }
         if (PlayerInteract.isHoldingKey)
         {
             if (Input.GetKeyUp(ControlsSettings.interact))
             {
                 PlayerInteract.isHoldingKey = false;
                 if (PlayerUI.window.showCursor)
                 {
                     if (base.player.inventory.isStoring && base.player.inventory.shouldInteractCloseStorage)
                     {
                         PlayerDashboardUI.close();
                         PlayerLifeUI.open();
                     }
                     else if (PlayerBarricadeSignUI.active)
                     {
                         PlayerBarricadeSignUI.close();
                         PlayerLifeUI.open();
                     }
                     else if (PlayerBarricadeStereoUI.active)
                     {
                         PlayerBarricadeStereoUI.close();
                         PlayerLifeUI.open();
                     }
                     else if (PlayerBarricadeLibraryUI.active)
                     {
                         PlayerBarricadeLibraryUI.close();
                         PlayerLifeUI.open();
                     }
                     else if (PlayerBarricadeMannequinUI.active)
                     {
                         PlayerBarricadeMannequinUI.close();
                         PlayerLifeUI.open();
                     }
                     else if (PlayerNPCDialogueUI.active)
                     {
                         if (PlayerNPCDialogueUI.dialogueAnimating)
                         {
                             PlayerNPCDialogueUI.skipText();
                         }
                         else if (PlayerNPCDialogueUI.dialogueHasNextPage)
                         {
                             PlayerNPCDialogueUI.nextPage();
                         }
                         else
                         {
                             PlayerNPCDialogueUI.close();
                             PlayerLifeUI.open();
                         }
                     }
                     else if (PlayerNPCQuestUI.active)
                     {
                         PlayerNPCQuestUI.closeNicely();
                     }
                     else if (PlayerNPCVendorUI.active)
                     {
                         PlayerNPCVendorUI.closeNicely();
                     }
                 }
                 else if (base.player.stance.stance == EPlayerStance.DRIVING || base.player.stance.stance == EPlayerStance.SITTING)
                 {
                     VehicleManager.exitVehicle();
                 }
                 else if (PlayerInteract.focus != null && PlayerInteract.interactable != null)
                 {
                     if (PlayerInteract.interactable.checkUseable())
                     {
                         PlayerInteract.interactable.use();
                     }
                 }
                 else if (PlayerInteract.purchaseAsset != null)
                 {
                     if (base.player.skills.experience >= base.player.movement.purchaseNode.cost)
                     {
                         base.player.skills.sendPurchase(base.player.movement.purchaseNode);
                     }
                 }
                 else if (ControlsSettings.inspect == ControlsSettings.interact && base.player.equipment.canInspect)
                 {
                     base.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[0]);
                 }
             }
             else if (Time.realtimeSinceStartup - PlayerInteract.lastKeyDown > this.salvageTime)
             {
                 PlayerInteract.isHoldingKey = false;
                 if (!PlayerUI.window.showCursor && PlayerInteract.interactable2 != null)
                 {
                     PlayerInteract.interactable2.use();
                 }
             }
         }
     }
 }