| | |
| | | [Header("GetWay")]
|
| | | [SerializeField]
|
| | | Button m_GetWayBtn;
|
| | | [SerializeField] Button m_ImmediatelyUnlock;
|
| | | [SerializeField] ScrollerController scrollerController;
|
| | | [SerializeField] RectTransform m_ContainerGetWay;
|
| | | [SerializeField] ClickScreenOtherSpace clickOtherSpace;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | PlayerMainDate taskMain { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
|
| | | PlayerPackModel pack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | static readonly Color equipHoleLimitColor = new Color32(250, 3, 3, 255);
|
| | | static readonly Color equipHoleUnLimitColor = new Color32(51, 8, 0, 255);
|
| | | #region Built-in
|
| | |
| | | }
|
| | | scrollerController.OnRefreshCell += OnRefreshCell;
|
| | | m_GetWayBtn.onClick.AddListener(OnGetWayBtn);
|
| | | m_ImmediatelyUnlock.onClick.AddListener(ImmediatelyUnlock);
|
| | | clickOtherSpace.AddListener(() =>
|
| | | {
|
| | | m_ContainerGetWay.gameObject.SetActive(false);
|
| | |
| | | m_DragImg.gameObject.SetActive(false);
|
| | | m_ContainerGetWay.gameObject.SetActive(false);
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | flipScroll.locked = false;
|
| | | PlayerSkillDatas.OnRefreshSkill += OnRefreshSkill;
|
| | | model.OnRefreshSltSkill += OnRefreshSltSkill;
|
| | |
| | | {
|
| | | base.OnActived();
|
| | | UpdatePageBtn();
|
| | |
|
| | | if (model.taskHoleRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | model.SetTaskHoleRemind();
|
| | | for (int i = 0; i < equipPassSkills.Count; i++)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | if (model.TryGetPassSkillLimit(i, out limit))
|
| | | {
|
| | | if (limit.OpenSkillSlots > 0
|
| | | && model.taskHoleDict[limit.OpenSkillSlots] == model.immediatelyUnlockTask)
|
| | | {
|
| | | OnClickEquipHole(i, false);
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | flipScroll.RefreshActive();
|
| | | var _equipIndex = GetEquipHoleIndex(model.presentSltSkillID);
|
| | | SetEquipHoleSelect(_equipIndex);
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex));
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 1);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 2);
|
| | | OnUpdateSltSkillInfo();
|
| | | }
|
| | |
|
| | | private bool CheckOpenGetWays(int _index)
|
| | | private int CheckOpenGetWays(int _index)
|
| | | {
|
| | | PassSkillLimit _limit;
|
| | | if (model.TryGetPassSkillLimit(_index, out _limit))
|
| | | {
|
| | | if (_limit.level > 0 && PlayerDatas.Instance.baseData.LV < _limit.level)
|
| | | {
|
| | | return true;
|
| | | return 1;
|
| | | }
|
| | | else if (_limit.vipLv > 0 && PlayerDatas.Instance.baseData.VIPLv < _limit.vipLv)
|
| | | {
|
| | | return true;
|
| | | return 1;
|
| | | }
|
| | | else if (_limit.MountLv > 0 && promoteModel.GetMountTotallv() < _limit.MountLv)
|
| | | {
|
| | | return true;
|
| | | return 1;
|
| | | }
|
| | | else if (_limit.OpenSkillSlots > 0 && !model.IsTaskHoleUnlock(_limit.OpenSkillSlots))
|
| | | {
|
| | | return false;
|
| | | if (model.taskHoleDict.ContainsKey(_limit.OpenSkillSlots))
|
| | | {
|
| | | var taskId = model.taskHoleDict[_limit.OpenSkillSlots];
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV >= config.lv
|
| | | && taskId == model.immediatelyUnlockTask)
|
| | | {
|
| | | return 2;
|
| | | }
|
| | | }
|
| | | return 3;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void OnRefreshPlayerInfo(PlayerDataRefresh type)
|
| | |
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | | var taskName = string.Empty;
|
| | |
|
| | | if (model.taskHoleDict.ContainsKey(limit.OpenSkillSlots))
|
| | | {
|
| | | var taskConfig = Config.Instance.Get<PyTaskConfig>(model.taskHoleDict[limit.OpenSkillSlots]);
|
| | | if (taskConfig != null)
|
| | | var taskId = model.taskHoleDict[limit.OpenSkillSlots];
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV < config.lv)
|
| | | {
|
| | | var taskInfoConfig = Config.Instance.Get<TASKINFOConfig>(taskConfig.name);
|
| | | taskName = taskInfoConfig == null ? string.Empty : taskInfoConfig.show_writing;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get("PassSkillHoleLimitTask_6", config.lv));
|
| | | continue;
|
| | | }
|
| | | }
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots)));
|
| | | continue;
|
| | | }
|
| | | else if (model.taskHoleDict[limit.OpenSkillSlots] == model.immediatelyUnlockTask
|
| | | && model.IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | if (m_ImmediatelyUnlock.gameObject.activeSelf)
|
| | | {
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | var dis = Vector3.Distance(des.center, src.center);
|
| | | if (dis < rect.rect.width / 2)
|
| | | {
|
| | | if (CheckOpenGetWays(i))
|
| | | if (CheckOpenGetWays(i) != 0)
|
| | | {
|
| | | //SoundPlayer.Instance.PlayUIAudio(2);
|
| | | return;
|
| | |
| | | UpdatePassEquipPageBtn();
|
| | | var _equipIndex = GetEquipHoleIndex(model.presentSltSkillID);
|
| | | SetEquipHoleSelect(_equipIndex);
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex));
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 1);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 2);
|
| | | }
|
| | |
|
| | | private void UpdatePassEquipPageBtn()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickEquipHole(int index)
|
| | | private void OnClickEquipHole(int index, bool requireRemind = true)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | SetEquipHoleSelect(index);
|
| | | if (model.TryGetPassSkillLimit(index, out limit))
|
| | | {
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.LV < limit.level)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitLevel", limit.level);
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitLevel", limit.level);
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < limit.vipLv)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitVip", limit.vipLv);
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitVip", limit.vipLv);
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(true);
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | if (promoteModel.GetMountTotallv() < limit.MountLv)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitMountLevel", limit.MountLv);
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitMountLevel", limit.MountLv);
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (!model.IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | var taskName = string.Empty;
|
| | | if (model.taskHoleDict.ContainsKey(limit.OpenSkillSlots))
|
| | | {
|
| | | var taskConfig = Config.Instance.Get<PyTaskConfig>(model.taskHoleDict[limit.OpenSkillSlots]);
|
| | | if (taskConfig != null)
|
| | | var taskId = model.taskHoleDict[limit.OpenSkillSlots];
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV < config.lv)
|
| | | {
|
| | | var taskInfoConfig = Config.Instance.Get<TASKINFOConfig>(taskConfig.name);
|
| | | taskName = taskInfoConfig == null ? string.Empty : taskInfoConfig.show_writing;
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | return;
|
| | | }
|
| | | if (taskId == model.immediatelyUnlockTask)
|
| | | {
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | SysNotifyMgr.Instance.ShowTip(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots));
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots));
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
| | | m_ContainerGetWay.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | void ImmediatelyUnlock()
|
| | | {
|
| | | var count = pack.GetItemCountByID(PackType.rptItem, taskMain.ItemID);
|
| | | if (count >= taskMain.ItemNumber)
|
| | | {
|
| | | task.CompletionOfTask(model.immediatelyUnlockTask);
|
| | | }
|
| | | else
|
| | | {
|
| | | var requireJade = (ulong)((taskMain.ItemNumber - count) * taskMain.UnitPrice);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("PassiveSkillTask3", requireJade), |
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(1) >= requireJade)
|
| | | {
|
| | | task.CompletionOfTask(model.immediatelyUnlockTask);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickFunc(CellView cell)
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)cell.index);
|