zhaoyang 3 éve
szülő
commit
815fcafe65

+ 2 - 3
FGUIProject/assets/LuckyBox/LuckyBoxUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1,,2," selected="0"/>
+  <controller name="c1" pages="0,,1,,2,,3," selected="0"/>
   <displayList>
     <list id="n23_vek8" name="listBg" xy="0,0" size="1080,1920" pageController="c1" layout="row" overflow="scroll" scroll="horizontal" scrollBarFlags="154" defaultItem="ui://drx9d1usvek811">
       <relation target="" sidePair="height-height,center-center,middle-middle"/>
@@ -29,8 +29,7 @@
     </component>
     <component id="n10_ga16" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="91,1748" group="n31_vek8"/>
     <component id="n11_ga16" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="577,1748" group="n31_vek8"/>
-    <image id="n21_ga16" name="iconSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="919,1663" group="n31_vek8">
-      <gearDisplay controller="c1" pages="0"/>
+    <image id="n21_ga16" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="919,1663" group="n31_vek8">
       <relation target="n11_ga16" sidePair="left-left,top-top"/>
     </image>
     <text id="n16_ga16" name="txtRemainTimes" xy="540,1869" pivot="0.5,0" anchor="true" size="248,44" group="n31_vek8" fontSize="32" color="#fff7d4" align="center" vars="true" text="今日剩余次数:{v1=0}">

+ 2 - 5
FGUIProject/assets/LuckyBox/components/ComListBgItem.xml

@@ -1,16 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1,,2," selected="0"/>
   <displayList>
     <loader id="n25_vek8" name="loaBg" xy="0,-240" size="1080,2400" url="ui://drx9d1useshh1f" autoSize="true">
       <relation target="" sidePair="center-center,middle-middle"/>
     </loader>
-    <loader id="n26_vek8" name="n26" xy="0,1378" size="1080,542" url="ui://drx9d1usvek8s" autoSize="true">
-      <gearDisplay controller="c1" pages="2"/>
+    <loader id="n26_vek8" name="loaImg" xy="0,1378" size="1080,542" url="ui://drx9d1usvek8s" autoSize="true">
       <relation target="" sidePair="bottom-bottom"/>
     </loader>
-    <text id="n28_vek8" name="txtTime" xy="324,409" size="55,902" fontSize="40" color="#fffbdd" align="center" vAlign="middle" autoSize="none" text="剩余81天">
-      <gearDisplay controller="c1" pages="0"/>
+    <text id="n28_vek8" name="txtTime" xy="324,409" size="90,902" fontSize="40" color="#fffbdd" align="center" vAlign="middle" autoSize="none" text="剩余813天">
       <relation target="" sidePair="height-height,top-top"/>
     </text>
   </displayList>

+ 0 - 0
FGUIProject/assets/LuckyBox/images/cj_bj_1.jpg → FGUIProject/assets/LuckyBox/imagesExport/cj_bj_1.jpg


+ 0 - 0
FGUIProject/assets/LuckyBox/images/cj_bj_2.jpg → FGUIProject/assets/LuckyBox/imagesExport/cj_bj_2.jpg


+ 0 - 0
FGUIProject/assets/LuckyBox/images/cj_bj_3.jpg → FGUIProject/assets/LuckyBox/imagesExport/cj_bj_3.jpg


+ 0 - 0
FGUIProject/assets/LuckyBox/images/cj_bj_4.jpg → FGUIProject/assets/LuckyBox/imagesExport/cj_bj_4.jpg


+ 4 - 4
FGUIProject/assets/LuckyBox/package.xml

@@ -24,12 +24,12 @@
     <image id="l5nzo" name="cj_xk_yd.png" path="/images/"/>
     <image id="l5nzp" name="cj_xk_xian.png" path="/images/" scale="9grid" scale9grid="5,0,30,12"/>
     <component id="l5nzq" name="ComStar.xml" path="/components/"/>
-    <image id="vek8r" name="cj_bj_1.jpg" path="/images/" exported="true" atlas="alone_npot"/>
+    <image id="vek8r" name="cj_bj_1.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>
     <image id="vek8s" name="cj_ditua.png" path="/images/"/>
     <image id="vek8t" name="cj_duihuan.png" path="/images/"/>
     <image id="vek8v" name="cj_yulan.png" path="/images/"/>
