Browse Source

用户协议指引

guodong 2 years ago
parent
commit
757fbbbd0b

+ 2 - 2
FGUIProject/assets/Launcher/LauncherAgreeUI.xml

@@ -4,7 +4,7 @@
     <component id="n0_l55o" name="bg" src="si5ztih" fileName="components/ComBg.xml" xy="0,0" size="962,531">
       <relation target="n5_l55o" sidePair="height-height"/>
     </component>
-    <text id="n5_l55o" name="txtContent" xy="114,141" size="734,202" fontSize="30" color="#876e54" vAlign="middle" autoSize="none" autoClearText="true" text="        为了更好地保障您的个人权益,在使用本游戏前,请您务必阅读以下内容,并点击“同意”开始游戏。如果您拒绝,将无法进入游戏。&#xA;&#xA;">
+    <text id="n5_l55o" name="txtContent" xy="114,141" size="734,202" fontSize="30" color="#876e54" vAlign="middle" autoSize="none" text="        为了更好地保障您的个人权益,在使用本游戏前,请您务必阅读以下内容,并点击“同意”开始游戏。如果您拒绝,将无法进入游戏。&#xA;&#xA;">
       <relation target="" sidePair="center-center"/>
     </text>
     <component id="n3_l55o" name="btnLeft" src="dhoaw" fileName="components/Button18.xml" xy="88,381">
@@ -15,7 +15,7 @@
       <relation target="n3_l55o" sidePair="top-top"/>
       <Button title="同意"/>
     </component>
-    <text id="n6_dgkd" name="txtContent" xy="124,54" size="714,49" fontSize="36" color="#876e54" align="center" vAlign="middle" autoSize="height" autoClearText="true" text="用户协议和隐私政策保护指引"/>
+    <text id="n6_dgkd" name="txtContent" xy="124,54" size="714,49" fontSize="36" color="#876e54" align="center" vAlign="middle" autoSize="height" text="用户协议和隐私政策保护指引"/>
     <text id="n11_dgkd" name="n11" xy="169,275" size="228,44" group="n14_dgkd" fontSize="32" color="#d69f1a" ubb="true" text="游戏用户协议、"/>
     <text id="n12_dgkd" name="n12" xy="169,278" size="260,44" group="n14_dgkd" fontSize="32" color="#d69f1a" autoSize="none" underline="true" text="                      "/>
     <loader id="n13_dgkd" name="loaEventa" xy="169,283" size="192,32" group="n14_dgkd"/>

+ 0 - 5
GameClient/Assets/Game/HotUpdate/Utils/ResPathUtil.cs

@@ -2,7 +2,6 @@ namespace GFGGame
 {
     public class ResPathUtil
     {
-        public const string RESIN_TXT_DIR_PATH = "Assets/ResIn/Txt";
 
         public const string FONT_DIR_PATH = "Assets/ResIn/Font";
         public static readonly string UI_DIR_PATH = "Assets/ResIn/UI";
@@ -94,10 +93,6 @@ namespace GFGGame
         {
             return $"{MUSIC_DIR_PATH}/{res}.{extName}";
         }
-        public static string GetTxtPath(string res, string extName = "txt")
-        {
-            return $"{RESIN_TXT_DIR_PATH}/{res}.{extName}";
-        }
         public static string GetFontPath(string res, string extName = "TTF")
         {
             return $"{FONT_DIR_PATH}/{res}.{extName}";

+ 4 - 27
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -49,13 +49,11 @@ namespace GFGGame
             _ui.m_btnAge.onClick.Add(OnClickBtnAge);
             _ui.m_btnTapLogin.onClick.Add(OnClickBtnStart);
 
-            _ui.m_imgLogo.visible = LauncherConfig.netType != LauncherConfig.EnumNetType.TEMP;
-
             _ui.m_btnChange.onClick.Add(OnBtnChangeClick);
 
-            _ui.m_loaEventa.onClick.Add(() => { OnClickRichTextAgreeLink("event:a"); });
-            _ui.m_loaEventb.onClick.Add(() => { OnClickRichTextAgreeLink("event:b"); });
-            _ui.m_loaEventc.onClick.Add(() => { OnClickRichTextAgreeLink("event:c"); });
+            _ui.m_loaEventa.onClick.Add(() => { FullScreenTextController.Show("event:a"); });
+            _ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); });
+            _ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); });
             //_ui.m_btnAgree.onClick.Add(OnBtnAgreeCklick);
 
         }
@@ -219,30 +217,9 @@ namespace GFGGame
             ViewManager.Show<SystemNoticeView>(new object[] { LoginController.ageTipsTitle, LoginController.ageTips });
         }
 
