فهرست منبع

限时抽奖奖励

zhaoyang 2 سال پیش
والد
کامیت
0b228de778

+ 3 - 3
FGUIProject/assets/ActivityThemeLuckyBox/compoents/ListTaskItem.xml → FGUIProject/assets/ActivityThemeLuckyBox/compoents/ListItem.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="882,208">
-  <controller name="c1" pages="0,,1,,2,,3," selected="3">
+  <controller name="c1" pages="0,,1,,2,,3," selected="0">
     <remark page="0" value="不可领取"/>
     <remark page="1" value="可领取"/>
     <remark page="2" value="已领取"/>
@@ -8,11 +8,11 @@
   </controller>
   <displayList>
     <image id="n2_mbf1" name="n2" src="mbf13" fileName="images/tc_xuanxiangkuang.png" xy="0,0"/>
-    <list id="n3_mbf1" name="lsitRewards" xy="30,69" size="320,131" layout="row" colGap="6" defaultItem="ui://eg2y0ldp9jv6tls">
+    <list id="n3_mbf1" name="listRewards" xy="30,69" size="320,131" layout="row" colGap="6" defaultItem="ui://eg2y0ldp9jv6tls">
       <item/>
       <item/>
     </list>
-    <text id="n4_mbf1" name="txtTitle" xy="30,8" size="448,44" fontSize="32" color="#a07c49" vars="true" text="{title=巴拉巴拉限定摘星99次}{curValue=0}/{allValue=}99)"/>
+    <text id="n4_mbf1" name="txtTitle" xy="30,8" size="448,44" fontSize="32" color="#a07c49" text="巴拉巴拉限定摘星99次(0/99)"/>
     <component id="n7_mbf1" name="btnGetNone" src="mbf1tn7" fileName="components/BtnStyle003.xml" pkg="eg2y0ldp" xy="648,80">
       <gearDisplay controller="c1" pages="0"/>
       <Button title="领取"/>

+ 0 - 24
FGUIProject/assets/ActivityThemeLuckyBox/compoents/ListRewardItem.xml

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<component size="882,208">
-  <controller name="c1" pages="0,,1,,2," selected="0">
-    <remark page="0" value="不可领取"/>
-    <remark page="1" value="可领取"/>
-    <remark page="2" value="已领取"/>
-  </controller>
-  <displayList>
-    <image id="n2_mbf1" name="n2" src="mbf13" fileName="images/tc_xuanxiangkuang.png" xy="0,0"/>
-    <list id="n3_mbf1" name="lsitRewards" xy="30,69" size="320,131" layout="row" colGap="6" defaultItem="ui://eg2y0ldp9jv6tls">
-      <item/>
-      <item/>
-    </list>
-    <text id="n4_mbf1" name="txtTitle" xy="30,8" size="448,44" fontSize="32" color="#a07c49" vars="true" text="{title=巴拉巴拉限定摘星99次}({curValue=0}/{allValue=}99)"/>
-    <component id="n5_mbf1" name="btnGet" src="rv091p" fileName="components/BtnStyle1Big.xml" pkg="eg2y0ldp" xy="648,80" size="189,58">
-      <gearDisplay controller="c1" pages="1"/>
-      <Button title="领取" icon="ui://eg2y0ldpmbf1tn8"/>
-    </component>
-    <component id="n7_mbf1" name="btnGot" src="mbf1tn7" fileName="components/BtnStyle003.xml" pkg="eg2y0ldp" xy="648,80">
-      <gearDisplay controller="c1" pages="0,2"/>
-      <Button title="领取"/>
-    </component>
-  </displayList>
-</component>

+ 1 - 2
FGUIProject/assets/ActivityThemeLuckyBox/package.xml

@@ -10,8 +10,7 @@
     <image id="mbf15" name="cj_xiafang_db.png" path="/images/"/>
     <component id="mbf16" name="ActivityThemeLuckyBoxBonusUI.xml" path="/" exported="true"/>
     <image id="mbf17" name="tx_xuanxiang_zz.png" path="/images/"/>
-    <component id="mbf19" name="ListTaskItem.xml" path="/compoents/"/>
-    <component id="mbf1a" name="ListRewardItem.xml" path="/compoents/"/>
+    <component id="mbf19" name="ListItem.xml" path="/compoents/"/>
     <image id="mbf1b" name="lm_biaotizi_15.png" path="/images/"/>
     <image id="mbf1c" name="lm_biaotizi_14.png" path="/images/"/>
     <component id="mbf1d" name="ActivityThemeLuckyBoxTaskUI.xml" path="/" exported="true"/>

+ 1 - 1
FGUIProject/assets/CommonGame/components/ComItemNew.xml

@@ -2,7 +2,7 @@
 <component size="124,124" pivot="0.5,0.5" overflow="hidden" opaque="false">
   <displayList>
     <component id="n25_pu55" name="comItemIcon" src="9jv6tlt" fileName="components/ComItemIconNew.xml" xy="0,0" pivot="0.5,0.5" aspect="true"/>
-    <text id="n15_ehs9" name="txtCount" xy="61,78" pivot="0.5,0" anchor="true" size="97,44" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#ffffff" align="center" vars="true" text="x00200">
+    <text id="n15_ehs9" name="txtCount" xy="61,78" pivot="0.5,0" anchor="true" size="97,44" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#ffffff" align="center" text="x00200">
       <relation target="n25_pu55" sidePair="center-center"/>
     </text>
     <text id="n26_r9ri" name="txtName" xy="62,124" pivot="0.5,0" anchor="true" size="60,39" fontSize="28" color="#a78d67" text="江南">

+ 10 - 10
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityThemeLuckyBox/UI_ListTaskItem.cs → GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityThemeLuckyBox/UI_ListItem.cs

@@ -4,11 +4,11 @@ using FairyGUI;
 
 namespace UI.ActivityThemeLuckyBox
 {
-    public partial class UI_ListTaskItem
+    public partial class UI_ListItem
     {
         public GComponent target;
         public Controller m_c1;
-        public GList m_lsitRewards;
+        public GList m_listRewards;
         public GTextField m_txtTitle;
         public GButton m_btnGetNone;
         public GButton m_btnGet;
@@ -16,12 +16,12 @@ namespace UI.ActivityThemeLuckyBox
         public GButton m_btnGo;
         public const string URL = "ui://ubfk2kobmbf19";
         public const string PACKAGE_NAME = "ActivityThemeLuckyBox";
-        public const string RES_NAME = "ListTaskItem";
-        private static UI_ListTaskItem _proxy;
+        public const string RES_NAME = "ListItem";
+        private static UI_ListItem _proxy;
 
-        public static UI_ListTaskItem Create(GObject gObject = null)
+        public static UI_ListItem Create(GObject gObject = null)
         {
-            var ui = new UI_ListTaskItem();
+            var ui = new UI_ListItem();
             if(gObject == null)
             	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
             else
@@ -30,11 +30,11 @@ namespace UI.ActivityThemeLuckyBox
             return ui;
         }
 
-        public static UI_ListTaskItem Proxy(GObject gObject = null)
+        public static UI_ListItem Proxy(GObject gObject = null)
         {
             if(_proxy == null)
             {
-                _proxy = new UI_ListTaskItem();
+                _proxy = new UI_ListItem();
             }
             var ui = _proxy;
             if(gObject == null)
@@ -62,7 +62,7 @@ namespace UI.ActivityThemeLuckyBox
         private void Init(GComponent comp)
         {
             m_c1 = comp.GetController("c1");
-            m_lsitRewards = (GList)comp.GetChild("lsitRewards");
+            m_listRewards = (GList)comp.GetChild("listRewards");
             m_txtTitle = (GTextField)comp.GetChild("txtTitle");
             m_btnGetNone = (GButton)comp.GetChild("btnGetNone");
             m_btnGet = (GButton)comp.GetChild("btnGet");
@@ -72,7 +72,7 @@ namespace UI.ActivityThemeLuckyBox
         public void Dispose(bool disposeTarget = false)
         {
             m_c1 = null;
-            m_lsitRewards = null;
+            m_listRewards = null;
             m_txtTitle = null;
             m_btnGetNone = null;
             m_btnGet = null;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityThemeLuckyBox/UI_ListTaskItem.cs.meta → GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityThemeLuckyBox/UI_ListItem.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: a760567c6036cbf49b9c0dacad857c9d
+guid: 1c2c2b24b08f93f48b678d58ccc42720
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 5 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/LuckyBoxSProxy.cs

@@ -14,6 +14,11 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
+                    ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(ActivityDataManager.Instance.activityId);
+                    if (activityOpenCfg.paramsArr[0] == luckyBoxId)
+                    {
+                        ActivityDataManager.Instance.allPlayTimes += response.Times;
+                    }
                     LuckyBoxDataManager.Instance.times = response.Times;
                     LuckyBoxDataManager.Instance.luckyBoxId = response.LuckyBoxId;
                     LuckyBoxDataManager.Instance.RewardList = ItemUtil.CreateItemDataList(response.bonusList);

+ 94 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityThemeLuckyBox/ActivityThemeLuckyBoxBonusView.cs

@@ -0,0 +1,94 @@
+using System.Collections.Generic;
+using ET;
+using FairyGUI;
+using UI.ActivityThemeLuckyBox;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class ActivityThemeLuckyBoxBonusView : BaseWindow
+    {
+        private UI_ActivityThemeLuckyBoxBonusUI _ui;
+        private List<ActivityLuckybonusCfg> _bonueCfgs = new List<ActivityLuckybonusCfg>();
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_ActivityThemeLuckyBoxBonusUI.PACKAGE_NAME;
+            _ui = UI_ActivityThemeLuckyBoxBonusUI.Create();
+            this.viewCom = _ui.target;
+            this.viewCom.Center();
+            this.modal = true;
+            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+
+            _ui.m_list.itemRenderer = RenderListItem;
+
+        }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _bonueCfgs = ActivityLuckybonusCfgArray.Instance.GetCfgsByid(ActivityDataManager.Instance.activityId);
+            _ui.m_list.numItems = _bonueCfgs.Count;
+
+
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+
+        }
+
+        private void RenderListItem(int index, GObject obj)
+        {
+            ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(ActivityDataManager.Instance.activityId);
+
+            UI_ListItem item = UI_ListItem.Proxy(obj);
+
+            item.m_txtTitle.text = string.Format("{0}限定摘星{1}次({2}/{3})", activityOpenCfg.themeName, _bonueCfgs[index].num, ActivityDataManager.Instance.allPlayTimes, _bonueCfgs[index].num);
+            if (item.m_listRewards.data == null)
+            {
+                item.m_listRewards.itemRenderer = RenderListRewardItem;
+            }
+            item.m_listRewards.data = _bonueCfgs[index].bonusArr;
+            item.m_listRewards.numItems = _bonueCfgs[index].bonusArr.Length;
+            int key = _bonueCfgs[index].num;
+            item.m_c1.selectedIndex = ActivityDataManager.Instance.luckyBoxActBonusState.ContainsKey(key) ? ActivityDataManager.Instance.luckyBoxActBonusState[key] : 0;
+
+            UI_ListItem.ProxyEnd();
+        }
+
+        private void RenderListRewardItem(int index, GObject obj)
+        {
+            int[][] bonus = (int[][])obj.parent.data;
+            ItemData reward = ItemUtil.createItemData(bonus[index]);
+            if (obj.data == null)
+            {
+                obj.data = new ItemView(obj as GComponent);
+            }
+            (obj.data as ItemView).SetData(reward);
+            (obj.data as ItemView).ChangeTxtCountStyle();
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityThemeLuckyBox/ActivityThemeLuckyBoxBonusView.cs.meta

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

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/ActivityThemeLuckyBox/ActivityThemeLuckyBoxTaskView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using FairyGUI;
 using UI.ActivityThemeLuckyBox;
@@ -8,6 +9,7 @@ namespace GFGGame
     public class ActivityThemeLuckyBoxTaskView : BaseWindow
     {
         private UI_ActivityThemeLuckyBoxTaskUI _ui;
+        private List<TaskCfg> _taskCfgs = new List<TaskCfg>();
 
         public override void Dispose()
         {
@@ -29,6 +31,8 @@ namespace GFGGame
             this.modal = true;
             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
+            _ui.m_list.itemRenderer = RenderListItem;
+
         }
         protected override void AddEventListener()
         {
@@ -38,6 +42,8 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            _taskCfgs = TaskCfgArray.Instance.GetCfgsBytaskType(TaskType.LuckyBoxActivity);
+
 
         }
 
@@ -52,5 +58,10 @@ namespace GFGGame
             base.RemoveEventListener();
 
         }
+
+        private void RenderListItem(int index, GObject obj)
+        {
+
+        }
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxActivityView.cs

@@ -179,7 +179,7 @@ namespace GFGGame
 
         private void OnClikcBtnReward()
         {
-
+            ViewManager.Show<ActivityThemeLuckyBoxBonusView>();
         }
         private void OnClikcBtnShop()
         {

BIN
GameClient/Assets/ResIn/UI/ActivityThemeLuckyBox/ActivityThemeLuckyBox_fui.bytes