少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-16 5c694ed3ac01d4203538ffe98baff54f386f908b
4121 【前端】【1.2.0】登录界面新增客服中心入口和功能界面
3个文件已修改
9个文件已添加
353 ■■■■■ 已修改文件
Core/GameEngine/Model/Config/ContactConfig.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/ContactConfig.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HelpInfoConfig.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HelpInfoConfig.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/ConfigManager.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Launch/LaunchWin.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Login/LoginWin.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/UserHelp.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/UserHelp/UserHelpWin.cs 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/UserHelp/UserHelpWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/UserHelp/UserIssueBehaviour.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/UserHelp/UserIssueBehaviour.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/ContactConfig.cs
New file
@@ -0,0 +1,44 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Monday, October 15, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
    public partial class ContactConfig : ConfigBase {
        public string appid { get ; private set; }
        public string qq { get ; private set; }
        public string phone { get ; private set; }
        public override string getKey()
        {
            return appid.ToString();
        }
        public override void Parse() {
            try
            {
                appid = rawContents[0].Trim();
                qq = rawContents[1].Trim();
                phone = rawContents[2].Trim();
            }
            catch (Exception ex)
            {
                DebugEx.Log(ex);
            }
        }
    }
}
Core/GameEngine/Model/Config/ContactConfig.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8ecbb84f62ba262448b74256777f91ec
timeCreated: 1539586414
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/GameEngine/Model/Config/HelpInfoConfig.cs
New file
@@ -0,0 +1,41 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Monday, October 15, 2018
//--------------------------------------------------------
using UnityEngine;
using System;
namespace TableConfig {
    public partial class HelpInfoConfig : ConfigBase {
        public string title { get ; private set; }
        public string help { get ; private set; }
        public override string getKey()
        {
            return title.ToString();
        }
        public override void Parse() {
            try
            {
                title = rawContents[0].Trim();
                help = rawContents[1].Trim();
            }
            catch (Exception ex)
            {
                DebugEx.Log(ex);
            }
        }
    }
}
Core/GameEngine/Model/Config/HelpInfoConfig.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d24d3981de1e03147b38f9ebab77daca
timeCreated: 1539586423
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/GameEngine/Model/ConfigManager.cs
@@ -36,13 +36,15 @@
    {
        StartSyncTask<PriorBundleConfig>(AssetPath.Resource);
        StartSyncTask<PriorLanguageConfig>(AssetPath.Resource);
        StartSyncTask<ContactConfig>(AssetPath.Resource);
        StartSyncTask<HelpInfoConfig>(AssetPath.Resource);
    }
    List<ConfigTask> configTasks = new List<ConfigTask>();
    public IEnumerator Co_LoadConfigs()
    {
        StartSyncTask<LoginSeverListConfig>(AssetSource.refdataFromEditor ? AssetPath.ResourceOut : AssetPath.External);
        AddAsyncTask<LoginSeverListConfig>();
        AddAsyncTask<IconConfig>();
        AddAsyncTask<ItemConfig>();
        AddAsyncTask<SkillConfig>();
@@ -50,6 +52,7 @@
        AddAsyncTask<TASKINFOConfig>();
        AddAsyncTask<mapnpcConfig>();
        AddAsyncTask<LanguageConfig>();
        AddAsyncTask<DienstgradConfig>();
        AddAsyncTask<PlayerPropertyConfig>();
        AddAsyncTask<RealmConfig>();
@@ -534,8 +537,6 @@
        }
        var task = new ConfigTask(typeof(T), _assetPath, path);
        configTasks.Add(task);
        task.contentLines = lines;
        if (lines != null && lines.Length > 3)
        {
System/Launch/LaunchWin.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
namespace Snxxz.UI
{
@@ -23,6 +24,7 @@
        [SerializeField] Text m_IosProgressTip;
        [SerializeField] Text m_BuildTime;
        [SerializeField] Text m_Version;
        [SerializeField] Button m_UserHelp;
        bool assetBuildTimeShowed = false;
@@ -44,6 +46,7 @@
        protected override void AddListeners()
        {
            m_UserHelp.SetListener(OpenUserHelp);
        }
        protected override void OnPreOpen()
@@ -55,14 +58,9 @@
            m_AlphaTween.SetStartState();
            m_Version.text = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex);
            if (VersionConfig.Get().debugVersion)
            {
                m_BuildTime.text = VersionConfig.Get().buildTime;
            }
            else
            {
                m_BuildTime.text = "";
            }
            m_BuildTime.text = VersionConfig.Get().debugVersion ? VersionConfig.Get().buildTime : "";
            m_UserHelp.gameObject.SetActive(Config.Instance.ContainKey<ContactConfig>(VersionConfig.Get().appId));
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
@@ -156,6 +154,10 @@
        }
        private void OpenUserHelp()
        {
            WindowCenter.Instance.OpenFromLocal<UserHelpWin>();
        }
    }
}
System/Login/LoginWin.cs
@@ -33,6 +33,7 @@
        [SerializeField] Button m_ServerSelect;
        [SerializeField] Button m_SwitchAccount;
        [SerializeField] Button m_Notice;
        [SerializeField] Button m_UserHelp;
        [SerializeField] RichText m_BanHao;
        LoginModel model { get { return ModelCenter.Instance.GetModel<LoginModel>(); } }
