提交修改
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using NBF.Utils;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -11,5 +12,11 @@ namespace NBF
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SetData(ItemInfo itemInfo)
|
||||
{
|
||||
title = itemInfo.ConfigId.GetName();
|
||||
this.SetIcon(itemInfo.ConfigId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,10 @@ namespace NBF
|
||||
base.OnInit();
|
||||
}
|
||||
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
ItemList.List.OnClickItem += OnClickItem;
|
||||
Game.Input.OnUICanceled += OnUICanceled;
|
||||
UseBottomMenu();
|
||||
|
||||
@@ -55,6 +57,12 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickItem(object item)
|
||||
{
|
||||
// ItemDetailsPanel.s
|
||||
ItemDetailsPanel.Show();
|
||||
}
|
||||
|
||||
private void UseBottomMenu()
|
||||
{
|
||||
BottomMenu.Use(this);
|
||||
@@ -63,6 +71,7 @@ namespace NBF
|
||||
protected override void OnHide()
|
||||
{
|
||||
Game.Input.OnUICanceled -= OnUICanceled;
|
||||
ItemList.List.OnClickItem -= OnClickItem;
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
|
||||
33
Assets/Scripts/UI/Bag/GearItem.Designer.cs
generated
Normal file
33
Assets/Scripts/UI/Bag/GearItem.Designer.cs
generated
Normal file
@@ -0,0 +1,33 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class GearItem
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7pnzfp1n";
|
||||
|
||||
public GTextField TextTitle;
|
||||
public GTextField TextDesc;
|
||||
public GButton BtnClose;
|
||||
public GImage Quality;
|
||||
public GLoader TagIcon;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
TextTitle = (GTextField)GetChild("TextTitle");
|
||||
TextDesc = (GTextField)GetChild("TextDesc");
|
||||
BtnClose = (GButton)GetChild("BtnClose");
|
||||
Quality = (GImage)GetChild("Quality");
|
||||
TagIcon = (GLoader)GetChild("TagIcon");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/GearItem.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/GearItem.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3958da30a5539fd40bf58bf9f7af003f
|
||||
15
Assets/Scripts/UI/Bag/GearItem.cs
Normal file
15
Assets/Scripts/UI/Bag/GearItem.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class GearItem : GButton
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/GearItem.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/GearItem.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a5f9858996c9ba4797aa38de40bb8b7
|
||||
27
Assets/Scripts/UI/Bag/ItemDetailsContent.Designer.cs
generated
Normal file
27
Assets/Scripts/UI/Bag/ItemDetailsContent.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 ItemDetailsContent
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7pnzfp1o";
|
||||
|
||||
public GComponent Basic;
|
||||
public GComponent Gear;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
Basic = (GComponent)GetChild("Basic");
|
||||
Gear = (GComponent)GetChild("Gear");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fb2c8c8c6c52d048bdad6ad20707b5d
|
||||
15
Assets/Scripts/UI/Bag/ItemDetailsContent.cs
Normal file
15
Assets/Scripts/UI/Bag/ItemDetailsContent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ItemDetailsContent : GComponent
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemDetailsContent.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemDetailsContent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0671f09b0678a3449478f263ea01748
|
||||
40
Assets/Scripts/UI/Bag/ItemDetailsPanel.Designer.cs
generated
Normal file
40
Assets/Scripts/UI/Bag/ItemDetailsPanel.Designer.cs
generated
Normal file
@@ -0,0 +1,40 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
/// <summary> </summary>
|
||||
public partial class ItemDetailsPanel
|
||||
{
|
||||
public GObject this[string aKey] => ContentPane.GetChild(aKey);
|
||||
public override string UIPackName => "Main";
|
||||
public override string UIResName => "ItemDetailsPanel";
|
||||
|
||||
[AutoFind(Name = "back")]
|
||||
public GImage back;
|
||||
[AutoFind(Name = "BottomMenu")]
|
||||
public BottomMenu BottomMenu;
|
||||
[AutoFind(Name = "title")]
|
||||
public GComponent title;
|
||||
[AutoFind(Name = "modelBack")]
|
||||
public GImage modelBack;
|
||||
[AutoFind(Name = "Quality")]
|
||||
public GImage Quality;
|
||||
[AutoFind(Name = "Model")]
|
||||
public ModelTexture Model;
|
||||
[AutoFind(Name = "Content")]
|
||||
public ItemDetailsContent Content;
|
||||
public override string[] GetDependPackages(){ return new string[] {"Common"}; }
|
||||
|
||||
public static void Show(object param = null){ App.UI.OpenUI<ItemDetailsPanel>(param); }
|
||||
|
||||
public static void Hide(){ App.UI.HideUI<ItemDetailsPanel>(); }
|
||||
|
||||
public static void Del(){ App.UI.DestroyUI<ItemDetailsPanel>(); }
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemDetailsPanel.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemDetailsPanel.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06f28badaa5d4c04e9d0cdfd853a5d28
|
||||
42
Assets/Scripts/UI/Bag/ItemDetailsPanel.cs
Normal file
42
Assets/Scripts/UI/Bag/ItemDetailsPanel.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ItemDetailsPanel : UIPanel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
Game.Input.OnUICanceled += OnUICanceled;
|
||||
}
|
||||
|
||||
private void OnUICanceled(string action)
|
||||
{
|
||||
if (!IsTop) return;
|
||||
if (action == InputDef.UI.SubPrev)
|
||||
{
|
||||
}
|
||||
else if (action == InputDef.UI.SubNext)
|
||||
{
|
||||
}
|
||||
else if (action == InputDef.UI.Up)
|
||||
{
|
||||
}
|
||||
else if (action == InputDef.UI.Down)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
Game.Input.OnUICanceled -= OnUICanceled;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemDetailsPanel.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemDetailsPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0d31d3946529c3428cf34f1c1ee7488
|
||||
@@ -19,6 +19,8 @@ namespace NBF
|
||||
UIObjectFactory.SetPackageItemExtension(HomeStatisticsPage.URL, typeof(HomeStatisticsPage));
|
||||
UIObjectFactory.SetPackageItemExtension(HomeButtonGroups.URL, typeof(HomeButtonGroups));
|
||||
UIObjectFactory.SetPackageItemExtension(ChatItem.URL, typeof(ChatItem));
|
||||
UIObjectFactory.SetPackageItemExtension(GearItem.URL, typeof(GearItem));
|
||||
UIObjectFactory.SetPackageItemExtension(ItemDetailsContent.URL, typeof(ItemDetailsContent));
|
||||
UIObjectFactory.SetPackageItemExtension(BagItem.URL, typeof(BagItem));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,8 @@ namespace NBF
|
||||
/// 为TabItemData列表添加"全部"选项卡
|
||||
/// </summary>
|
||||
/// <param name="tabItems">原始选项卡列表</param>
|
||||
/// <param name="addListTitle"></param>
|
||||
/// <returns>包含"全部"选项卡的新列表</returns>
|
||||
public static void AddAllTabItem(this List<TabItemData> tabItems, bool addListTitle = false)
|
||||
public static void AddAllTabItem(this List<TabItemData> tabItems)
|
||||
{
|
||||
//判断是否存在二级目录,有二级目录则只在二级目录有"全部"选项卡
|
||||
if (tabItems.Any(tabItem => tabItem.Children.Count > 0))
|
||||
@@ -26,7 +25,7 @@ namespace NBF
|
||||
Key = "All",
|
||||
Icon = "All",
|
||||
IsAll = true,
|
||||
Items = GetAllItemsFromTabs(tabItemData.Children, addListTitle)
|
||||
Items = GetAllItemsFromTabs(tabItemData.Children)
|
||||
};
|
||||
tabItemData.Children.Insert(0, allTab);
|
||||
}
|
||||
@@ -40,7 +39,7 @@ namespace NBF
|
||||
Key = "All",
|
||||
Icon = "All",
|
||||
IsAll = true,
|
||||
Items = GetAllItemsFromTabs(tabItems, addListTitle)
|
||||
Items = GetAllItemsFromTabs(tabItems)
|
||||
};
|
||||
tabItems.Insert(0, allTab);
|
||||
}
|
||||
@@ -49,16 +48,20 @@ namespace NBF
|
||||
/// <summary>
|
||||
/// 递归获取所有选项卡中的项目(去重)
|
||||
/// </summary>
|
||||
private static List<object> GetAllItemsFromTabs(List<TabItemData> tabs, bool addListTitle = false)
|
||||
private static List<object> GetAllItemsFromTabs(List<TabItemData> tabs)
|
||||
{
|
||||
var allItems = new List<object>();
|
||||
|
||||
foreach (var tab in tabs)
|
||||
{
|
||||
allItems.Add(new ClassifyListTitleData()
|
||||
{
|
||||
Title = tab.Key
|
||||
});
|
||||
// if (addListTitle)
|
||||
// {
|
||||
// allItems.Add(new ClassifyListTitleData()
|
||||
// {
|
||||
// Title = tab.Key
|
||||
// });
|
||||
// }
|
||||
|
||||
// 添加当前选项卡的项目
|
||||
if (tab.Items != null)
|
||||
{
|
||||
|
||||
@@ -24,9 +24,6 @@ namespace NBF
|
||||
private void OnInited()
|
||||
{
|
||||
Game.Input.OnUICanceled += OnUICanceled;
|
||||
List.defaultItem = ListTitleItem.URL;
|
||||
List.itemProvider = GetListItemResource;
|
||||
List.itemRenderer = OnRenderItem;
|
||||
List.onClickItem.Add(OnClickListItem);
|
||||
}
|
||||
|
||||
@@ -77,15 +74,26 @@ namespace NBF
|
||||
{
|
||||
List.selectedIndex = -1;
|
||||
_listData.Clear();
|
||||
|
||||
|
||||
foreach (var obj in listData)
|
||||
{
|
||||
_listData.Add(obj);
|
||||
}
|
||||
List.RemoveChildrenToPool();
|
||||
List.defaultItem = ListTitleItem.URL;
|
||||
List.itemProvider = GetListItemResource;
|
||||
List.itemRenderer = OnRenderItem;
|
||||
List.selectionMode = selectionMode;
|
||||
List.numItems = _listData.Count;
|
||||
List.ScrollToView(0);
|
||||
try
|
||||
{
|
||||
List.numItems = _listData.Count;
|
||||
List.ScrollToView(0);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e);
|
||||
}
|
||||
|
||||
_columnsCount = 5;
|
||||
}
|
||||
|
||||
@@ -100,11 +108,10 @@ namespace NBF
|
||||
if (obj is ListItemBase item)
|
||||
{
|
||||
item.SetData(itemData);
|
||||
// obj.SetSize(350, 300);
|
||||
}
|
||||
else if (obj is BagItem bagItem)
|
||||
{
|
||||
// obj.SetSize(350, 300);
|
||||
bagItem.SetData(itemData as ItemInfo);
|
||||
}
|
||||
else if (obj is ListTitleItem titleItem)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
@@ -24,14 +25,12 @@ namespace NBF
|
||||
{
|
||||
Menu.OnTabChange += ChangeTab;
|
||||
SubMenu.OnTabChange += ChangeSubTab;
|
||||
List.OnClickItem += OnClickItem;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
Menu.OnTabChange -= ChangeTab;
|
||||
SubMenu.OnTabChange -= ChangeSubTab;
|
||||
List.OnClickItem -= OnClickItem;
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ namespace NBF
|
||||
|
||||
if (showAll)
|
||||
{
|
||||
_tabList.AddAllTabItem(showListTitle);
|
||||
_tabList.AddAllTabItem();
|
||||
}
|
||||
|
||||
Menu.SetTabs(_tabList);
|
||||
@@ -105,9 +104,5 @@ namespace NBF
|
||||
var subList = _currentTab.Children[index];
|
||||
List.SetListData(subList.Items);
|
||||
}
|
||||
|
||||
private void OnClickItem(object item)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ namespace NBF
|
||||
if (ui.IsTop && !ui.IsDontBack)
|
||||
{
|
||||
App.UI.HideUI(ui.GetType());
|
||||
break;
|
||||
// ui.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace NBF
|
||||
}
|
||||
else
|
||||
{
|
||||
_texture = Resources.Load<Texture>(url); //Res.Inst.Load<Texture>(url);
|
||||
_texture = Resources.Load<Texture>(url);
|
||||
if (_texture != null)
|
||||
onExternalLoadSuccess(new NTexture(_texture));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user