zhaoyang 3 年之前
父节点
当前提交
33d004b883

+ 11 - 5
FGUIProject/assets/Common/AlertUI.xml

@@ -1,18 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="936,388">
+<component size="1080,1920">
   <displayList>
-    <image id="n0_l55o" name="bg" src="lwri5u" fileName="imagesExport/hc_kuang_6.png" xy="0,0" size="936,388">
+    <graph id="n6_a8jv" name="graphBg" xy="0,0" size="1080,1920" alpha="0.6" type="rect" lineSize="0" fillColor="#ff000000">
+      <relation target="" sidePair="width-width,height-height"/>
+    </graph>
+    <image id="n0_l55o" name="bg" src="lwri5u" fileName="imagesExport/hc_kuang_6.png" xy="72,766" size="936,388" group="n8_a8jv">
       <relation target="n5_l55o" sidePair="height-height"/>
     </image>
-    <text id="n5_l55o" name="txtContent" xy="111,87" size="714,49" fontSize="36" color="#876e54" align="center" vAlign="middle" autoSize="height" text=""/>
-    <component id="n3_l55o" name="btnLeft" src="q08x6" fileName="components/Button1.xml" xy="54,238">
+    <text id="n5_l55o" name="txtContent" xy="183,853" size="714,49" group="n8_a8jv" fontSize="36" color="#876e54" align="center" vAlign="middle" autoSize="height" text=""/>
+    <component id="n3_l55o" name="btnLeft" src="q08x6" fileName="components/Button1.xml" xy="126,1004" group="n8_a8jv">
       <relation target="n0_l55o" sidePair="bottom-bottom"/>
       <Button title="取消"/>
     </component>
-    <component id="n4_l55o" name="btnRight" src="q08x7" fileName="components/Button2.xml" xy="496,238">
+    <component id="n4_l55o" name="btnRight" src="q08x7" fileName="components/Button2.xml" xy="568,1004" group="n8_a8jv">
       <relation target="n3_l55o" sidePair="top-top"/>
       <Button title="确认"/>
     </component>
+    <group id="n8_a8jv" name="n8" xy="72,766" size="936,388" advanced="true">
+      <relation target="" sidePair="center-center,top-top"/>
+    </group>
   </displayList>
   <relation target="n0_l55o" sidePair="height-height"/>
 </component>

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Constant/ConstViewLayer.cs

@@ -10,7 +10,7 @@ namespace GFGGame
         /// </summary>
         public const string BOTTOM = "BOTTOM";
         /// <summary>
-        /// 最顶层
+        /// UI最顶层
         /// </summary>
         public const string TOP = "TOP";
         /// <summary>

+ 23 - 16
GameClient/Assets/Game/HotUpdate/Controller/AntiAddictionController.cs

