资源目录调整

This commit is contained in:
2025-11-23 10:46:34 +08:00
parent 4ac44848aa
commit 523c9550fe
60 changed files with 2449 additions and 408 deletions

View File

@@ -9,11 +9,6 @@ using UIPanel = NBC.UIPanel;
namespace NBF
{
public class ShopGearData
{
public string title;
}
public partial class FishingShopPanel : UIPanel
{
protected override void OnInit()
@@ -22,33 +17,33 @@ namespace NBF
this.AutoAddClick(OnClick);
IsShowCursor = true;
List<TabItemData> tabItemList = new List<TabItemData>();
for (int i = 0; i < 10; i++)
{
TabItemData tabItem = new TabItemData();
tabItem.Key = $"Tab_{i}";
for (int j = 0; j < 5; j++)
{
TabItemData tabSubItem = new TabItemData();
tabSubItem.Key = $"SubTab_{j}";
var count = Random.Range(2, 5);
for (int k = 0; k < count; k++)
{
var item = new ShopGearData
{
title = $"Item:{i}-{j}-{k}"
};
tabSubItem.Items.Add(item);
}
tabItem.Children.Add(tabSubItem);
}
tabItemList.Add(tabItem);
}
ItemList.SetPanel(this);
ItemList.SetData(tabItemList, true, true);
// List<TabItemData> tabItemList = new List<TabItemData>();
// for (int i = 0; i < 10; i++)
// {
// TabItemData tabItem = new TabItemData();
// tabItem.Key = $"Tab_{i}";
// for (int j = 0; j < 5; j++)
// {
// TabItemData tabSubItem = new TabItemData();
// tabSubItem.Key = $"SubTab_{j}";
// var count = Random.Range(2, 5);
// for (int k = 0; k < count; k++)
// {
// var item = new ShopGearData
// {
// title = $"Item:{i}-{j}-{k}"
// };
// tabSubItem.Items.Add(item);
// }
//
// tabItem.Children.Add(tabSubItem);
// }
//
// tabItemList.Add(tabItem);
// }
//
// ItemList.SetPanel(this);
// ItemList.SetData(tabItemList, true, true);
}
protected override void OnShow()
@@ -65,8 +60,8 @@ namespace NBF
private void OnClickItem(object item)
{
if (item is not ShopGearItem shopGearItem) return;
Log.Info($"click item ={shopGearItem.GearData.title}");
if (item is not ShopItem shopGearItem) return;
// Log.Info($"click item ={shopGearItem.GearData.title}");
}
private void OnClick(GComponent btn)

View File

@@ -7,19 +7,25 @@ using NBC;
namespace NBF
{
public partial class ShopGearItem
public partial class ShopItem
{
public const string URL = "ui://hxr7rc7poome9";
public GImage back;
public GImage ba;
public GImage Quality;
public GTextField TextCoin;
public GLoader CoinIcon;
public GTextField TextCoin_2;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
back = (GImage)GetChild("back");
ba = (GImage)GetChild("ba");
Quality = (GImage)GetChild("Quality");
TextCoin = (GTextField)GetChild("TextCoin");
CoinIcon = (GLoader)GetChild("CoinIcon");
TextCoin_2 = (GTextField)GetChild("TextCoin");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}

View File

@@ -6,18 +6,18 @@ using NBC;
namespace NBF
{
public partial class ShopGearItem : ListItemBase
public partial class ShopItem : ListItemBase
{
public ShopGearData GearData;
// public ShopGearData GearData;
private void OnInited()
{
}
protected override void OnSetData(object showData)
{
GearData = showData as ShopGearData;
if(GearData == null) return;
title = GearData.title;
// GearData = showData as ShopGearData;
// if(GearData == null) return;
// title = GearData.title;
}
}
}