private void OnNewGiftReaded() { PlayerPrefTool.SetIsThereNewGift(false); if (false == PlayerPrefTool.GetIsThereNewFriend() && false == PlayerPrefTool.GetIsThereNewApply()) { GameEvents.RedPointEvents.User_OnNewFriendEvent.SafeInvoke(false); } }
private void OnRefreshByPlayerPrefs() { if (PlayerPrefTool.GetIsThereNewEmail()) { OnNewEmailNotify(null); } if (PlayerPrefTool.GetIsThereNewFriend() || PlayerPrefTool.GetIsThereNewApply() || PlayerPrefTool.GetIsThereNewGift()) { OnNewFriendNotify(null); } if (PlayerPrefTool.GetIsThereNewActivity()) { OnNewActivityNotify(null); } if (PlayerPrefTool.GetIsThereNewAchievement()) { OnNewAchievementNotify(null); } if (PlayerPrefTool.GetIsThereNewNotice()) { OnNewNoticeNotify(null); } #if OFFICER_SYS if (PlayerPrefTool.GetIsThereNewPolice()) { OnNewPoliceNotify(); } #endif if (PlayerPrefTool.GetIsThereNewChapterNPC()) { OnNewChapterTypeNotify(0); } if (PlayerPrefTool.GetIsThereNewChapterClue()) { OnNewChapterTypeNotify(1); } if (PlayerPrefTool.GetIsThereNewChapterScene()) { OnNewChapterTypeNotify(2); } }
public void ShowContent(bool v_) { m_friend_info_list_root.Visible = false; m_friend_application_root.Visible = false; m_friend_confirm_root.Visible = false; m_add_friend_root.Visible = false; m_gift_root.Visible = false; if (v_) { ShowConfirmRedPoint(false); ShowApplyRedPoint(PlayerPrefTool.GetIsThereNewApply()); ShowGiftRedPoint(PlayerPrefTool.GetIsThereNewGift()); this.SwitchUI(FRIEND_UI_TOGGLE_TYPE.Added); } }
public override void OnShow(object param) { ShowConfirmRedPoint(false); ShowApplyRedPoint(PlayerPrefTool.GetIsThereNewApply()); ShowGiftRedPoint(PlayerPrefTool.GetIsThereNewGift()); this.SwitchUI(FRIEND_UI_TOGGLE_TYPE.Added); m_toggle_info.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Added, LocalizeModule.Instance.GetString("friend_1"), true, OnToggleClick); m_toggle_application.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Agreeing, LocalizeModule.Instance.GetString("friend_2"), false, OnToggleClick); m_toggle_confirm.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Addinfo, LocalizeModule.Instance.GetString("friend_3"), false, OnToggleClick); m_view_gifts_toggle.Refresh((int)FRIEND_UI_TOGGLE_TYPE.gift, LocalizeModule.Instance.GetString("friend_receive"), false, OnToggleClick); m_add_friend_toggle.Refresh((int)FRIEND_UI_TOGGLE_TYPE.scarch, LocalizeModule.Instance.GetString("friend_invite_btn"), false, OnToggleClick); m_application_switch.AddClickCallBack(OnApplicationToggleClicked); m_ignore_all_btn.AddClickCallBack(OnIgnoreAllClick); m_recommend_btn.AddClickCallBack(OnRecommendClick); }
public void Refresh(FRIEND_UI_TOGGLE_TYPE type_) { //this.SwitchUI(type_); ShowConfirmRedPoint(FriendDataManager.Instance.Last_apply); ShowApplyRedPoint(PlayerPrefTool.GetIsThereNewApply()); m_recommend_btn.Visible = false; if (FRIEND_UI_TOGGLE_TYPE.Added == type_ || FRIEND_UI_TOGGLE_TYPE.Addinfo == type_ || FRIEND_UI_TOGGLE_TYPE.Agreeing == type_) { int temp_type = (int)type_; Dictionary<long, PlayerFriendMsg> datas = FriendDataManager.Instance.GetDatas((FriendReqType)temp_type); if (FRIEND_UI_TOGGLE_TYPE.Added == type_ && m_friend_info_list_root.Visible) { if (null == datas) { m_friend_info_grid.Clear(); return; } List<PlayerFriendMsg> friends = new List<PlayerFriendMsg>(datas.Values); friends.Sort((a, b) => { if (a.Level > b.Level) return -1; else return 1; }); m_friend_info_grid.EnsureSize<FriendInfoItemUI>(friends.Count); for (int i = 0; i < m_friend_info_grid.ChildCount; ++i) { m_friend_info_grid.GetChild<FriendInfoItemUI>(i).Visible = false; m_friend_info_grid.GetChild<FriendInfoItemUI>(i).Visible = true; m_friend_info_grid.GetChild<FriendInfoItemUI>(i).Refresh(friends[i]); } m_friend_num_text.Text = string.Format("{0}/{1}", friends.Count, FriendDataManager.Instance.Max_friend_num); m_recommend_btn.Visible = 0 == friends.Count; m_recommend_tips.Visible = m_recommend_btn.Visible; } else if (FRIEND_UI_TOGGLE_TYPE.Agreeing == type_ && m_friend_application_root.Visible) { if (m_application_switch.Checked != FriendDataManager.Instance.Is_receive_application) m_application_switch.Checked = FriendDataManager.Instance.Is_receive_application; if (null == datas || 0 == datas.Count) { m_friend_application_grid.Clear(); m_ignore_all_btn.Enable = false; m_ignore_all_btn.SetGray(true); return; } m_ignore_all_btn.Enable = true; m_ignore_all_btn.SetGray(false); List<PlayerFriendMsg> friends = new List<PlayerFriendMsg>(datas.Values); friends.Sort((a, b) => { if (a.StatusTime > b.StatusTime) return -1; else return 1; }); m_friend_application_grid.EnsureSize<FriendApplicationItemUI>(friends.Count); for (int i = 0; i < m_friend_application_grid.ChildCount; ++i) { m_friend_application_grid.GetChild<FriendApplicationItemUI>(i).Visible = false; m_friend_application_grid.GetChild<FriendApplicationItemUI>(i).Visible = true; m_friend_application_grid.GetChild<FriendApplicationItemUI>(i).Refresh(friends[i]); } } else if (FRIEND_UI_TOGGLE_TYPE.Addinfo == type_ && m_friend_confirm_root.Visible) { if (null == datas) { m_friend_confirm_grid.Clear(); return; } List<PlayerFriendMsg> friends = new List<PlayerFriendMsg>(datas.Values); friends.Sort((a, b) => { if (a.StatusTime > b.StatusTime) return -1; else return 1; }); m_friend_confirm_grid.EnsureSize<FriendConfirmItemUI>(friends.Count); for (int i = 0; i < m_friend_confirm_grid.ChildCount; ++i) { m_friend_confirm_grid.GetChild<FriendConfirmItemUI>(i).Visible = false; m_friend_confirm_grid.GetChild<FriendConfirmItemUI>(i).Visible = true; m_friend_confirm_grid.GetChild<FriendConfirmItemUI>(i).Refresh(friends[i]); } } } else if (FRIEND_UI_TOGGLE_TYPE.gift == type_) { m_gift_root.Refresh(); } }