/// <summary> /// リストに一括受け取り可能なものがあるかチェックする /// </summary> /// <returns></returns> public bool IsGetReword() { if (Collection.IsNullOrEmpty()) { return(false); } MasterDataDefineLabel.AchievementReceiveType receiveType = MasterDataDefineLabel.AchievementReceiveType.NONE; if (mission.m_FilterInfo != null) { receiveType = mission.m_FilterInfo.m_receive_type; } for (int index = 0; index < Collection.Count; index++) { if ((Collection[index].IsState_Achieve || Collection[index].IsState_AchieveEffect) == false) { continue; } if (MasterDataUtil.CheckReceivePresentType(Collection[index].present_ids, receiveType) == false) { continue; } return(true); } return(false); }
/// <summary> /// ミッションの種別受け取のフィルタ項目のテキスト取得 /// </summary> /// <param name="filterType"></param> /// <returns></returns> static public string GetMissonReceiveFilterText(MasterDataDefineLabel.AchievementReceiveType filterType) { string textKey = ""; switch (filterType) { case MasterDataDefineLabel.AchievementReceiveType.NONE: textKey = "filter_display_all"; break; case MasterDataDefineLabel.AchievementReceiveType.UNIT: textKey = "filter_get_unit"; break; case MasterDataDefineLabel.AchievementReceiveType.COIN: textKey = "filter_get_coin"; break; case MasterDataDefineLabel.AchievementReceiveType.CHIP: textKey = "filter_get_chip"; break; case MasterDataDefineLabel.AchievementReceiveType.OTHER: textKey = "filter_get_etc"; break; default: break; } return(GameTextUtil.GetText(textKey)); }
public void UpdateReceiveFilter(MasterDataDefineLabel.AchievementReceiveType filterType) { if (ReceiveFilterButtons != null) { for (int i = 0; i < ReceiveFilterButtons.Count; i++) { ReceiveFilterButtons[i].IsSelect = (filterType == ReceiveFilterButtons[i].AchievementReceiveType); } } }
void AddReceiveFilterData(MasterDataDefineLabel.AchievementReceiveType filterType) { SortDialogTextButtonListContext filterButton = new SortDialogTextButtonListContext(); filterButton.AchievementReceiveType = filterType; filterButton.OffNameText = GameTextUtil.GetMissonReceiveFilterText(filterType); filterButton.OnNameText = string.Format(GameTextUtil.GetText("filter_choice"), GameTextUtil.GetMissonReceiveFilterText(filterType)); filterButton.OffTextColor = ColorUtil.COLOR_WHITE; filterButton.OnTextColor = ColorUtil.COLOR_YELLOW; filterButton.DidSelectItem = OnClickReceiveFilterButton; ReceiveFilterButtons.Add(filterButton); }
//一括受取ボタン public void OnClickReceiveAllButton() { #if BUILD_TYPE_DEBUG Debug.Log("CALLOnClickReceiveAllButton"); #endif if (GlobalMenuManager.Instance.IsPageClosing() == true) { return; } //連打防止 if (ServerApi.IsExists) { return; } if (GlobalMenuManager.Instance.IsCangeTime()) { return; } SoundUtil.PlaySE(SEID.SE_MENU_OK); List <MasterDataAchievementConverted> tmpOpenCollection = CurrentMissionGroup.Collection.FindAll((v) => v.IsState_Achieve || v.IsState_AchieveEffect); List <MasterDataAchievementConverted> openCollection = new List <MasterDataAchievementConverted>(); //-------------------------------------- // フィルター設定に該当するミッションを抽出する //-------------------------------------- MasterDataDefineLabel.AchievementReceiveType filterType = MasterDataDefineLabel.AchievementReceiveType.NONE; if (m_FilterInfo != null) { filterType = m_FilterInfo.m_receive_type; } for (int i = 0; i < tmpOpenCollection.Count; ++i) { if (MasterDataUtil.CheckReceivePresentType(tmpOpenCollection[i].present_ids, filterType) == true) { openCollection.Add(tmpOpenCollection[i]); } } uint[] present = openCollection.Select((v) => v.fix_id).ToArray(); // 現在のタブで、報酬があるアチーブメントの配列 // リクエスト ServerDataUtilSend.SendPacketAPI_AchievementOpen(present, new uint[] { (uint)CurrentMissionGroup.missionGroupType }). setSuccessAction((_data) => { //ユーザー情報更新 UserDataAdmin.Instance.m_StructPlayer = _data.UpdateStructPlayer <RecvOpenAchievement>(UserDataAdmin.Instance.m_StructPlayer); UserDataAdmin.Instance.ConvertPartyAssing(); RecvOpenAchievementValue result = _data.GetResult <RecvOpenAchievement>().result; MissionAllOpenResultMessage(result); #if BUILD_TYPE_DEBUG Debug.Log("FINISH:" + result.achievement_opened); #endif CurrentMissionGroup.SetEnaleReceiveButtonAll(false); // 開封したミッションリストのボタンを押せなくする CurrentMissionGroup.Activate(); // 開封した新規達成アチーブメントを削除 ResidentParam.DelAchievementClear(result.achievement_opened); MainMenuManager.Instance.UpdateUserStatusFromGlobalMenu(); }). setErrorAction((_data) => { Debug.LogError("ERROR:" + _data.m_PacketCode); CurrentMissionGroup.SetEnaleReceiveButtonAll(true); }). SendStart(); }
public void InitParam() { m_filter_type = MasterDataDefineLabel.AchievementFilterType.ALL; m_receive_type = MasterDataDefineLabel.AchievementReceiveType.NONE; }