-        private void OnClickRichTextAgreeLink(string eventname)
-        {
-            Debug.Log("link target " + eventname);
-            string content = null;
-            switch (eventname)
-            {
-                case "event:a":
-                    content = GFGAsset.Load<TextAsset>(ResPathUtil.GetTxtPath("serviceProtocal")).text;
-                    break;
-                case "event:b":
-                    content = GFGAsset.Load<TextAsset>(ResPathUtil.GetTxtPath("privacyPolicy")).text;
-                    break;
-                case "event:c":
-                    content = GFGAsset.Load<TextAsset>(ResPathUtil.GetTxtPath("privacyPolicyChildren")).text;
-                    break;
-            }
-            if (!string.IsNullOrEmpty(content))
-            {
-                FullScreenTextView.Instance.Show(content);
-            }
-        }
         private void OnBtnAgreeCklick()
         {
-            LocalCache.SetBool(GameConst.LAST_LOGIN_IS_AGREE_KEY, _ui.m_btnAgree.selected);
+            LocalCache.SetBool(LauncherConfig.LAST_LOGIN_IS_AGREE_KEY, _ui.m_btnAgree.selected);
         }
     }
 }

+ 3 - 27
GameClient/Assets/Game/HotUpdate/Views/Login/RegisterView.cs

@@ -13,9 +13,6 @@ namespace GFGGame
 
         public override void Dispose()
         {
-            GFGAsset.Release(ResPathUtil.GetTxtPath("serviceProtocal"));
-            GFGAsset.Release(ResPathUtil.GetTxtPath("privacyPolicy"));
-            GFGAsset.Release(ResPathUtil.GetTxtPath("privacyPolicyChildren"));
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -35,9 +32,9 @@ namespace GFGGame
 
             _ui.m_btnSubmit.onClick.Add(OnClickBtnSubmit);
             // _ui.m_richTextAgree.onClickLink.Add(OnClickRichTextAgreeLink);
-            _ui.m_loaEventa.onClick.Add(() => { OnClickRichTextAgreeLink("event:a"); });
-            _ui.m_loaEventb.onClick.Add(() => { OnClickRichTextAgreeLink("event:b"); });
-            _ui.m_loaEventc.onClick.Add(() => { OnClickRichTextAgreeLink("event:c"); });
+            _ui.m_loaEventa.onClick.Add(() => { FullScreenTextController.Show("event:a"); });
+            _ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); });
+            _ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); });
             // _ui.m_btnSendCode.onClick.Add(() => {
             //     
             //     _ui.m_btnSendCode.enabled = false;
@@ -125,26 +122,5 @@ namespace GFGGame
             LoginController.Register(account, password, realName, idNumberStr, CODE).Coroutine();
         }
 
-        private void OnClickRichTextAgreeLink(string eventname)
-        {
-            Debug.Log("link target " + eventname);
-            string content = null;
-            switch (eventname)
-            {
-                case "event:a":
-                    content = GFGAsset.Load<TextAsset>(ResPathUtil.GetTxtPath("serviceProtocal")).text;
-                    break;
-                case "event:b":
-                    content = GFGAsset.Load<TextAsset>(ResPathUtil.GetTxtPath("privacyPolicy")).text;
-                    break;
-                case "event:c":
-                    content = GFGAsset.Load<TextAsset>(ResPathUtil.GetTxtPath("privacyPolicyChildren")).text;
-                    break;
-            }
-            if (!string.IsNullOrEmpty(content))
-            {
-                FullScreenTextView.Instance.Show(content);
-            }
-        }
     }
 }

+ 8 - 0
GameClient/Assets/Game/Launcher/Controller.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f19f50f72ed6e4043923fffcb9b5a04e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 34 - 0
GameClient/Assets/Game/Launcher/Controller/FullScreenTextController.cs

