// 詳細ボタンのフィードバック public void OnClickedRecordButton(EventRecordListItemContex context) { // 詳細画面の表示 CreateDetailView(context); SoundUtil.PlaySE(SEID.SE_MENU_OK); }
private void closeDialog() { if (m_Dialog == null) { return; } //-------------------------------------- // 予約アイコンの更新 //-------------------------------------- EventScheduleDialog dialog = m_Dialog.GetComponent <EventScheduleDialog>(); if (dialog != null) { if (dialog.IsFuture) { EventRecordListItemContex item = Records1.Find((x) => x.FixId == dialog.FixId); if (item != null) { item.IsReserveBadge = dialog.IsOnNotif; } } } DestroyObject(m_Dialog); m_Dialog = null; IsViewContents = true; }
// 確認ダイアログボックス表示 private EventScheduleDialog CreateDetailView(EventRecordListItemContex contex) { m_Dialog = Instantiate(DialogInfo) as GameObject; m_Dialog.transform.SetParent(DialogInfoRoot.transform, false); bool future = (m_Category == Category.Furture) ? true : false; EventScheduleDialog eventDialog = m_Dialog.GetComponent <EventScheduleDialog>(); eventDialog.Create(contex, future); IsViewContents = false; return(eventDialog); }
// ダイアログの初期化 public void Create(EventRecordListItemContex contex, bool _future) { EventId = contex.EventId; FixId = contex.FixId; IsFuture = _future; QuestType = contex.questType; if (IsFuture) { LocalSaveEventNotification cEventNotification = LocalSaveManager.Instance.CheckFuncNotificationRequest((uint)FixId); if (cEventNotification != null) { IsOnNotif = cEventNotification.m_Push; } } MasterDataEvent eventMaster = MasterFinder <MasterDataEvent> .Instance.Find(FixId); if (eventMaster == null) { #if BUILD_TYPE_DEBUG Debug.LogError("Eventがみつかりません fix_id: " + FixId); #endif return; } // テキスト Title0 = "開催期間"; Title1 = eventMaster.head_titel_1; Title2 = eventMaster.head_titel_2; OverviewText = eventMaster.head_text; //サイクルタイプで終了が設定されていない場合、規定文字列を表示 if (eventMaster.period_type == MasterDataDefineLabel.PeriodType.CYCLE && eventMaster.timing_end == 0) { DateText = GameTextUtil.GetText("schedule_text"); } else { DateText = string.Format("{0}~{1}", EventSchedule.TimingFormat(eventMaster.timing_start), ((eventMaster.timing_end != 0 ? EventSchedule.TimingFormat(eventMaster.timing_end, true) : ""))); // イベント開催~終了まで } // メインイメージを読み込み MainImage = null; string bannerUrl = eventMaster.banner_img_url; if (bannerUrl.IsNullOrEmpty() == false) { bannerUrl = GlobalDefine.GetEventScheduleBannerUrl() + bannerUrl; WebResource.Instance.GetSprite(bannerUrl, (Sprite sprite) => { MainImage = sprite; }, () => { }); } // 通知情報 var notification = MasterDataUtil.GetMasterDataNotification(eventMaster.fix_id, ServerDataDefine.NOTIFICATION_TYPE.EVENT); if (notification == null) { notificationTitle = null; notificationBody = null; notificationdelay = 0; } else { notificationTitle = notification.notification_title; notificationBody = notification.notification_body; var delay = TimeUtil.GetDateTime(notification.timing_start) - TimeManager.Instance.m_TimeNow; notificationdelay = delay.Milliseconds; } // デバッグ用 //OverviewText += "\n"; // エリア情報 AreaId = (uint)eventMaster.area_id; var areaMaster = MasterFinder <MasterDataArea> .Instance.FindAll(); var areaCateId = areaMaster.Where(x => x.fix_id == AreaId).Select(x => x.area_cate_id).ToList(); AreaCateId = areaCateId.Count() != 0 ? areaCateId[0] : 0; List <uint> bossUnits = new List <uint>(); switch (QuestType) { case MasterDataDefineLabel.QuestType.NORMAL: { var questMaster = MasterFinder <MasterDataQuest2> .Instance.FindAll(); bossUnits = questMaster.Where(x => x.area_id == AreaId).Select(x => x.boss_chara_id).ToList(); } break; case MasterDataDefineLabel.QuestType.CHALLENGE: { var challengeMaster = MasterFinder <MasterDataChallengeQuest> .Instance.FindAll(); bossUnits = challengeMaster.Where(x => x.area_id == AreaId).Select(x => x.boss_chara_id).ToList(); } break; default: break; } // ゲリラボスユニット(複数) var guerrillaUnits = new List <uint>(); var area_id_list = new int[] { (int)AreaId }; var serverApi = ServerDataUtilSend.SendPacketAPI_GetGuerrillaBossInfo(area_id_list); // ゲリラボスユニット取得成功時の振る舞い serverApi.setSuccessAction(_data => { var guerrilla = _data.GetResult <ServerDataDefine.RecvGetGuerrillaBossInfo>().result.guerrilla_boss_list; if (guerrilla != null) { for (int i = 0; i < guerrilla.Length; i++) { for (int j = 0; j < guerrilla[i].boss_id_list.Length; j++) { guerrillaUnits.Add((uint)guerrilla[i].boss_id_list[j]); } } } // 出現ユニット List <uint> units = new List <uint>(); // ボス・ゲリラボスIDの結合 units.AddRange(bossUnits); units.AddRange(guerrillaUnits); // ソート units.Sort(); // 重複を削除 List <uint> unique = units.Distinct().ToList(); // バトルが無いクエストはユニットが出現しないので削除(設定:UnitID=0) unique.RemoveAll(x => x == 0); // 該当ユニットの追加 for (int i = 0; i < unique.Count; i++) { var icon = new CircleButtonListItemContex(i, unique[i]); icon.IsEnableSelect = false; Icons.Add(icon); // デバッグ用 //OverviewText += i + ":" + "出現ユニットID[" + unique[i] + "]" + "\n"; // レイアウト再構成 m_LastUpdateCount = 5; } }); // SendStartの失敗時の振る舞い serverApi.setErrorAction(_date => { #if BUILD_TYPE_DEBUG Debug.Log("MASTER_HASH_GET:Error"); #endif }); // ゲリラボス取得API serverApi.SendStart(); }
/// <summary> /// レコードの追加 /// </summary> private void AddRecord(Category category, EventScheduleInfo data) { var contex = new EventRecordListItemContex(); contex.FixId = (int)data.m_MasterDataEvent.fix_id; contex.EventId = (int)data.m_MasterDataEvent.event_id; // アイコンイメージの設定 //クエスト情報 contex.questType = MasterDataDefineLabel.QuestType.NONE; //通常クエスト MasterDataQuest2 lastQuestMaster = MasterFinder <MasterDataQuest2> .Instance.SelectFirstWhere("where area_id = ? AND boss_chara_id > 0 AND story = 0 ORDER BY fix_id DESC" , data.m_MasterDataEvent.area_id); if (lastQuestMaster != null) { contex.questType = MasterDataDefineLabel.QuestType.NORMAL; } else { //成長ボスクエスト lastQuestMaster = MasterFinder <MasterDataChallengeQuest> .Instance.SelectFirstWhere("where area_id = ? AND boss_chara_id > 0 AND story = 0 ORDER BY fix_id DESC" , data.m_MasterDataEvent.area_id); if (lastQuestMaster != null) { contex.questType = MasterDataDefineLabel.QuestType.CHALLENGE; //タイトル差し替え setupChallengeTitle(data); } } if (lastQuestMaster == null) { // ボスが居ない場合の画像 contex.IconImage = ResourceManager.Instance.Load("divine1", ResourceType.Common); #if BUILD_TYPE_DEBUG DialogManager.Open1B_Direct("EventSchedule AddRecord", "renew_quest_masterのarea_idに下記の\nidが含まれていません。\nプランナーさんに画面を見せるか\n画面キャプチャーして報告してください。\n\n" + "area_id: " + data.m_MasterDataEvent.area_id, "common_button7", true, true). SetOkEvent(() => { }); #endif Debug.LogError("[none x.boss_chara_id > 0]: " + data.m_MasterDataEvent.area_id); } else { UnitIconImageProvider.Instance.Get( lastQuestMaster.boss_chara_id, sprite => { contex.IconImage = sprite; }); } // 予約済みアイコンの設定 if (category == Category.Furture) { LocalSaveEventNotification cEventNotification = LocalSaveManager.Instance.CheckFuncNotificationRequest((uint)data.m_MasterDataEvent.fix_id); if (cEventNotification != null) { contex.IsReserveBadge = cEventNotification.m_Push; } } // タイトル(エリア名称)表示 contex.CaptionText01 = data.m_AreaName; // 枠色変更 contex.IconColor = this.IconColor[(int)category]; contex.FrameColor = this.FrameColor[(int)category]; // ボタン挙動 contex.DidSelectItem += OnClickedRecordButton; // レコードの追加先の指定 switch (category) { case Category.Active: // 日付表示 contex.CaptionText02 = data.m_MasterDataEvent.timing_end != 0 ? string.Format(GameTextUtil.GetText("schedule_held_text"), TimingFormat(data.m_MasterDataEvent.timing_end, true)) : ""; Records0.Add(contex); break; case Category.Furture: contex.CaptionText02 = data.m_MasterDataEvent.timing_start != 0 ? string.Format(GameTextUtil.GetText("schedule_plans_text"), TimingFormat(data.m_MasterDataEvent.timing_start)) : ""; Records1.Add(contex); break; default: return; } }
public void PostSceneStart() { AndroidBackKeyManager.Instance.StackPush(gameObject, OnClickedBackButton); // ナビゲーションバー ScheduleTab1 = GameTextUtil.GetText("schedule_tab1"); ScheduleTab2 = GameTextUtil.GetText("schedule_tab2"); EmptyLabel = GameTextUtil.GetText("common_not_list"); IsViewContents = true; //--------------------------------------------- // 開催中レコード //--------------------------------------------- Records0.Clear(); List <EventScheduleInfo> activeEventInfoList = GetEvetntItemList(Category.Active); activeEventInfoList.Sort(SortExec); foreach (EventScheduleInfo item in activeEventInfoList) { AddRecord(Category.Active, item); } RecordCount0 = Records0.Count; //--------------------------------------------- // 開催予定レコード //--------------------------------------------- Records1.Clear(); List <EventScheduleInfo> furtureEventInfoList = GetEvetntItemList(Category.Furture); furtureEventInfoList.Sort(SortExec); foreach (EventScheduleInfo item in furtureEventInfoList) { AddRecord(Category.Furture, item); } RecordCount1 = Records1.Count; //--------------------------------------------- // データがある場合は詳細ダイアログを表示する //--------------------------------------------- if (MainMenuParam.m_DialogEventScheduleData != null) { EventRecordListItemContex record = Records0.Find((v) => v.FixId == MainMenuParam.m_DialogEventScheduleData.fix_id); if (record != null) { EventScheduleDialog eventDialog = CreateDetailView(record); eventDialog.IsViewJumpButton = false; } else { #if BUILD_TYPE_DEBUG string messageText = "イベントがありませんでした。\nMasterDataEvent::fix_id:" + MainMenuParam.m_DialogEventScheduleData.fix_id; Dialog dloalog = DialogManager.Open1B_Direct("デバッグ ダイアログ", messageText, "common_button7", true, true) .SetOkEvent(() => { }); #endif } MainMenuParam.m_DialogEventScheduleData = null; } }