提交修改

This commit is contained in:
2025-10-20 00:00:56 +08:00
parent 983203f603
commit 4ee5d0885c
292 changed files with 14032 additions and 78 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cd909ef726234c2282ca734bca8be5d5
timeCreated: 1760875043

View File

@@ -0,0 +1,18 @@
using NBC;
using NBF.Utils;
namespace NBF
{
public static class IConfigTableExtensions
{
public static string GetName(this IConfigTable config)
{
return config.Key.GetName();
}
public static string GetDesc(this IConfigTable config)
{
return config.Key.GetDesc();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 08653a1add0a416cb39ccabdf4bd8280
timeCreated: 1760875056

View File

@@ -1,4 +1,7 @@
namespace NBF.Utils
using FairyGUI;
using NBC;
namespace NBF.Utils
{
public static class ItemHelper
{
@@ -6,5 +9,31 @@
{
return (ItemType)(id / 10000);
}
public static string GetName(this uint id)
{
return Lan.Get($"Name_{id}");
}
public static string GetDesc(this uint id)
{
return Lan.Get($"Desc_{id}");
}
public static string GetIcon(this uint id)
{
//Assets/Resources/Icons/baitfrog.png
return $"Icons/{id}";
}
public static void SetIcon(this GLoader loader, uint id)
{
loader.url = id.GetIcon();
}
public static void SetIcon(this GComponent loader, uint id)
{
loader.icon = id.GetIcon();
}
}
}

View File

@@ -18,15 +18,19 @@ namespace NBF
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint EfficacyBase { get; set; } // 吸引力
[ProtoMember(3)]
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Length { get; set; } // 长度(毫米)
public uint EfficacyBase { get; set; } // 吸引力
[ProtoMember(5)]
public uint Weight { get; set; } // 重量(克)
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(6)]
public uint[] Arr { get; set; } = Array.Empty<uint>(); // 重量(克)
public uint Weight { get; set; } // 重量(克)
[ProtoMember(7)]
public uint[] Arr { get; set; } = Array.Empty<uint>(); // 重量(克)
[ProtoMember(8)]
public string[] ArrStr { get; set; } = Array.Empty<string>(); // 重量(克)
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,12 +19,14 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Weight { get; set; } // 重量(克)
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Displacement { get; set; } // 位移
public uint Weight { get; set; } // 重量(克)
[ProtoMember(6)]
public uint Displacement { get; set; } // 位移
[ProtoMember(7)]
public uint NightLight { get; set; } // 是否夜光
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,10 +19,12 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Capacity { get; set; } // 能力
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Capacity { get; set; } // 能力
[ProtoMember(6)]
public uint Weight { get; set; } // 重量(克)
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,12 +19,14 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Zadzior { get; set; } // 长钉
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Length { get; set; } // 长度(毫米)
public uint Zadzior { get; set; } // 长
[ProtoMember(6)]
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(7)]
public uint Weight { get; set; } // 重量(克)
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,10 +19,12 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Max { get; set; } // 最大堆叠数量
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Max { get; set; } // 最大堆叠数量
[ProtoMember(6)]
public uint AutoUse { get; set; } // 获得自动使用
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,12 +19,14 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Length { get; set; } // 长度(毫米)
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Strength { get; set; } // 强度
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(6)]
public uint Strength { get; set; } // 强度
[ProtoMember(7)]
public uint Size { get; set; } // 尺寸
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,12 +19,14 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint[] Hook { get; set; } = Array.Empty<uint>(); //
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint EfficacyBase { get; set; } // 吸引力
public uint[] Hook { get; set; } = Array.Empty<uint>(); //
[ProtoMember(5)]
public uint Length { get; set; } // 长度(毫米)
public uint EfficacyBase { get; set; } // 吸引力
[ProtoMember(6)]
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(7)]
public uint Weight { get; set; } // 重量(克)
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,12 +19,14 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public float[] GearRatio { get; set; } = Array.Empty<float>(); // 组件比
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Size { get; set; } // 尺寸
public float[] GearRatio { get; set; } = Array.Empty<float>(); // 组件比
[ProtoMember(6)]
public uint Size { get; set; } // 尺寸
[ProtoMember(7)]
public uint Strength { get; set; } // 强度
[ProtoIgnore]
public uint Key => Id;

View File

@@ -17,7 +17,9 @@ namespace NBF
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Model { get; set; } // 模型
public string Model { get; set; } // 模型
[ProtoMember(3)]
public string Icon { get; set; } // 图标
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,18 +19,20 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Ring { get; set; } // 导线圈
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Length { get; set; } // 长度(毫米)
public uint Ring { get; set; } // 导线圈
[ProtoMember(6)]
public uint Weight { get; set; } // 重量(克)
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(7)]
public uint Strength { get; set; } // 强度
public uint Weight { get; set; } // 重量(克)
[ProtoMember(8)]
public uint MaxRange { get; set; } // 最大范围
public uint Strength { get; set; } // 强度
[ProtoMember(9)]
public uint MaxRange { get; set; } // 最大范围
[ProtoMember(10)]
public uint ConstructionType { get; set; } // 结构类型
[ProtoIgnore]
public uint Key => Id;

View File

@@ -19,8 +19,10 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public uint Type { get; set; } // 类型
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint Weight { get; set; } // 重量(克)
[ProtoIgnore]
public uint Key => Id;

View File

@@ -101,7 +101,7 @@ namespace NBF
public void StartGame()
{
Screen.SetResolution(1280, 720, FullScreenMode.Windowed);
Screen.SetResolution(1920, 1080, FullScreenMode.FullScreenWindow);
PermanentCommon.Init();
InputDef.LoadIcon();
// UI.Inst.OpenUI<FishingShopPanel>();

View File

@@ -7,4 +7,13 @@
{
public uint Key { get; }
}
public interface IConfigItemTable
{
public string Model { get; }
public string Quality { get; }
public string Icon { get; }
}
}

View File

@@ -21,6 +21,17 @@ namespace NBC
}
public static ILanguage Text => Inst.GetLanguageModule((int)LanguageModuleType.Text);
public static string Get(string key)
{
return Text.Get(key);
}
public static string Get(string key, params object[] args)
{
var format = string.Format(Text.Get(key), args);
return format;
}
public static void SetLanguage(this GObject child, string key, params object[] args)
{

View File

@@ -227,6 +227,10 @@ namespace FairyGUI
{
if (index >= 0 && index <= _children.Count)
{
if (child == null)
{
}
if (child.parent == this)
{
SetChildIndex(child, index);

View File

@@ -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);
}
}
}

View File

@@ -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()

View 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);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3958da30a5539fd40bf58bf9f7af003f

View File

@@ -0,0 +1,15 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class GearItem : GButton
{
private void OnInited()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2a5f9858996c9ba4797aa38de40bb8b7

View 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);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0fb2c8c8c6c52d048bdad6ad20707b5d

View File

@@ -0,0 +1,15 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class ItemDetailsContent : GComponent
{
private void OnInited()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a0671f09b0678a3449478f263ea01748

View 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>(); }
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 06f28badaa5d4c04e9d0cdfd853a5d28

View 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;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f0d31d3946529c3428cf34f1c1ee7488

View File

@@ -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));
}
}

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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)
{
}
}
}

View File

@@ -29,6 +29,7 @@ namespace NBF
if (ui.IsTop && !ui.IsDontBack)
{
App.UI.HideUI(ui.GetType());
break;
// ui.Hide();
}
}

View File

@@ -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