메일 보상 받을 때 상점 아이템인 지 확인
This commit is contained in:
parent
8cc3cd0424
commit
63201604d9
|
|
@ -88,7 +88,7 @@ messageinfo 엄청 느린 버그
|
||||||
상점
|
상점
|
||||||
- 인앱 결제
|
- 인앱 결제
|
||||||
- 상품 ui 등...
|
- 상품 ui 등...
|
||||||
- 메일 보상 받을 때 상점 아이템인 지 확인
|
// - 메일 보상 받을 때 상점 아이템인 지 확인
|
||||||
// - 인앱 구매 플레이팹 연동 등
|
// - 인앱 구매 플레이팹 연동 등
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ public class table_shopitemlist : table_missionbase
|
||||||
{
|
{
|
||||||
public static table_shopitemlist Ins;
|
public static table_shopitemlist Ins;
|
||||||
List<ShopItemListTableData> tableDatas;
|
List<ShopItemListTableData> tableDatas;
|
||||||
|
Dictionary<int, ShopItemListTableData> dic_shopdata = new Dictionary<int, ShopItemListTableData>();
|
||||||
Dictionary<(int, int), List<ShopItemListTableData>> dic_shop = new Dictionary<(int, int), List<ShopItemListTableData>>();
|
Dictionary<(int, int), List<ShopItemListTableData>> dic_shop = new Dictionary<(int, int), List<ShopItemListTableData>>();
|
||||||
List<ShopItemListTableData> list_ad = new List<ShopItemListTableData>();
|
List<ShopItemListTableData> list_ad = new List<ShopItemListTableData>();
|
||||||
List<ShopItemListTableData> list_day = new List<ShopItemListTableData>();
|
List<ShopItemListTableData> list_day = new List<ShopItemListTableData>();
|
||||||
|
|
@ -129,6 +130,7 @@ public class table_shopitemlist : table_missionbase
|
||||||
for (int i = 0; i < Get_DataList().Count; i++)
|
for (int i = 0; i < Get_DataList().Count; i++)
|
||||||
{
|
{
|
||||||
var temp = Get_DataList()[i];
|
var temp = Get_DataList()[i];
|
||||||
|
dic_shopdata.Add(temp.n_ShopItemID, temp);
|
||||||
if (!dic_shop.ContainsKey((temp.n_ShopTab, temp.n_ShopSubTab)))
|
if (!dic_shop.ContainsKey((temp.n_ShopTab, temp.n_ShopSubTab)))
|
||||||
dic_shop.Add((temp.n_ShopTab, temp.n_ShopSubTab), new List<ShopItemListTableData>());
|
dic_shop.Add((temp.n_ShopTab, temp.n_ShopSubTab), new List<ShopItemListTableData>());
|
||||||
dic_shop[(temp.n_ShopTab, temp.n_ShopSubTab)].Add(temp);
|
dic_shop[(temp.n_ShopTab, temp.n_ShopSubTab)].Add(temp);
|
||||||
|
|
@ -166,7 +168,8 @@ public class table_shopitemlist : table_missionbase
|
||||||
}
|
}
|
||||||
public static Action Login;
|
public static Action Login;
|
||||||
|
|
||||||
public ShopItemListTableData Get_Data(int maintab, int subtab = 0) { return dic_shop[(maintab, subtab)][0]; }
|
public ShopItemListTableData Get_Data(int maintab, int subtab) { return dic_shop[(maintab, subtab)][0]; }
|
||||||
|
public ShopItemListTableData Get_Data(int id) { return dic_shopdata[id]; }
|
||||||
public List<ShopItemListTableData> Get_DataList() { return tableDatas; }
|
public List<ShopItemListTableData> Get_DataList() { return tableDatas; }
|
||||||
public List<ShopItemListTableData> Get_DataList(int maintab, int subtab) { return dic_shop[(maintab, subtab)]; }
|
public List<ShopItemListTableData> Get_DataList(int maintab, int subtab) { return dic_shop[(maintab, subtab)]; }
|
||||||
public List<ShopItemListTableData> Get_DataList_AD() { return list_ad; }
|
public List<ShopItemListTableData> Get_DataList_AD() { return list_ad; }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
|
@ -50,9 +51,8 @@ public class MailCard : CardBase
|
||||||
ToastUI.Ins.Set(144);
|
ToastUI.Ins.Set(144);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// TODO 정인호 : 상점 패키지 확인 필요
|
var lst = MailUI.Ins.Get_MailReward(new List<ItemSimpleData> { new ItemSimpleData { itemid = id, amount = amount } });
|
||||||
sinfo.m_ServerData.Add_Item(id, amount);
|
sinfo.Write(() => { ObtainItemUI.Ins.Set(lst); });
|
||||||
sinfo.Write(() => { ObtainItemUI.Ins.Set(new ItemSimpleData { itemid = id, amount = amount }); });
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
MailUI.Ins.Del_Mail(m_ServerMailData);
|
MailUI.Ins.Del_Mail(m_ServerMailData);
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ public class MailUI : MonoBehaviourSingletonuScrollViewMgr<MailUI>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obtainlist = Get_MailReward(obtainlist);
|
||||||
|
|
||||||
ServerInfo.Ins.Write(() =>
|
ServerInfo.Ins.Write(() =>
|
||||||
{
|
{
|
||||||
if (obtainlist.Count > 0) ObtainItemUI.Ins.Set(obtainlist);
|
if (obtainlist.Count > 0) ObtainItemUI.Ins.Set(obtainlist);
|
||||||
|
|
@ -68,6 +70,31 @@ public class MailUI : MonoBehaviourSingletonuScrollViewMgr<MailUI>
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ItemSimpleData> Get_MailReward(List<ItemSimpleData> rewards)
|
||||||
|
{
|
||||||
|
var obtainlist = new List<ItemSimpleData>();
|
||||||
|
for (int i = 0; i < rewards.Count; i++)
|
||||||
|
{
|
||||||
|
var temp = rewards[i];
|
||||||
|
var itemdata = table_itemlist.Ins.Get_Data(temp.itemid);
|
||||||
|
if (itemdata.e_ItemType == eItem.Shop)
|
||||||
|
{
|
||||||
|
var shopdata = table_shopitemlist.Ins.Get_Data(temp.itemid);
|
||||||
|
var bag = table_randombag.Ins.Get_DataList(shopdata.n_RandomBagID);
|
||||||
|
for (int j = 0; j < bag.Count; j++)
|
||||||
|
obtainlist.Add(new ItemSimpleData { itemid = bag[j].n_ItemId, amount = bag[j].n_DropCount });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
obtainlist.Add(new ItemSimpleData { itemid = temp.itemid, amount = temp.amount });
|
||||||
|
}
|
||||||
|
|
||||||
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||||||
|
for (int i = 0; i < obtainlist.Count; i++)
|
||||||
|
sdata.Add_Item(obtainlist[i].itemid, obtainlist[i].amount);
|
||||||
|
|
||||||
|
return obtainlist;
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnClick_Back()
|
public override void OnClick_Back()
|
||||||
{
|
{
|
||||||
Del_BackKey();
|
Del_BackKey();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class ShopUI : BotMenuBase
|
||||||
//for (int i = 0; i < shopContents.Length; i++) shopContents[i].gameObject.SetActive(false);
|
//for (int i = 0; i < shopContents.Length; i++) shopContents[i].gameObject.SetActive(false);
|
||||||
|
|
||||||
var mainIndex = Tab_Main.Get_Index();
|
var mainIndex = Tab_Main.Get_Index();
|
||||||
var mainshopdata = table_shopitemlist.Ins.Get_Data(mainIndex);
|
var mainshopdata = table_shopitemlist.Ins.Get_Data(mainIndex, 0);
|
||||||
//shopContents[mainIndex].Set(mainIndex, Tab_Sub.Get_Index());
|
//shopContents[mainIndex].Set(mainIndex, Tab_Sub.Get_Index());
|
||||||
shopContents.Set(mainIndex, Tab_Sub.Get_Index());
|
shopContents.Set(mainIndex, Tab_Sub.Get_Index());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue