Quellcode durchsuchen

增加了一个简易的登陆出错处理

大爷 vor 2 Jahren
Ursprung
Commit
d5f5c4b2b1

+ 8 - 6
FGUIProject/assets/Login/Login.xml

@@ -2,14 +2,16 @@
 <component size="900,1600">
   <displayList>
     <image id="n31_j5ra" name="n31" src="j5rasi" fileName="loginbg.png" xy="0,0"/>
-    <component id="n12_8ibs" name="Btn_Login" src="pdjlb" fileName="Btn_StartGame.xml" xy="270,984" size="297,64" group="n16_8ibs">
+    <component id="n12_8ibs" name="Btn_Login" src="pdjlb" fileName="Btn_StartGame.xml" xy="316,984" size="297,64" group="n16_8ibs">
       <Button titleColor="#ffffff" titleFontSize="40"/>
     </component>
-    <image id="n28_j5ra" name="n28" src="pdjl8" fileName="UI_LoginInput.PNG" xy="220,838" size="368,47" group="n16_8ibs"/>
-    <text id="n25_j5ra" name="input_name" xy="270,838" size="293,46" group="n16_8ibs" fontSize="30" color="#ffffff" vAlign="middle" autoSize="none" text="" input="true" prompt="[i][color=#999999]输入用户名&#xA;[/color][/i]" maxLength="16" keyboardType="1"/>
-    <image id="n29_j5ra" name="n29" src="pdjl8" fileName="UI_LoginInput.PNG" xy="220,906" size="368,47" group="n16_8ibs"/>
-    <text id="n30_j5ra" name="input_password" xy="270,906" size="293,46" group="n16_8ibs" font="ui://btak13q2brolh" fontSize="30" color="#ffffff" vAlign="middle" autoSize="none" text="" input="true" prompt="[i][color=#999999]输入密码[/color][/i]" maxLength="16" keyboardType="1" password="true"/>
-    <group id="n16_8ibs" name="Gro_LoginInfo" xy="220,838" size="368,210"/>
+    <image id="n28_j5ra" name="n28" src="pdjl8" fileName="UI_LoginInput.PNG" xy="266,838" size="368,47" group="n16_8ibs"/>
+    <text id="n25_j5ra" name="input_name" xy="316,838" size="293,46" group="n16_8ibs" fontSize="30" color="#ffffff" vAlign="middle" autoSize="none" text="" input="true" prompt="[i][color=#999999]输入用户名&#xA;[/color][/i]" maxLength="16" keyboardType="1"/>
+    <image id="n29_j5ra" name="n29" src="pdjl8" fileName="UI_LoginInput.PNG" xy="266,906" size="368,47" group="n16_8ibs"/>
+    <text id="n30_j5ra" name="input_password" xy="316,906" size="293,46" group="n16_8ibs" font="ui://btak13q2brolh" fontSize="30" color="#ffffff" vAlign="middle" autoSize="none" text="" input="true" prompt="[i][color=#999999]输入密码[/color][/i]" maxLength="16" keyboardType="1" password="true"/>
+    <text id="n33_a12q" name="txt_tips" xy="6,1073" size="888,254" group="n16_8ibs" visible="false" fontSize="24" color="#ff3300" align="center" ubb="true" autoSize="none" strokeColor="#ff9900" strokeSize="0.05" text=""/>
+    <image id="n32_a12q" name="img_tips" src="pxxk1" fileName="UIMajorCity_48.PNG" xy="400,1065" group="n16_8ibs" visible="false"/>
+    <group id="n16_8ibs" name="Gro_LoginInfo" xy="6,838" size="888,489"/>
     <text id="n23_rwz6" name="Text_Version" xy="0,1213" size="865,343" fontSize="20" color="#ffffff" align="right" vAlign="bottom" autoSize="none" text="Version:1"/>
   </displayList>
   <transition name="Tween_LoginPanelFlyIn" autoPlay="true"/>

BIN
FGUIProject/assets/Login/UIMajorCity_48.PNG


+ 2 - 1
FGUIProject/assets/Login/package.xml

@@ -9,6 +9,7 @@
     <image id="pdjlc" name="banzi_da.png" path="/"/>
     <component id="brolsg" name="Btn_ContinueGame.xml" path="/"/>
     <image id="j5rasi" name="loginbg.png" path="/"/>
+    <image id="pxxk1" name="UIMajorCity_48.PNG" path="/"/>
   </resources>
-  <publish name=""/>
+  <publish name="" genCode="true"/>
 </packageDescription>

+ 1 - 1
FGUIProject/settings/Publish.json

@@ -9,7 +9,7 @@
   "compressPNG": false,
   "codeGeneration": {
     "allowGenCode": true,
-    "codePath": "../Unity\\Assets\\Scripts\\Codes\\Model\\Client\\FGUIGenerate",
+    "codePath": "../Unity\\Assets\\Scripts\\Codes\\ModelView\\Client\\FGUIGenerate",
     "classNamePrefix": "",
     "memberNamePrefix": "",
     "packageName": "FUI",

BIN
Unity/Assets/Res/FGUI/Login_atlas0.png


BIN
Unity/Assets/Res/FGUI/Login_fui.bytes


+ 1 - 0
Unity/Assets/Scripts/Codes/Hotfix/Client/Demo/Login/LoginHelper.cs

@@ -42,6 +42,7 @@ namespace ET.Client
             }
             catch (Exception e)
             {
+                await EventSystem.Instance.PublishAsync(clientScene, new EventType.LoginFinish() { exeception = e.Message });
                 Log.Error(e);
             }
         } 

+ 27 - 2
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/LoginFinish_RemoveLoginUI.cs

@@ -1,11 +1,36 @@
-namespace ET.Client
+using FairyGUI;
+using Sirenix.Utilities;
+
+namespace ET.Client
 {
 	[Event(SceneType.Client)]
 	public class LoginFinish_RemoveLoginUI: AEvent<EventType.LoginFinish>
 	{
 		protected override async ETTask Run(Scene scene, EventType.LoginFinish args)
 		{
-			await UIHelper.Remove(scene, UIType.UILogin);
+			if(!args.exeception.IsNullOrWhitespace()) 
+			{
+				var loginview = GRoot.inst.GetChild("Login");
+				if(loginview != null)
+				{
+					var component = loginview.asCom;
+					var tips = component.GetChild("txt_tips");
+					tips.visible = true;
+					tips.text = "连接服务器过程中出现了问题\n" +
+						"如重试后还是不行,请与客服联系" +
+						"\n[color=#FFCCCC][b]QQ: 400888666[/b][/color]  微信:[color=#FFCCCC][b]大老板[/color][/b]";
+                    component.GetChild("img_tips").visible = false;
+                    component.GetChild("Btn_Login").enabled = true;
+				}
+				else
+				{
+					Log.Error("not found login view @login error");
+				}
+				return;
+			}
+
+			GRoot.inst.RemoveChildAt(0, true);
+			UIPackage.RemovePackage("Login");
 		}
 	}
 }

+ 1 - 0
Unity/Assets/Scripts/Codes/Model/Share/Demo/EventType.cs

@@ -24,6 +24,7 @@
 
         public struct LoginFinish
         {
+            public string exeception;
         }
 
         public struct EnterMapFinish