소스 검색

活动卡池

zhaoyang 2 년 전
부모
커밋
708049b1bc

+ 4 - 1
FGUIProject/assets/LuckyBox/combox/ComBox_1.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="1080,1920">
+<component size="1080,1920" designImage="ui://drx9d1usdhoatab" designImageOffsetY="-240">
   <displayList>
     <loader id="n25_vek8" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,2400" url="ui://drx9d1useshh1f" fill="scaleMatchWidth">
       <relation target="" sidePair="center-center,middle-middle"/>
@@ -34,6 +34,9 @@
     <group id="n31_njmn" name="n31" xy="45,1603" size="989,250" advanced="true">
       <relation target="" sidePair="center-center,bottom-bottom"/>
     </group>
+    <text id="n38_dhoa" name="txtTime" xy="641,970" size="57,208" fontSize="40" color="#fffbdd" align="center" autoSize="height" text="剩余80天">
+      <relation target="" sidePair="middle-middle"/>
+    </text>
   </displayList>
   <customProperty target="loaBg" propertyId="1"/>
 </component>

BIN
FGUIProject/assets/LuckyBox/images/cj_bj_2.png


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

@@ -60,6 +60,7 @@
     <image id="v95q39" name="hdkp_xhd.png" path="/images/"/>
     <image id="v95q3a" name="kp_lanshan.jpg" path="/images/"/>
     <image id="v95q3b" name="hdkp_dj.png" path="/images/"/>
+    <image id="dhoatab" name="cj_bj_2.png" path="/images/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\LuckyBox" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

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

@@ -19,9 +19,10 @@ namespace GFGGame
         private Dictionary<int, ItemData> _firstRewardsList = new Dictionary<int, ItemData>();//首次获得的奖励
         private Dictionary<int, List<LuckyBoxBonusData>> _dicShowList = new Dictionary<int, List<LuckyBoxBonusData>>();
 
-        public int[] luckyBoxIds = new int[] { 2, 3 };//奖池列表
-        public long startTime = 1635157620;
-        public long endTime = 1704038400;
+        public int[] luckyBoxIds = new int[] { 1, 2, 3 };//奖池列表
+        public long startTime = 1668873600000;
+        public long endTime = 1674144000000;
+
 
         public int times = 0;
         public int luckyBoxId;

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

@@ -17,6 +17,7 @@ namespace UI.LuckyBox
         public UI_Button2 m_btnBuyTen;
         public GImage m_imgSpecial;
         public GTextField m_txtRemainTimes;
+        public GTextField m_txtTime;
         public const string URL = "ui://drx9d1usnjmn2p";
         public const string PACKAGE_NAME = "LuckyBox";
         public const string RES_NAME = "ComBox_1";
@@ -74,6 +75,7 @@ namespace UI.LuckyBox
             m_btnBuyTen = (UI_Button2)UI_Button2.Create(comp.GetChild("btnBuyTen"));
             m_imgSpecial = (GImage)comp.GetChild("imgSpecial");
             m_txtRemainTimes = (GTextField)comp.GetChild("txtRemainTimes");
+            m_txtTime = (GTextField)comp.GetChild("txtTime");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -93,6 +95,7 @@ namespace UI.LuckyBox
             m_btnBuyTen = null;
             m_imgSpecial = null;
             m_txtRemainTimes = null;
+            m_txtTime = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 17 - 3
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -174,8 +174,22 @@ namespace GFGGame
             btnPreview.data = boxId;
 
             obj.data = boxId;
+
+            if (boxId == 1)
+            {
+                long endTime = LuckyBoxDataManager.Instance.endTime;
+                long curTime = TimeHelper.ServerNow();
+                TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
+                (obj as GComponent).GetChild("txtTime").asTextField.text = string.Format("剩余{0}{1}", num, str);
+            }
         }
 
+        // private void UpdateTime(object param)
+        // {
+        //     GTextField txtTime = _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTime").asTextField;
+        //     txtTime.text = TimeUtil.FormattingTime(LuckyBoxDataManager.Instance.startTime, LuckyBoxDataManager.Instance.startTime);
+        // }
+
         private void UpdateBg(object param)
         {
             string[] resArr = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId).resArr;
@@ -227,8 +241,8 @@ namespace GFGGame
             long endTime = LuckyBoxDataManager.Instance.endTime;
             long curTime = TimeHelper.ServerNow();
             TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
-            _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTime").asTextField.text = string.Format("{0}", num);
-            _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTimeStr").asTextField.text = string.Format("{0}", str);
+            _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTime").asTextField.text = string.Format("剩余{0}{1}", num, str);
+            // _ui.m_listBg.GetChildAt(0).asCom.GetChild("txtTimeStr").asTextField.text = string.Format("{0}", str);
         }
         private void updateBoxEffect()
         {
@@ -280,7 +294,6 @@ namespace GFGGame
                  {
                      ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
                      LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZAI_XING, 2);
-
                  }
              });
         }
@@ -318,6 +331,7 @@ namespace GFGGame
             Timers.inst.Remove(CheckTime);
             Timers.inst.Remove(UpdateBg);
             Timers.inst.Remove(CheckGuide);
+            // Timers.inst.Remove(UpdateTime);
         }
         protected override void RemoveEventListener()
         {

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