瀏覽代碼

田野调查

zhaoyang 3 年之前
父節點
當前提交
e2ff863182

+ 6 - 1
FGUIProject/assets/Field/FieldUI.xml

@@ -39,10 +39,15 @@
     <component id="n26_ohun" name="proTaskReward" src="ohunz" fileName="components/ProgressBar1.xml" xy="198,1790" group="n29_ohun">
       <ProgressBar value="50" max="100"/>
     </component>
-    <loader id="n28_ohun" name="loaTaskReward" xy="89,1758" size="50,50" group="n29_ohun"/>
+    <loader id="n28_ohun" name="loaTaskReward" xy="45,1736" size="135,135" group="n29_ohun" aspect="true" fill="scaleMatchWidth"/>
     <image id="n27_ohun" name="n27" src="ohunp" fileName="images/tydc_mzjl.png" xy="40,1826" group="n29_ohun"/>
     <group id="n29_ohun" name="grpTaskReward" xy="0,1722" size="756,176" advanced="true">
       <relation target="" sidePair="left-left,bottom-bottom"/>
     </group>
+    <image id="n30_wet2" name="n30" src="wet210" fileName="images/tydc_dikuang_3.png" xy="806,1797" group="n32_wet2"/>
+    <text id="n31_wet2" name="txtTime" xy="917,1802" pivot="0.5,0" size="10,46" group="n32_wet2" fontSize="34" color="#f4dba2" align="center" text=""/>
+    <group id="n32_wet2" name="grpTime" xy="806,1797" size="234,58" advanced="true">
+      <relation target="" sidePair="bottom-bottom"/>
+    </group>
   </displayList>
 </component>

二進制
FGUIProject/assets/Field/images/tydc_dikuang_3.png


+ 1 - 0
FGUIProject/assets/Field/package.xml

@@ -34,6 +34,7 @@
     <image id="ohunx" name="tydc_npcdik.png" path="/images/"/>
     <component id="ohuny" name="Button6.xml" path="/components/"/>
     <component id="ohunz" name="ProgressBar1.xml" path="/components/"/>
+    <image id="wet210" name="tydc_dikuang_3.png" path="/images/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Field" packageCount="2" genCode="true"/>
 </packageDescription>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -48,5 +48,8 @@ namespace GFGGame
 
         public const string SERVER_CHANGE = "SERVER_CHANGE";//更换区服
 
+        public const string FIELD_RESULT = "FIELD_RESULT";//田野结算
+        public const string FIELD_TASK = "FIELD_TASK";//田野任务
+
     }
 }

+ 11 - 7
GameClient/Assets/Game/HotUpdate/Data/FieldDataManager.cs

@@ -53,8 +53,8 @@ namespace GFGGame
     public class FieldDataManager : SingletonBase<FieldDataManager>
     {
 
-        public FieldInfos fieldInfos= new FieldInfos();
-        public FieldResult fieldResult;//= new FieldResult();
+        public FieldInfos fieldInfos = new FieldInfos();
+        public FieldResult fieldResult = new FieldResult();
 
 
         /// <summary>
@@ -65,6 +65,10 @@ namespace GFGGame
         /// 当前关卡挑战进度,起始为1
         /// </summary>
         public int currFightLv = 1;
+        /// <summary>
+        /// 当前难度
+        /// </summary>
+        public int difficulty = 0;
 
 
 
@@ -106,11 +110,11 @@ namespace GFGGame
             List<FieldTaskCfg> cfgs = new List<FieldTaskCfg>(FieldTaskCfgArray.Instance.dataArray);
             cfgs.Sort((FieldTaskCfg a, FieldTaskCfg b) =>
             {
-                int stateA = GetTaskState(a.id);
-                int stateB = GetTaskState(b.id);
-                if (stateA == 1) return -1;
-                if (stateB == 1) return 1;
-                return stateA.CompareTo(stateB);
+                int stateA = GetTaskState(a.id) == 1 ? 1 : -1;
+                int stateB = GetTaskState(b.id) == 1 ? 1 : -1;
+                if (stateA > stateB) return -1;
+                if (stateB > stateA) return 1;
+                return GetTaskState(a.id).CompareTo(GetTaskState(b.id));
 
             });
             return cfgs;

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Field/UI_FieldUI.cs

@@ -25,6 +25,8 @@ namespace UI.Field
         public GProgressBar m_proTaskReward;
         public GLoader m_loaTaskReward;
         public GGroup m_grpTaskReward;
+        public GTextField m_txtTime;
+        public GGroup m_grpTime;
         public const string URL = "ui://5oh3t7988jo90";
         public const string PACKAGE_NAME = "Field";
         public const string RES_NAME = "FieldUI";
@@ -90,6 +92,8 @@ namespace UI.Field
             m_proTaskReward = (GProgressBar)comp.GetChild("proTaskReward");
             m_loaTaskReward = (GLoader)comp.GetChild("loaTaskReward");
             m_grpTaskReward = (GGroup)comp.GetChild("grpTaskReward");
+            m_txtTime = (GTextField)comp.GetChild("txtTime");
+            m_grpTime = (GGroup)comp.GetChild("grpTime");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -114,6 +118,8 @@ namespace UI.Field
             m_proTaskReward = null;
             m_loaTaskReward = null;
             m_grpTaskReward = null;
+            m_txtTime = null;
+            m_grpTime = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/FieldSProxy.cs

@@ -66,6 +66,7 @@ namespace GFGGame
                             FieldDataManager.Instance.fieldInfos.taskDic[response.kTaskIds[i]] = response.vTaskStatus[i];
                         }
                     }
