public static void RequestTakeSevenDayReward(SevenDayRewardDataEx data) { if (data == null || data.Data == null || data.Info == null) { global::Debug.LogError(new object[] { "Data error" }); return; } if (data.Data.TakeReward) { global::Debug.LogError(new object[] { "Reward taken." }); return; } if (!data.IsComplete()) { global::Debug.LogError(new object[] { "SevenDayReward has not Complete." }); return; } MC2S_TakeSevenDayReward mC2S_TakeSevenDayReward = new MC2S_TakeSevenDayReward(); mC2S_TakeSevenDayReward.ID = data.Data.ID; Globals.Instance.CliSession.Send(722, mC2S_TakeSevenDayReward); }
public override void Refresh(object _data) { SevenDayRewardDataEx sevenDayRewardDataEx = (SevenDayRewardDataEx)_data; if (sevenDayRewardDataEx == this.Data && this.CacheInfo == sevenDayRewardDataEx.Info) { this.RefreshFinnishState(); return; } this.Data = sevenDayRewardDataEx; this.CacheInfo = this.Data.Info; this.RefreshData(); }
private int GetSortWeight(SevenDayRewardDataEx data) { int result = 1000; if (data.IsComplete()) { if (data.Data.TakeReward) { result = 0; } else { result = 1000000; } } return result; }
private void OnTakeSevenDayReward(SevenDayRewardDataEx data) { if (data == null || data.Info == null) { global::Debug.LogErrorFormat("take seven day error", new object[0]); return; } this.UpdateSevenDayRewardFlag = true; int num = Mathf.Clamp(data.Info.DayIndex - 1, 0, 6); if (num == this.currentSelectDay) { int num2 = Mathf.Clamp(data.Info.PageIndex - 1, 0, 2); this.SevenDayRewardTable[num2].repositionNow = true; } List<RewardData> list = new List<RewardData>(); for (int i = 0; i < data.Info.RewardType.Count; i++) { if (data.Info.RewardType[i] != 0 && data.Info.RewardType[i] != 20) { list.Add(new RewardData { RewardType = data.Info.RewardType[i], RewardValue1 = data.Info.RewardValue1[i], RewardValue2 = data.Info.RewardValue2[i] }); } } GUIRewardPanel.Show(list, null, false, true, null, false); }
private void OnSevenDayRewardUpdate(SevenDayRewardDataEx data) { if (data == null || data.Info == null) { global::Debug.LogErrorFormat("take seven day error", new object[0]); return; } this.UpdateSevenDayRewardFlag = true; int num = Mathf.Clamp(data.Info.DayIndex - 1, 0, 6); if (num == this.currentSelectDay) { int num2 = Mathf.Clamp(data.Info.PageIndex - 1, 0, 2); this.SevenDayRewardTable[num2].repositionNow = true; } }
public void InitInfos() { foreach (SevenDayInfo current in Globals.Instance.AttDB.SevenDayDict.Values) { SevenDayRewardDataEx sevenDayRewardDataEx = new SevenDayRewardDataEx(); sevenDayRewardDataEx.Info = current; sevenDayRewardDataEx.Data = new SevenDayRewardData(); sevenDayRewardDataEx.Data.ID = current.ID; this.sevenDayRewards.Add(current.ID, sevenDayRewardDataEx); } foreach (ShareAchievementInfo current2 in Globals.Instance.AttDB.ShareAchievementDict.Values) { ShareAchievementDataEx shareAchievementDataEx = new ShareAchievementDataEx(); shareAchievementDataEx.Info = current2; shareAchievementDataEx.Data = new ShareAchievementData(); shareAchievementDataEx.Data.ID = current2.ID; this.ShareAchievements.Add(shareAchievementDataEx); } foreach (MiscInfo current3 in Globals.Instance.AttDB.MiscDict.Values) { if (current3.FundLevel > 0) { this.FundRewards.Add(new FundRewardData(current3, false)); } if (current3.BuyFundCount > 0) { this.FundRewards.Add(new FundRewardData(current3, true)); } } this.initFlag = true; }