|
@@ -24,11 +24,13 @@ namespace GFGGame
|
|
|
private int _selectTab = 0;
|
|
|
private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
|
|
|
private List<GGraph> _listEffectHolder = new List<GGraph>();
|
|
|
- private List<CardData> cardList = new List<CardData>();
|
|
|
- private int wordRow = 4; //字行数
|
|
|
- private int wordNumber = 5;//字每行个数
|
|
|
- private int nowIndex = 0;
|
|
|
- private bool refDodgeStar = true;
|
|
|
+ private List<CardData> _cardList = new List<CardData>();
|
|
|
+ private int _wordRow = 4; //字行数
|
|
|
+ private int _wordNumber = 5;//字每行个数
|
|
|
+ private int _nowIndex = 0;
|
|
|
+ private bool _refDodgeStar = true;
|
|
|
+ private int _isAutoSelect = 0;
|
|
|
+
|
|
|
private EffectUI _effectUI1;
|
|
|
private EffectUI _effectUI3;
|
|
|
private EffectUI _effectUI4;
|
|
@@ -110,6 +112,7 @@ namespace GFGGame
|
|
|
_ui.m_ComFosterBottom.m_btnClearAll.onClick.Add(OnClcikBtnClearAll);
|
|
|
_ui.m_ComFosterBottom.m_btnUpStar.onClick.Add(OnClickBtnUpStar);
|
|
|
_ui.m_ComFosterBottom.m_btnUpSkillLv.onClick.Add(OnBtnUpSkill);
|
|
|
+ _ui.m_ComFosterBottom.m_btnCheckAuto.onClick.Add(OnBtnCheckAuto);
|
|
|
|
|
|
//升级升星消耗材料列表
|
|
|
_ui.m_ComFosterBottom.m_listLvConsume.itemRenderer = RenderListLvConsumeItem;
|
|
@@ -144,7 +147,7 @@ namespace GFGGame
|
|
|
|
|
|
private void RefLeftAndRight()
|
|
|
{
|
|
|
- if (nowIndex <= 0)
|
|
|
+ if (_nowIndex <= 0)
|
|
|
{
|
|
|
_ui.m_btnLeft.grayed = true;
|
|
|
_ui.m_btnLeft.touchable = false;
|
|
@@ -154,7 +157,7 @@ namespace GFGGame
|
|
|
_ui.m_btnLeft.touchable = true;
|
|
|
}
|
|
|
|
|
|
- if (nowIndex >= cardList.Count - 1)
|
|
|
+ if (_nowIndex >= _cardList.Count - 1)
|
|
|
{
|
|
|
_ui.m_btnRight.grayed = true;
|
|
|
_ui.m_btnRight.touchable = false;
|
|
@@ -168,17 +171,17 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnLeft()
|
|
|
{
|
|
|
- nowIndex -= 1;
|
|
|
+ _nowIndex -= 1;
|
|
|
RefLeftAndRight();
|
|
|
- _cardData = cardList[nowIndex];
|
|
|
+ _cardData = _cardList[_nowIndex];
|
|
|
RefCardFosterInfo();
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnRight()
|
|
|
{
|
|
|
- nowIndex += 1;
|
|
|
+ _nowIndex += 1;
|
|
|
RefLeftAndRight();
|
|
|
- _cardData = cardList[nowIndex];
|
|
|
+ _cardData = _cardList[_nowIndex];
|
|
|
RefCardFosterInfo();
|
|
|
}
|
|
|
|
|
@@ -228,16 +231,16 @@ namespace GFGGame
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("cp_beijing");
|
|
|
|
|
|
_cardData = CardDataManager.GetCardDataById((this.viewData as CardData).id);
|
|
|
- nowIndex = _cardData.index;
|
|
|
+ _nowIndex = _cardData.index;
|
|
|
_comFosterBottom = _ui.m_ComFosterBottom;
|
|
|
|
|
|
- cardList = CardDataManager.GetCardListByRarity(_cardData.pageIndex);
|
|
|
+ _cardList = CardDataManager.GetCardListByRarity(_cardData.pageIndex);
|
|
|
if (CardDataManager.isFilter == true)
|
|
|
{
|
|
|
//筛选
|
|
|
- cardList = CardDataManager.FilterCardList(cardList);
|
|
|
+ _cardList = CardDataManager.FilterCardList(_cardList);
|
|
|
}
|
|
|
- cardList = CardDataManager.SortItemList(cardList);
|
|
|
+ _cardList = CardDataManager.SortItemList(_cardList);
|
|
|
|
|
|
RefCardFosterInfo();
|
|
|
}
|
|
@@ -700,15 +703,18 @@ namespace GFGGame
|
|
|
ET.Log.Error("词牌:" + _cardData.id + " 无" + _cardData.star + "星升星配置");
|
|
|
return;
|
|
|
}
|
|
|
+ _isAutoSelect = GameGlobal.myNumericComponent.GetAsInt(NumericType.IsAutoSelect);
|
|
|
+ _comFosterBottom.m_btnCheckAuto.selected = _isAutoSelect == 1;
|
|
|
|
|
|
//升星后星数正5才不进入
|
|
|
- if (refDodgeStar || _cardData.star % 5 != 0) {
|
|
|
+ if (_refDodgeStar || _cardData.star % 5 != 0) {
|
|
|
UpdateUpStarOfStarAndText();
|
|
|
}
|
|
|
- refDodgeStar = true;
|
|
|
+ _refDodgeStar = true;
|
|
|
|
|
|
_comFosterBottom.m_btnRule.onClick.Add(RuleController.ShowRuleView);
|
|
|
- _comFosterBottom.m_btnRule.data = 300015;
|
|
|
+ _comFosterBottom.m_btnRule.data = 300021;
|
|
|
+
|
|
|
if (CardDataManager.isFullStar(_cardData.id, _cardData.star, false))
|
|
|
{
|
|
|
_comFosterBottom.m_ctrlFullStar.selectedIndex = 1;
|
|
@@ -722,7 +728,7 @@ namespace GFGGame
|
|
|
_comFosterBottom.m_ctrlFullStar.selectedIndex = 0;
|
|
|
// List<CardStarCfg> starCfgs = CardStarCfgArray.Instance.GetCfgsBycardId(_cardData.id);
|
|
|
|
|
|
- _comFosterBottom.m_btnUpStar.data = 0;//data 0:材料不足,1:可以升级
|
|
|
+ //_comFosterBottom.m_btnUpStar.data = 0;//data 0:材料不足,1:可以升级
|
|
|
|
|
|
ItemUtil.UpdateItemNeedNum(_comFosterBottom.m_comStarCousumeGold, cardStarCfg.costID, cardStarCfg.costNum);
|
|
|
|
|
@@ -730,7 +736,7 @@ namespace GFGGame
|
|
|
_comFosterBottom.m_listStarConsume.numItems = cardStarCfg.materiarsArr.Length;
|
|
|
_comFosterBottom.m_txtTips.text = _cardData.lv < cardStarCfg.needLv ? string.Format("需等级达到{0}级", cardStarCfg.needLv) : "";
|
|
|
_comFosterBottom.m_comStarCousumeGold.visible = _cardData.lv >= cardStarCfg.needLv;
|
|
|
- _comFosterBottom.m_btnUpStar.grayed = int.Parse(_comFosterBottom.m_btnUpStar.data.ToString()) == 0 ? true : false;
|
|
|
+ //_comFosterBottom.m_btnUpStar.grayed = int.Parse(_comFosterBottom.m_btnUpStar.data.ToString()) == 0 ? true : false;
|
|
|
// _comFosterBottom.m_btnUpStar.GetChild("ani").asMovieClip.visible = false;// !_comFosterBottom.m_btnUpStar.grayed;
|
|
|
}
|
|
|
}
|
|
@@ -743,8 +749,8 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateUpStarOfStar()
|
|
|
{
|
|
|
- int starLevelDodge = _cardData.star / wordNumber;
|
|
|
- for (int i = 0; i < wordRow; i++)
|
|
|
+ int starLevelDodge = _cardData.star / _wordNumber;
|
|
|
+ for (int i = 0; i < _wordRow; i++)
|
|
|
{
|
|
|
UI_ComDodgeStar dodgeStar = UI_ComDodgeStar.Proxy(_comFosterBottom.target.GetChild("dodgeStar" + i));
|
|
|
dodgeStar.m_lightType.selectedIndex = (starLevelDodge > i) ? 1 : 0;
|
|
@@ -754,10 +760,10 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateUpStarOfText()
|
|
|
{
|
|
|
- int starLevel = _cardData.star / wordNumber;
|
|
|
- if (starLevel >= wordRow)
|
|
|
- starLevel = wordRow - 1;
|
|
|
- int index = starLevel * wordNumber;
|
|
|
+ int starLevel = _cardData.star / _wordNumber;
|
|
|
+ if (starLevel >= _wordRow)
|
|
|
+ starLevel = _wordRow - 1;
|
|
|
+ int index = starLevel * _wordNumber;
|
|
|
UI_ComStarItem comStarItem = UI_ComStarItem.Proxy(_comFosterBottom.target.GetChild("comStarItem"));
|
|
|
string starDesc = "";
|
|
|
for (int j = 0; j < _cardData.itemCfg.starDescArr[starLevel].Length; j++)
|
|
@@ -785,6 +791,13 @@ namespace GFGGame
|
|
|
listItem.m_QualityType.selectedIndex = 4;
|
|
|
int needCount = cardStarCfg.materiarsArr[index][1];
|
|
|
long hasCount = ItemDataManager.GetItemNum(cardStarCfg.materiarsArr[index][0]);
|
|
|
+ if (_isAutoSelect == 1) {
|
|
|
+ if(index == 0)
|
|
|
+ hasCount += ItemDataManager.GetItemNum(6003001);
|
|
|
+ else
|
|
|
+ hasCount += ItemDataManager.GetItemNum(6003002);
|
|
|
+ }
|
|
|
+
|
|
|
listItem.m_txtDecomCount.text = StringUtil.GetColorText(hasCount.ToString(), hasCount < needCount ? "#D27869" : "#FFFFFF");// StringUtil.GetColorText(needCount.ToString(), hasCount < needCount ? "#D27869" : "#FDF3D7"); ;
|
|
|
listItem.m_txtDecomHasCount.text = "/" + needCount.ToString(); //; hasCount.ToString();
|
|
|
if (listItem.target.data == null)
|
|
@@ -794,7 +807,9 @@ namespace GFGGame
|
|
|
// listItem.m_btnPlus.data = cardStarCfg.materiarsArr[index][0];
|
|
|
listItem.target.data = cardStarCfg.materiarsArr[index][0];
|
|
|
|
|
|
- _comFosterBottom.m_btnUpStar.data = hasCount >= needCount && ItemDataManager.GetItemNum(cardStarCfg.costID) >= cardStarCfg.costNum ? 1 : 0;
|
|
|
+ //if (CardDataManager.GetUpStarEnoughMaterial(_cardData.id) == false) return;
|
|
|
+
|
|
|
+ //_comFosterBottom.m_btnUpStar.data = hasCount >= needCount && ItemDataManager.GetItemNum(cardStarCfg.costID) >= cardStarCfg.costNum ? 1 : 0;
|
|
|
|
|
|
if (hasCount < needCount)
|
|
|
{
|
|
@@ -867,20 +882,16 @@ namespace GFGGame
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < cardStarCfg.materiarsArr.Length; i++)
|
|
|
- {
|
|
|
- if (!ItemUtil.CheckItemEnough(cardStarCfg.materiarsArr[i][0], cardStarCfg.materiarsArr[i][1], true)) return;
|
|
|
- }
|
|
|
-
|
|
|
this.UpStar();
|
|
|
}
|
|
|
private async void UpStar()
|
|
|
{
|
|
|
+ _comFosterBottom.m_btnCheckAuto.selected = _isAutoSelect == 1;
|
|
|
bool result = await CardSProxy.UpgradeCardStar(_cardData.id, _comFosterBottom.m_btnCheckAuto.selected);
|
|
|
if (result)
|
|
|
{
|
|
|
UpdateCommon();
|
|
|
- refDodgeStar = false;
|
|
|
+ _refDodgeStar = false;
|
|
|
UpdateUpStarView();
|
|
|
UpdateCardRes();
|
|
|
// this._selectTab = _comFosterBottom.m_ctrlTab.selectedIndex;
|
|
@@ -889,8 +900,8 @@ namespace GFGGame
|
|
|
UpdateRedDot();
|
|
|
|
|
|
if (_cardData.star % 5 == 0) {
|
|
|
- int starLevelDodge = _cardData.star / wordNumber;
|
|
|
- int starLevel = _cardData.star / wordNumber - 1;
|
|
|
+ int starLevelDodge = _cardData.star / _wordNumber;
|
|
|
+ int starLevel = _cardData.star / _wordNumber - 1;
|
|
|
UI_ComStarItem comStarItem = UI_ComStarItem.Proxy(_comFosterBottom.target.GetChild("comStarItem"));
|
|
|
string starDesc = "";
|
|
|
for (int j = 0; j < _cardData.itemCfg.starDescArr[starLevel].Length; j++)
|
|
@@ -929,7 +940,7 @@ namespace GFGGame
|
|
|
EffectUIPool.Recycle(_effectUI9);
|
|
|
_effectUI9 = null;
|
|
|
}
|
|
|
- int starLevelDodge = _cardData.star / wordNumber;
|
|
|
+ int starLevelDodge = _cardData.star / _wordNumber;
|
|
|
UI_ComDodgeStar dodgeStar = UI_ComDodgeStar.Proxy(_comFosterBottom.target.GetChild("dodgeStar" + (starLevelDodge - 1)));
|
|
|
//升星字体拖尾特效
|
|
|
_effectUI9 = EffectUIPool.CreateEffectUI(dodgeStar.m_holderUpStarMove, "ui_Activity", "SX_Text_Taril_02");
|
|
@@ -949,7 +960,7 @@ namespace GFGGame
|
|
|
EffectUIPool.Recycle(_effectUI10);
|
|
|
_effectUI10 = null;
|
|
|
}
|
|
|
- int starLevelDodge = _cardData.star / wordNumber;
|
|
|
+ int starLevelDodge = _cardData.star / _wordNumber;
|
|
|
UI_ComDodgeStar dodgeStar = UI_ComDodgeStar.Proxy(_comFosterBottom.target.GetChild("dodgeStar" + (starLevelDodge - 1)));
|
|
|
//星星特效
|
|
|
_effectUI10 = EffectUIPool.CreateEffectUI(dodgeStar.m_holderStarLight, "ui_Activity", "SX_Text_STAR_03");
|
|
@@ -1000,6 +1011,24 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void OnBtnCheckAuto()
|
|
|
+ {
|
|
|
+ var success = CardSProxy.SaveIsAutoSelect(_comFosterBottom.m_btnCheckAuto.selected);
|
|
|
+ CardStarCfg cardStarCfg = CardStarCfgArray.Instance.GetCfgBycardIdAndstarLvl(_cardData.id, _cardData.star);
|
|
|
+ if (cardStarCfg == null)
|
|
|
+ {
|
|
|
+ ET.Log.Error("词牌:" + _cardData.id + " 无" + _cardData.star + "星升星配置");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (_isAutoSelect == 0)
|
|
|
+ _isAutoSelect = 1;
|
|
|
+ else
|
|
|
+ _isAutoSelect = 0;
|
|
|
+
|
|
|
+ _comFosterBottom.m_listStarConsume.data = cardStarCfg;
|
|
|
+ _comFosterBottom.m_listStarConsume.numItems = cardStarCfg.materiarsArr.Length;
|
|
|
+ }
|
|
|
+
|
|
|
private void OnBtnUpSkill()
|
|
|
{
|
|
|
List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(_cardData.id);
|
|
@@ -1020,7 +1049,7 @@ namespace GFGGame
|
|
|
float diffValueX = touchBeginX - inputEvent.x;
|
|
|
if (diffValueX > 20 && showCard == false)
|
|
|
{
|
|
|
- if (nowIndex < cardList.Count - 1)
|
|
|
+ if (_nowIndex < _cardList.Count - 1)
|
|
|
{
|
|
|
OnClickBtnRight();
|
|
|
RefLeftAndRight();
|
|
@@ -1028,7 +1057,7 @@ namespace GFGGame
|
|
|
}
|
|
|
else if (diffValueX < -20 && showCard == false)
|
|
|
{
|
|
|
- if (nowIndex > 0)
|
|
|
+ if (_nowIndex > 0)
|
|
|
{
|
|
|
OnClickBtnLeft();
|
|
|
RefLeftAndRight();
|