|
@@ -9,12 +9,18 @@ namespace GFGGame
|
|
{
|
|
{
|
|
public class CardUpView : BaseWindow
|
|
public class CardUpView : BaseWindow
|
|
{
|
|
{
|
|
-
|
|
|
|
private UI_CardUpUI _ui;
|
|
private UI_CardUpUI _ui;
|
|
private Dictionary<int, int> _scores;
|
|
private Dictionary<int, int> _scores;
|
|
private string _type;
|
|
private string _type;
|
|
private int _lastNum;
|
|
private int _lastNum;
|
|
private int _curNum;
|
|
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()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
@@ -37,9 +43,8 @@ namespace GFGGame
|
|
|
|
|
|
//MakeFullScreen(_ui);
|
|
//MakeFullScreen(_ui);
|
|
|
|
|
|
-
|
|
|
|
_ui.m_listProperty.itemRenderer = RenderListPropertyItem;
|
|
_ui.m_listProperty.itemRenderer = RenderListPropertyItem;
|
|
-
|
|
|
|
|
|
+ _ui.m_listLastProperty.itemRenderer = RenderListLastPropertyItem;
|
|
}
|
|
}
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
@@ -48,31 +53,82 @@ namespace GFGGame
|
|
_type = (string)(viewData as object[])[1];
|
|
_type = (string)(viewData as object[])[1];
|
|
_lastNum = (int)(viewData as object[])[2];
|
|
_lastNum = (int)(viewData as object[])[2];
|
|
_curNum = (int)(viewData as object[])[3];
|
|
_curNum = (int)(viewData as object[])[3];
|
|
|
|
+ _cardId = (int)(viewData as object[])[4];
|
|
|
|
|
|
_ui.m_listProperty.numItems = _scores.Count;
|
|
_ui.m_listProperty.numItems = _scores.Count;
|
|
|
|
+
|
|
if (_type == "lv")
|
|
if (_type == "lv")
|
|
{
|
|
{
|
|
_ui.m_c1.selectedIndex = 0;
|
|
_ui.m_c1.selectedIndex = 0;
|
|
_ui.m_txtLast.text = string.Format("{0}级", _lastNum);
|
|
_ui.m_txtLast.text = string.Format("{0}级", _lastNum);
|
|
_ui.m_txtNow.text = string.Format("{0}级", _curNum);
|
|
_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_c1.selectedIndex = 1;
|
|
_ui.m_txtLast.text = string.Format("{0}星", _lastNum / 5);
|
|
_ui.m_txtLast.text = string.Format("{0}星", _lastNum / 5);
|
|
_ui.m_txtNow.text = string.Format("{0}星", _curNum / 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);
|
|
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);
|
|
UI_ListScoreItem listItem = UI_ListScoreItem.Proxy(obj);
|
|
|
|
|
|
listItem.m_txtProperty.text = _scores[index + 1].ToString();
|
|
listItem.m_txtProperty.text = _scores[index + 1].ToString();
|
|
listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (index + 1));
|
|
listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (index + 1));
|
|
UI_ListScoreItem.ProxyEnd();
|
|
UI_ListScoreItem.ProxyEnd();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|