2024-12-15 01:39:39 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
|
|
public class FarmInvenUI : BotMenuBase
|
|
|
|
|
{
|
|
|
|
|
public static FarmInvenUI Ins;
|
2025-07-22 06:43:35 +00:00
|
|
|
private void Start() { Ins = this; m_FarmInvenCard.Set_CardType(eUICardType.NoTouch); }
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
public ArrowUI m_ArrowUI;
|
2025-07-22 06:43:35 +00:00
|
|
|
public TextMeshProUGUI[] texts; // 0 이름, 1 설명, 2 스탯 증가량, 3 먹은 갯수
|
|
|
|
|
public FarmInvenCard m_FarmInvenCard;
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
FarmInvenCard SelectCard;
|
|
|
|
|
List<int> list_fruit = new List<int>();
|
|
|
|
|
|
|
|
|
|
public override void Set()
|
|
|
|
|
{
|
|
|
|
|
base.Set();
|
|
|
|
|
if (list_fruit.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_STR"));
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_DEX"));
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_INT"));
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_LUK"));
|
2025-04-29 01:04:24 +00:00
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_ALL"));
|
2024-12-15 01:39:39 +00:00
|
|
|
}
|
|
|
|
|
Set_ScrollView(list_fruit);
|
|
|
|
|
|
|
|
|
|
Set_SelectCard(DSUtil.CheckNull(SelectCard) ? list_CardBase[0] as FarmInvenCard : SelectCard);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Set_SelectCard(FarmInvenCard card)
|
|
|
|
|
{
|
|
|
|
|
if (!DSUtil.CheckNull(SelectCard))
|
2025-07-22 06:43:35 +00:00
|
|
|
SelectCard.Set_Selected(false);
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
SelectCard = card;
|
2025-07-22 06:43:35 +00:00
|
|
|
SelectCard.Set_Selected(true);
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
var id = SelectCard.Get_FruitID();
|
|
|
|
|
var itemData = table_itemlist.Ins.Get_Data(id);
|
|
|
|
|
var amount = (int)sdata.Get_ItemAmount(id);
|
|
|
|
|
|
2025-07-22 06:43:35 +00:00
|
|
|
m_FarmInvenCard.Set(itemData.n_ItemID);
|
2024-12-22 01:07:25 +00:00
|
|
|
texts[0].text = table_itemlist.Ins.Get_ItemName(itemData.n_ItemID);
|
|
|
|
|
texts[1].text = table_itemlist.Ins.Get_ItemDesc(itemData.n_ItemID);
|
2024-12-15 01:39:39 +00:00
|
|
|
texts[2].text = table_fruit.Ins.Get_Data_orNull(id).Get_Desc();
|
2025-07-22 06:43:35 +00:00
|
|
|
texts[3].text = $"(확인용)먹은 갯수 : {sdata.Get_EatFruitCount(id)}";
|
2024-12-15 01:39:39 +00:00
|
|
|
|
|
|
|
|
m_ArrowUI.Set(totalcount => { }, amount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnClick_Eat()
|
|
|
|
|
{
|
|
|
|
|
if (m_ArrowUI.Get_TotalCount() > 0)
|
|
|
|
|
{
|
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
var id = SelectCard.Get_FruitID();
|
|
|
|
|
sdata.Use_Item(id, m_ArrowUI.Get_TotalCount());
|
|
|
|
|
sdata.Add_EatFruitCount(id, m_ArrowUI.Get_TotalCount());
|
|
|
|
|
Set();
|
|
|
|
|
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|