-    <image id="vek8x" name="cj_bj_2.jpg" path="/images/" exported="true" atlas="alone_npot"/>
-    <image id="vek8y" name="cj_bj_3.jpg" path="/images/" exported="true" atlas="alone_npot"/>
+    <image id="vek8x" name="cj_bj_2.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>
+    <image id="vek8y" name="cj_bj_3.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>
     <component id="vek811" name="ComListBgItem.xml" path="/components/"/>
     <component id="vek812" name="ComCost.xml" path="/components/"/>
     <image id="qdrt14" name="hd_dkdk_1.png" path="/images/"/>
@@ -43,7 +43,7 @@
     <component id="qdrt1c" name="Button4.xml" path="/components/"/>
     <image id="ly9g1d" name="cj_xhua.png" path="/images/"/>
     <component id="ly9g1e" name="Button5.xml" path="/components/"/>
-    <image id="eshh1f" name="cj_bj_4.jpg" path="/images/" exported="true" atlas="alone_npot"/>
+    <image id="eshh1f" name="cj_bj_4.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>
     <image id="o1391g" name="cj_tp_3.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>
     <image id="o1391h" name="cj_tp_1.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>
     <image id="o1391i" name="cj_tp_2.jpg" path="/imagesExport/" exported="true" atlas="alone_npot"/>

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -6,6 +6,12 @@ namespace GFGGame
 {
     public class LuckyBoxDataManager : SingletonBase<LuckyBoxDataManager>
     {
+
+        public const int BOX_ID_1 = 1;
+        public const int BOX_ID_2 = 2;
+        public const int BOX_ID_3 = 3;
+
+
         private List<ItemData> _rewardsList;//当前奖励,每次抽奖后刷新
         private Dictionary<int, ItemData> _firstRewardsList = new Dictionary<int, ItemData>();//首次获得的奖励
         public int[] luckyBoxIds = new int[] { 1, 2, 3 };//奖池列表

+ 3 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComListBgItem.cs

@@ -7,8 +7,8 @@ namespace UI.LuckyBox
     public partial class UI_ComListBgItem
     {
         public GComponent target;
-        public Controller m_c1;
         public GLoader m_loaBg;
+        public GLoader m_loaImg;
         public GTextField m_txtTime;
         public const string URL = "ui://drx9d1usvek811";
         public const string PACKAGE_NAME = "LuckyBox";
@@ -57,14 +57,14 @@ namespace UI.LuckyBox
 
         private void Init(GComponent comp)
         {
-            m_c1 = comp.GetController("c1");
             m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_loaImg = (GLoader)comp.GetChild("loaImg");
             m_txtTime = (GTextField)comp.GetChild("txtTime");
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_c1 = null;
             m_loaBg = null;
+            m_loaImg = null;
             m_txtTime = null;
             if(disposeTarget && target != null)
             {

+ 3 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_LuckyBoxUI.cs

@@ -20,7 +20,7 @@ namespace UI.LuckyBox
         public UI_ComCost m_comCostTen;
         public GButton m_btnBuyOne;
         public GButton m_btnBuyTen;
-        public GImage m_iconSpecial;
+        public GImage m_imgSpecial;
         public GTextField m_txtRemainTimes;
         public GGroup m_grpBottom;
         public GButton m_btnLeft;
@@ -85,7 +85,7 @@ namespace UI.LuckyBox
             m_comCostTen = (UI_ComCost)UI_ComCost.Create(comp.GetChild("comCostTen"));
             m_btnBuyOne = (GButton)comp.GetChild("btnBuyOne");
             m_btnBuyTen = (GButton)comp.GetChild("btnBuyTen");
-            m_iconSpecial = (GImage)comp.GetChild("iconSpecial");
+            m_imgSpecial = (GImage)comp.GetChild("imgSpecial");
             m_txtRemainTimes = (GTextField)comp.GetChild("txtRemainTimes");
             m_grpBottom = (GGroup)comp.GetChild("grpBottom");
             m_btnLeft = (GButton)comp.GetChild("btnLeft");
@@ -108,7 +108,7 @@ namespace UI.LuckyBox
             m_comCostTen = null;
             m_btnBuyOne = null;
             m_btnBuyTen = null;
-            m_iconSpecial = null;
+            m_imgSpecial = null;
             m_txtRemainTimes = null;
             m_grpBottom = null;
             m_btnLeft = null;

+ 42 - 11
GameClient/Assets/Game/HotUpdate/Utils/DateUtils.cs

@@ -22,35 +22,66 @@ namespace GFGGame
 
             return (int)timeSpan.TotalSeconds;
         }
-        public string getFormatBySecond(int second, int type = 1, int showLength = 2)
+        //direction排版方向:0横向,1纵向
+        public string getFormatBySecond(int second, int type = 1, int direction = 0)
         {
-            string str  = "";
+            string str = "";
             int ms = second * 1000;
             switch (type)
             {
                 case DateUtils.TIME_FORMAT_1:
-                    str = this.format_1(second);
+                    str = this.format_1(second, direction);
                     break;
             }
             return str;
         }
         //剩余时间大于1天返回天数,小于一天返回小时数,小于一小时返回分钟数,小于1分钟返回秒数
-        public string format_1(int second)
+        public string format_1(int second, int direction = 0)
         {
             if (second / this.SECOND_PER_DAY >= 1)
             {
-                return string.Format ("剩余{0}天", Mathf.Floor(second / this.SECOND_PER_DAY));
+                if (direction == 0)
+                {
+                    return string.Format("剩余{0}天", Mathf.Floor(second / this.SECOND_PER_DAY));
+                }
+                else
+                {
+                    return string.Format("剩\n余\n{0}\n天", Mathf.Floor(second / this.SECOND_PER_DAY));
+                }
             }
-            else if(second / this.SECOND_PER_DAY<1&& second/(this.MUNITE_PER_HOUR*this.SECOND_PER_MUNITE) >= 1)
+            else if (second / this.SECOND_PER_DAY < 1 && second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE) >= 1)
             {
-                return string.Format("剩余{0}小时", Mathf.Floor(second /( this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE)));
+                if (direction == 0)
+                {
+                    return string.Format("剩余{0}小时", Mathf.Floor(second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE)));
+
+                }
+                else
+                {
+                    return string.Format("剩\n余\n{0}\n小\n时", Mathf.Floor(second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE)));
+                }
             }
-            else if (second / this.SECOND_PER_DAY < 1 && second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE) < 1&& second/this. SECOND_PER_MUNITE>=1)
+            else if (second / this.SECOND_PER_DAY < 1 && second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE) < 1 && second / this.SECOND_PER_MUNITE >= 1)
             {
-                return string.Format("剩余{0}分钟", Mathf.Floor(second / this.SECOND_PER_MUNITE));
-            }else if (second< this.SECOND_PER_MUNITE)
+                if (direction == 0)
+                {
+                    return string.Format("剩余{0}分钟", Mathf.Floor(second / this.SECOND_PER_MUNITE));
+                }
+                else
+                {
+                    return string.Format("剩\n余\n{0}\n分\n钟", Mathf.Floor(second / this.SECOND_PER_MUNITE));
+                }
+            }
+            else if (second < this.SECOND_PER_MUNITE)
             {
-                return string.Format("剩余{0}秒", second);
+                if (direction == 0)
+                {
+                    return string.Format("剩余{0}秒", second);
+                }
+                else
+                {
+                    return string.Format("剩\n余\n{0}\n秒", second);
+                }
             }
             return "";
         }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -197,12 +197,12 @@ namespace GFGGame
         }
         private void UpdateCJGoodsCount()
         {
-            int luckyBoxId1 = LuckyBoxDataManager.Instance.luckyBoxIds[0];
+            int luckyBoxId1 = LuckyBoxDataManager.BOX_ID_3;
             LuckyBoxCfg luckyBoxCfg1 = LuckyBoxCfgArray.Instance.GetCfg(luckyBoxId1);
             _ui.m_txtCount0.text = "" + ItemDataManager.GetItemNum(luckyBoxCfg1.drop);
             _ui.m_loaIcon0.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg1.drop).res);
 
