修改表结构,修改物品详情,增加物品品质描边

This commit is contained in:
2025-10-21 23:15:31 +08:00
parent 4ee5d0885c
commit af7592331b
41 changed files with 595 additions and 305 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fc83e1d6083241c08d36a271df033aa6
timeCreated: 1761057848

View File

@@ -0,0 +1,14 @@
using NBF;
namespace NBC
{
public partial class ItemInfo
{
private ItemConfig _config;
public ItemConfig Config
{
get { return _config ??= ItemConfig.Get(ConfigId); }
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fdc07f3a841e4cba821c2ae2b82b2697
timeCreated: 1761057852

View File

@@ -0,0 +1,23 @@
using FairyGUI;
using NBF.Utils;
namespace NBF
{
public static class GObjectExtensions
{
public static void SetQuality(this GImage image, uint quality)
{
image.color = ItemHelper.GetItemQualityColor(quality);
}
public static void SetQuality(this GTextField image, uint quality)
{
image.strokeColor = ItemHelper.GetItemQualityColor(quality);
}
public static void SetTitleQuality(this GButton com, uint quality)
{
com.GetTextField().strokeColor = ItemHelper.GetItemQualityColor(quality);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1e39c262c800477e8b6e353aa1d62383
timeCreated: 1761058048

View File

@@ -1,5 +1,6 @@
using FairyGUI;
using NBC;
using UnityEngine;
namespace NBF.Utils
{
@@ -35,5 +36,29 @@ namespace NBF.Utils
{
loader.icon = id.GetIcon();
}
#region
public static Color QualityColor0 = new Color(1, 1, 1, 0);
public static Color QualityColor1 = new Color(96 / 255f, 160 / 255f, 224 / 255f, 1);
public static Color QualityColor2 = new Color(0 / 255f, 138 / 255f, 255 / 255f, 1);
public static Color QualityColor3 = new Color(126 / 255f, 0 / 255f, 255 / 255f, 1);
public static Color QualityColor4 = new Color(220 / 255f, 50 / 255f, 50 / 255f, 1);
public static Color QualityColor5 = new Color(255 / 255f, 108 / 255f, 0 / 255f, 1);
public static Color GetItemQualityColor(uint quality)
{
return quality switch
{
1 => QualityColor1,
2 => QualityColor2,
3 => QualityColor3,
4 => QualityColor4,
5 => QualityColor5,
_ => QualityColor0
};
}
#endregion
}
}

View File

@@ -39,6 +39,11 @@ namespace NBF.Fishing2
dic[type].Add(item);
}
foreach (var (key, list) in dic)
{
list.Sort((x, y) => (int)(y.Config.Quality - x.Config.Quality));
}
return dic;
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -19,13 +19,21 @@ namespace NBF
[ProtoMember(2)]
public string Model { get; set; } // 模型
[ProtoMember(3)]
public string Icon { get; set; } // 图标
[ProtoMember(4)]
public uint Type { get; set; } // 类型
[ProtoMember(4)]
public uint Quality { get; set; } // 品质
[ProtoMember(5)]
public uint Max { get; set; } // 最大堆叠数量
public uint Brand { get; set; } // 品牌
[ProtoMember(6)]
public uint AutoUse { get; set; } // 获得自动使用
public uint Weight { get; set; } // 重量(克)
[ProtoMember(7)]
public uint Length { get; set; } // 长度(毫米)
[ProtoMember(8)]
public uint Max { get; set; } // 最大堆叠数量
[ProtoMember(9)]
public uint AutoUse { get; set; } // 获得自动使用
[ProtoMember(10)]
public uint Deal { get; set; } // 交易类型
[ProtoIgnore]
public uint Key => Id;

View File

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

View File

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

View File

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

View File

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

View File

@@ -86,6 +86,7 @@ namespace NBF
Binder.BindAll();
UIObjectFactory.SetLoaderExtension(typeof(XGLoader));
UIConst.UIPackRootUrl = UIDef.UIRoot;
UIConfig.verticalScrollBar = "ui://6hgkvlauoomej";
UIConfig.defaultFont = "AlibabaPuHuiTi-3-Medium";
App.UI.SetUILanguage<UILangeageConfig>();
UIConfig.modalLayerColor = new Color(0, 0, 0, 0.9f);

View File

@@ -12,14 +12,14 @@ namespace NBF
public const string URL = "ui://hxr7rc7puq3a1h";
public GImage back;
public GImage ba;
public GImage Quality;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
back = (GImage)GetChild("back");
ba = (GImage)GetChild("ba");
Quality = (GImage)GetChild("Quality");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}

View File

@@ -9,14 +9,19 @@ namespace NBF
{
public partial class BagItem : GButton
{
public ItemInfo ItemInfo;
private void OnInited()
{
}
public virtual void SetData(ItemInfo itemInfo)
{
ItemInfo = itemInfo;
title = itemInfo.ConfigId.GetName();
this.SetIcon(itemInfo.ConfigId);
Quality.SetQuality(ItemInfo.Config.Quality);
this.SetTitleQuality(ItemInfo.Config.Quality);
}
}
}

View File

@@ -59,8 +59,9 @@ namespace NBF
private void OnClickItem(object item)
{
if (item is not BagItem bagItem) return;
// ItemDetailsPanel.s
ItemDetailsPanel.Show();
ItemDetailsPanel.Show(bagItem.ItemInfo);
}
private void UseBottomMenu()

View File

@@ -0,0 +1,29 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class ItemBasicInfoTag
{
public const string URL = "ui://hxr7rc7pnzfp1p";
public GTextField TextTitle;
public GTextField TextDesc;
public GTextField TextContent;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
TextTitle = (GTextField)GetChild("TextTitle");
TextDesc = (GTextField)GetChild("TextDesc");
TextContent = (GTextField)GetChild("TextContent");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 64ece59eb75f6874b8956a0b1073c8f7

View File

@@ -0,0 +1,23 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
using NBF.Utils;
namespace NBF
{
public partial class ItemBasicInfoTag : GComponent
{
private void OnInited()
{
}
public void SetInfo(ItemInfo itemInfo)
{
var itemConfig = ItemConfig.Get(itemInfo.ConfigId);
TextTitle.text = itemInfo.ConfigId.GetName();
TextTitle.SetQuality(itemInfo.Config.Quality);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 62624753a7f37ea4c93a816a7ebac8e3

View File

@@ -11,15 +11,15 @@ namespace NBF
{
public const string URL = "ui://hxr7rc7pnzfp1o";
public GComponent Basic;
public GComponent Gear;
public ItemBasicInfoTag Basic;
public ItemGearInfoTag Gear;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
Basic = (GComponent)GetChild("Basic");
Gear = (GComponent)GetChild("Gear");
Basic = (ItemBasicInfoTag)GetChild("Basic");
Gear = (ItemGearInfoTag)GetChild("Gear");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}

View File

@@ -11,5 +11,6 @@ namespace NBF
private void OnInited()
{
}
}
}

View File

@@ -7,6 +7,9 @@ namespace NBF
{
public partial class ItemDetailsPanel : UIPanel
{
public ItemInfo ItemInfo;
// public
protected override void OnInit()
{
base.OnInit();
@@ -14,6 +17,18 @@ namespace NBF
protected override void OnShow()
{
ItemInfo = GetData() as ItemInfo;
// Model.SetModel();
// Instance = Object.Instantiate(prefab);
// Debug.LogError($"预制体:{prefab.name} 实例={Instance}");
// Model.SetModel(Instance);
Quality.SetQuality(ItemInfo.Config.Quality);
Content.Basic.SetInfo(ItemInfo);
Content.Basic.SetInfo(ItemInfo);
Game.Input.OnUICanceled += OnUICanceled;
}

View File

@@ -0,0 +1,29 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class ItemGearInfoTag
{
public const string URL = "ui://hxr7rc7pnzfp1q";
public GTextField TextTitle;
public GRichTextField TextDesc;
public GList List;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
TextTitle = (GTextField)GetChild("TextTitle");
TextDesc = (GRichTextField)GetChild("TextDesc");
List = (GList)GetChild("List");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6210f89fdfdedcf43ad112aee8624548

View File

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

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 32b242aeba14ccf4e8daab2f502128e3

View File

@@ -21,6 +21,8 @@ namespace NBF
UIObjectFactory.SetPackageItemExtension(ChatItem.URL, typeof(ChatItem));
UIObjectFactory.SetPackageItemExtension(GearItem.URL, typeof(GearItem));
UIObjectFactory.SetPackageItemExtension(ItemDetailsContent.URL, typeof(ItemDetailsContent));
UIObjectFactory.SetPackageItemExtension(ItemBasicInfoTag.URL, typeof(ItemBasicInfoTag));
UIObjectFactory.SetPackageItemExtension(ItemGearInfoTag.URL, typeof(ItemGearInfoTag));
UIObjectFactory.SetPackageItemExtension(BagItem.URL, typeof(BagItem));
}
}