diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XChatVoiceStatusView.cs | 109 |
1 files changed, 109 insertions, 0 deletions
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<XChatVoiceStatusView, XChatVoiceStatusBehaviour>
+ {
+ 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<XChatApolloMgr>.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++;
+ }
+ }
+ }
+ }
+}
|