From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XChatVoiceStatusView.cs | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs (limited to 'Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs') diff --git a/Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs b/Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs new file mode 100644 index 00000000..d40678f0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs @@ -0,0 +1,109 @@ +using System; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XChatVoiceStatusView : DlgBase + { + public override string fileName + { + get + { + return "GameSystem/ChatVoiceStatus"; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool isHideChat + { + get + { + return false; + } + } + + public bool IsNormalHide { get; set; } + + protected override void OnShow() + { + base.OnShow(); + int num = 0; + while ((long)num < (long)((ulong)XChatVoiceStatusBehaviour.MAX_VOL_NUM)) + { + base.uiBehaviour.m_Volume[num].SetVisible(false); + num++; + } + this.IsNormalHide = false; + } + + protected override void OnUnload() + { + bool flag = !this.IsNormalHide; + if (flag) + { + XSingleton.singleton.StopRecord(true); + } + this.IsNormalHide = false; + } + + public void SetNormalHide(bool normal) + { + this.IsNormalHide = normal; + } + + public void OnSetVolume(uint volume) + { + bool flag = !base.IsLoaded() || !base.IsVisible(); + if (!flag) + { + bool flag2 = volume > XChatVoiceStatusBehaviour.MAX_VOL_NUM; + if (flag2) + { + volume = XChatVoiceStatusBehaviour.MAX_VOL_NUM; + } + else + { + bool flag3 = volume <= 0u; + if (flag3) + { + volume = 1u; + } + } + int num = 0; + while ((long)num < (long)((ulong)XChatVoiceStatusBehaviour.MAX_VOL_NUM)) + { + bool flag4 = base.uiBehaviour.m_Volume[num] != null; + if (flag4) + { + bool flag5 = (long)num < (long)((ulong)volume); + if (flag5) + { + base.uiBehaviour.m_Volume[num].SetVisible(true); + } + else + { + base.uiBehaviour.m_Volume[num].SetVisible(false); + } + } + num++; + } + } + } + } +} -- cgit v1.1-26-g67d0