Browse Source

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

guodong 1 year ago
parent
commit
110d40744b
27 changed files with 274 additions and 19 deletions
  1. 35 1
      GameClient/Assets/Game/HotUpdate/Data/TaskDataManager.cs
  2. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_TaskListItem.cs
  3. 8 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/PopWindow.meta
  4. 74 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/PopWindow/UI_ExchangeGoodsUI.cs
  5. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/PopWindow/UI_ExchangeGoodsUI.cs.meta
  6. 6 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_ListLevelItem.cs
  7. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Task/UI_TaskAchieveDetailUI.cs
  8. 10 3
      GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs
  9. 8 0
      GameClient/Assets/Game/HotUpdate/Views/PopWindow.meta
  10. 65 0
      GameClient/Assets/Game/HotUpdate/Views/PopWindow/ExchangeGoodsView.cs
  11. 11 0
      GameClient/Assets/Game/HotUpdate/Views/PopWindow/ExchangeGoodsView.cs.meta
  12. 1 1
      GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBaseView.cs
  13. 8 4
      GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFilingView.cs
  14. 30 9
      GameClient/Assets/Game/HotUpdate/Views/Task/TaskAchieveDetailView.cs
  15. 1 1
      GameClient/Assets/Game/HotUpdate/Views/Task/TaskAchieveView.cs
  16. BIN
      GameClient/Assets/ResIn/UI/Card/Card_fui.bytes
  17. BIN
      GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes
  18. BIN
      GameClient/Assets/ResIn/UI/Studio/Studio_fui.bytes
  19. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0!a.png
  20. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0.png
  21. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0_1!a.png
  22. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0_1.png
  23. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0_2!a.png
  24. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0_2.png
  25. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0_3!a.png
  26. BIN
      GameClient/Assets/ResIn/UI/Task/Task_atlas0_3.png
  27. BIN
      GameClient/Assets/ResIn/UI/Task/Task_fui.bytes

+ 35 - 1
GameClient/Assets/Game/HotUpdate/Data/TaskDataManager.cs

@@ -101,13 +101,47 @@ namespace GFGGame
             {
                 var stateA = TaskInfosDic[a.id].State == 1 ? 1 : -1;
                 var stateB = TaskInfosDic[b.id].State == 1 ? 1 : -1;
-                if (stateA > stateB) return -1;
                 return stateB > stateA ? 1 : TaskInfosDic[a.id].State.CompareTo(TaskInfosDic[b.id].State);
             });
             return cfgs;
         }
 
         /// <summary>
+        /// 获取任务成就列表
+        /// </summary>
+        /// <returns></returns>
+        public List<TaskCfg> GetTaskAchieveCfgs(int taskType)
+        {
+            var cfgs = new List<TaskCfg>();
+
+            TaskType2TaskIdListDic.TryGetValue(taskType, out var taskIds);
+            if (taskIds == null) return cfgs;
+            cfgs.AddRange(taskIds.Select(taskId => TaskCfgArray.Instance.GetCfg(taskId)));
+
+            cfgs.Sort((a, b) =>
+            {
+                var stateA = TaskInfosDic[a.id].State == 1 ? 1 : -1;
+                var stateB = TaskInfosDic[b.id].State == 1 ? 1 : -1;
+                if (stateA > stateB)
+                    return -1;
+                else if(stateA < stateB)
+                    return 1;
+                else {
+                    if (TaskInfosDic[a.id].State.CompareTo(TaskInfosDic[b.id].State) > 0)
+                        return -1;
+                    else if (TaskInfosDic[a.id].State.CompareTo(TaskInfosDic[b.id].State) < 0)
+                        return 1;
+                    else {
+                        if (a.id > b.id)
+                            return 1;
+                        else
+                            return -1;
+                    }
+                }
+            });
+            return cfgs;
+        }
+        /// <summary>
         /// 获取任务列表
         /// </summary>
         /// <returns></returns>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_TaskListItem.cs

@@ -16,6 +16,7 @@ namespace UI.CommonGame
         public UI_Button22 m_GetRewardBt;
         public UI_Button22 m_ComeBt;
         public UI_Button22 m_GetRewardBt_2;
+        public GProgressBar m_taskBar;
         public const string URL = "ui://eg2y0ldplh8v5";
         public const string PACKAGE_NAME = "CommonGame";
         public const string RES_NAME = "TaskListItem";