-            int luckyBoxId2 = LuckyBoxDataManager.Instance.luckyBoxIds[1];
+            int luckyBoxId2 = LuckyBoxDataManager.BOX_ID_2;
             LuckyBoxCfg luckyBoxCfg2 = LuckyBoxCfgArray.Instance.GetCfg(luckyBoxId2);
             _ui.m_txtCount1.text = "" + ItemDataManager.GetItemNum(luckyBoxCfg2.drop);
             _ui.m_loaIcon1.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg2.drop).res);

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -131,12 +131,12 @@ namespace GFGGame
         //ÕªÐÇ£¨³é½±£©¶Ò»»
         private void UpdateCJExchange()
         {
-            int luckyBoxId1 = LuckyBoxDataManager.Instance.luckyBoxIds[1];
+            int luckyBoxId1 = LuckyBoxDataManager.BOX_ID_2;
             LuckyBoxCfg luckyBoxCfg1 = LuckyBoxCfgArray.Instance.GetCfg(luckyBoxId1);
             _valueBar.m_btnCJLuoXing.text = "" + ItemDataManager.GetItemNum(luckyBoxCfg1.drop);
             _valueBar.m_btnCJLuoXing.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg1.drop).res);
 
-            int luckyBoxId2 = LuckyBoxDataManager.Instance.luckyBoxIds[2];
+            int luckyBoxId2 = LuckyBoxDataManager.BOX_ID_1;
             LuckyBoxCfg luckyBoxCfg2 = LuckyBoxCfgArray.Instance.GetCfg(luckyBoxId2);
             _valueBar.m_btnCJHuoDong.text = "" + ItemDataManager.GetItemNum(luckyBoxCfg2.drop);
             _valueBar.m_btnCJHuoDong.icon = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg2.drop).res);

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

