Esempio n. 1
0
 private void UpdateBatteryLevel()
 {
     this.m_BatteryLevel.text = (PlayerWalkieTalkieModule.Get().GetBatteryLevel() * 100f).ToString("F0") + "%";
     if (PlayerWalkieTalkieModule.Get().CanCall())
     {
         this.m_BatteryLevel.color = Color.white;
         return;
     }
     this.m_BatteryLevel.color = Color.red;
 }
Esempio n. 2
0
    private void UpdateVis()
    {
        Color color = Color.white;
        bool  flag  = PlayerWalkieTalkieModule.Get().CanCall();

        if (GreenHellGame.IsPCControllerActive())
        {
            using (List <HUDSelectDialogElemData> .Enumerator enumerator = this.m_Datas.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    HUDSelectDialogElemData hudselectDialogElemData = enumerator.Current;
                    if (flag && RectTransformUtility.RectangleContainsScreenPoint(hudselectDialogElemData.m_BG.rectTransform, Input.mousePosition))
                    {
                        this.m_MarkedData = hudselectDialogElemData;
                        hudselectDialogElemData.m_BG.gameObject.SetActive(true);
                    }
                    else
                    {
                        hudselectDialogElemData.m_BG.gameObject.SetActive(false);
                    }
                    color   = hudselectDialogElemData.m_Text.color;
                    color.a = (flag ? 1f : this.m_InactiveAlpha);
                    hudselectDialogElemData.m_Text.color = color;
                }
                goto IL_194;
            }
        }
        if (this.m_PadSelectionIndex < 0)
        {
            this.m_PadSelectionIndex = 0;
        }
        for (int i = 0; i < this.m_Datas.Count; i++)
        {
            HUDSelectDialogElemData hudselectDialogElemData2 = this.m_Datas[i];
            if (flag && i == this.m_PadSelectionIndex)
            {
                this.m_MarkedData = hudselectDialogElemData2;
                hudselectDialogElemData2.m_BG.gameObject.SetActive(true);
            }
            else
            {
                hudselectDialogElemData2.m_BG.gameObject.SetActive(false);
            }
            hudselectDialogElemData2.m_PadIconSelect.SetActive(hudselectDialogElemData2.m_BG.gameObject.activeSelf);
            color   = hudselectDialogElemData2.m_Text.color;
            color.a = (flag ? 1f : this.m_InactiveAlpha);
            hudselectDialogElemData2.m_Text.color = color;
        }
IL_194:
        this.UpdateHeaderText();
    }
Esempio n. 3
0
 public void StartDialogWithWT(string dialog_name)
 {
     this.StartDialog(dialog_name);
     if (this.IsAnyDialogPlaying() && (!Player.Get().m_ActiveFightController || !Player.Get().m_ActiveFightController.IsAttack()))
     {
         Player.Get().m_ShouldStartWalkieTalkieController = true;
         if (Player.Get().GetCurrentItem(Hand.Left) == null)
         {
             Player.Get().StartController(PlayerControllerType.WalkieTalkie);
         }
     }
     PlayerWalkieTalkieModule.Get().OnCall();
 }
Esempio n. 4
0
 private void OnSelectDialog(HUDSelectDialogElemData data)
 {
     if (data.m_Dialogs != null)
     {
         this.m_LastGroupName = data.m_DialogName;
         this.SetupGroup(data.m_Dialogs);
         return;
     }
     DialogsManager.Get().StartDialog(data.m_DialogName);
     PlayerWalkieTalkieModule.Get().OnCall();
     this.m_MarkedData           = null;
     this.m_LastSelectDialogTime = Time.time;
     this.Deactivate();
 }
Esempio n. 5
0
 private void UpdateHeaderText()
 {
     if (!PlayerWalkieTalkieModule.Get().CanCall())
     {
         this.m_HeaderText.text = this.m_HeaderCharging;
         return;
     }
     if (this.m_InGroup)
     {
         Localization localization = GreenHellGame.Instance.GetLocalization();
         this.m_HeaderText.text = localization.Get("HUD_" + this.m_LastGroupName, true);
         return;
     }
     this.m_HeaderText.text = this.m_HeaderSelectDialog;
 }
Esempio n. 6
0
    protected override void Update()
    {
        base.Update();
        this.UpdateScroll();
        this.m_MarkedData = null;
        this.UpdateVis();
        bool flag = PlayerWalkieTalkieModule.Get().CanCall();

        this.m_BackBG.gameObject.SetActive(this.m_MarkedData == null && RectTransformUtility.RectangleContainsScreenPoint(this.m_BackBG.rectTransform, Input.mousePosition));
        CursorManager.Get().SetCursor((this.m_MarkedData != null || this.m_BackBG.gameObject.activeSelf) ? CursorManager.TYPE.MouseOver : CursorManager.TYPE.Normal);
        if (flag && (Input.GetMouseButtonDown(0) || Input.GetKeyDown(InputHelpers.PadButton.Button_X.KeyFromPad())))
        {
            if (this.m_MarkedData != null)
            {
                this.OnSelectDialog(this.m_MarkedData);
            }
            else if (this.m_BackBG.gameObject.activeSelf)
            {
                if (this.m_InGroup)
                {
                    this.SetupDialogs();
                    this.m_InGroup = false;
                }
                else if (WalkieTalkieController.Get().IsActive())
                {
                    WalkieTalkieController.Get().Stop();
                }
            }
        }
        this.UpdateBatteryLevel();
        this.UpdateHeaderText();
        Color color = this.m_WTIcon.color;

        color.a             = (flag ? 1f : this.m_InactiveAlpha);
        this.m_WTIcon.color = color;
        this.UpdateBackButton();
    }
Esempio n. 7
0
 public bool CanSelectDialog()
 {
     return(!this.IsAnyDialogPlaying() && this.m_ScenarioDialogs.Count != 0 && PlayerWalkieTalkieModule.Get().CanCall());
 }
 protected override void Update()
 {
     base.Update();
     this.m_WTMask.fillAmount = PlayerWalkieTalkieModule.Get().GetBatteryLevel();
 }