+                    EventAgent.DispatchEvent(ConstMessage.FIELD_RESULT);
                     return true;
                 }
             }
@@ -82,6 +83,8 @@ namespace GFGGame
                     // FieldInfos fieldInfos = FieldDataManager.Instance.fieldInfos;
                     FieldDataManager.Instance.fieldInfos.bonusMaxLimit = response.BonusMaxLimit;
                     FieldDataManager.Instance.fieldInfos.taskDic[response.TaskId] = response.TaskStatus;
+                    EventAgent.DispatchEvent(ConstMessage.FIELD_TASK);
+
                     return true;
                 }
             }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -121,6 +121,7 @@ namespace GFGGame
             if (_levelCfg.type == ConstInstanceZonesType.Field)
             {
                 _fightCfg.scoreType = FieldDataManager.Instance.fieldInfos.theme;
+                _ui.m_btnAutoPlay.visible = false;
             }
 
 

+ 4 - 1
GameClient/Assets/Game/HotUpdate/Views/Field/FieldFightEndView.cs

@@ -26,17 +26,20 @@ namespace GFGGame
             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
             _ui.m_list.itemRenderer = ListItemRender;
+            _ui.m_btnConfirm.onClick.Add(this.Hide);
         }
 
         protected override void OnShown()
         {
             base.OnShown();
+            FieldDataManager.Instance.currFightLv = 1;
+
             UpdateView();
         }
         private void UpdateView()
         {
 
-            FieldCfg fieldCfg = FieldCfgArray.Instance.GetCfg(FieldDataManager.Instance.chapterId);
+            FieldCfg fieldCfg = FieldCfgArray.Instance.GetCfg(FieldDataManager.Instance.fieldResult.chapterId);
             string num = StringUtil.GetColorText(string.Format("{0}/{1}", FieldDataManager.Instance.fieldResult.passLvl, fieldCfg.num), "#BB674E");
             _ui.m_txtNum.text = string.Format("第{0}轮", num);
             _ui.m_txtCostNum.text = FieldDataManager.Instance.fieldResult.costNum.ToString();

+ 1 - 2
GameClient/Assets/Game/HotUpdate/Views/Field/FieldFightInfoView.cs

@@ -44,7 +44,7 @@ namespace GFGGame
             StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfgs(fieldCfg.type, 0, fieldCfg.id)[dataManager.currFightLv];
             StoryFightCfg storyFightCfg = StoryFightCfgArray.Instance.GetCfg(storyLevelCfg.fightID);
             dataManager.currFightLv++;
-            InstanceZonesDataManager.currentLevelCfgId = storyLevelCfg.id;
+            FieldFightDataManager.Instance.currentLevelCfgId = storyLevelCfg.id;
 
             _ui.m_txtName.text = storyFightCfg.targetName;
             _ui.m_txtDesc.text = storyLevelCfg.desc;
@@ -95,7 +95,6 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
-
         }
 
     }

+ 9 - 5
GameClient/Assets/Game/HotUpdate/Views/Field/FieldTaskView.cs

@@ -35,22 +35,26 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _cfgs = FieldDataManager.Instance.GetTaskCfgs();
-            _ui.m_list.numItems = _cfgs.Count;
-
+            UpdateList();
         }
 
         protected override void OnHide()
         {
             base.OnHide();
         }
+        private void UpdateList()
+        {
+            _cfgs = FieldDataManager.Instance.GetTaskCfgs();
+            _ui.m_list.numItems = _cfgs.Count;
+
+        }
         private void ListItemRender(int index, GObject obj)
         {
             UI_ListItem item = UI_ListItem.Proxy(obj);
 
             FieldCfg cfg = FieldCfgArray.Instance.GetCfg(_cfgs[index].chapterId);
 
-            item.m_txtDesc.text = string.Format("{0}难度挑战成功轮", cfg.name);
+            item.m_txtDesc.text = string.Format("{0}难度挑战成功{1}轮", cfg.name, _cfgs[index].target);
             item.m_btnGet.m_txtTitle.text = string.Format("每周上限+{0}", _cfgs[index].addRewardLimit);
             item.m_btnGet.m_c1.selectedIndex = FieldDataManager.Instance.GetTaskState(_cfgs[index].id);
             if (item.m_btnGet.target.data == null)
@@ -70,7 +74,7 @@ namespace GFGGame
                 if (result)
                 {
                     PromptController.Instance.ShowFloatTextPrompt("每周奖励上限提升");
-                    _ui.m_list.numItems = _cfgs.Count;
+                    UpdateList();
 
                 }
             }

+ 19 - 8
GameClient/Assets/Game/HotUpdate/Views/Field/FieldView.cs

@@ -1,5 +1,6 @@
 
 using ET;
+using FairyGUI;
 using UI.Field;
 using UnityEngine;
 
@@ -37,24 +38,22 @@ namespace GFGGame
             _ui.m_c1.onChanged.Add(OnDifficultyChange);
             _valueBarController = new ValueBarController(_ui.m_comValueBar);
 
-            // FieldDataManager.Instance.fieldInfos.theme = 1;
-            // FieldDataManager.Instance.fieldInfos.bonusWeekly = 250;
-            // FieldDataManager.Instance.fieldInfos.bonusMaxLimit = 800;
-            // FieldDataManager.Instance.fieldInfos.highestLvls = new System.Collections.Generic.Dictionary<int, int>();
-            // FieldDataManager.Instance.fieldInfos.taskDic = new System.Collections.Generic.Dictionary<int, int>();
+            EventAgent.AddEventListener(ConstMessage.FIELD_RESULT, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.FIELD_TASK, UpdateView);
+
         }
 
         protected override void OnShown()
         {
             base.OnShown();
             _valueBarController.OnShown();
-            _selectedIndex = 0;
+            _dataManager = FieldDataManager.Instance;
+            _selectedIndex = _dataManager.difficulty;
             _ui.m_c1.selectedIndex = _selectedIndex;
 
             _curCfg = FieldCfgArray.Instance.dataArray[_selectedIndex];
-            _dataManager = FieldDataManager.Instance;
             _dataManager.chapterId = _curCfg.id;
-            _dataManager.currFightLv = 1;
+
 
             FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
             for (int i = 0; i < cfgs.Length; i++)
@@ -63,16 +62,21 @@ namespace GFGGame
                 _ui.target.GetChild("btn" + i).asButton.GetChild("imgLock").asImage.visible = !isPass;
             }
             UpdateView();
+            Timers.inst.Add(1, 0, UpdateShowTime);
+
 
         }
 
         protected override void OnHide()
         {
             base.OnHide();
+            Timers.inst.Remove(UpdateShowTime);
+
         }
 
         private void OnClickBtnBack()
         {
+            _dataManager.difficulty = 0;
             ViewManager.GoBackFrom(typeof(FieldView).FullName);
         }
 
@@ -100,6 +104,7 @@ namespace GFGGame
             _selectedIndex = _ui.m_c1.selectedIndex;
             _curCfg = FieldCfgArray.Instance.dataArray[_selectedIndex]; ;
             _dataManager.chapterId = _curCfg.id;
+            _dataManager.difficulty = _selectedIndex;
             UpdateView();
         }
         private void UpdateView()
@@ -109,6 +114,12 @@ namespace GFGGame
             _ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
             _ui.m_proTaskReward.max = _dataManager.fieldInfos.bonusMaxLimit;
             _ui.m_proTaskReward.value = _dataManager.fieldInfos.bonusWeekly;
+            _ui.m_loaTaskReward.url = ResPathUtil.GetIconPath(ItemCfgArray.Instance.GetCfg(ConstItemID.DIAMOND_RED));
+
+        }
+        private void UpdateShowTime(object param)
+        {
+            _ui.m_txtTime.text = string.Format("{0}后刷新", TimeUtil.FormattingTime(TimeHelper.ServerNowSecs, TimeUtil.GetNextWeekTime(GlobalCfgArray.globalCfg.refreshTime)));
         }
         private void OnClickBtnGo()
         {

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -147,10 +147,11 @@ namespace GFGGame
 
                 if (!this._resultData.Result || FieldDataManager.Instance.currFightLv == FieldCfgArray.Instance.GetCfg(FieldDataManager.Instance.chapterId).num)
                 {
+                    ViewManager.Show<FieldView>();
+                    if (FieldDataManager.Instance.currFightLv <= 1) return;
                     bool result = await FieldSProxy.ReqFieldInstanceResult();
                     if (result)
                     {
-                        ViewManager.Show<FieldView>();
                         ViewManager.Show<FieldFightEndView>();
                     }
                 }

二進制
GameClient/Assets/ResIn/UI/Field/Field_atlas0.png


二進制
GameClient/Assets/ResIn/UI/Field/Field_fui.bytes