@@ -64,7 +64,9 @@ namespace GFGGame
         private void OnClickBg()
         {
             this.Hide();
-            ViewManager.Show(ViewName.LUCKY_BOX_VIEW);
+
+            ViewManager.Show(ViewName.LUCKY_BOX_VIEW, ViewManager.GetGoBackDatas(ViewName.LUCKY_BOX_STAR_VIEW));
+            // ViewManager.GoBackFrom(ViewName.LUCKY_BOX_VIEW);
         }
 
         private void ShowBonusList(List<ItemData> itemList)

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

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using FairyGUI;
 using System.Threading;
 using System.Threading.Tasks;
+using System;
 
 namespace GFGGame
 {
@@ -56,7 +57,8 @@ namespace GFGGame
 
             _rewardList = LuckyBoxDataManager.Instance.RewardList;
             _ui.m_ctrlBuyType.selectedIndex = _rewardList != null && _rewardList.Count > 1 ? 1 : 0;
-            _ui.m_ctrlRewardsType.selectedIndex = (int)viewData;
+
+            _ui.m_ctrlRewardsType.selectedIndex = Array.IndexOf(LuckyBoxCfgArray.Instance.dataArray, LuckyBoxCfgArray.Instance.GetCfg((int)viewData)); ;
 
             ResetStartView();
 

+ 49 - 68
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -10,6 +10,9 @@ namespace GFGGame
         private UI_LuckyBoxUI _ui;
         private ValueBarController _valueBarController;
 
+
+        private int _selectedIndex = 0;
+
         public override void Dispose()
         {
             _valueBarController.Dispose();
@@ -39,7 +42,7 @@ namespace GFGGame
             _ui.m_listBg.itemRenderer = RenderListBgItem;
             _ui.m_c1.onChanged.Add(OnListBgScroll);//分页控制器
 
-            Reset();//初始默认值
+            // Reset();//初始默认值
         }
 
         protected override void OnShown()
@@ -49,16 +52,26 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateNormal);
             EventAgent.AddEventListener(ConstMessage.MONEY_CHANGE, UpdateNormal);
 
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
+            if (this.viewData != null)
+            {
+                object[] datas = (this.viewData as object[]);
+                if (datas != null && datas.Length > 1)
+                {
+                    boxId = (int)datas[1];
+                }
+                else
+                {
+                    boxId = (int)this.viewData;
+                }
+            }
+            // int boxId = this.viewData != null ? (int)this.viewData : LuckyBoxDataManager.Instance.luckyBoxIds[0];
+            LuckyBoxBonusDataCache.currentBoxId = boxId;
 
