/// <summary> /// リストの作成 /// </summary> /// <param name="periodLoginMaster"></param> public void SetUpList(LoginBonusRecordListContext item) { SetCount(item.date_count); Presents.Clear(); for (int i = 0; i < item.present_ids.Length; ++i) { int presentID = item.present_ids[i]; MasterDataPresent presentMaster = MasterDataUtil.GetPresentParamFromID((uint)presentID); LoginBonusPresentListContext present = new LoginBonusPresentListContext(); MainMenuUtil.GetPresentIcon(presentMaster, sprite => { present.IconImage = sprite; }); present.NameText = MasterDataUtil.GetPresentName(presentMaster); present.NumText = string.Format(GameTextUtil.GetText("loginbonus_amount"), MasterDataUtil.GetPresentCount(presentMaster)); present.NumRate = GameTextUtil.GetText("loginbonus_multipled"); Presents.Add(present); } // 先頭のアイテムの線を非表示にする LoginBonusPresentListContext selectItem = Presents.First(); if (selectItem != null) { selectItem.IsViewBorder = false; } PresentItemCount = Presents.Count; }
public QuestMissionContext(PacketAchievement clearAchievement) { MasterDataPresent presentData = (!clearAchievement.present_ids.IsNullOrEmpty()) ? MasterDataUtil.GetPresentParamFromID(clearAchievement.present_ids[0]) : null; if (presentData != null) { //TODO MasterDataAchievementConverted → PresentMasterCount とまとめたい fix_id = clearAchievement.fix_id; int mastercount = 1; uint presentid = clearAchievement.present_ids[0]; for (int j = 1; j < clearAchievement.present_ids.Length; j++) { if (presentid == clearAchievement.present_ids[j]) { mastercount += 1; } } int itemValue = MasterDataUtil.GetPresentCount(presentData) * mastercount; Title = clearAchievement.draw_msg; ItemName = MasterDataUtil.GetPresentName(presentData); MainMenuUtil.GetPresentIcon( presentData, sprite => { IconImage = sprite; }); IsViewCount = false; ItemValue = (itemValue > 0) ? itemValue.ToString() : ""; } }
/// <summary> /// /// </summary> /// <param name="present_ids"></param> private void setupPresent(int[] present_ids) { MasterDataPresent present = MasterDataUtil.GetPresentParamFromID((uint)present_ids[0]); m_SpriteName = string.Empty; MainMenuUtil.GetPresentIcon(present, ref m_SpriteName, (sprite) => { if (MainMenuUtil.IsWriteIcon(ref m_SpriteName, sprite)) { IconImage = sprite; } }); ItemName = MasterDataUtil.GetPresentName(present); int num = MasterDataUtil.GetPresentCount(present); int count = 0; for (int i = 0; i < present_ids.Length; i++) { if (present_ids[0] == present_ids[i]) { count++; } } ItemNum = string.Format("{0}", num * count); }
} //!< プレゼント定義:パラメータ /// <summary> /// コピー /// </summary> /// <param name="cSrc"></param> public void Copy(MasterDataPresent src) { base.Copy(src); present_type = src.present_type; present_param1 = src.present_param1; present_param2 = src.present_param2; present_param3 = src.present_param3; present_param4 = src.present_param4; present_param5 = src.present_param5; present_param6 = src.present_param6; present_param7 = src.present_param7; present_param8 = src.present_param8; present_param9 = src.present_param9; present_param10 = src.present_param10; }
public void setup(PacketStructUserScoreReward reward, int type) { Reward = reward; switch (reward.type) { case 1: ScoreLabel = GameTextUtil.GetText("scorereward_list_01"); break; case 2: ScoreLabel = GameTextUtil.GetText("scorereward_list_02"); break; } Score = string.Format(GameTextUtil.GetText("scorereward_list_03"), reward.score); RewardType = type; MasterDataPresent present = MasterDataUtil.GetPresentParamFromID((uint)reward.present_ids[0]); m_SpriteName = string.Empty; MainMenuUtil.GetPresentIcon(present, ref m_SpriteName, (sprite) => { if (MainMenuUtil.IsWriteIcon(ref m_SpriteName, sprite)) { IconImage = sprite; } }); ItemName = MasterDataUtil.GetPresentName(present); int num = MasterDataUtil.GetPresentCount(present); int count = 0; for (int i = 0; i < reward.present_ids.Length; i++) { if (reward.present_ids[0] == reward.present_ids[i]) { count++; } } ItemNum = string.Format("{0}", num * count); IsViewEventName = false; EventName = ""; }
// アイコンのSpriteを取得 private void image(PacketStructPresent presentData, System.Action <Sprite> callback) { MasterDataPresent presentMaster = new MasterDataPresent(); presentMaster.present_type = (MasterDataDefineLabel.PresentType)presentData.present_type; presentMaster.present_param1 = (int)presentData.present_value0; presentMaster.present_param2 = (int)presentData.present_value1; presentMaster.present_param3 = (int)presentData.present_value2; presentMaster.present_param4 = (int)presentData.present_value3; presentMaster.present_param5 = (int)presentData.present_value4; presentMaster.present_param6 = (int)presentData.present_value5; presentMaster.present_param7 = (int)presentData.present_value6; presentMaster.present_param8 = (int)presentData.present_value7; presentMaster.present_param9 = (int)presentData.present_value8; presentMaster.present_param10 = (int)presentData.present_value9; MainMenuUtil.GetPresentIcon(presentMaster, sprite => { callback(sprite); }); }
public void addScoreInfo(PacketStructUserScoreInfo scoreInfo, MasterDataScoreEvent scoreEventMaster) { ScoreEventContext scoreEvent = new ScoreEventContext(); //スコア情報 scoreEvent.ScoreInfo = scoreInfo; //タイトル scoreEvent.Title = scoreEventMaster.title; //期間 string timeFormat = GameTextUtil.GetText("score_time_format"); if (TimeEventManager.Instance.ChkEventActive(scoreEventMaster.event_id) == true) { //開催中 MasterDataEvent eventData = MasterDataUtil.GetMasterDataEventFromID(scoreEventMaster.event_id); DateTime startTime = TimeUtil.GetDateTime(eventData.timing_start); if (eventData.timing_end != 0) { DateTime endTime = TimeUtil.GetDateTime(eventData.timing_end); endTime = endTime.SubtractAMinute(); scoreEvent.Time = string.Format(GameTextUtil.GetText("score_period"), startTime.ToString(timeFormat), endTime.ToString(timeFormat)); } else { //終了期限なし scoreEvent.Time = string.Format(GameTextUtil.GetText("score_period_infinite"), startTime.ToString(timeFormat), ""); } scoreEvent.IsTimeEnd = false; } else { //イベント終了 if (scoreEventMaster.receiving_end != 0) { DateTime endTime = TimeUtil.GetDateTime(scoreEventMaster.receiving_end); endTime = endTime.SubtractAMinute(); string kikanFormat = GameTextUtil.GetText("Score_period_01"); scoreEvent.TimeEnd = string.Format(kikanFormat, endTime.ToString(timeFormat)); } else { scoreEvent.TimeEnd = GameTextUtil.GetText("Score_period_02"); } scoreEvent.IsTimeEnd = true; } //エリア情報 scoreEvent.AreaMessage = GameTextUtil.GetText("score_notice"); //ハイスコア scoreEvent.HiScoreLabel = GameTextUtil.GetText("score_subtitle_highscore"); scoreEvent.HiScore = string.Format(GameTextUtil.GetText("score_entity_01"), scoreInfo.hi_score); scoreEvent.HiScorePt = GameTextUtil.GetText("score_entity_02"); //累積スコア scoreEvent.TotalScoreLabel = GameTextUtil.GetText("score_subtitle_cumulative");; scoreEvent.TotalScore = string.Format(GameTextUtil.GetText("score_entity_01"), scoreInfo.total_score); scoreEvent.TotalScorePt = GameTextUtil.GetText("score_entity_02"); //報酬情報更新 updateScoreReward(scoreEvent, scoreInfo); //アイコン MasterDataPresent imagePresent = null; if (scoreEventMaster.image_present_id != 0) { imagePresent = MasterDataUtil.GetPresentParamFromID(scoreEventMaster.image_present_id); } if (imagePresent != null) { MainMenuUtil.GetPresentIcon(imagePresent, (sprite) => { scoreEvent.IconImage = sprite; }); } else { UnitIconImageProvider.Instance.Get( 1, (sprite) => { scoreEvent.IconImage = sprite; }); } scoreEvent.DidSelectItem = OnSelectItem; EventList.Add(scoreEvent); }
/// <summary> /// その他アイテムの表示 /// </summary> void OnStartOthersItem() { // 本文 List <string> mainTextList = new List <string>(); // その他の入手アイテム long[] othersIDList = UserDataAdmin.Instance.m_StructOthersPresent.serial_numbers; List <MasterDataPresent> messageList = new List <MasterDataPresent>(); List <MasterDataPresent> othersList = new List <MasterDataPresent>(); if (othersIDList != null) { for (int i = 0; i < othersIDList.Length; i++) { PacketStructPresent tmp = UserDataAdmin.Instance.SearchPresent(othersIDList[i]); MasterDataPresent presentMaster = MasterDataUtil.ConvertStructPresentToMasterData(tmp); if (presentMaster != null) { switch (presentMaster.present_type) { case MasterDataDefineLabel.PresentType.MSG: case MasterDataDefineLabel.PresentType.NOTICE: messageList.Add(presentMaster); break; default: othersList.Add(presentMaster); break; } } } } // その他の入手アイテムが1個以上ある場合は表示する if (0 < othersList.Count || 0 < MainMenuParam.m_LoginFriendPointGet) { // タイトル string othreText = string.Format(GameTextUtil.GetText("pp4q_title_3")); // プレゼントの初回表示 if (0 < othersList.Count) { // アイテム foreach (var presentMaster in othersList) { string text = string.Format(GameTextUtil.GetText("pp4q_content_2"), MasterDataUtil.GetPresentName(presentMaster), MasterDataUtil.GetPresentCount(presentMaster)); othreText += "\n" + text; } } // 運営からのお知らせ if (messageList != null && messageList.Count() > 0) { var presentMaster = messageList.First(); string text = string.Format(GameTextUtil.GetText("pp4q_content_2"), MasterDataUtil.GetPresentName(presentMaster), messageList.Count()); othreText += "\n" + text; } // 助っ人経由で入手した友情ポイント if (0 < MainMenuParam.m_LoginFriendPointGet) { // {0}人の助っ人をしました。友情ポイント×{1} string text = string.Format(GameTextUtil.GetText("pp4q_content_1"), MainMenuParam.m_LoginFriendHelpCt, //!< ログイン情報:フレンド:助っ人として助けた人数 MainMenuParam.m_LoginFriendPointGet); //!< ログイン情報:フレンド:フレンドポイント:今回取得分 othreText += "\n" + text; } mainTextList.Add(othreText); } if (mainTextList.IsNullOrEmpty() == true) { LoginBonusFSM.Instance.SendFsmNextEvent(); } else { // 本文の連結 string MainText = string.Join("\n\n", mainTextList.ToArray()); // ダイアログ設定 Dialog newDialog = Dialog.Create(DialogType.DialogScroll); newDialog.SetDialogText(DialogTextType.Title, GameTextUtil.GetText("pp4q_title_0")); newDialog.SetTextAlignment(DialogTextType.MainText, TMPro.TextAlignmentOptions.Center); newDialog.SetDialogText(DialogTextType.MainText, MainText); newDialog.SetDialogText(DialogTextType.OKText, GameTextUtil.GetText("common_button1")); newDialog.SetDialogEvent(DialogButtonEventType.OK, new System.Action(() => { LoginBonusFSM.Instance.SendFsmNextEvent(); })); // ダイアログ表示 newDialog.Show(); } }