|
@@ -9,9 +9,8 @@ namespace GFGGame
|
|
{
|
|
{
|
|
private UI_FieldUI _ui;
|
|
private UI_FieldUI _ui;
|
|
|
|
|
|
- private FieldCfg _curCfg;
|
|
|
|
private int _curLevelId;
|
|
private int _curLevelId;
|
|
-
|
|
|
|
|
|
+ private FieldCfg _curCfg;
|
|
private FieldDataManager _dataManager;
|
|
private FieldDataManager _dataManager;
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
@@ -37,15 +36,16 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
_dataManager = FieldDataManager.Instance;
|
|
_dataManager = FieldDataManager.Instance;
|
|
- _dataManager.c_difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
|
|
+ _dataManager.difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
+ _dataManager.currFightIndex = 0;
|
|
_curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
_curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
- _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
|
|
+ _curLevelId = _dataManager.GetLevelIdByDifficulty(_dataManager.difficulty, _dataManager.currFightIndex);
|
|
|
|
+
|
|
FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
|
|
FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
|
|
for (int i = 0; i < cfgs.Length; i++)
|
|
for (int i = 0; i < cfgs.Length; i++)
|
|
{
|
|
{
|
|
- // bool isPass = InstanceZonesDataManager.CheckLevelPass(cfgs[i].s);
|
|
|
|
-
|
|
|
|
- // _ui.target.GetChild("btn"+i).asButton.GetChild("imgLock").asImage.visible=
|
|
|
|
|
|
+ bool isPass = InstanceZonesDataManager.CheckLevelPass(cfgs[i].storyLvId);
|
|
|
|
+ _ui.target.GetChild("btn" + i).asButton.GetChild("imgLock").asImage.visible = !isPass;
|
|
}
|
|
}
|
|
UpdateView();
|
|
UpdateView();
|
|
_ui.m_proTaskReward.max = 100;
|
|
_ui.m_proTaskReward.max = 100;
|
|
@@ -64,26 +64,57 @@ namespace GFGGame
|
|
|
|
|
|
private void OnDifficultyChange()
|
|
private void OnDifficultyChange()
|
|
{
|
|
{
|
|
- _dataManager.c_difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
|
|
+ FieldCfg cfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
+ bool isPass = InstanceZonesDataManager.CheckLevelPass(cfg.storyLvId);
|
|
|
|
+ if (!isPass && _ui.m_c1.selectedIndex != ConstInstanceZonesSubType.Normal)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_c1.selectedIndex = _dataManager.difficulty;
|
|
|
|
+ StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(cfg.storyLvId);
|
|
|
|
+ string str = string.Format("完成主线{0}-{1}解锁", storyLevelCfg.chapterId, storyLevelCfg.order);
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt(str);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (_dataManager.fieldInfos.highestLvls[_ui.m_c1.selectedIndex] < cfg.num && _ui.m_c1.selectedIndex != ConstInstanceZonesSubType.Normal)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_c1.selectedIndex = _dataManager.difficulty;
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ _dataManager.difficulty = _ui.m_c1.selectedIndex;
|
|
_curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
_curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
- _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
|
|
+ _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex, _dataManager.currFightIndex);
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
private void UpdateView()
|
|
private void UpdateView()
|
|
{
|
|
{
|
|
_ui.m_txtScore.text = ConstDressUpScoreType.scoreTypeList()[_dataManager.fieldInfos.theme].ToString();
|
|
_ui.m_txtScore.text = ConstDressUpScoreType.scoreTypeList()[_dataManager.fieldInfos.theme].ToString();
|
|
- _ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", 0, _curCfg.num);
|
|
|
|
|
|
+ _ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", _dataManager.fieldInfos.highestLvls[_dataManager.difficulty], _curCfg.num);
|
|
_ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
|
|
_ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
|
|
}
|
|
}
|
|
private void OnClickBtnGo()
|
|
private void OnClickBtnGo()
|
|
{
|
|
{
|
|
- // ViewManager.Show<FieldFightInfoView>();
|
|
|
|
|
|
|
|
if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) < _curCfg.needPower)
|
|
if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) < _curCfg.needPower)
|
|
{
|
|
{
|
|
PromptController.Instance.ShowFloatTextPrompt("体力不足");
|
|
PromptController.Instance.ShowFloatTextPrompt("体力不足");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (_dataManager.fieldInfos.bonusWeekly >= _dataManager.fieldInfos.bonusMaxLimit)
|
|
|
|
+ {
|
|
|
|
+ Alert.Show("本周可获得奖励已达上限,是否继续挑战?")
|
|
|
|
+ .SetLeftButton(true)
|
|
|
|
+ .SetRightButton(true, "确定", (object data) =>
|
|
|
|
+ {
|
|
|
|
+ StartFight();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ StartFight();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ private void StartFight()
|
|
|
|
+ {
|
|
ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, _curLevelId, new object[] { typeof(FieldView).Name, this.viewData }, true);
|
|
ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, _curLevelId, new object[] { typeof(FieldView).Name, this.viewData }, true);
|
|
InstanceZonesDataManager.currentLevelCfgId = _curLevelId;
|
|
InstanceZonesDataManager.currentLevelCfgId = _curLevelId;
|
|
}
|
|
}
|