@@ -72,6 +73,7 @@ namespace UI.CommonGame
             m_GetRewardBt = (UI_Button22)UI_Button22.Create(comp.GetChild("GetRewardBt"));
             m_ComeBt = (UI_Button22)UI_Button22.Create(comp.GetChild("ComeBt"));
             m_GetRewardBt_2 = (UI_Button22)UI_Button22.Create(comp.GetChild("GetRewardBt"));
+            m_taskBar = (GProgressBar)comp.GetChild("taskBar");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -87,6 +89,7 @@ namespace UI.CommonGame
             m_ComeBt = null;
             m_GetRewardBt_2.Dispose();
             m_GetRewardBt_2 = null;
+            m_taskBar = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 8 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/PopWindow.meta

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

+ 74 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/PopWindow/UI_ExchangeGoodsUI.cs

@@ -0,0 +1,74 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.PopWindow
+{
+    public partial class UI_ExchangeGoodsUI
+    {
+        public GComponent target;
+        public GGraph m_holderLeftTop;
+        public GGraph m_holderRightDowm;
+        public const string URL = "ui://i9tn319dnzuq0";
+        public const string PACKAGE_NAME = "PopWindow";
+        public const string RES_NAME = "ExchangeGoodsUI";
+        private static UI_ExchangeGoodsUI _proxy;
+
+        public static UI_ExchangeGoodsUI Create(GObject gObject = null)
+        {
+            var ui = new UI_ExchangeGoodsUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ExchangeGoodsUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ExchangeGoodsUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_holderLeftTop = (GGraph)comp.GetChild("holderLeftTop");
+            m_holderRightDowm = (GGraph)comp.GetChild("holderRightDowm");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_holderLeftTop = null;
+            m_holderRightDowm = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/PopWindow/UI_ExchangeGoodsUI.cs.meta

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

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_ListLevelItem.cs

@@ -16,8 +16,10 @@ namespace UI.Studio
         public GImage m_imgLockBg;
         public GImage m_imgLock;
         public GGroup m_grpLock;
+        public GGroup m_Panel;
         public Transition m_ToLeft;
         public Transition m_ToRight;
+        public Transition m_Left;
         public const string URL = "ui://xz8kxrecv4822p";
         public const string PACKAGE_NAME = "Studio";
         public const string RES_NAME = "ListLevelItem";
@@ -74,8 +76,10 @@ namespace UI.Studio
             m_imgLockBg = (GImage)comp.GetChild("imgLockBg");
             m_imgLock = (GImage)comp.GetChild("imgLock");
             m_grpLock = (GGroup)comp.GetChild("grpLock");
+            m_Panel = (GGroup)comp.GetChild("Panel");
             m_ToLeft = comp.GetTransition("ToLeft");
             m_ToRight = comp.GetTransition("ToRight");
+            m_Left = comp.GetTransition("Left");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -89,8 +93,10 @@ namespace UI.Studio
             m_imgLockBg = null;
             m_imgLock = null;
             m_grpLock = null;
+            m_Panel = null;
             m_ToLeft = null;
             m_ToRight = null;
+            m_Left = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Task/UI_TaskAchieveDetailUI.cs

@@ -11,6 +11,7 @@ namespace UI.Task
         public GLoader m_loaBg;
         public GButton m_btnBack;
         public GList m_listAchieveTask;
+        public GTextField m_txtProgress;
         public const string URL = "ui://5mpsibzzaigntob";
         public const string PACKAGE_NAME = "Task";
         public const string RES_NAME = "TaskAchieveDetailUI";
@@ -62,6 +63,7 @@ namespace UI.Task
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_listAchieveTask = (GList)comp.GetChild("listAchieveTask");
+            m_txtProgress = (GTextField)comp.GetChild("txtProgress");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -69,6 +71,7 @@ namespace UI.Task
             m_loaBg = null;
             m_btnBack = null;
             m_listAchieveTask = null;
+            m_txtProgress = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 10 - 3
GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs

@@ -14,7 +14,8 @@ namespace GFGGame
         {
             IN,
             IDLE,
-            OPEN
+            OPEN,
+            OUT
         }
 
         private UI_CreateRoleUI _ui;
@@ -47,7 +48,7 @@ namespace GFGGame
             // this.viewCom.Center();
             this.isfullScreen = true;
             this.clickBlankToClose = false;
-            this.modal = true;
+            this.modal = false;
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_yaoqinghan");
             _ui.m_envelopeModel.m_btnSure.onClick.Add(OnClickBtnSure);
@@ -87,6 +88,12 @@ namespace GFGGame
                     _ui.m_envelopeModel.m_t_Idle.Stop();
                     _ui.m_t_Open.Play();
                     break;
+                case State.OUT:
+                    _ui.m_t_AfterOpen.Play(()=>
+                    {
+                        this.Hide();
+                    });
+                    break;
             }
         }
 
@@ -132,7 +139,7 @@ namespace GFGGame
             if (result)
             {
                 StorageSProxy.ReqSetClientValue(ConstStorageId.CHANGE_NAME, 1).Coroutine();
-                this.Hide();
+                ChangeAnimationState(State.OUT);
             }
         }
 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/Views/PopWindow.meta

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

