public ProductsListItemContex( int id, MasterDataPointShopProduct product, ListItemModel model /* TODO : 機能に関するものはListItemModelに移動 */) { // ボタンID Id = id; // 販売データ Product = product; // 商品名 NameText = Product.product_name; // 販売価格 通貨単位はunity上で付与 Price = Product.price; //残り時間 if (product.timing_end > 0) { DateTime cTimeEnd = TimeUtil.GetDateTime(product.timing_end); TimeSpan cCountDown = cTimeEnd - TimeManager.Instance.m_TimeNow; BalloonMessageText = GameTextUtil.GetRemainStr(cCountDown, GameTextUtil.GetText("general_time_02")); } // アイコン設定 this.image(sprite => { IconImage = sprite; }); m_model = model; }
private void updateEpsodeTime(EpisodeDataContext newEpisode, MasterDataArea area) { //残り時間計算 newEpisode.Time = ""; if (area.event_id != 0) { uint unTimingEnd = MainMenuUtil.GetEventTimingEnd(area.event_id); if (unTimingEnd != 0) { DateTime endTime = TimeUtil.GetDateTime(unTimingEnd); DateTime nowTime = TimeManager.Instance.m_TimeNow; TimeSpan leftTime = endTime - nowTime; newEpisode.Time = GameTextUtil.GetRemainStr(leftTime, GameTextUtil.GetText("general_time_01")); } } }
public DialogTipItem(StoreProduct _product, DialogButtonEventType _type) { InitParam(); product = _product; Stone_num = string.Format(GameTextUtil.GetText("sh119q_content3"), _product.product_num); Stone_price = _product.product_price_format; Event_active = false; if (_product.event_text != null && _product.event_text != "") { // 作成したテキストを連結したものを表示する string eventText = string.Format(_product.event_text, GameTextUtil.GetRemainStr(_product.remaining_time, GameTextUtil.GetText("general_time_01")), string.Format("残り{0}回", _product.event_chip_count)); Event_msg = eventText; Event_active = true; } Caption_active = false; if (_product.event_caption != null && _product.event_caption != "") { Caption_msg = _product.event_caption; Caption_active = true; } buttonType = _type; }
private void sendMissionGet(System.Action callback = null) { m_QuestDetailMission.MissionList.Clear(); ServerDataUtilSend.SendPacketAPI_GetMasterDataAchievement(4, 0, 0, MainMenuParam.m_QuestSelectMissionID) .setSuccessAction(_data => { RecvMasterDataAchievementValue _result = _data.GetResult <RecvMasterDataAchievement>().result; MasterDataAchievementConverted[] achievementArray = _result.master_array_achievement; // 未達成と達成済みを分ける List <MasterDataAchievementConverted> notAchievedList = new List <MasterDataAchievementConverted>(); List <MasterDataAchievementConverted> achievedList = new List <MasterDataAchievementConverted>(); for (int i = 0; i < achievementArray.Length; ++i) { if (achievementArray[i].IsState_Achieve) { achievedList.Add(achievementArray[i]); } else { notAchievedList.Add(achievementArray[i]); } } // 未達成と達成済みを結合する notAchievedList.AddRange(achievedList); achievementArray = notAchievedList.ToArray(); int clearCount = 0; for (int i = 0; i < achievementArray.Length; i++) { MasterDataAchievementConverted _master = achievementArray[i]; QuestMissionContext newMission = new QuestMissionContext(); newMission.Title = _master.draw_msg; newMission.ItemName = _master.PresentName; newMission.Count = (int)_master.ProgressCount; newMission.CountMax = (int)_master.TotalCount; _master.GetPresentIcon(sprite => { newMission.IconImage = sprite; }); newMission.IsActiveLeftTime = false; newMission.ItemValue = (_master.PresentCount > 0) ? _master.PresentCount.ToString() : ""; if (_master.event_id != 0) { uint unTimingEnd = MainMenuUtil.GetEventTimingEnd(_master.event_id); if (unTimingEnd != 0) { DateTime endTime = TimeUtil.GetDateTime(unTimingEnd); DateTime nowTime = TimeManager.Instance.m_TimeNow; TimeSpan leftTime = endTime - nowTime; newMission.LeftValue = GameTextUtil.GetRemainStr(leftTime, GameTextUtil.GetText("general_time_01")); newMission.IsActiveLeftTime = true; } } if (_master.IsState_Achieve) { newMission.Count = newMission.CountMax; clearCount++; } m_QuestDetailMission.MissionList.Add(newMission); } m_QuestDetailMission.Count = clearCount; m_QuestDetailMission.CountMax = achievementArray.Length; if (callback != null) { callback(); } }) .setErrorAction(_data => { if (callback != null) { callback(); } }) .SendStart(); }