@@ -6,8 +6,10 @@ namespace GFGGame
 {
     public class AntiAddictionController
     {
-        public static bool CheckAntiAddiction(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay) {
-            if(!GameGlobal.antiAddiction) {
+        public static bool CheckAntiAddiction(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
+        {
+            if (!GameGlobal.antiAddiction)
+            {
                 return false;
             }
             Debug.LogFormat("init onlineTimeSecs {0} onlineDurationSecs {1} onlineDurationSecsDay{2}", onlineTimeSecs, onlineDurationSecs, onlineDurationSecsDay);
@@ -18,8 +20,9 @@ namespace GFGGame
                 if (remainMinutes <= 0)
                 {
                     string promptStr = "您属于未成年人,已被纳入防沉迷系统。仅可在周五、周六、周日和法定节假日每日20时至21时登录游戏,目前已超出健康游戏体验时间,将强制游戏下线。";
-                    Alert.Show(promptStr)
-                        .SetRightButton(true, "知道啦", (object data) => {
+                    AlertSystem.Show(promptStr)
+                        .SetRightButton(true, "知道啦", (object data) =>
+                        {
                             GameController.QuitToLoginView(false);
                         });
                     return true;
@@ -41,15 +44,16 @@ namespace GFGGame
                         promptStr += "单次充值金额不得超过{0}元人民币,每月充值金额不得超过{1}元人民币。";
                         promptStr = String.Format(promptStr, maxRechargeSingle, maxRechargeTotal);
                     }
-                    Alert.Show(promptStr)
+                    AlertSystem.Show(promptStr)
                         .SetRightButton(true, "知道啦");
                 }
             }
             return false;
         }
 
-        public static bool CheckOnlineTime(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay) {
-            if(!GameGlobal.antiAddiction)
+        public static bool CheckOnlineTime(int onlineTimeSecs, int onlineDurationSecs, int onlineDurationSecsDay)
+        {
+            if (!GameGlobal.antiAddiction)
             {
                 return false;
             }
@@ -61,8 +65,9 @@ namespace GFGGame
                 if (remainMinutes <= 0)
                 {
                     string promptStr = "您属于未成年人,已被纳入防沉迷系统。仅可在周五、周六、周日和法定节假日每日20时至21时登录游戏。目前已超出健康游戏体验时间,将强制游戏下线。";
-                    Alert.Show(promptStr)
-                        .SetRightButton(true, "知道啦", (object data) => {
+                    AlertSystem.Show(promptStr)
+                        .SetRightButton(true, "知道啦", (object data) =>
+                        {
                             GameController.QuitToLoginView(false);
                         });
                     return true;
@@ -71,8 +76,9 @@ namespace GFGGame
             return false;
         }
 
-        public static bool CheckAntiAddictionRecharge(int value) {
-            if(!GameGlobal.antiAddiction)
+        public static bool CheckAntiAddictionRecharge(int value)
+        {
+            if (!GameGlobal.antiAddiction)
             {
                 return false;
             }
@@ -80,8 +86,8 @@ namespace GFGGame
             if (GameGlobal.isVisitor)
             {
                 promptStr += "您当前为游客模式,已被纳入防沉迷系统,在此模式下不能充值和付费消费。";
-                Alert.Show(promptStr)
-                    .SetRightButton(true, "知道啦");
+                AlertSystem.Show(promptStr)
+                     .SetRightButton(true, "知道啦");
                 return true;
             }
             string ageRangeStr = null;
@@ -94,7 +100,7 @@ namespace GFGGame
             if (age < 8)
             {
                 promptStr += "本游戏不为未满8周岁的用户提供游戏充值服务。";
-                Alert.Show(promptStr)
+                AlertSystem.Show(promptStr)
                     .SetRightButton(true, "知道啦");
                 return true;
             }
@@ -105,7 +111,7 @@ namespace GFGGame
                 {
                     promptStr += "单次充值金额不得超过{0}元人民币,每月充值金额不得超过{1}元人民币。";
                     promptStr = String.Format(promptStr, maxRechargeSingle, maxRechargeTotal);
-                    Alert.Show(promptStr)
+                    AlertSystem.Show(promptStr)
                         .SetRightButton(true, "知道啦");
                     return true;
                 }
@@ -113,7 +119,8 @@ namespace GFGGame
             return false;
         }
 
-        private static void GetAntiValue(out string ageRangeStr, out int maxRechargeSingle, out int maxRechargeTotal) {
+        private static void GetAntiValue(out string ageRangeStr, out int maxRechargeSingle, out int maxRechargeTotal)
+        {
             int age = GameGlobal.userAge;
             if (age < 8)
             {

+ 7 - 7
GameClient/Assets/Game/HotUpdate/Controller/ErrorCodeController.cs

@@ -7,11 +7,11 @@ namespace GFGGame
         //返回结果为true时,表示可以继续失败步骤
         public static bool Handler(int errorCode)
         {
-            switch(errorCode)
+            switch (errorCode)
             {
                 case ET.ErrorCode.ERR_NetWorkError:
                     {
-                        Alert.Show("网络异常")
+                        AlertSystem.Show("网络异常")
                         .SetRightButton(true, "知道了", (object data) =>
                         {
                             Application.Quit();
@@ -20,7 +20,7 @@ namespace GFGGame
                     break;
                 case ET.ErrorCode.ERR_ClientVersionError:
                     {
-                        Alert.Show("客户端版本错误,请联系研发获取最新版本!")
+                        AlertSystem.Show("客户端版本错误,请联系研发获取最新版本!")
                             .SetLeftButton(true, "知道了", (data) =>
                             {
                                 Application.Quit();
@@ -29,13 +29,13 @@ namespace GFGGame
                     break;
                 case ET.ErrorCode.Err_LoginCountFull:
                     {
-                        Alert.Show("游戏已爆满,请稍后再试!")
-                            .SetLeftButton(true, "知道了");
+                        AlertSystem.Show("游戏已爆满,请稍后再试!")
+                              .SetLeftButton(true, "知道了");
                     }
                     break;
                 case ET.ErrorCode.Err_ServerMaintain:
                     {
-                        Alert.Show("服务器维护中,请稍后再试!")
+                        AlertSystem.Show("服务器维护中,请稍后再试!")
                             .SetLeftButton(true, "知道了", (data) =>
                             {
                                 Application.Quit();
@@ -45,7 +45,7 @@ namespace GFGGame
                 case ET.ErrorCode.ERR_AntiAddiction:
                     {
                         string promptStr = "您属于未成年人,已被纳入防沉迷系统。每日22时至次日8时,本游戏将无法为未成年人用户提供游戏服务。";
-                        Alert.Show(promptStr)
+                        AlertSystem.Show(promptStr)
                             .SetRightButton(true, "知道啦", (object data) =>
                             {
 

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -168,6 +168,7 @@ namespace GFGGame
             {
                 Logout().Coroutine();
             }
+            ViewManager.Hide<GuideView>();
             ViewManager.Show<LoginView>(null, null, true);
             LoginController.Logout();
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -164,7 +164,7 @@ namespace GFGGame
             var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
             if (serverInfosComponent.ServerInfoList.Count <= 0)
             {
-                Alert.Show("服务器列表为空:\n请检查网络和服务器状态")
+                AlertSystem.Show("服务器列表为空:\n请检查网络和服务器状态")
                     .SetRightButton(true, "知道啦", (object data) =>
                     {
                         Application.Quit();

+ 6 - 6
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/Account/A2C_DisconnectHandler.cs

@@ -8,26 +8,26 @@ namespace ET
         {
             session?.GetComponent<DisConnectedCompnent>()?.CancelAlert();
             session.Dispose();
-            switch(message.Error)
+            switch (message.Error)
             {
                 case ErrorCode.ERR_loginTimeOut:
-                    Alert.Show("登录超时,请重新登录!")
+                    AlertSystem.Show("登录超时,请重新登录!")
                         .SetLeftButton(true, "返回登录", (obj) =>
                         {
                             GameController.QuitToLoginView(false);
                         });
                     break;
                 case ErrorCode.ERR_loginByOther:
-                    Alert.Show("账号已在其他地方登录!")
+                    AlertSystem.Show("账号已在其他地方登录!")
                         .SetLeftButton(true, "返回登录", (obj) =>
                         {
                             GameController.QuitToLoginView(true);
                         });
                     break;
                 default:
-                    if(string.IsNullOrEmpty(message.Message))
+                    if (string.IsNullOrEmpty(message.Message))
                     {
-                        Alert.Show(message.Message)
+                        AlertSystem.Show(message.Message)
                         .SetLeftButton(true, "返回登录", (obj) =>
                         {
                             GameController.QuitToLoginView(true);
@@ -35,7 +35,7 @@ namespace ET
                     }
                     else
                     {
-                        Alert.Show("您已被迫下线!");
+                        AlertSystem.Show("您已被迫下线!");
                     }
                     break;
             }

+ 5 - 7
GameClient/Assets/Game/HotUpdate/ETCodes/Hotfix/App/DisConnected/DisConnectedCompnentSystem.cs

@@ -13,13 +13,11 @@ namespace ET
         {
             if (self.showAlert)
             {
-                ViewManager.Hide<GuideView>();
-
-                Alert.Show("服务器连接已断开!")
-                    .SetLeftButton(true, "返回登录", (obj) =>
-                    {
-                        GameController.QuitToLoginView(false);
-                    });
+                AlertSystem.Show("服务器连接已断开!")
+                      .SetLeftButton(true, "返回登录", (obj) =>
+                      {
+                          GameController.QuitToLoginView(false);
+                      });
             }
             self.showAlert = true;
         }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Common/UI_AlertUI.cs

@@ -7,6 +7,7 @@ namespace UI.Common
     public partial class UI_AlertUI
     {
         public GComponent target;
+        public GGraph m_graphBg;
         public GImage m_bg;
         public GTextField m_txtContent;
         public GButton m_btnLeft;
@@ -58,6 +59,7 @@ namespace UI.Common
 
         private void Init(GComponent comp)
         {
+            m_graphBg = (GGraph)comp.GetChild("graphBg");
             m_bg = (GImage)comp.GetChild("bg");
             m_txtContent = (GTextField)comp.GetChild("txtContent");
             m_btnLeft = (GButton)comp.GetChild("btnLeft");
@@ -65,6 +67,7 @@ namespace UI.Common
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_graphBg = null;
             m_bg = null;
             m_txtContent = null;
             m_btnLeft = null;

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/Alert.cs

@@ -23,6 +23,7 @@ namespace GFGGame
                 _alertWindow = new AlertWindow();
             }
             _alertWindow.Reset();
+            _alertWindow.SetLayer(ConstViewLayer.TOP);
             _alertWindow.SetMessage(message);
             _alertWindow.Show();
 

+ 43 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertSystem.cs

@@ -0,0 +1,43 @@
+/*
+ * 使用示例:
+    AlertSystem.Show("喜欢吗!")
+    .SetTitle("温馨提示")
+    .SetLeftButton(true, "喜欢", (object data1) =>
+    {
+        
+    })
+    .SetRightButton(true, "不喜欢")
+    .SetData("aa");
+ */
+
+namespace GFGGame
+{
+    public class AlertSystem
+    {
+        private static AlertWindow _alertWindow;
+
+        public static IAlert Show(string message)
+        {
+            if (_alertWindow == null)
+            {
+                _alertWindow = new AlertWindow();
+            }
+
+            _alertWindow.Reset();
+            _alertWindow.SetLayer(ConstViewLayer.ALERT);
+            _alertWindow.SetMessage(message);
+            _alertWindow.Show();
+
+            return _alertWindow;
+        }
+
+        public static void hide()
+        {
+            if (_alertWindow != null)
+            {
+                _alertWindow.Hide();
+            }
+        }
+    }
+
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b379ab3e8438491448933efb9648be35
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 14 - 10
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertWindow.cs

@@ -4,7 +4,7 @@ using UI.Common;
 namespace GFGGame
 {
     //不要直接创建此类,通过AlertSystem调用
-    public class AlertWindow : BaseWindow, IAlert
+    public class AlertWindow : BaseView, IAlert
     {
         public delegate void AlertCallback(object data);
         private UI_AlertUI _ui;
@@ -20,9 +20,9 @@ namespace GFGGame
         private AlertCallback m_leftButtonCallback = null;
         private AlertCallback m_rightButtonCallback = null;
 
+        private bool _setAlertLayer = false;
         public AlertWindow() : base()
         {
-
         }
 
         protected override void OnInit()
@@ -30,15 +30,14 @@ namespace GFGGame
             base.OnInit();
             _ui = UI_AlertUI.Create();
             this.viewCom = _ui.target;
-            this.viewCom.Center();
-            this.modal = true;
-            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
-            //this.clickBlankToClose = false;
+            isfullScreen = true;
+            layer = ConstViewLayer.TOP;
+            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+            this.viewCom.Center();
             m_xLeftButton = _ui.m_btnLeft.x;
             m_xRightButton = _ui.m_btnRight.x;
             // this.sortingOrder = ConstSortingOrder.FLOATING_PROMPT;
-
             this.SetMessage(m_content);
             this.SetLeftButton(m_isShowLeftButton, m_textLeft);
             this.SetRightButton(m_isShowRightButton, m_textRight);
@@ -59,7 +58,7 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-
+            _ui.target.Center();
         }
 
         protected override void OnHide()
@@ -77,7 +76,12 @@ namespace GFGGame
         //        }
         //    }
         //}
+        public IAlert SetLayer(string setlayer)
+        {
+            layer = setlayer;
+            return this;
 
+        }
         private void updateButtonPosition()
         {
             float xLeftButton = m_xLeftButton;
@@ -112,7 +116,7 @@ namespace GFGGame
             m_rightButtonCallback = null;
             m_isShowLeftButton = false;
             m_isShowRightButton = false;
-            clickBlankToClose = false;
+            // clickBlankToClose = false;
             m_data = null;
             if (this._ui != null)
             {
@@ -188,7 +192,7 @@ namespace GFGGame
 
         public IAlert SetClickBlankToClose(bool value)
         {
-            this.clickBlankToClose = value;
+            // this.clickBlankToClose = value;
             return this;
         }
         protected override void UpdateToCheckGuide(object param)

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/IAlert.cs

@@ -4,6 +4,7 @@ namespace GFGGame
 {
     public interface IAlert
     {
+        IAlert SetLayer(string layer);
         IAlert SetMessage(string message);
         IAlert SetLeftButton(bool isShow, string textLeft = "取消", AlertCallback callback = null);
         IAlert SetRightButton(bool isShow, string textRight = "确认", AlertCallback callback = null);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -346,7 +346,7 @@ namespace GFGGame
         {
             if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home))
             {
-                Alert.Show("我会想你的")
+                AlertSystem.Show("我会想你的")
                 .SetLeftButton(true, "继续游戏")
                 .SetRightButton(true, "退出游戏", (object data) =>
                 {

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/MainUI/RoleInfoView.cs

@@ -63,7 +63,7 @@ namespace GFGGame
 
         private void OnClickBtnExit()
         {
-            Alert.Show("确认返回登录页吗?")
+            AlertSystem.Show("确认返回登录页吗?")
                 .SetLeftButton(true)
                 .SetRightButton(true, "确认", (object data) =>
                 {
@@ -73,7 +73,7 @@ namespace GFGGame
 
         private void OnClickBtnLogout()
         {
-            Alert.Show("确认注销当前账号吗?")
+            AlertSystem.Show("确认注销当前账号吗?")
                 .SetLeftButton(true)
                 .SetRightButton(true, "确认", (object data) =>
                 {

二进制
GameClient/Assets/ResIn/UI/Common/Common_fui.bytes