-
-            _ui.m_listBg.numItems = 3;
-            int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxBonusDataCache.currentBoxId);
-            // if (!GuideDataManager.CheckGuideIsCompletedAtThisLogin(ConstGuideId.MAIN_UI_BTN_ZHAI_XING))
-            // {
-            //     index = _ui.m_listBg.numItems - 1;
-            // }
-            _ui.m_listBg.ScrollToView(index);
+            _ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Length;
+            _ui.m_listBg.ScrollToView(Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxBonusDataCache.currentBoxId));
             _ui.m_listBg.scrollPane.decelerationRate = 0.8f;
+
             Timers.inst.Add(1, 0, CheckTime);
 
             _valueBarController.OnShown();
@@ -66,7 +79,6 @@ namespace GFGGame
 
             onClickChange(0);
 
-
         }
         private void RenderListBgItem(int index, GObject obj)
         {
@@ -76,32 +88,28 @@ namespace GFGGame
         }
         private void CheckTime(object param = null)
         {
-            int startTime = LuckyBoxDataManager.Instance.startTime;
-            int endTime = LuckyBoxDataManager.Instance.endTime;
-            int curTime = DateUtils.Instance.GetCurTime();
-            if (curTime < startTime || curTime >= endTime)
+            int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1);
+            if (index < 0)
             {
-                //抽奖活动未开启或已过时
-                if (_ui.m_c1.selectedIndex == 2)
-                {
-                    _ui.m_listBg.ScrollToView(0);
-                }
-                _ui.m_listBg.numItems = 2;
+                //活动未开启
+                LuckyBoxBonusDataCache.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
                 Timers.inst.Remove(CheckTime);
                 return;
             }
-            UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(2)).m_txtTime.text = DateUtils.Instance.getFormatBySecond(endTime - curTime);
+            int endTime = LuckyBoxDataManager.Instance.endTime;
+            int curTime = DateUtils.Instance.GetCurTime();
+            UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(0)).m_txtTime.text = DateUtils.Instance.getFormatBySecond(endTime - curTime, 1, 1);
         }
         private void OnListBgScroll()
         {
-            if (_ui.m_c1.selectedIndex == -1 || _ui.m_listBg.numChildren <= 0) return;
-            onClickChange(0);
+            // if (_ui.m_c1.selectedIndex == -1 || _ui.m_listBg.numChildren <= 0) return;
 
             UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(_ui.m_c1.selectedIndex));
-            item.m_c1.selectedIndex = _ui.m_c1.selectedIndex;
-
             LuckyBoxBonusDataCache.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_ui.m_c1.selectedIndex];
+            item.m_txtTime.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
+            item.m_loaImg.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_3;
 
+            onClickChange(0);
             UpdateNormal();
         }
 
@@ -111,19 +119,13 @@ namespace GFGGame
             _valueBarController.UpdateCJ(LuckyBoxBonusDataCache.currentBoxId);
 
 
-            _ui.m_comCostOne.m_txtCost.text = luckyBoxCfg.costNum.ToString();// string.Format("{0}",);
-            _ui.m_comCostTen.m_txtCost.text = luckyBoxCfg.costNumTen.ToString();// string.Format("{1}", );
+            _ui.m_comCostOne.m_txtCost.text = luckyBoxCfg.costNum.ToString();
+            _ui.m_comCostTen.m_txtCost.text = luckyBoxCfg.costNumTen.ToString();
             _ui.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
             _ui.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
 
-            // if (!GuideController.TryGuideByGuideId(_ui.m_btnBuyTen, ConstGuideId.MAIN_UI_BTN_ZHAI_XING, 1, true, "点击按钮,开始抽奖,可以抽到好看的服装哦"))
-            // {
-            //     GuideController.TryGuideByGuideId(_ui.m_btnBack, ConstGuideId.LUCKY_BOX_VIEW_BTN_BACK, 1, true, "点击按钮,返回主界面", 0, ConstGuideId.MAIN_UI_BTN_ZHAI_XING);
-            // }
-            // if (GuideDataManager.GetGuideCount(ConstGuideId.LUCKY_BOX_VIEW_BTN_BACK) <= 0)
-            // {
             Timers.inst.AddUpdate(UpdateToCheckGuide);