@@ -0,0 +1,34 @@
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class FullScreenTextController
+    {
+        public const string RESIN_TXT_DIR_PATH = "Assets/ResIn/Txt";
+        public static string GetTxtPath(string res, string extName = "txt")
+        {
+            return $"{RESIN_TXT_DIR_PATH}/{res}.{extName}";
+        }
+
+        public static void Show(string eventName)
+        {
+            string content = null;
+            switch (eventName)
+            {
+                case "event:a":
+                    content = GFGAsset.Load<TextAsset>(GetTxtPath("serviceProtocal")).text;
+                    break;
+                case "event:b":
+                    content = GFGAsset.Load<TextAsset>(GetTxtPath("privacyPolicy")).text;
+                    break;
+                case "event:c":
+                    content = GFGAsset.Load<TextAsset>(GetTxtPath("privacyPolicyChildren")).text;
+                    break;
+            }
+            if (!string.IsNullOrEmpty(content))
+            {
+                FullScreenTextView.Instance.Show(content);
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/Launcher/Controller/FullScreenTextController.cs.meta

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

+ 2 - 0
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -17,6 +17,8 @@ namespace GFGGame
         public static string MUSIC_KEY = "music";
         public const string SQL_FILE_NAME = "excelConfig.sqlite.bytes";
 
+        public const string LAST_LOGIN_IS_AGREE_KEY = "LAST_LOGIN_IS_AGREE_KEY_4";//上次登录是否同意隐私政策
+
         public static string CDN_ROOT;
         public static string loginApiUrl;
         public static string gameApiUrl;

+ 36 - 0
GameClient/Assets/Game/Launcher/LauncherController.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GFGGame
+{
+    public class LauncherController
+    {
+
+        public static void AfterVersion()
+        {
+            if (LocalCache.GetBool(LauncherConfig.LAST_LOGIN_IS_AGREE_KEY, false))
+            {
+                StartGame();
+            }
+            else
+            {
+                LauncherView.Instance.SetDesc("");
+                LauncherAgreeView.Instance.Open(() => {
+                    StartGame();
+                });
+            }
+        }
+
+        public static void StartGame()
+        {
+            LauncherView.Instance.SetDesc($"正在启动游戏...");
+            LauncherView.Instance.SetProgress(100, () =>
+            {
+                HotUpdateCodeLoader.Instance.StartLoad();
+            });
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/Launcher/LauncherController.cs.meta

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

+ 1 - 5
GameClient/Assets/Game/Launcher/Version/VersionController.cs

@@ -136,11 +136,7 @@ namespace GFGGame
             {
                 updateVersions.Override();
             }
-            LauncherView.Instance.SetDesc($"正在启动游戏...");
-            LauncherView.Instance.SetProgress(100, () =>
-            {
-                HotUpdateCodeLoader.Instance.StartLoad();
-            });
+            LauncherController.AfterVersion();
         }
 
     }

+ 1 - 1
GameClient/Assets/Game/Launcher/Views/Alert/Alert.cs

@@ -28,7 +28,7 @@ namespace GFGGame.Launcher
             return _alertWindow;
         }
 
-        public static void hide()
+        public static void Hide()
         {
             if (_alertWindow != null)
             {

+ 1 - 0
GameClient/Assets/Game/Launcher/Views/FullScreenTextView.cs

@@ -27,6 +27,7 @@ namespace GFGGame
         /// </summary>
         private string _packageName;
 
+
         public void Dispose()
         {
             if (_ui != null)

+ 71 - 0
GameClient/Assets/Game/Launcher/Views/LauncherAgreeView.cs

@@ -0,0 +1,71 @@
+using System;
+using FairyGUI;
+using UI.Launcher;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class LauncherAgreeView : Window
+    {
+
+        private static LauncherAgreeView m_Instance = null;
+        /// <summary>
+        /// 单例
+        /// </summary>
+        public static LauncherAgreeView Instance
+        {
+            get
+            {
+                if (m_Instance == null)
+                {
+                    m_Instance = new LauncherAgreeView();
+                }
+                return m_Instance;
+            }
+        }
+
+        private Action _onHideCallback;
+        public void Open(Action onHide)
+        {
+            _onHideCallback = onHide;
+            Show();
+        }
+
+        private UI_LauncherAgreeUI _ui;
+        protected override void OnInit()
+        {
+            base.OnInit();
+            _ui = UI_LauncherAgreeUI.Create();
+            this.contentPane = _ui.target;
+            this.Center();
+            //this.modal = true;
+
+            _ui.m_btnLeft.onClick.Add(() =>
+            {
+                this.Hide();
+                Application.Quit();
+            });
+            _ui.m_btnRight.onClick.Add(() =>
+            {
+                this.Hide();
+                LocalCache.SetBool(LauncherConfig.LAST_LOGIN_IS_AGREE_KEY, true);
+                _onHideCallback?.Invoke();
+            });
+            _ui.m_loaEventa.onClick.Add(() => { FullScreenTextController.Show("event:a"); });
+            _ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); });
+            _ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); });
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+        }
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/Launcher/Views/LauncherAgreeView.cs.meta

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

+ 0 - 1
GameClient/Assets/Game/Launcher/Views/LauncherView.cs

@@ -170,7 +170,6 @@ namespace GFGGame
             _ui.m_txtDescRight.text = "";
             GRoot.inst.AddChild(_ui.target);
             isOpen = true;
-            _ui.m_imgLogo.visible = LauncherConfig.netType != LauncherConfig.EnumNetType.TEMP;
         }
 
         /// <summary>

BIN
GameClient/Assets/Resources/UI/Launcher/Launcher_fui.bytes