public void UpdateStoreLootFree() { if (m_store_loot_info == null || m_store_loot_info.infos == null) { return; } StoreInfo store_info = StoreInfoManager.Instance.GetInfoByID("Loot"); foreach (var store_loot_info in m_store_loot_info.infos) { StoreLootItem item = store_info.m_LootItem.Find(l => l.ID == store_loot_info.loot_id); if (item != null && item.refresh_free > 0) { if (item.refresh_count == 0) { Network.Instance.NotifyMenu.is_store_free_loot = store_loot_info.available_time <= Network.Instance.ServerTime; } else { Network.Instance.NotifyMenu.is_store_free_loot = Network.DailyIndex != store_loot_info.daily_index || (store_loot_info.available_count > 0 && store_loot_info.available_time <= Network.Instance.ServerTime); } } if (Network.Instance.NotifyMenu.is_store_free_loot) { return; } } }
public void InitStoreItem(StoreLootItem item) { Clear(); if (item.LootCount < 1) { m_count.gameObject.SetActive(false); } m_IconStore.gameObject.SetActive(true); m_count.text = item.LootCount.ToString(); m_IconStore.spriteName = item.Image; }
public StoreConfirmParam(StoreLootItem item, OnOkDeleage _del = null, bool is_free = false) { title = item.Name; icon_id = item.IconID; if (is_free) { price = 0; } else { price = item.Price.goods_value; } message = Localization.Get("StorePurchaseMessage"); loot_item = item; OnOk = _del; }
public void Init(StoreLootItem item, pd_StoreLootInfo loot_info) { m_ItemLoot = item; gameObject.SetActive(true); m_Event.SetActive(false); m_Bonus.SetActive(false); m_SpriteStoreItem.spriteName = item.Image; m_ItemName.text = item.Name; m_NeedTicket.SetActive(false); m_UseIcon.spriteName = item.Price.goods_type.ToString(); m_Price.text = Localization.Format("GoodsFormat", item.Price.goods_value); bool bFree = false; if (item.refresh_count > 0) { m_StoreLootInfo = loot_info; if (m_StoreLootInfo == null) { m_StoreLootInfo = new pd_StoreLootInfo(); m_StoreLootInfo.daily_index = Network.DailyIndex; m_StoreLootInfo.weekly_index = Network.WeeklyIndex; m_StoreLootInfo.available_count = item.refresh_count; m_StoreLootInfo.available_time = DateTime.MinValue; } if (m_StoreLootInfo.daily_index != Network.DailyIndex || m_StoreLootInfo.available_count > 0 && m_StoreLootInfo.available_time <= Network.Instance.ServerTime) { bFree = true; if (m_StoreLootInfo.daily_index != Network.DailyIndex) { if (m_StoreLootInfo.available_time > Network.Instance.ServerTime) { bFree = false; } else { m_StoreLootInfo.daily_index = Network.DailyIndex; m_StoreLootInfo.weekly_index = Network.WeeklyIndex; m_StoreLootInfo.available_count = item.refresh_count; m_StoreLootInfo.available_time = DateTime.MinValue; } } m_LabelNeedTicket.text = Localization.Format("StoreFreeLimit", item.refresh_count, m_StoreLootInfo.available_count); } m_NeedTicket.SetActive(true); } else if (item.refresh_free > 0) { m_StoreLootInfo = loot_info; if (m_StoreLootInfo == null) { m_StoreLootInfo = new pd_StoreLootInfo(); m_StoreLootInfo.daily_index = Network.DailyIndex; m_StoreLootInfo.weekly_index = Network.WeeklyIndex; m_StoreLootInfo.available_count = item.refresh_count; m_StoreLootInfo.available_time = DateTime.MinValue; } if (m_StoreLootInfo.available_time <= Network.Instance.ServerTime) { bFree = true; } m_NeedTicket.SetActive(!bFree); } m_LabelDescTop.text = item.DescTop; m_LabelDescTop.gameObject.SetActive(item.DescTop != ""); if (item.DescBottom != "") { m_LabelNeedTicket.text = item.DescBottom; m_NeedTicket.SetActive(true); } m_Free.SetActive(bFree); m_Normal.SetActive(!bFree); Network.Instance.NotifyMenu.is_store_free_loot |= bFree; }