private List <AchievementMsg> OnFilter() { if (m_CurrntIndex == 0) { m_achieveMent_data.Sort(AchievementTools.s_Comparer); return(m_achieveMent_data); } else if (m_CurrntIndex == 1) { List <AchievementMsg> msgs = new List <AchievementMsg>(); for (int i = 0; i < m_achieveMent_data.Count; i++) { AchievementMsg msg = m_achieveMent_data[i]; ConfAchievement confAchieve = ConfAchievement.Get(msg.Id); if (confAchieve != null) { if (msg.Progress < confAchieve.progress1) { msgs.Add(msg); } } } return(msgs); } else { return(new List <AchievementMsg>()); } }
public void SetData(AchievementMsg msg) { ConfAchievement confItem = ConfAchievement.Get(msg.Id); //m_Name_lab.Text = LocalizeModule.Instance.GetString(confItem.name); //m_Desc_lab.Text = LocalizeModule.Instance.GetString(confItem.info); long titleID = -1; long.TryParse(confItem.nobility, out titleID); if (titleID < 0) { m_Title_lab.Visible = false; } else { ConfTitle confTitle = ConfTitle.Get(titleID); if (confTitle != null) { m_Title_lab.Visible = true; m_Title_lab.Text = LocalizeModule.Instance.GetString("cheng_jiu_3", LocalizeModule.Instance.GetString(confTitle.name)); this.m_titleContentLab.Text = LocalizeModule.Instance.GetString(confTitle.info); } else { m_Title_lab.Visible = false; } } m_PopItem01.SetData(msg, confItem.progress1, confItem.rewardicon1, confItem.reward1, confItem.cash1, 0); m_PopItem02.SetData(msg, confItem.progress2, confItem.rewardicon2, confItem.reward2, confItem.cash1, 1); m_PopItem03.SetData(msg, confItem.progress3, confItem.rewardicon3, confItem.reward3, confItem.cash1, 2); }
public override void OnShow(object param) { base.OnShow(param); m_Close_btn.AddClickCallBack(OnClose); m_BG_img.AddClickCallBack(OnClose); this.m_canVisible = true; this.OnShowTweenFinished = ShowTweenFinished; if (param != null) { AchievementMsg msg = (AchievementMsg)param; SetData(msg); } }
private static int CompareAchievementById(AchievementMsg msg0, AchievementMsg msg1) { long msgID0 = msg0.Id; long msgID1 = msg1.Id; if (msgID0 < msgID1) { return(-1); } if (msgID0 == msgID1) { return(0); } return(1); }
private static long getFinishTime(AchievementMsg msg) { if (msg.FinishTime > 0) { return(msg.FinishTime); } else if (msg.FinishTime2 > 0) { return(msg.FinishTime2); } else if (msg.FinishTime1 > 0) { return(msg.FinishTime1); } return(0); }
private void OnInitUI(AchievementMsg msg) { ConfAchievement confItem = ConfAchievement.Get(msg.Id); m_Name_lab.Text = LocalizeModule.Instance.GetString(confItem.name); m_Icon_img.Sprite = confItem.rewardicon1; if (msg.Progress < confItem.progress1) { m_Submit = 0; m_Lock_img.Visible = true; m_Icon_img.Color = new Color(1, 1, 1, 0.6f); m_Time_lab.Visible = false; m_Tips_img.Visible = false; } else { long finishTime = msg.FinishTime1; if (msg.Progress < confItem.progress2 && msg.Progress >= confItem.progress1) { m_Icon_img.Sprite = confItem.rewardicon1; m_Submit = 2; finishTime = msg.FinishTime1; } else if (msg.Progress < confItem.progress3 && msg.Progress >= confItem.progress2) { m_Icon_img.Sprite = confItem.rewardicon2; m_Submit = 6; finishTime = msg.FinishTime2; } else if (msg.Progress >= confItem.progress3) { m_Icon_img.Sprite = confItem.rewardicon3; m_Submit = 14; finishTime = msg.FinishTime; } m_Tips_img.Visible = (msg.SubmitStatus < m_Submit); DateTime dt = CommonTools.TimeStampToDateTime(finishTime * 10000); if (dt != null) { m_Time_lab.Text = string.Format("{0:D2}.{1:D2}.{2:D2}", dt.Year, dt.Month, dt.Day); } m_Lock_img.Visible = false; m_Icon_img.Color = Color.white; LoadTipEffect(); } }
private static int CompareAchievement(AchievementMsg msg01, AchievementMsg msg02) { long msgFinishTime1 = getFinishTime(msg01); long msgFinishTime2 = getFinishTime(msg02); if (msgFinishTime1 == 0 && msgFinishTime2 == 0) { return(CompareAchievementById(msg01, msg02)); } if (msgFinishTime1 < msgFinishTime2) { return(1); } if (msgFinishTime1 == msgFinishTime2) { return(0); } return(-1); }
public void SetData(AchievementMsg msg, bool showLock) { m_data = msg; m_showLock = showLock; }
public void SetData(AchievementMsg msg, int progress, string rewardicon, int reward, int cash, int index) { if (msg == null) { Visible = false; return; } this.m_needShowEffect = false; m_Id = msg.Id; m_Stage = index; m_Reward = reward; m_Cash = cash; //m_submit = msg.SubmitStatus; ConfAchievement confItem = ConfAchievement.Get(msg.Id); if (confItem == null) { Visible = false; return; } long finishTime = msg.FinishTime1; if (index == 1) { finishTime = msg.FinishTime2; } else if (index == 2) { finishTime = msg.FinishTime; } DateTime dt = CommonTools.TimeStampToDateTime(finishTime * 10000); if (dt != null) { m_Time_lab.Text = string.Format("{0:D2}.{1:D2}.{2:D2}", dt.Year, dt.Month, dt.Day); } this.m_lockEffect.Visible = false; m_Icon_img.Sprite = rewardicon; if (msg.Progress < progress) { //未解锁 m_Icon_img.Color = new Color(0.494f, 0.494f, 0.494f, 0.549f); m_BigLock_img.Visible = true; m_SmallLock_img.Sprite = "icon_lock_2.png"; m_SmallLock_img.Color = m_SmallLockColor_color; m_RewardBG_img.Color = m_GrayColor_color; m_Time_lab.Visible = false; m_Term_lab.Text = LocalizeModule.Instance.GetString("Achievement_" + confItem.type); //"Achievement_" + confItem.type m_Percent01_lab.Text = msg.Progress.ToString(); m_Percent01_lab.color = m_NumberRedColor; //m_PercentColor; m_Percent02_lab.Text = string.Format("/{0}", progress); m_Percent02_lab.color = m_NumberGreenColor; m_Achieve_lab.Text = reward.ToString(); m_Cash_lab.Text = cash.ToString(); //m_Achieve_lab.color = m_CashGray_color; //m_Cash_lab.color = m_CashGray_color; m_Achieve_lab.color = m_NormalReward01_color; m_Cash_lab.color = m_NormalReward01_color; m_Receive_btn.Visible = false; m_Receive_img.Visible = false; } else { int submit = msg.SubmitStatus & m_ShiftFactor[index]; //m_Percent02_lab.color = new Color(0.074f,0.258f,0.396f); if (0 == submit) { this.m_needShowEffect = true; this.m_lockEffect.EffectPrefabName = "UI_chengjiu0" + (index + 1) + ".prefab"; //TimeModule.Instance.SetTimeout(OnPlayEffect,1.8f); //this.m_lockEffect.Visible = true; //未领取 m_Icon_img.Color = Color.white; m_BigLock_img.Visible = false; m_SmallLock_img.Sprite = "icon_giftbox_1.png"; m_SmallLock_img.Color = Color.white; m_RewardBG_img.Color = m_NormalRewardBG_color; m_Time_lab.Visible = true; m_Term_lab.Text = LocalizeModule.Instance.GetString("Achievement_" + confItem.type); //confItem.name m_Percent01_lab.Text = progress.ToString(); m_Percent01_lab.color = m_NumberGreenColor; //m_NormalText_color; m_Percent02_lab.Text = string.Format("/{0}", progress); m_Percent02_lab.color = m_NumberGreenColor; m_Achieve_lab.Text = reward.ToString(); m_Cash_lab.Text = cash.ToString(); m_Achieve_lab.color = m_NormalReward01_color; m_Cash_lab.color = m_NormalReward02_color; //m_Receive_img.Sprite = "btn_common_3.png"; m_Receive_btn.Visible = true; m_Receive_img.Visible = false; } else { //已经领取 m_Icon_img.Color = Color.white; m_BigLock_img.Visible = false; m_SmallLock_img.Sprite = "icon_giftbox_1.png"; m_SmallLock_img.Color = m_SmallLockColor_color; m_RewardBG_img.Color = m_GrayColor_color; m_Time_lab.Visible = true; m_Term_lab.Text = LocalizeModule.Instance.GetString("Achievement_" + confItem.type); m_Percent01_lab.Text = progress.ToString(); m_Percent01_lab.color = m_NormalText_color; m_Percent02_lab.Text = string.Format("/{0}", progress); m_Percent02_lab.color = m_NormalText_color; m_Achieve_lab.Text = reward.ToString(); m_Cash_lab.Text = cash.ToString(); m_Achieve_lab.color = m_CashGray_color; m_Cash_lab.color = m_CashGray_color; m_Receive_img.Visible = true; m_Receive_btn.Visible = false; } } }