+ 65 - 0
GameClient/Assets/Game/HotUpdate/Views/PopWindow/ExchangeGoodsView.cs

@@ -0,0 +1,65 @@
+using FairyGUI;
+using UI.PopWindow;
+
+namespace GFGGame
+{
+    public class ExchangeGoodsView : BaseWindow
+    {
+        private UI_ExchangeGoodsUI _ui;
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_ExchangeGoodsUI.PACKAGE_NAME;
+            _ui = UI_ExchangeGoodsUI.Create();
+            viewCom = _ui.target;
+            isfullScreen = true;
+            bringToFontOnClick = false;
+            //_ui.m_btnBack.onClick.Add(OnBtnBackClick);
+        }
+
+        private void OnBtnBackClick()
+        {
+            ViewManager.Hide<CombTaskController>();
+            //ViewManager.Hide<BattlePassTaskView>();
+            ViewManager.GoBackFrom(typeof(TaskView).FullName);
+        }
+
+        private void OnBtnAchieveClick()
+        {
+            ViewManager.Show<TaskAchieveView>();
+        }
+            
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+          
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/PopWindow/ExchangeGoodsView.cs.meta

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

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBaseView.cs

@@ -194,7 +194,7 @@ namespace GFGGame
                 list.GetChildAt(i).visible = false;
             }
             _time = 0;
-            Timers.inst.Add(0.2f, list.numChildren, OnTimerUpdate, 1);
+            Timers.inst.Add(0.07f, list.numChildren, OnTimerUpdate, 1);
         }
         private void OnTimerUpdate(object param)
         {

+ 8 - 4
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFilingView.cs

@@ -134,7 +134,7 @@ namespace GFGGame
         {
             // int _index = _storyLevelCfgs.Count - index - 1;
             UI_ListLevelItem item = UI_ListLevelItem.Proxy(obj);
-            item.m_c1.selectedIndex = index % 2 == 0 ? 0 : 1;
+            //item.m_c1.selectedIndex = index % 2 == 0 ? 0 : 1;
             item.m_txtName.text = _storyLevelCfgs[index].name;
             bool isFight = string.IsNullOrEmpty(_storyLevelCfgs[index].storyStartID);
             string resBg = isFight ? "cyjd_di_1" : "cyjd_di_2";
@@ -265,21 +265,25 @@ namespace GFGGame
                 _ui.m_list.GetChildAt(i).visible = false;
             }
             itemIndex = 0;
-            Timers.inst.Add(0.2f, _ui.m_list.numChildren, AddItemUpdate, 1);
+            Timers.inst.Add(0.05f, _ui.m_list.numChildren, AddItemUpdate, 1);
         }
 
         private void AddItemUpdate(object param)
         {
             _ui.m_list.GetChildAt(itemIndex).visible = true;
             UI_ListLevelItem item = UI_ListLevelItem.Proxy(_ui.m_list.GetChildAt(itemIndex));
+            Vector3 position = item.target.position;
             if (itemIndex % 2 == 0)
             {
-                item.m_ToLeft.Play();
+                //item.m_ToLeft.Play();
             }
             else
             {
-                item.m_ToRight.Play();
+                position.x = 200;
+                item.target.position = position;
+                //item.m_ToRight.Play();
             }
+            item.m_Left.Play();
             itemIndex++;
             UI_ListLevelItem.ProxyEnd();
         }

+ 30 - 9
GameClient/Assets/Game/HotUpdate/Views/Task/TaskAchieveDetailView.cs