-            // }
+
             int count = LuckyBoxBonusDataCache.GetOwnedCount();
             _ui.m_txtOwned.SetVar("v1", "" + count).FlushVars();
 
@@ -132,38 +134,18 @@ namespace GFGGame
         private void onClickChange(int count)
         {
             _ui.m_c1.selectedIndex = _ui.m_c1.selectedIndex + count;
-
-            if (_ui.m_c1.selectedIndex == _ui.m_listBg.numItems - 1)
-            {
-                _ui.m_btnRight.visible = false;
-            }
-            else
-            {
-                _ui.m_btnRight.visible = true;
-            }
-            if (_ui.m_c1.selectedIndex == 0)
-            {
-                _ui.m_btnLeft.visible = false;
-            }
-            else
-            {
-                _ui.m_btnLeft.visible = true;
-            }
+            _ui.m_imgSpecial.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
+            _ui.m_btnRight.visible = _ui.m_c1.selectedIndex != _ui.m_listBg.numItems - 1;
+            _ui.m_btnLeft.visible = _ui.m_c1.selectedIndex != 0;
         }
 
 
         private void OnClickBtnExChange()
         {
-            int storeId = ConstStoreId.CLOTHING_STORE_ID;
-            if (_ui.m_c1.selectedIndex == 2 || _ui.m_c1.selectedIndex == 1 || _ui.m_c1.selectedIndex == -1)
-            {
-                storeId = ConstStoreId.LUCKY_BOX_STORE_ID;
-            }
-            else if (_ui.m_c1.selectedIndex == 0)
-            {
-                storeId = ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID;
-            }
-            ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW });
+            // int storeId = ConstStoreId.CLOTHING_STORE_ID;
+
+            int storeId = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1 ? ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID : ConstStoreId.LUCKY_BOX_STORE_ID;
+            ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
             this.Hide();
         }
         private void OnClickBtnPreview()
@@ -177,7 +159,7 @@ namespace GFGGame
              {
                  ItemDataManager.Remove(luckyBoxCfg.costID, luckyBoxCfg.costNum);
                  LuckyBoxDataManager.Instance.RewardList = LuckyBoxBonusDataCache.GetBonusList(1);
-                 ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, _ui.m_c1.selectedIndex);
+                 ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxBonusDataCache.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
              });
 
         }
@@ -191,7 +173,7 @@ namespace GFGGame
                 Timers.inst.AddUpdate(UpdateToCheckGuide);
                 ItemDataManager.Remove(luckyBoxCfg.costID, luckyBoxCfg.costNumTen);
                 LuckyBoxDataManager.Instance.RewardList = LuckyBoxBonusDataCache.GetBonusList(10, true);
-                ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, _ui.m_c1.selectedIndex);
+                ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxBonusDataCache.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
             }
             else
             {
@@ -200,7 +182,7 @@ namespace GFGGame
                  {
                      ItemDataManager.Remove(luckyBoxCfg.costID, luckyBoxCfg.costNumTen);
                      LuckyBoxDataManager.Instance.RewardList = LuckyBoxBonusDataCache.GetBonusList(10, false);
-                     ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, _ui.m_c1.selectedIndex);
+                     ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxBonusDataCache.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
 
                  });
             }
@@ -242,7 +224,7 @@ namespace GFGGame
         {
             GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX_VIEW_BTN_BACK);
             this.Hide();
-            // ViewManager.Show(ViewName.MAINUI_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW });
+
             Reset();
             ViewManager.GoBackFrom(ViewName.LUCKY_BOX_VIEW);
         }
@@ -250,12 +232,11 @@ namespace GFGGame
         private void OnClickBtnHome()
         {
             GameController.GoBackToMainView();
-            Reset();
+            // Reset();
         }
         private void Reset()
         {
-            LuckyBoxBonusDataCache.currentBoxId = 1;
-            _ui.m_c1.selectedIndex = 0;
+            LuckyBoxBonusDataCache.currentBoxId = LuckyBoxDataManager.BOX_ID_1;
         }
 
     }

BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes