|
@@ -8,6 +8,12 @@ using System.Collections;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
+ public class DressUpFightType
|
|
|
+ {
|
|
|
+ public int levelID;
|
|
|
+ public int teaPartID;
|
|
|
+ }
|
|
|
+
|
|
|
public class DressUpFightView : BaseView
|
|
|
{
|
|
|
private UI_DressUpFightUI _ui;
|
|
@@ -27,6 +33,7 @@ namespace GFGGame
|
|
|
private StoryLevelCfg _levelCfg;
|
|
|
private StoryFightCfg _fightCfg;
|
|
|
private int scoreType = 0; //目标分数类型保存
|
|
|
+ private bool IsTeaPart = false;
|
|
|
|
|
|
private const int SORT_BY_HIGH_SCORE = 0;
|
|
|
private const int SORT_BY_LOW_SCORE = 1;
|
|
@@ -141,6 +148,17 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
+
|
|
|
+ var objData = (DressUpFightType)this.viewData;
|
|
|
+ if (objData.teaPartID > 0)
|
|
|
+ IsTeaPart = true;
|
|
|
+
|
|
|
+ _levelID = objData.levelID;
|
|
|
+ if (!IsTeaPart)
|
|
|
+ _ui.m_c1.selectedIndex = 0;
|
|
|
+ else
|
|
|
+ _ui.m_c1.selectedIndex = 2;
|
|
|
+
|
|
|
_ui.m_loaGuide.visible = true;
|
|
|
InstanceZonesDataManager.usedRecommend = false;
|
|
|
// _ui.m_comboBox.title = "我的套装";
|
|
@@ -150,43 +168,44 @@ namespace GFGGame
|
|
|
_scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
|
|
|
_ui.m_btnAutoPlay.selected = FightDataManager.Instance.autoPlay;
|
|
|
_ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
|
|
|
- _ui.m_btnRecommend.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false); ;
|
|
|
-
|
|
|
- _levelID = (int)viewData;
|
|
|
- InstanceZonesDataManager.currentLevelCfgId = _levelID;
|
|
|
- _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
|
|
|
- _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
|
|
|
- if (_levelCfg.type == ConstInstanceZonesType.Field)
|
|
|
- {
|
|
|
- scoreType = FieldDataManager.Instance.fieldInfos.theme;
|
|
|
- _ui.m_btnAutoPlay.visible = false;
|
|
|
- }
|
|
|
- else {
|
|
|
- scoreType = _fightCfg.scoreType;
|
|
|
- }
|
|
|
- InstanceZonesDataManager.FightScene = _levelCfg.type;
|
|
|
+ _ui.m_btnRecommend.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
|
|
|
|
|
|
- _ui.m_compNeed.target.visible = _fightCfg.needItemId > 0 || _fightCfg.needSuitId > 0 || _fightCfg.needTagsArr.Length > 0;
|
|
|
- if (_ui.m_compNeed.target.visible)
|
|
|
- {
|
|
|
- _ui.m_compNeed.m_c1.selectedIndex = 0;
|
|
|
- if (_fightCfg.needItemId > 0)
|
|
|
+ if (!IsTeaPart) {
|
|
|
+ InstanceZonesDataManager.currentLevelCfgId = _levelID;
|
|
|
+ _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
|
|
|
+ _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
|
|
|
+ if (_levelCfg.type == ConstInstanceZonesType.Field)
|
|
|
{
|
|
|
- _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetItemName(_fightCfg.needItemId);
|
|
|
- _ui.m_compNeed.target.data = _fightCfg.needItemId;
|
|
|
- _ui.m_compNeed.m_imgGot.visible = ItemDataManager.GetItemNum(_fightCfg.needItemId) > 0;
|
|
|
+ scoreType = FieldDataManager.Instance.fieldInfos.theme;
|
|
|
+ _ui.m_btnAutoPlay.visible = false;
|
|
|
}
|
|
|
- else if (_fightCfg.needSuitId > 0)
|
|
|
- {
|
|
|
- _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetSuitName(_fightCfg.needSuitId);
|
|
|
- _ui.m_compNeed.target.data = _fightCfg.needSuitId;
|
|
|
- _ui.m_compNeed.m_imgGot.visible = DressUpMenuSuitDataManager.CheckHaveSuit(_fightCfg.needSuitId);
|
|
|
+ else {
|
|
|
+ scoreType = _fightCfg.scoreType;
|
|
|
}
|
|
|
- else
|
|
|
+ InstanceZonesDataManager.FightScene = _levelCfg.type;
|
|
|
+
|
|
|
+ _ui.m_compNeed.target.visible = _fightCfg.needItemId > 0 || _fightCfg.needSuitId > 0 || _fightCfg.needTagsArr.Length > 0;
|
|
|
+ if (_ui.m_compNeed.target.visible)
|
|
|
{
|
|
|
- _ui.m_compNeed.m_c1.selectedIndex = 1;
|
|
|
- _ui.m_compNeed.m_listTag.numItems = _fightCfg.needTagsArr.Length;
|
|
|
- _ui.m_compNeed.m_imgGot.visible = false;
|
|
|
+ _ui.m_compNeed.m_c1.selectedIndex = 0;
|
|
|
+ if (_fightCfg.needItemId > 0)
|
|
|
+ {
|
|
|
+ _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetItemName(_fightCfg.needItemId);
|
|
|
+ _ui.m_compNeed.target.data = _fightCfg.needItemId;
|
|
|
+ _ui.m_compNeed.m_imgGot.visible = ItemDataManager.GetItemNum(_fightCfg.needItemId) > 0;
|
|
|
+ }
|
|
|
+ else if (_fightCfg.needSuitId > 0)
|
|
|
+ {
|
|
|
+ _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetSuitName(_fightCfg.needSuitId);
|
|
|
+ _ui.m_compNeed.target.data = _fightCfg.needSuitId;
|
|
|
+ _ui.m_compNeed.m_imgGot.visible = DressUpMenuSuitDataManager.CheckHaveSuit(_fightCfg.needSuitId);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _ui.m_compNeed.m_c1.selectedIndex = 1;
|
|
|
+ _ui.m_compNeed.m_listTag.numItems = _fightCfg.needTagsArr.Length;
|
|
|
+ _ui.m_compNeed.m_imgGot.visible = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
InstanceZonesDataManager.currentScoreType = scoreType;
|
|
@@ -215,9 +234,16 @@ namespace GFGGame
|
|
|
_ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
|
|
|
|
|
|
UpdateStepBtn(true);
|
|
|
-
|
|
|
UpdateScore();
|
|
|
- SendLog();
|
|
|
+
|
|
|
+ if (!IsTeaPart)
|
|
|
+ SendLog();
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId
|
|
|
+ _ui.m_txtTeaPartyName.text = teapartyRoleCfg[objData.teaPartID - 1].name;
|
|
|
+ }
|
|
|
+
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
|
}
|
|
|
|
|
@@ -258,7 +284,10 @@ namespace GFGGame
|
|
|
AlertUI.Show("是否确定退出?")
|
|
|
.SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
|
|
|
{
|
|
|
- if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
|
|
|
+ if(_levelCfg == null){
|
|
|
+ ViewManager.Show<LeagueTeaPartyView>();
|
|
|
+ }
|
|
|
+ else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
|
|
|
{
|
|
|
ViewManager.Show(StudioDataManager.Instance.VIEW_NAME, StudioDataManager.Instance.PROPERTY_SELECT_INDEX, ViewManager.GetGoBackDatas(StudioDataManager.Instance.VIEW_NAME));
|
|
|
}
|
|
@@ -571,7 +600,7 @@ namespace GFGGame
|
|
|
|
|
|
yield return new WaitForEndOfFrame();
|
|
|
|
|
|
- if (CardDataManager.GetCardListByRarity(0).Count > 0)
|
|
|
+ if (CardDataManager.GetCardListByRoleType(0).Count > 0)
|
|
|
{
|
|
|
|
|
|
ViewManager.Show<StoryCardChoose>(scoreType);
|
|
@@ -781,7 +810,7 @@ namespace GFGGame
|
|
|
// }
|
|
|
|
|
|
//必穿品放在列表最前面
|
|
|
- if (_fightCfg.needItemId > 0)
|
|
|
+ if (_fightCfg!= null && _fightCfg.needItemId > 0)
|
|
|
{
|
|
|
int index = _currentList3.IndexOf(_fightCfg.needItemId);
|
|
|
if (index >= 0)
|
|
@@ -791,7 +820,7 @@ namespace GFGGame
|
|
|
_currentList3.Insert(0, item);
|
|
|
}
|
|
|
}
|
|
|
- else if (_fightCfg.needSuitId > 0)
|
|
|
+ else if (_fightCfg != null && _fightCfg.needSuitId > 0)
|
|
|
{
|
|
|
int index = _currentList3.IndexOf(_fightCfg.needSuitId);
|
|
|
if (index >= 0)
|
|
@@ -941,7 +970,15 @@ namespace GFGGame
|
|
|
typeItem.m_txtname.text = item1.name;
|
|
|
//typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
|
|
|
typeItem.target.data = item1.id;
|
|
|
- typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
|
|
|
+ if (!IsTeaPart)
|
|
|
+ {
|
|
|
+ typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
|
|
|
+ typeItem.m_itemType.selectedIndex = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ typeItem.m_itemType.selectedIndex = 1;
|
|
|
+
|
|
|
+
|
|
|
typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
|
|
|
UI_TypeItem.ProxyEnd();
|
|
|
}
|
|
@@ -954,13 +991,33 @@ namespace GFGGame
|
|
|
typeItem.m_txtname.text = item2.name;
|
|
|
//typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
|
|
|
typeItem.target.data = item2.id;
|
|
|
- var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
|
|
|
- typeItem.m_imgNeed.visible = subType == item2.type;
|
|
|
- typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
|
|
|
+ if (!IsTeaPart) {
|
|
|
+ typeItem.m_itemType.selectedIndex = 0;
|
|
|
+ var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
|
|
|
+ typeItem.m_imgNeed.visible = subType == item2.type;
|
|
|
+ typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ typeItem.m_itemType.selectedIndex = 1;
|
|
|
|
|
|
UI_TypeItem.ProxyEnd();
|
|
|
}
|
|
|
|
|
|
+ private void ListTagItem(int index, GObject item)
|
|
|
+ {
|
|
|
+ ItemCfg itemCfg = (ItemCfg)item.parent.data;
|
|
|
+ UI_ComTagItem listItem = UI_ComTagItem.Proxy(item);
|
|
|
+ string name = itemCfg.tagsArr[index][0].ToString();
|
|
|
+ int tagType = TagCfgArray.Instance.GetCfg(name).type;
|
|
|
+ UI.CommonGame.UI_ComTag itemTag = UI.CommonGame.UI_ComTag.Proxy(listItem.m_loaTag);
|
|
|
+ itemTag.m_txtTag.text = name;
|
|
|
+ itemTag.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
|
|
|
+ itemTag.m_loaTag.scale = new Vector2(0.8f, 0.8f);
|
|
|
+ UI.CommonGame.UI_ComTag.ProxyEnd();
|
|
|
+ listItem.m_txtScore.text = itemCfg.tagsArr[index][1];
|
|
|
+ UI_ComTagItem.ProxyEnd();
|
|
|
+ }
|
|
|
+
|
|
|
private void ListPartsItem(int index, GObject item)
|
|
|
{
|
|
|
UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
|
|
@@ -985,7 +1042,17 @@ namespace GFGGame
|
|
|
iconRes = itemCfg.res;
|
|
|
partName = itemCfg.name;
|
|
|
listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
|
|
|
- listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
|
|
|
+ if (!IsTeaPart)
|
|
|
+ listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
|
|
|
+ else {
|
|
|
+ if (listItem.m_ListTag.data == null)
|
|
|
+ {
|
|
|
+ listItem.m_ListTag.itemRenderer = ListTagItem;
|
|
|
+ }
|
|
|
+ listItem.m_ListTag.data = itemCfg;
|
|
|
+ listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
|
|
|
+ }
|
|
|
+
|
|
|
listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
|
|
|
bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
|
|
|
listItem.m_imgNew.visible = isNew;
|
|
@@ -1003,12 +1070,18 @@ namespace GFGGame
|
|
|
longPressGesture.onAction.Add(OnLongPress);
|
|
|
_listLongPress.Add(longPressGesture);
|
|
|
}
|
|
|
+
|
|
|
+ if (!IsTeaPart)
|
|
|
+ listItem.m_itemType.selectedIndex = 0;
|
|
|
+ else
|
|
|
+ listItem.m_itemType.selectedIndex = 1;
|
|
|
+
|
|
|
listItem.m_btnAni.visible = false;
|
|
|
listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
|
|
|
listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + scoreType;
|
|
|
listItem.m_txtTitle.text = partName;
|
|
|
listItem.target.data = id;
|
|
|
- listItem.m_imgNeed.visible = _fightCfg.needItemId == id || _fightCfg.needSuitId == id;
|
|
|
+ listItem.m_imgNeed.visible = _fightCfg != null && (_fightCfg.needItemId == id || _fightCfg.needSuitId == id);
|
|
|
UI_PartsListItem.ProxyEnd();
|
|
|
}
|
|
|
private void ListParts2Item(int index, GObject item)
|
|
@@ -1155,8 +1228,11 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateScore()
|
|
|
{
|
|
|
- _ui.m_txtScore.text = "" + FightDataManager.Instance.GetScore(InstanceZonesDataManager.roleData).ToString();
|
|
|
+ if (!IsTeaPart)
|
|
|
+ _ui.m_txtScore.text = "" + FightDataManager.Instance.GetScore(InstanceZonesDataManager.roleData).ToString();
|
|
|
// GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
|
|
|
+ else
|
|
|
+ _ui.m_txtMatch.text = "" + LeagueDataManager.Instance.GetTeaPartyMatchedValue(InstanceZonesDataManager.roleData);
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnSearch()
|