|
@@ -11,6 +11,7 @@ namespace GFGGame
|
|
|
private UI_StoryLevelInfoUI _ui;
|
|
|
private int _fightID;
|
|
|
private int _levelID;
|
|
|
+ private int _type;
|
|
|
private int _storyType;
|
|
|
private List<ItemData> _bonusList = new List<ItemData>();
|
|
|
private int _fightTimes;
|
|
@@ -46,6 +47,7 @@ namespace GFGGame
|
|
|
base.OnShown();
|
|
|
_levelID = (int)viewData;
|
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
|
|
|
+ _type = levelCfg.type;
|
|
|
_storyType = levelCfg.subType;
|
|
|
_ui.m_btnStart.touchable = true;
|
|
|
UpdateView();
|
|
@@ -64,8 +66,10 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnStart()
|
|
|
{
|
|
|
- int time = InstanceZonesDataManager.GetCanFightTime(_levelID);
|
|
|
- if (time > 0)
|
|
|
+
|
|
|
+ // int time = InstanceZonesDataManager.GetCanFightTime(_levelID);
|
|
|
+ InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
|
|
|
+ if (times > 0)
|
|
|
{
|
|
|
ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, _levelID, null, true);
|
|
|
}
|
|
@@ -77,8 +81,9 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnFightOnce()
|
|
|
{
|
|
|
- int time = InstanceZonesDataManager.GetCanFightTime(_levelID);
|
|
|
- if (time > 0)
|
|
|
+ // int time = InstanceZonesDataManager.GetCanFightTime(_levelID);
|
|
|
+ InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
|
|
|
+ if (times > 0)
|
|
|
{
|
|
|
ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, 1);
|
|
|
}
|
|
@@ -90,21 +95,22 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnFightTimes()
|
|
|
{
|
|
|
+ InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
|
|
|
|
|
|
- if (_storyType == ConstInstanceZonesSubType.Normal)
|
|
|
+ if (_type == ConstInstanceZonesType.Story && _storyType == ConstInstanceZonesSubType.Normal)
|
|
|
{
|
|
|
- if (_fightTimes < _timeCount)
|
|
|
+ if (times < GameConst.MAX_COUNT_FIGHT_QUICKLY)
|
|
|
{
|
|
|
ItemUtil.AddPower("体力不足", OnClickBtnFightTimes);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, _fightTimes);
|
|
|
+ ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, times);
|
|
|
}
|
|
|
}
|
|
|
- else if (_storyType == ConstInstanceZonesSubType.Hard)
|
|
|
+ else
|
|
|
{
|
|
|
- ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, _fightTimes);
|
|
|
+ ViewManager.Show(ViewName.STORY_FIGHT_QUICKLY_VIEW, times);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -119,7 +125,7 @@ namespace GFGGame
|
|
|
}
|
|
|
(item.data as ItemView).SetData(itemData);
|
|
|
List<ItemData> bonusOnceData = StoryBonusDataCache.GetBonusData(_levelID).bonusOnce;
|
|
|
- (item.data as ItemView).LoaShouTongRewardVisble = !MainStoryDataManager.CheckCurrentLevelPass() && index < bonusOnceData.Count;
|
|
|
+ (item.data as ItemView).LoaShouTongRewardVisble = !InstanceZonesDataManager.CheckLevelPass(_levelID) && index < bonusOnceData.Count;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -127,24 +133,12 @@ namespace GFGGame
|
|
|
{
|
|
|
if (_ui.m_groupPass.visible)
|
|
|
{
|
|
|
- int time = InstanceZonesDataManager.GetCanFightTime(_levelID);
|
|
|
- time = Math.Min(GameConst.MAX_COUNT_FIGHT_QUICKLY, time);
|
|
|
- if (_storyType == ConstInstanceZonesSubType.Normal)
|
|
|
+ InstanceZonesDataManager.GetCanFightTime(_type, _storyType, _levelID, out int times, out string title);
|
|
|
+ _ui.m_btnFightTimes.title = title;
|
|
|
+ _ui.m_btnFightTimes.visible = times > 0;
|
|
|
+ if (_type == ConstInstanceZonesType.Story && _storyType == ConstInstanceZonesSubType.Normal)
|
|
|
{
|
|
|
_ui.m_btnFightTimes.visible = true;
|
|
|
-
|
|
|
- _fightTimes = time;
|
|
|
- _ui.m_btnFightTimes.text = "挑战" + NumberUtil.GetChiniseNumberText(_timeCount) + "次";
|
|
|
- }
|
|
|
- else if (_storyType == ConstInstanceZonesSubType.Hard)
|
|
|
- {
|
|
|
-
|
|
|
- _ui.m_btnFightTimes.visible = time > 0;
|
|
|
- if (_ui.m_btnFightTimes.visible)
|
|
|
- {
|
|
|
- _fightTimes = time;
|
|
|
- _ui.m_btnFightTimes.text = "挑战" + NumberUtil.GetChiniseNumberText(time) + "次";
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -175,7 +169,7 @@ namespace GFGGame
|
|
|
_ui.m_loaderHead.url = ResPathUtil.GetNpcHeadPath("self");
|
|
|
}
|
|
|
_bonusList.Clear();
|
|
|
- if (MainStoryDataManager.CheckCurrentLevelPass())
|
|
|
+ if (InstanceZonesDataManager.CheckLevelPass(_levelID))
|
|
|
{
|
|
|
_bonusList = StoryBonusDataCache.GetBonusList(_levelID, false);
|
|
|
_ui.m_groupPass.visible = true;
|