Esempio n. 1
0
 // Token: 0x060037DE RID: 14302 RVA: 0x0018C1A5 File Offset: 0x0018A5A5
 private static void onClickedYesButton(SleekButton button)
 {
     if (PlayerBarricadeSignUI.sign != null)
     {
         BarricadeManager.updateSign(PlayerBarricadeSignUI.sign.transform, PlayerBarricadeSignUI.textField.text);
     }
     PlayerLifeUI.open();
     PlayerBarricadeSignUI.close();
 }
Esempio n. 2
0
 // Token: 0x06002170 RID: 8560 RVA: 0x000B6CB0 File Offset: 0x000B50B0
 public override void use()
 {
     PlayerBarricadeSignUI.open(base.objectAsset.interactabilityText);
     PlayerLifeUI.close();
     ObjectManager.useObjectQuest(base.transform);
     if (!Provider.isServer)
     {
         base.objectAsset.applyInteractabilityConditions(Player.player, false);
         base.objectAsset.grantInteractabilityRewards(Player.player, false);
     }
 }
Esempio n. 3
0
 // Token: 0x060037DC RID: 14300 RVA: 0x0018C0E0 File Offset: 0x0018A4E0
 public static void open(InteractableSign newSign)
 {
     if (PlayerBarricadeSignUI.active)
     {
         PlayerBarricadeSignUI.close();
         return;
     }
     PlayerBarricadeSignUI.active = true;
     PlayerBarricadeSignUI.sign   = newSign;
     PlayerBarricadeSignUI.yesButton.isVisible       = true;
     PlayerBarricadeSignUI.noButton.positionOffset_X = 5;
     PlayerBarricadeSignUI.noButton.sizeOffset_X     = 195;
     PlayerBarricadeSignUI.textField.text            = PlayerBarricadeSignUI.sign.text;
     PlayerBarricadeSignUI.textField.isVisible       = true;
     PlayerBarricadeSignUI.textBox.isVisible         = false;
     PlayerBarricadeSignUI.container.lerpPositionScale(0f, 0f, ESleekLerp.EXPONENTIAL, 20f);
 }
Esempio n. 4
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();
                 }
             }
         }
     }
 }
Esempio n. 5
0
 // Token: 0x060037DF RID: 14303 RVA: 0x0018C1DA File Offset: 0x0018A5DA
 private static void onClickedNoButton(SleekButton button)
 {
     PlayerLifeUI.open();
     PlayerBarricadeSignUI.close();
 }
 // Token: 0x060021DF RID: 8671 RVA: 0x000BB38A File Offset: 0x000B978A
 public override void use()
 {
     PlayerBarricadeSignUI.open(this);
     PlayerLifeUI.close();
 }