客户端代码修改提交
This commit is contained in:
27
Assets/Scripts/UI/Bag/BagItem.Designer.cs
generated
Normal file
27
Assets/Scripts/UI/Bag/BagItem.Designer.cs
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class BagItem
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7puq3a1h";
|
||||
|
||||
public GImage back;
|
||||
public GImage ba;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
back = (GImage)GetChild("back");
|
||||
ba = (GImage)GetChild("ba");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/BagItem.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/BagItem.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3fa85a75ea9865f438ee246e23aefc66
|
||||
15
Assets/Scripts/UI/Bag/BagItem.cs
Normal file
15
Assets/Scripts/UI/Bag/BagItem.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class BagItem : GButton
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/BagItem.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/BagItem.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23a4348047aba5743b09c9d65e404a93
|
||||
@@ -1,7 +1,9 @@
|
||||
// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NBC;
|
||||
using NBF.Fishing2;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -16,6 +18,24 @@ namespace NBF
|
||||
{
|
||||
Game.Input.OnUICanceled += OnUICanceled;
|
||||
UseBottomMenu();
|
||||
|
||||
List<TabItemData> tabItemList = new List<TabItemData>();
|
||||
var role = App.Main.GetComponent<Role>();
|
||||
var roleBag = role.GetComponent<RoleBag>();
|
||||
|
||||
var dic = roleBag.GetItemsByType();
|
||||
foreach (var (type, list) in dic)
|
||||
{
|
||||
TabItemData tabItem = new TabItemData
|
||||
{
|
||||
Key = type.ToString()
|
||||
};
|
||||
tabItem.Items.AddRange(list);
|
||||
tabItemList.Add(tabItem);
|
||||
}
|
||||
|
||||
ItemList.SetPanel(this);
|
||||
ItemList.SetData(tabItemList, true, true);
|
||||
}
|
||||
|
||||
private void OnUICanceled(string action)
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace NBF
|
||||
UIObjectFactory.SetPackageItemExtension(HomeStatisticsPage.URL, typeof(HomeStatisticsPage));
|
||||
UIObjectFactory.SetPackageItemExtension(HomeButtonGroups.URL, typeof(HomeButtonGroups));
|
||||
UIObjectFactory.SetPackageItemExtension(ChatItem.URL, typeof(ChatItem));
|
||||
UIObjectFactory.SetPackageItemExtension(BagItem.URL, typeof(BagItem));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,5 +69,18 @@ namespace NBF
|
||||
// 去重处理(基于引用相等,如果需要基于内容去重需要重写Equals方法)
|
||||
return allItems.Distinct().ToList();
|
||||
}
|
||||
|
||||
public static void TabItemDataAddListTitle(this TabItemData tabItem)
|
||||
{
|
||||
if (tabItem.Items == null || tabItem.Items.Count < 1) return;
|
||||
var hasListTitle = tabItem.Items.OfType<ClassifyListTitleData>().Any();
|
||||
if (!hasListTitle)
|
||||
{
|
||||
tabItem.Items.Insert(0, new ClassifyListTitleData()
|
||||
{
|
||||
Title = tabItem.Key
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,11 @@ namespace NBF
|
||||
if (obj is ListItemBase item)
|
||||
{
|
||||
item.SetData(itemData);
|
||||
obj.SetSize(350, 300);
|
||||
// obj.SetSize(350, 300);
|
||||
}
|
||||
else if (obj is BagItem bagItem)
|
||||
{
|
||||
// obj.SetSize(350, 300);
|
||||
}
|
||||
else if (obj is ListTitleItem titleItem)
|
||||
{
|
||||
@@ -120,6 +124,10 @@ namespace NBF
|
||||
return ShopGearItem.URL;
|
||||
}
|
||||
|
||||
if (itemData is ItemInfo itemInfo)
|
||||
{
|
||||
return BagItem.URL;
|
||||
}
|
||||
if (itemData is ClassifyListTitleData titleData)
|
||||
{
|
||||
return ListTitleItem.URL;
|
||||
|
||||
@@ -51,7 +51,24 @@ namespace NBF
|
||||
style.selectedIndex = 1; //有二级菜单
|
||||
}
|
||||
|
||||
|
||||
_tabList.AddRange(tabItemList);
|
||||
|
||||
if (showListTitle)
|
||||
{
|
||||
foreach (var tabItemData in _tabList)
|
||||
{
|
||||
tabItemData.TabItemDataAddListTitle();
|
||||
if (tabItemData.Children.Count > 0)
|
||||
{
|
||||
foreach (var itemData in tabItemData.Children)
|
||||
{
|
||||
itemData.TabItemDataAddListTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showAll)
|
||||
{
|
||||
_tabList.AddAllTabItem(showListTitle);
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace NBF
|
||||
await LoginHelper.Login(InputAccount.text);
|
||||
|
||||
BagPanel.Show();
|
||||
FishingShopPanel.Show();
|
||||
// FishingShopPanel.Show();
|
||||
|
||||
// var mapId = role.Info.MapId;
|
||||
// if (mapId == 0)
|
||||
|
||||
Reference in New Issue
Block a user