private void RefreshReward(RewardPreviewUI.CopyType type) { SpecialFightMode mode = SpecialFightMode.None; switch (type) { case RewardPreviewUI.CopyType.GUARD: mode = SpecialFightMode.Hold; break; case RewardPreviewUI.CopyType.ESCORT: mode = SpecialFightMode.Protect; break; case RewardPreviewUI.CopyType.ATTACK: mode = SpecialFightMode.Save; break; } SpecialFightCommonTableData specialFightCommonTableData = SpecialFightManager.GetSpecialFightCommonTableData(mode); if (specialFightCommonTableData != null) { for (int i = 0; i < this.mSpecialRewards.get_childCount(); i++) { Object.Destroy(this.mSpecialRewards.GetChild(i).get_gameObject()); } for (int j = 0; j < specialFightCommonTableData.itemIDs.get_Count(); j++) { GameObject gameObject = ItemShow.ShowItem(this.mSpecialRewards, specialFightCommonTableData.itemIDs.get_Item(j), 0L, false, null, 2001); gameObject.get_transform().set_localScale(new Vector3(0.5f, 0.5f, 1f)); } this.mSpecialRewards.get_gameObject().SetActive(true); } }
public bool IsFinishInDailyTask(SpecialFightMode mode) { DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo; if (defendFightModeInfo == null) { return(false); } int type = 0; switch (mode) { case SpecialFightMode.Hold: type = 8; break; case SpecialFightMode.Protect: type = 7; break; case SpecialFightMode.Save: type = 6; break; } int maxVipTimesByType = VIPPrivilegeManager.Instance.GetMaxVipTimesByType(type); return(defendFightModeInfo.todayBuyTimes >= maxVipTimesByType); }
public SpecialFightInfo GetFightInfo(SpecialFightMode mode) { if (!this.SFightInfo.ContainsKey(mode)) { return(null); } return(this.SFightInfo.get_Item(mode)); }
protected void InitDifficulty(SpecialFightMode mode) { DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo; this.DifficultyList.get_gameObject().SetActive(false); this.BuffObj.SetActive(false); this.OnUpdateDetailUI(); this.InstanceTimesNum.set_text(defendFightModeInfo.todayCanChallengeTimes.ToString()); this.BuyTimeBtn.get_gameObject().SetActive(defendFightModeInfo.todayCanChallengeTimes == 0); }
public void Init(SpecialFightMode theMode, Action <SpecialFightMode> theBtnCallBack, string theTaskOpenText, string theCountDownText, string[] theWeekText) { this.mode = theMode; this.btnCallBack = theBtnCallBack; this.taskOpenText = theTaskOpenText; this.countDownText = theCountDownText; this.weekText = theWeekText; this.InfoText = base.get_transform().FindChild(base.get_gameObject().get_name() + "Text").GetComponent <Text>(); base.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnBtnClick); this.systemId = SpecialFightManager.GetSystemIDByMode(this.mode); }
public void OnBuyDefendTimes(SpecialFightMode mode) { DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo; if (defendFightModeInfo == null) { return; } SpecialFightCommonTableData specialFightCommonTableData = SpecialFightManager.GetSpecialFightCommonTableData(mode); if (specialFightCommonTableData == null) { return; } int todayBuyTimes = defendFightModeInfo.todayBuyTimes; int todayCanBuyTimes = defendFightModeInfo.todayCanBuyTimes; int canBuyTimes = Math.Max(todayCanBuyTimes - todayBuyTimes, 0); if (canBuyTimes <= 0 && todayBuyTimes < specialFightCommonTableData.priceList.get_Count()) { string chineseContent = GameDataUtils.GetChineseContent(505105, false); DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), chineseContent, null, delegate { LinkNavigationManager.OpenVIPUI2Privilege(); }, "取 消", "确 定", "button_orange_1", "button_yellow_1", null, true, true); return; } if (todayBuyTimes >= specialFightCommonTableData.priceList.get_Count()) { DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(513531, false), GameDataUtils.GetChineseContent(513528, false), delegate { }, GameDataUtils.GetChineseContent(505114, false), "button_orange_1", null); } else { DialogBoxUIViewModel.Instance.ShowAsOKCancel_as(GameDataUtils.GetChineseContent(513531, false), string.Format(GameDataUtils.GetChineseContent(513530, false), specialFightCommonTableData.priceList.get_Item(todayBuyTimes), canBuyTimes, todayCanBuyTimes), null, null, delegate { if (canBuyTimes == 0) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513528, false), 1f, 1f); DialogBoxUIViewModel.Instance.BtnRclose = false; } else { DialogBoxUIViewModel.Instance.BtnRclose = true; DefendFightManager.Instance.SendDefendFightBuyChallengeReq((DefendFightMode.DFMD)mode); } }, GameDataUtils.GetChineseContent(500012, false), GameDataUtils.GetChineseContent(500011, false), "button_orange_1", "button_yellow_1", null); } }
public void SetModeInit(SpecialFightMode mode) { this.currentMode = mode; SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(mode) as SpecialFightInfo; if (specialFightInfo != null && specialFightInfo.m_BuffIds.get_Count() > 0) { this.SelectBuff(specialFightInfo.m_BuffIds); } else { this.ClearBuffs(); } }
protected static void OpenSpecialInstanceAppointedUI(SpecialFightMode mode) { if (!SystemOpenManager.IsSystemClickOpen(17, 0, true)) { return; } if (!SystemOpenManager.IsSystemClickOpen(SpecialFightManager.GetSystemIDByMode(mode), 0, true)) { return; } InstanceManagerUI.InstanceID = 0; SpecialInstanceUI specialInstanceUI = UIManagerControl.Instance.OpenUI("SpecialInstanceUI", null, false, UIType.FullScreen) as SpecialInstanceUI; specialInstanceUI.FakeClick(mode); }
public static object GetSpecialFightInfo(SpecialFightMode mode) { SpecialFightModeGroup modeCroup = SpecialFightManager.GetModeCroup(mode); SpecialFightModeGroup specialFightModeGroup = modeCroup; if (specialFightModeGroup == SpecialFightModeGroup.Defend) { return(DefendFightManager.Instance.GetModeInfo((DefendFightMode.DFMD)mode)); } if (specialFightModeGroup != SpecialFightModeGroup.Expericence) { return(null); } return(SpecialFightManager.Instance.GetFightInfo(mode)); }
public static SpecialFightCommonTableData GetSpecialFightCommonTableData(SpecialFightMode mode) { SpecialFightModeGroup modeCroup = SpecialFightManager.GetModeCroup(mode); SpecialFightModeGroup specialFightModeGroup = modeCroup; if (specialFightModeGroup == SpecialFightModeGroup.Defend) { return(DefendFightManager.Instance.GetSpecialFightCommonTableData((DefendFightMode.DFMD)mode)); } if (specialFightModeGroup != SpecialFightModeGroup.Expericence) { return(null); } return(SpecialFightManager.Instance.commonData); }
public static SpecialFightModeGroup GetModeCroup(SpecialFightMode mode) { switch (mode) { case SpecialFightMode.Hold: case SpecialFightMode.Protect: case SpecialFightMode.Save: return(SpecialFightModeGroup.Defend); case SpecialFightMode.Expericence: return(SpecialFightModeGroup.Expericence); default: return((SpecialFightModeGroup)0); } }
protected void InitBuff(SpecialFightMode mode) { this.DifficultyList.get_gameObject().SetActive(false); this.BuffObj.SetActive(true); SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(this.currentMode) as SpecialFightInfo; if (specialFightInfo == null) { return; } int buffId = 0; if (specialFightInfo.m_BuffIds != null && specialFightInfo.m_BuffIds.get_Count() > 0) { buffId = specialFightInfo.m_BuffIds.get_Item(0); } this.OnUpdateBuff(buffId); }
public void SetInit(SpecialFightMode mode) { this.currentMode = mode; this.currentGroup = SpecialFightManager.GetModeCroup(mode); this.SetTitleText(this.currentMode); SpecialFightModeGroup specialFightModeGroup = this.currentGroup; if (specialFightModeGroup != SpecialFightModeGroup.Defend) { if (specialFightModeGroup != SpecialFightModeGroup.Expericence) { } } else { this.InitDifficulty(mode); } this.OnUpdateSpecialInstanceDetailUI(); }
public static int GetSystemIDByMode(SpecialFightMode mode) { switch (mode) { case SpecialFightMode.Hold: return(54); case SpecialFightMode.Protect: return(55); case SpecialFightMode.Save: return(56); case SpecialFightMode.Expericence: return(63); default: return(0); } }
protected void OnEnterDetail(SpecialFightMode mode, string anim) { if (!SystemOpenManager.IsSystemClickOpen(SpecialFightManager.GetSystemIDByMode(mode), 0, true)) { return; } if (!this.DetailUI) { return; } SpecialFightManager.Instance.SelectDetailMode = mode; if (SpecialFightManager.GetModeCroup(mode) == SpecialFightModeGroup.Defend) { DefendFightManager.Instance.SelectDetailMode = (DefendFightMode.DFMD)mode; } this.DetailUI.SetInit(mode); SpecialFightManager.Instance.isInDetailPanel = false; this.animator.Play(anim, 0, 0f); this.EnabledModeList(false); }
protected void SetTitleText(SpecialFightMode mode) { switch (mode) { case SpecialFightMode.Hold: this.TitleText.set_text(GameDataUtils.GetChineseContent(513507, false)); break; case SpecialFightMode.Protect: this.TitleText.set_text(GameDataUtils.GetChineseContent(513505, false)); break; case SpecialFightMode.Save: this.TitleText.set_text(GameDataUtils.GetChineseContent(513506, false)); break; case SpecialFightMode.Expericence: this.TitleText.set_text(GameDataUtils.GetChineseContent(502322, false)); break; } }
private void InitExperienceFightData(short state, ExperienceCopyInfoNty down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down == null) { return; } SpecialFightMode specialFightMode = SpecialFightMode.Expericence; SpecialFightInfo specialFightInfo = this.GetFightInfo(specialFightMode); if (specialFightInfo != null) { specialFightInfo.m_Mode = specialFightMode; specialFightInfo.m_RestTimes = down.restChallengeTimes; specialFightInfo.m_ExtendTimes = down.extendTimes; } else { specialFightInfo = new SpecialFightInfo { m_Mode = specialFightMode, m_RestTimes = down.restChallengeTimes, m_ExtendTimes = down.extendTimes, m_InstanceID = DataReader <FJingYanFuBenPeiZhi> .Get("dungeonId").num }; this.SFightInfo.Add(specialFightMode, specialFightInfo); } this.BroadcastRefreshEvent(); EventDispatcher.Broadcast(EventNames.UpdateSpecialInstanceDetailUI); if (UIManagerControl.Instance.IsOpen("DailyTaskUI")) { EventDispatcher.Broadcast(EventNames.DailyTaskNty); } }
protected string SetNameText(SpecialFightMode mode, int difficultyIndex, int difficultyLevel) { switch (mode) { case SpecialFightMode.Hold: case SpecialFightMode.Protect: return(string.Format(GameDataUtils.GetChineseContent(513500, false), difficultyLevel)); case SpecialFightMode.Save: switch (difficultyIndex) { case 0: return(GameDataUtils.GetChineseContent(513501, false)); case 1: return(GameDataUtils.GetChineseContent(513502, false)); case 2: return(GameDataUtils.GetChineseContent(513503, false)); } break; } return(string.Empty); }
public void FakeClick(SpecialFightMode mode) { this.OnEnterDetail(mode, SpecialInstanceUI.RecoveryDetailAnimaName); }
public bool CanShowBuyBtnInDailyTask(SpecialFightMode mode) { DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo; return(defendFightModeInfo != null && defendFightModeInfo.todayCanChallengeTimes <= 0); }
protected void OnClickEnterDetail(SpecialFightMode mode) { this.OnEnterDetail(mode, SpecialInstanceUI.GoDetailPanelAnimaName); }