Просмотр исходного кода

词牌升星小弹窗增加属性修改

huangxiaoyue 1 год назад
Родитель
Сommit
72405f7afc

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_CardFosterUI.cs

@@ -16,6 +16,8 @@ namespace UI.Card
         public UI_ComFosterTop m_ComFosterTop;
         public UI_ComFosterBottom m_ComFosterBottom;
         public GLoader m_loaGuide;
+        public GButton m_btnLeft;
+        public GButton m_btnRight;
         public Transition m_t0;
         public Transition m_t1;
         public Transition m_open;
@@ -75,6 +77,8 @@ namespace UI.Card
             m_ComFosterTop = (UI_ComFosterTop)UI_ComFosterTop.Create(comp.GetChild("ComFosterTop"));
             m_ComFosterBottom = (UI_ComFosterBottom)UI_ComFosterBottom.Create(comp.GetChild("ComFosterBottom"));
             m_loaGuide = (GLoader)comp.GetChild("loaGuide");
+            m_btnLeft = (GButton)comp.GetChild("btnLeft");
+            m_btnRight = (GButton)comp.GetChild("btnRight");
             m_t0 = comp.GetTransition("t0");
             m_t1 = comp.GetTransition("t1");
             m_open = comp.GetTransition("open");
@@ -94,6 +98,8 @@ namespace UI.Card
             m_ComFosterBottom.Dispose();
             m_ComFosterBottom = null;
             m_loaGuide = null;
+            m_btnLeft = null;
+            m_btnRight = null;
             m_t0 = null;
             m_t1 = null;
             m_open = null;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_CardUpUI.cs

@@ -12,6 +12,7 @@ namespace UI.Card
         public GTextField m_txtLast;
         public GTextField m_txtNow;
         public GList m_listProperty;
+        public GList m_listLastProperty;
         public const string URL = "ui://7l6lvkayjzrr8p";
         public const string PACKAGE_NAME = "Card";
         public const string RES_NAME = "CardUpUI";
@@ -64,6 +65,7 @@ namespace UI.Card
             m_txtLast = (GTextField)comp.GetChild("txtLast");
             m_txtNow = (GTextField)comp.GetChild("txtNow");
             m_listProperty = (GList)comp.GetChild("listProperty");
+            m_listLastProperty = (GList)comp.GetChild("listLastProperty");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -72,6 +74,7 @@ namespace UI.Card
             m_txtLast = null;
             m_txtNow = null;
             m_listProperty = null;
+            m_listLastProperty = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 61 - 5
GameClient/Assets/Game/HotUpdate/Views/Card/CardUpView.cs

@@ -9,12 +9,18 @@ namespace GFGGame
 {
     public class CardUpView : BaseWindow
     {
-
         private UI_CardUpUI _ui;
         private Dictionary<int, int> _scores;
         private string _type;
         private int _lastNum;
         private int _curNum;
+        private int _cardId;
+        private CardLvlCfg _cardLvCfg;
+        private CardStarCfg _cardStarCfg;
+        private int _mainScore = 0;
+        private int _otherScore = 0;
+        private int _itemCfgMainScore = 0;
+
         public override void Dispose()
         {
             if (_ui != null)
@@ -37,9 +43,8 @@ namespace GFGGame
 
             //MakeFullScreen(_ui);
 
-
             _ui.m_listProperty.itemRenderer = RenderListPropertyItem;
-
+            _ui.m_listLastProperty.itemRenderer = RenderListLastPropertyItem;
         }
         protected override void OnShown()
         {
@@ -48,31 +53,82 @@ namespace GFGGame
             _type = (string)(viewData as object[])[1];
             _lastNum = (int)(viewData as object[])[2];
             _curNum = (int)(viewData as object[])[3];
+            _cardId = (int)(viewData as object[])[4];
 
             _ui.m_listProperty.numItems = _scores.Count;
+
             if (_type == "lv")
             {
                 _ui.m_c1.selectedIndex = 0;
                 _ui.m_txtLast.text = string.Format("{0}级", _lastNum);
                 _ui.m_txtNow.text = string.Format("{0}级", _curNum);
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_cardId);
+                _cardLvCfg = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(itemCfg.rarity, _lastNum);
+                _cardStarCfg = null;
+                _itemCfgMainScore = itemCfg.mainScore;
+
+                _mainScore = 0;
+                _otherScore = 0;
+                for (int i = _lastNum; i < _curNum; i++)
+                {
+                    CardLvlCfg cardLvCfg = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(itemCfg.rarity, i);
+                    _mainScore += cardLvCfg.mainScore;
+                    _otherScore += cardLvCfg.otherScore;
+                }
             }
-            else
+            else if (_type == "star")
             {
                 _ui.m_c1.selectedIndex = 1;
                 _ui.m_txtLast.text = string.Format("{0}星", _lastNum / 5);
                 _ui.m_txtNow.text = string.Format("{0}星", _curNum / 5);
+                _cardStarCfg = CardStarCfgArray.Instance.GetCfgBycardIdAndstarLvl(_cardId, _lastNum);
+                _cardLvCfg = null;
+            }
+            else { 
+                _ui.m_c1.selectedIndex = 2;
+                _cardStarCfg = CardStarCfgArray.Instance.GetCfgBycardIdAndstarLvl(_cardId, _lastNum);
+                _cardLvCfg = null;
             }
+            _ui.m_listLastProperty.numItems = _scores.Count;
             Timers.inst.AddUpdate(CheckGuide);
         }
-        private void RenderListPropertyItem(int index, GObject obj)
+
+        private void RenderListLastPropertyItem(int index, GObject obj)
         {
+            UI_ListScoreItem listItem = UI_ListScoreItem.Proxy(obj);
+            int score = 0;
+            if (_cardStarCfg != null)
+            {
+                if (index == 0)
+                    score = _scores[index + 1] - _cardStarCfg.score1;
+                else if (index == 1)
+                    score = _scores[index + 1] - _cardStarCfg.score2;
+                else if (index == 2)
+                    score = _scores[index + 1] - _cardStarCfg.score3;
+                else if (index == 3)
+                    score = _scores[index + 1] - _cardStarCfg.score4;
+            }
+            else {
+                if ((index + 1) == _itemCfgMainScore)
+                    score = _scores[index + 1] - _mainScore;
+                else
+                    score = _scores[index + 1] - _otherScore;
+            }
+            listItem.m_txtProperty.text = score.ToString();
+            listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (index + 1));
+            UI_ListScoreItem.ProxyEnd();
+        }
 
+        private void RenderListPropertyItem(int index, GObject obj)
+        {
             UI_ListScoreItem listItem = UI_ListScoreItem.Proxy(obj);
 
             listItem.m_txtProperty.text = _scores[index + 1].ToString();
             listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (index + 1));
             UI_ListScoreItem.ProxyEnd();
         }
+
+        
         protected override void OnHide()
         {
             base.OnHide();

BIN
GameClient/Assets/ResIn/UI/Card/Card_fui.bytes