Exemplo n.º 1
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();
    }
Exemplo n.º 2
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();
 }
Exemplo n.º 3
0
    private HUDSelectDialogElemData CreateElement(string name, bool show_new)
    {
        HUDSelectDialogElemData hudselectDialogElemData = new HUDSelectDialogElemData();

        hudselectDialogElemData.m_Object     = UnityEngine.Object.Instantiate <GameObject>(this.m_Prefab, base.transform);
        hudselectDialogElemData.m_DialogName = name;
        Localization localization = GreenHellGame.Instance.GetLocalization();

        hudselectDialogElemData.m_Text = hudselectDialogElemData.m_Object.GetComponentInChildren <Text>();
        if (PlayerSanityModule.Get().IsWhispersLevel())
        {
            if (this.m_TempSanityTexts.Count == 0)
            {
                this.m_TempSanityTexts.AddRange(this.m_SanityTexts);
            }
            int    index = UnityEngine.Random.Range(0, this.m_TempSanityTexts.Count);
            string key   = this.m_TempSanityTexts[index];
            hudselectDialogElemData.m_Text.text = localization.Get(key, true);
            this.m_TempSanityTexts.RemoveAt(index);
        }
        else
        {
            hudselectDialogElemData.m_Text.text = localization.Get("HUD_" + hudselectDialogElemData.m_DialogName, true);
        }
        hudselectDialogElemData.m_BG = hudselectDialogElemData.m_Object.FindChild("BG").GetComponent <RawImage>();
        hudselectDialogElemData.m_BG.gameObject.SetActive(false);
        hudselectDialogElemData.m_PadIconSelect = hudselectDialogElemData.m_Object.FindChild("PadIconSelect").gameObject;
        hudselectDialogElemData.m_PadIconSelect.SetActive(false);
        hudselectDialogElemData.m_CounterObject = hudselectDialogElemData.m_Object.FindChild("Counter").gameObject;
        if (show_new)
        {
            hudselectDialogElemData.m_CounterObject.SetActive(true);
            hudselectDialogElemData.m_CounterObject.GetComponentInChildren <Text>().text = this.m_NewText;
        }
        else
        {
            hudselectDialogElemData.m_CounterObject.SetActive(false);
        }
        return(hudselectDialogElemData);
    }