public void SetBG() { EVENT_DAILY_DUNGEON_INFO dailyDungeonInfo = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(1, this.m_nDayOfWeek); if (dailyDungeonInfo == null) { this.Close(); return; } this.m_szBackImage = "UI/DailyDungeon/" + dailyDungeonInfo.szBGIMG; this.m_dtBG.SetTextureFromBundle(this.m_szBackImage); if (this.m_goBackTexture != null) { Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.m_szBackImage); if (texture == null) { NrTSingleton <UIImageBundleManager> .Instance.RequestBundleImage(this.m_szBackImage, new PostProcPerItem(this.SetBundleImage)); } else { Renderer component = this.m_goBackTexture.GetComponent <Renderer>(); if (component != null) { component.material.mainTexture = texture; } } } }
public bool IsGet_DailyDungeonReward() { bool result = false; sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek(); DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)dayOfWeek); if (dailyDungeonInfo != null) { sbyte b = dailyDungeonInfo.m_i8Diff; if ((int)b == 0) { b = 1; } if (EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(b, dayOfWeek) == null) { return(false); } if (dailyDungeonInfo.m_i32IsClear <= 1) { result = (dailyDungeonInfo.m_i32IsClear == 1); if ((int)dailyDungeonInfo.m_i8IsReward == 1) { result = false; } } } else { result = false; } return(result); }
public static EVENT_DAILY_DUNGEON_DATA GetInstance() { if (EVENT_DAILY_DUNGEON_DATA.Instance == null) { EVENT_DAILY_DUNGEON_DATA.Instance = new EVENT_DAILY_DUNGEON_DATA(); } return(EVENT_DAILY_DUNGEON_DATA.Instance); }
private void SetDifficultData() { sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek(); Dictionary <sbyte, EVENT_DAILY_DUNGEON_INFO> dailyDungeonInfo = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(dayOfWeek); if (dailyDungeonInfo == null) { return; } this.m_nlDifficulty.Clear(); foreach (EVENT_DAILY_DUNGEON_INFO current in dailyDungeonInfo.Values) { if (current != null) { NewListItem newListItem = new NewListItem(this.m_nlDifficulty.ColumnNum, true, string.Empty); string empty = string.Empty; NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1697"), "itemname", NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(current.i32RewardItemUnique), "count", current.i32RewardItemNum.ToString() }); newListItem.SetListItemData(0, empty, null, null, null); UIBaseInfoLoader loader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_WorrGradeS" + current.i8Difficulty.ToString()); newListItem.SetListItemData(1, loader, null, null, null); newListItem.SetListItemData(3, new ITEM { m_nItemUnique = current.i32RewardItemUnique, m_nItemNum = current.i32RewardItemNum }, null, null, null); newListItem.Data = current; this.m_nlDifficulty.Add(newListItem); this.m_nlDifficulty.RepositionItems(); } } }
public bool SetBasicData() { if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null) { return(false); } sbyte dayOfWeek = NrTSingleton <DailyDungeonManager> .Instance.GetDayOfWeek(); DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)dayOfWeek); if (dailyDungeonInfo == null) { return(false); } if ((int)this.m_nDifficult < 0) { this.m_nDifficult = dailyDungeonInfo.m_i8Diff; } if ((int)this.m_nDifficult == 0) { this.m_nDifficult = 1; } return(EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, dayOfWeek) != null && (dailyDungeonInfo.m_i32IsClear > 1 || (int)dailyDungeonInfo.m_i8IsReward == 0)); }
public void SetInfo(int nIndex, int nDayOfWeek, bool bReward, bool bClear) { sbyte b = (sbyte)NrTSingleton <DailyDungeonManager> .Instance.GetCurrWeekofDay(); string empty = string.Empty; long num = this.MaxResetCount(); long resetCount = NrTSingleton <DailyDungeonManager> .Instance.GetResetCount(); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3441"), "count1", resetCount.ToString(), "count2", num.ToString() }); this.m_lbLimitCount.Text = empty; EVENT_DAILY_DUNGEON_INFO dailyDungeonInfo = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(1, (sbyte)nDayOfWeek); if (dailyDungeonInfo == null) { return; } if (bReward) { this.m_dtSatge[nIndex].enabled = true; this.m_dtSatge[nIndex].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_btStage[nIndex].controlIsEnabled = true; this.m_btStage[nIndex].Click = null; this.m_dtSatge_Lock1[nIndex].Visible = true; this.m_dtSatge_Lock2[nIndex].Visible = true; this.m_btStage_Reset[nIndex].Visible = true; this.m_btStage_Reset[nIndex].Data = (sbyte)nDayOfWeek; this.m_btStage_Reset[nIndex].Click = new EZValueChangedDelegate(this.ClickDailyDungeonReset); if (resetCount >= num) { this.m_dtSatge_Lock1[nIndex].Visible = false; this.m_dtSatge_Lock2[nIndex].Visible = false; this.m_btStage_Reset[nIndex].Visible = false; this.m_btStage_Reset[nIndex].Click = null; } } else if ((int)b == 0 || (int)b == 6) { if (bClear && !bReward) { this.m_dtSatge[nIndex].enabled = true; this.m_dtSatge[nIndex].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_dtSatge[nIndex].SetTextureFromBundle("UI/" + dailyDungeonInfo.szOpen); this.m_btStage[nIndex].controlIsEnabled = true; this.m_btStage[nIndex].Data = (sbyte)(nIndex + 1); this.m_btStage[nIndex].Click = new EZValueChangedDelegate(this.ClickDailyDungeonOpen); this.m_dtSatge_Lock1[nIndex].Visible = true; this.m_dtSatge_Lock2[nIndex].Visible = true; this.m_btStage_Reset[nIndex].Visible = true; this.m_btStage_Reset[nIndex].Data = (sbyte)(nIndex + 1); Button expr_263 = this.m_btStage_Reset[nIndex]; expr_263.Click = (EZValueChangedDelegate)Delegate.Combine(expr_263.Click, new EZValueChangedDelegate(this.ClickDailyDungeonReset)); } } this.m_dtSatge[nIndex].enabled = true; this.m_dtSatge[nIndex].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_dtSatge[nIndex].SetTextureFromBundle("UI/" + dailyDungeonInfo.szOpen); this.m_btStage[nIndex].controlIsEnabled = true; this.m_btStage[nIndex].Data = (sbyte)(nIndex + 1); this.m_btStage[nIndex].Click = new EZValueChangedDelegate(this.ClickDailyDungeonOpen); this.m_dtSatge_Lock1[nIndex].Visible = true; this.m_dtSatge_Lock2[nIndex].Visible = true; this.m_btStage_Reset[nIndex].Visible = true; this.m_btStage_Reset[nIndex].Data = (sbyte)(nIndex + 1); Button expr_358 = this.m_btStage_Reset[nIndex]; expr_358.Click = (EZValueChangedDelegate)Delegate.Combine(expr_358.Click, new EZValueChangedDelegate(this.ClickDailyDungeonReset)); }
public void SetData() { if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null) { this.Close(); return; } string empty = string.Empty; bool flag = false; sbyte b = (sbyte)NrTSingleton <DailyDungeonManager> .Instance.GetCurrWeekofDay(); long num = this.MaxResetCount(); long resetCount = NrTSingleton <DailyDungeonManager> .Instance.GetResetCount(); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3441"), "count1", resetCount.ToString(), "count2", num.ToString() }); this.m_lbLimitCount.Text = empty; for (int i = 0; i < 5; i++) { EVENT_DAILY_DUNGEON_INFO dailyDungeonInfo = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(1, (sbyte)(i + 1)); if ((int)b == 0 || (int)b == 6) { int num2 = this.DailyDungeonClearCheck((sbyte)(i + 1)); flag = this.DailyDungeonRewardCheck((sbyte)(i + 1)); if (flag) { this.m_btStage[i].controlIsEnabled = false; this.m_btStage[i].Click = null; this.m_dtSatge[i].enabled = true; this.m_dtSatge[i].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_dtSatge_Lock1[i].Visible = true; this.m_dtSatge_Lock2[i].Visible = true; this.m_btStage_Reset[i].Visible = true; this.m_btStage_Reset[i].Data = (sbyte)(i + 1); Button expr_176 = this.m_btStage_Reset[i]; expr_176.Click = (EZValueChangedDelegate)Delegate.Combine(expr_176.Click, new EZValueChangedDelegate(this.ClickDailyDungeonReset)); } else { this.m_btStage[i].controlIsEnabled = true; this.m_btStage[i].Data = (sbyte)(i + 1); this.m_btStage[i].Click = new EZValueChangedDelegate(this.ClickDailyDungeonOpen); this.m_dtSatge[i].SetTextureFromBundle("UI/" + dailyDungeonInfo.szOpen); this.m_dtSatge_Lock1[i].Visible = false; this.m_dtSatge_Lock2[i].Visible = false; this.m_btStage_Reset[i].Visible = false; this.m_btStage_Reset[i].Data = (sbyte)(i + 1); this.m_btStage_Reset[i].Click = null; } if (num2 != 0 && num2 != i + 1) { this.m_btStage[i].controlIsEnabled = false; this.m_btStage[i].Click = null; this.m_dtSatge[i].enabled = true; this.m_dtSatge[i].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_dtSatge_Lock1[i].Visible = false; this.m_dtSatge_Lock2[i].Visible = false; this.m_btStage_Reset[i].Visible = false; } } else if ((int)b == (int)((sbyte)i) + 1) { flag = this.DailyDungeonRewardCheck((sbyte)(i + 1)); if (flag) { this.m_btStage[i].controlIsEnabled = false; this.m_dtSatge[i].enabled = true; this.m_dtSatge[i].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_dtSatge_Lock1[i].Visible = true; this.m_dtSatge_Lock2[i].Visible = true; this.m_btStage_Reset[i].Visible = true; this.m_btStage_Reset[i].Data = (sbyte)(i + 1); this.m_btStage_Reset[i].Click = new EZValueChangedDelegate(this.ClickDailyDungeonReset); } else { this.m_btStage[i].controlIsEnabled = true; this.m_btStage[i].Data = (sbyte)(i + 1); this.m_btStage[i].Click = new EZValueChangedDelegate(this.ClickDailyDungeonOpen); this.m_dtSatge[i].enabled = false; this.m_dtSatge[i].SetTextureFromBundle("UI/" + dailyDungeonInfo.szOpen); this.m_dtSatge_Lock1[i].Visible = false; this.m_dtSatge_Lock2[i].Visible = false; this.m_btStage_Reset[i].Visible = false; this.m_btStage_Reset[i].Data = (sbyte)(i + 1); } } else { this.m_btStage[i].controlIsEnabled = false; this.m_dtSatge[i].enabled = true; this.m_dtSatge[i].SetTextureFromBundle("UI/" + dailyDungeonInfo.szClose); this.m_dtSatge_Lock1[i].Visible = false; this.m_dtSatge_Lock2[i].Visible = false; this.m_btStage_Reset[i].Visible = false; this.m_btStage_Reset[i].Data = (sbyte)(i + 1); this.m_btStage_Reset[i].Click = null; } this.m_itRewardItem[i].SetItemTexture(dailyDungeonInfo.i32RewardItemUnique); this.m_lbRewardItemName[i].SetText(NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(dailyDungeonInfo.i32RewardItemUnique)); if (resetCount >= num && flag) { this.m_btStage[i].controlIsEnabled = false; this.m_dtSatge_Lock1[i].Visible = false; this.m_dtSatge_Lock2[i].Visible = false; this.m_btStage_Reset[i].Visible = false; } } }
public EVENT_DAILY_DUNGEON_DATA() : base(CDefinePath.DAILY_DUNGEON_URL) { this.m_dicDailyDungeonData = new Dictionary <sbyte, Dictionary <sbyte, EVENT_DAILY_DUNGEON_INFO> >(); this.m_dicDailyDungeonData.Clear(); EVENT_DAILY_DUNGEON_DATA.Instance = this; }
public void SetBasicData(sbyte nDayOfWeek, bool bCheck) { if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null) { this.Close(); return; } DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)nDayOfWeek); EVENT_DAILY_DUNGEON_INFO dailyDungeonInfo2; if (dailyDungeonInfo != null) { this.m_nDayOfWeek = (sbyte)dailyDungeonInfo.m_i32DayOfWeek; if (!bCheck) { this.m_nDifficult = dailyDungeonInfo.m_i8Diff; } dailyDungeonInfo2 = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, this.m_nDayOfWeek); if (dailyDungeonInfo2 == null) { this.Close(); return; } if (dailyDungeonInfo.m_i32IsClear <= 1) { if (dailyDungeonInfo.m_i32IsClear != 1) { this.m_btStart.Visible = true; this.m_btReward.Visible = false; if (this.m_goGageEffect != null) { this.m_goGageEffect.SetActive(false); } } else { this.m_btStart.Visible = false; this.m_btReward.Visible = true; if (this.m_goGageEffect != null) { this.m_goGageEffect.SetActive(true); } } if ((int)dailyDungeonInfo.m_i8IsReward == 1) { this.m_btStart.Visible = false; this.m_btReward.Visible = false; this.m_btHeroInfo.Visible = false; this.m_lbHeroInfo.Visible = false; this.m_dtRightBottomFrame.Visible = false; if (this.m_goGageEffect != null) { this.m_goGageEffect.SetActive(true); } MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg; if (myCharInfoDlg != null) { myCharInfoDlg.UpdateNoticeInfo(); } } } } else { this.m_nDayOfWeek = nDayOfWeek; if ((int)this.m_nDifficult <= 0 || !bCheck) { this.m_nDifficult = 1; } dailyDungeonInfo2 = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, this.m_nDayOfWeek); if (dailyDungeonInfo2 == null) { this.Close(); return; } this.m_btStart.Visible = true; this.m_btReward.Visible = false; if (this.m_goGageEffect != null) { this.m_goGageEffect.SetActive(false); } } if (dailyDungeonInfo2 == null) { this.Close(); return; } string textFromMap = NrTSingleton <NrTextMgr> .Instance.GetTextFromMap(dailyDungeonInfo2.i32TextKey.ToString()); this.m_lbTitle.SetText(textFromMap); ITEM iTEM = new ITEM(); iTEM.m_nItemUnique = dailyDungeonInfo2.i32RewardItemUnique; iTEM.m_nItemNum = dailyDungeonInfo2.i32RewardItemNum; this.m_itRewardItem.SetItemTexture(iTEM); string empty = string.Empty; NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1697"), "itemname", NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(dailyDungeonInfo2.i32RewardItemUnique), "count", dailyDungeonInfo2.i32RewardItemNum.ToString() }); this.m_lbRewardName.SetText(empty); this.m_dtDifficulty.SetTexture("Win_I_WorrGradeS" + this.m_nDifficult.ToString()); this.m_lbMonsterInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(dailyDungeonInfo2.i32ExplainText.ToString())); this.m_dtMonsterImage.SetTextureFromBundle("ui/soldier/512/" + dailyDungeonInfo2.szMonIMG); }