@@ -45,14 +46,11 @@
        protected override void AddListeners()
        {
            m_EnterGame.AddListener(EnterGame);
            m_ServerSelect.AddListener(OpenServerListWin);
            if (m_SwitchAccount != null)
            {
                m_SwitchAccount.AddListener(SwitchAccount);
            }
            m_Notice.AddListener(VeiwNotice);
            m_EnterGame.SetListener(EnterGame);
            m_ServerSelect.SetListener(OpenServerListWin);
            m_SwitchAccount.SetListener(SwitchAccount);
            m_Notice.SetListener(VeiwNotice);
            m_UserHelp.SetListener(OpenUserHelp);
        }
        protected override void OnPreOpen()
@@ -66,10 +64,9 @@
            m_Notice.gameObject.SetActive(GameNotice.HasNotice());
            m_AlphaTween.SetStartState();
            if (m_SwitchAccount != null)
            {
                m_SwitchAccount.gameObject.SetActive(VersionConfig.Get().versionAuthority == VersionAuthority.Release && !VersionConfig.Get().isBanShu);
            }
            m_UserHelp.gameObject.SetActive(Config.Instance.ContainKey<ContactConfig>(VersionConfig.Get().appId));
            m_WaitServerList.gameObject.SetActive(!ServerListCenter.Instance.serverListGot);
            m_ContainerEnterGame.gameObject.SetActive(ServerListCenter.Instance.serverListGot);
@@ -238,6 +235,10 @@
            GameNotice.OpenGameNoticeForce();
        }
        private void OpenUserHelp()
        {
            WindowCenter.Instance.OpenFromLocal<UserHelpWin>();
        }
    }
System/UserHelp.meta
New file
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: eac3e6e851e862848b53dc6a427f4ac3
folderAsset: yes
timeCreated: 1539587065
licenseType: Pro
DefaultImporter:
  userData:
  assetBundleName:
  assetBundleVariant:
System/UserHelp/UserHelpWin.cs
New file
@@ -0,0 +1,135 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, October 15, 2018
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
namespace Snxxz.UI
{
    public class UserHelpWin : Window
    {
        [SerializeField] Button m_Close;
        [SerializeField] Toggle m_Issues;
        [SerializeField] Toggle m_Contact;
        [SerializeField] RectTransform m_IssueContainer;
        [SerializeField] ScrollRect m_IssueScrollRect;
        [SerializeField] UserIssueBehaviour m_IssueBehaviourPattern;
        [SerializeField] RectTransform m_ContactContainer;
        [SerializeField] Text m_QQ;
        [SerializeField] Text m_Phone;
        [SerializeField] Button m_CopyQQ;
        [SerializeField] Button m_CopyPhone;
        bool inited = false;
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            m_Close.SetListener(CloseClick);
            m_Issues.SetListener(DisplayIssues);
            m_Contact.SetListener(DisplayContact);
            m_CopyQQ.SetListener(CopyQQ);
            m_CopyPhone.SetListener(CopyPhone);
        }
        protected override void OnPreOpen()
        {
            if (!inited)
            {
                inited = true;
                InitIssues();
                InitContact();
            }
            m_Issues.isOn = true;
            m_Contact.isOn = false;
            DisplayIssues(true);
            DisplayContact(false);
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        protected override void OnActived()
        {
            base.OnActived();
        }
        #endregion
        private void InitIssues()
        {
            var configs = Config.Instance.GetAllValues<HelpInfoConfig>();
            var needCount = configs.Count;
            var behaviours = new List<UserIssueBehaviour>();
            behaviours.Add(m_IssueBehaviourPattern);
            for (var i = 1; i < needCount; i++)
            {
                var instance = Instantiate(m_IssueBehaviourPattern.gameObject) as GameObject;
                var behaviour = instance.GetComponent<UserIssueBehaviour>();
                behaviours.Add(behaviour);
                behaviour.transform.SetParentEx(m_IssueScrollRect.content, Vector3.zero, Vector3.zero, Vector3.one);
            }
            for (var i = 0; i < behaviours.Count; i++)
            {
                behaviours[i].Display(configs[i].title, configs[i].help);
            }
        }
        private void InitContact()
        {
            var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
            m_QQ.text = Language.GetFromLocal(31, config.qq);
            m_Phone.text = Language.GetFromLocal(32, config.phone);
        }
        private void DisplayIssues(bool display)
        {
            m_IssueContainer.gameObject.SetActive(display);
        }
        private void DisplayContact(bool display)
        {
            m_ContactContainer.gameObject.SetActive(display);
        }
        private void CopyQQ()
        {
            SDKUtility.Instance.CopyContent(m_QQ.text);
        }
        private void CopyPhone()
        {
            SDKUtility.Instance.CopyContent(m_Phone.text);
        }
    }
}
System/UserHelp/UserHelpWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a87e195085aa9aa439b6b66d8b0282ba
timeCreated: 1539587097
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/UserHelp/UserIssueBehaviour.cs
New file
@@ -0,0 +1,28 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, October 15, 2018
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class UserIssueBehaviour : MonoBehaviour
    {
        [SerializeField] Text m_Title;
        [SerializeField] Text m_Content;
        public void Display(string title, string content)
        {
            this.m_Title.text = title;
            this.m_Content.text = content;
        }
    }
}
System/UserHelp/UserIssueBehaviour.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 730822a53ac23f442ad087f645e3176c
timeCreated: 1539587636
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: