Browse Source

田野调查

zhaoyang 3 years ago
parent
commit
8b3b5f0cdc

+ 8 - 5
FGUIProject/assets/Field/components/Button1.xml

@@ -9,16 +9,19 @@
     <image id="n6_ohun" name="n6" src="ohunj" fileName="images/tydc_jbkuang_2.png" xy="2,0">
     <image id="n6_ohun" name="n6" src="ohunj" fileName="images/tydc_jbkuang_2.png" xy="2,0">
       <gearDisplay controller="button" pages="1"/>
       <gearDisplay controller="button" pages="1"/>
     </image>
     </image>
-    <text id="n3_s20j" name="title" xy="-18,0" size="248,67" fontSize="38" color="#e3d49f" align="center" vAlign="middle" autoSize="none" singleLine="true" text="初级">
+    <loader id="n7_ohun" name="icon" xy="52,10" size="88,51" group="n9_qjjq" url="ui://5oh3t798ohunk" autoSize="true">
+      <gearDisplay controller="button" pages="1"/>
+    </loader>
+    <text id="n3_s20j" name="title" xy="52,7" size="88,52" group="n9_qjjq" fontSize="38" color="#e3d49f" align="center" vAlign="middle" autoSize="none" singleLine="true" text="初级">
       <gearDisplay controller="button" pages="0"/>
       <gearDisplay controller="button" pages="0"/>
       <gearColor controller="button" pages="1" values="#fff8df,#fef6d9" default="#e3d49f,#000000"/>
       <gearColor controller="button" pages="1" values="#fff8df,#fef6d9" default="#e3d49f,#000000"/>
     </text>
     </text>
-    <loader id="n7_ohun" name="icon" xy="61,11" size="88,51" url="ui://5oh3t798ohunk" autoSize="true">
-      <gearDisplay controller="button" pages="1"/>
-    </loader>
-    <image id="n8_ohun" name="imgLock" src="ohuntac" fileName="imagesExport/zhuxian_shuoto.png" pkg="eg2y0ldp" xy="149,25" scale="0.7,0.7">
+    <image id="n8_ohun" name="imgLock" src="ohuntac" fileName="imagesExport/zhuxian_shuoto.png" pkg="eg2y0ldp" xy="140,25" size="71,37" group="n9_qjjq" scale="0.7,0.7">
       <gearDisplay controller="c1" pages="0"/>
       <gearDisplay controller="c1" pages="0"/>
     </image>
     </image>
+    <group id="n9_qjjq" name="n9" xy="52,7" size="159,55" advanced="true" layout="hz" excludeInvisibles="true">
+      <relation target="" sidePair="center-center"/>
+    </group>
   </displayList>
   </displayList>
   <Button mode="Radio"/>
   <Button mode="Radio"/>
 </component>
 </component>

+ 3 - 3
FGUIProject/assets/Field/components/Button3.xml

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <component size="230,73" extention="Button">
 <component size="230,73" extention="Button">
   <controller name="button" pages="0,up,1,down" selected="0"/>
   <controller name="button" pages="0,up,1,down" selected="0"/>
-  <controller name="c1" pages="0,,1,,2," selected="0"/>
+  <controller name="c1" pages="0,,1,,2," selected="2"/>
   <displayList>
   <displayList>
     <image id="n4_ohun" name="n4" src="ohunt" fileName="images/tydc_sxtsan_1.png" xy="0,0">
     <image id="n4_ohun" name="n4" src="ohunt" fileName="images/tydc_sxtsan_1.png" xy="0,0">
-      <gearDisplay controller="c1" pages="0"/>
+      <gearDisplay controller="c1" pages="1"/>
     </image>
     </image>
     <image id="n5_ohun" name="n5" src="ohunu" fileName="images/tydc_sxtsan_2.png" xy="1,0">
     <image id="n5_ohun" name="n5" src="ohunu" fileName="images/tydc_sxtsan_2.png" xy="1,0">
-      <gearDisplay controller="c1" pages="1"/>
+      <gearDisplay controller="c1" pages="0"/>
     </image>
     </image>
     <image id="n6_ohun" name="n6" src="ohunv" fileName="images/tydc_sxtsan_3.png" xy="1,0">
     <image id="n6_ohun" name="n6" src="ohunv" fileName="images/tydc_sxtsan_3.png" xy="1,0">
       <gearDisplay controller="c1" pages="2"/>
       <gearDisplay controller="c1" pages="2"/>

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Data/FieldDataManager.cs

@@ -125,20 +125,21 @@ namespace GFGGame
             {
             {
                 int stateA = GetTaskState(a.id);
                 int stateA = GetTaskState(a.id);
                 int stateB = GetTaskState(b.id);
                 int stateB = GetTaskState(b.id);
-
+                if (stateA == 1) return -1;
+                if (stateB == 1) return 1;
                 return stateA.CompareTo(stateB);
                 return stateA.CompareTo(stateB);
 
 
             });
             });
             return cfgs;
             return cfgs;
         }
         }
         /// <summary>
         /// <summary>
-        /// 根据任务ID获取任务状态0可领取1未完成2已领取
+        /// 根据任务ID获取任务状态0未完成1可领取2已领取
         /// </summary>
         /// </summary>
         /// <param name="taskId"></param>
         /// <param name="taskId"></param>
         /// <returns></returns>
         /// <returns></returns>
         public int GetTaskState(int taskId)
         public int GetTaskState(int taskId)
         {
         {
-            return fieldInfos.taskDic.ContainsKey(taskId) ? fieldInfos.taskDic[taskId] : 1;
+            return fieldInfos.taskDic.ContainsKey(taskId) ? fieldInfos.taskDic[taskId] : 0;
         }
         }
     }
     }
 }
 }

+ 5 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/FieldSProxy.cs

@@ -19,7 +19,10 @@ namespace GFGGame
                     FieldInfos fieldInfos = FieldDataManager.Instance.fieldInfos;
                     FieldInfos fieldInfos = FieldDataManager.Instance.fieldInfos;
                     fieldInfos.theme = response.Theme;
                     fieldInfos.theme = response.Theme;
                     fieldInfos.highestLvls = new Dictionary<int, int>();
                     fieldInfos.highestLvls = new Dictionary<int, int>();
-
+                    for (int i = 0; i < response.kHighestLvl.Count; i++)
+                    {
+                        fieldInfos.highestLvls.Add(response.kHighestLvl[i], response.vHighestLvl[i]);
+                    }
                     fieldInfos.bonusWeekly = response.BonusWeekly;
                     fieldInfos.bonusWeekly = response.BonusWeekly;
                     fieldInfos.bonusMaxLimit = response.BonusMaxLimit;
                     fieldInfos.bonusMaxLimit = response.BonusMaxLimit;
                     fieldInfos.hasBonus = response.HasBonus;
                     fieldInfos.hasBonus = response.HasBonus;
@@ -48,7 +51,7 @@ namespace GFGGame
                     fieldResult.chapterId = response.ChapterId;
                     fieldResult.chapterId = response.ChapterId;
 
 
                     FieldInfos fieldInfos = FieldDataManager.Instance.fieldInfos;
                     FieldInfos fieldInfos = FieldDataManager.Instance.fieldInfos;
-                    fieldInfos.highestLvls[Array.IndexOf(FieldCfgArray.Instance.dataArray, fieldResult.chapterId)] = response.HighestLvl;
+                    fieldInfos.highestLvls[fieldResult.chapterId] = response.HighestLvl;
                     fieldInfos.bonusWeekly = response.BonusWeekly;
                     fieldInfos.bonusWeekly = response.BonusWeekly;
                     for (int i = 0; i < response.kTaskIds.Count; i++)
                     for (int i = 0; i < response.kTaskIds.Count; i++)
                     {
                     {

+ 12 - 4
GameClient/Assets/Game/HotUpdate/Views/Field/FieldTaskView.cs

@@ -54,14 +54,22 @@ namespace GFGGame
             {
             {
                 item.m_btnGet.target.onClick.Add(OnBtnGetClick);
                 item.m_btnGet.target.onClick.Add(OnBtnGetClick);
             }
             }
-            item.m_btnGet.target.data = item.m_btnGet.m_c1.selectedIndex;
+            item.m_btnGet.target.data = _cfgs[index].id;//item.m_btnGet.m_c1.selectedIndex;
             UI_ListItem.ClearProxy();
             UI_ListItem.ClearProxy();
         }
         }
-        private void OnBtnGetClick(EventContext context)
+        private async void OnBtnGetClick(EventContext context)
         {
         {
-            if ((int)(context.sender as GObject).data == 0)
+            int taskId = (int)(context.sender as GObject).data;
+            int state = FieldDataManager.Instance.GetTaskState(taskId);
+            if (state == 1)
             {
             {
-                PromptController.Instance.ShowFloatTextPrompt("每周奖励领取成功");
+                bool result = await FieldSProxy.ReqFieldTaskBonus(taskId);
+                if (result)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt("每周奖励上限提升");
+                    _ui.m_list.numItems = _cfgs.Count;
+
+                }
             }
             }
         }
         }
     }
     }

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/Field/FieldView.cs

@@ -9,7 +9,7 @@ namespace GFGGame
     {
     {
         private UI_FieldUI _ui;
         private UI_FieldUI _ui;
 
 
-        // private int _curLevelId;
+
         private FieldCfg _curCfg;
         private FieldCfg _curCfg;
         private FieldDataManager _dataManager;
         private FieldDataManager _dataManager;
         private int _selectedIndex = 0;
         private int _selectedIndex = 0;
@@ -35,6 +35,7 @@ namespace GFGGame
             FieldDataManager.Instance.fieldInfos.theme = 1;
             FieldDataManager.Instance.fieldInfos.theme = 1;
             FieldDataManager.Instance.fieldInfos.bonusWeekly = 250;
             FieldDataManager.Instance.fieldInfos.bonusWeekly = 250;
             FieldDataManager.Instance.fieldInfos.bonusMaxLimit = 800;
             FieldDataManager.Instance.fieldInfos.bonusMaxLimit = 800;
+            FieldDataManager.Instance.fieldInfos.highestLvls = new System.Collections.Generic.Dictionary<int, int>();
         }
         }
 
 
         protected override void OnShown()
         protected override void OnShown()
@@ -50,7 +51,7 @@ namespace GFGGame
             FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
             FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
             for (int i = 0; i < cfgs.Length; i++)
             for (int i = 0; i < cfgs.Length; i++)
             {
             {
-                bool isPass = InstanceZonesDataManager.CheckLevelPass(cfgs[i].storyLvId);
+                bool isPass = i == 0 ? true : InstanceZonesDataManager.CheckLevelPass(cfgs[i].storyLvId);
                 _ui.target.GetChild("btn" + i).asButton.GetChild("imgLock").asImage.visible = !isPass;
                 _ui.target.GetChild("btn" + i).asButton.GetChild("imgLock").asImage.visible = !isPass;
             }
             }
             UpdateView();
             UpdateView();

BIN
GameClient/Assets/ResIn/UI/Field/Field_fui.bytes