@@ -11,7 +11,7 @@ namespace GFGGame
         private List<TaskCfg> _cfgs = new List<TaskCfg>();
         private int funcType = TaskFuncType.Achievement;
         private List<TaskCfg> _cfgsAll = new List<TaskCfg>();
-
+        public int taskSubType = 0;
         public override void Dispose()
         {
             if (_ui != null)
@@ -39,22 +39,24 @@ namespace GFGGame
         {
             ViewManager.Hide<TaskAchieveDetailView>();
         }
-
     
         protected override void AddEventListener()
         {
             base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.ACHIEVEMENT_TASK_PRO_CHANGED, UpdateProgressValue);
         }
 
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.ACHIEVEMENT_TASK_PRO_CHANGED, UpdateProgressValue);
         }
 
         protected override void OnShown()
         {
             base.OnShown();
             UpdateTask();
+            _ui.m_listAchieveTask.ScrollToView(0);
         }
 
         protected override void OnHide()
@@ -62,15 +64,29 @@ namespace GFGGame
             base.OnHide();
         }
 
+        private void UpdateProgressValue()
+        {
+            var taskTypeProList = TaskDataManager.Instance.GetAchievementTaskTypeProList();
+            foreach (var info in taskTypeProList)
+            {
+                if (info.AchievementType == taskSubType + 1)
+                {
+                    _ui.m_txtProgress.text = (info.CompleteTaskNum*100 /info.AllTaskNum) + "%";
+                    break;
+                }
+            }
+        }
+
         private void UpdateTask()   
         {
-            int taskSubType = (int)this.viewData;
+            taskSubType = (int)this.viewData;
             _ui.m_AchieveType.selectedIndex = taskSubType;
-            _cfgsAll = TaskDataManager.Instance.GetTaskCfgs(funcType);
+            UpdateProgressValue();
+            _cfgsAll = TaskDataManager.Instance.GetTaskAchieveCfgs(funcType);
             _cfgs.Clear();
-            foreach (var info in _cfgsAll) {
-                if (info.achievementType == taskSubType+1)
-                    _cfgs.Add(info);
+            for (int i= 0; i< _cfgsAll.Count;i++) {
+                if (_cfgsAll[i].achievementType == taskSubType+1)
+                    _cfgs.Add(_cfgsAll[i]);
             }
             _ui.m_listAchieveTask.numItems = _cfgs.Count;
         }
@@ -81,9 +97,14 @@ namespace GFGGame
             //Áìȡ״̬
             item.m_c1.selectedIndex = TaskDataManager.Instance.GetTaskStateById(_cfgs[index].id);
             item.m_c2.selectedIndex = _cfgs[index].jumpId == "" ? 1 : 0;
+            item.m_c3.selectedIndex = 2;
             item.m_txtDesc.text = TaskDataManager.Instance.GetTaskDesc(_cfgs[index].id);
-            item.m_txtCount.text =
-                $"{TaskDataManager.Instance.GetTaskProgressById(_cfgs[index].id)}/{_cfgs[index].GetTargetCount()}";
+            
+            item.m_taskBar.value = TaskDataManager.Instance.GetTaskProgressById(_cfgs[index].id);
+            item.m_taskBar.max = _cfgs[index].GetTargetCount();
+
+            //item.m_txtCount.text =
+            //    $"{TaskDataManager.Instance.GetTaskProgressById(_cfgs[index].id)}/{_cfgs[index].GetTargetCount()}";
             if (item.m_GetRewardBt.target.data == null)
             {
                 item.m_GetRewardBt.target.onClick.Add(OnBtnGetClick);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Task/TaskAchieveView.cs

@@ -103,7 +103,7 @@ namespace GFGGame
                 }
             }
 
-            RedDotController.Instance.SetComRedDot(listItem.target, TaskDataManager.Instance.CheckTaskSubRewardCanGet(TaskFuncType.Achievement, index),"",-10,60);
+            RedDotController.Instance.SetComRedDot(listItem.target, TaskDataManager.Instance.CheckTaskSubRewardCanGet(TaskFuncType.Achievement, index),"",-30,120);
 
             UI_AchieveItem.ProxyEnd();
         }

BIN
GameClient/Assets/ResIn/UI/Card/Card_fui.bytes


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Studio/Studio_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0_2!a.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0_2.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0_3!a.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0_3.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_fui.bytes