diff --git a/Assets/Resources/Fgui/Main/Main_fui.bytes b/Assets/Resources/Fgui/Main/Main_fui.bytes index 260c4c41b..0f17a0635 100644 Binary files a/Assets/Resources/Fgui/Main/Main_fui.bytes and b/Assets/Resources/Fgui/Main/Main_fui.bytes differ diff --git a/Assets/Scripts/Common/Enum.meta b/Assets/Scripts/Common/Enum.meta new file mode 100644 index 000000000..9aec07d68 --- /dev/null +++ b/Assets/Scripts/Common/Enum.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1a0c4fc0d6264961aeae4fd1036c8e26 +timeCreated: 1760429230 \ No newline at end of file diff --git a/Assets/Scripts/Common/Enum/ItemType.cs b/Assets/Scripts/Common/Enum/ItemType.cs new file mode 100644 index 000000000..2de1f2b00 --- /dev/null +++ b/Assets/Scripts/Common/Enum/ItemType.cs @@ -0,0 +1,27 @@ +namespace NBF +{ + public enum ItemType + { + None, + Currency, + Item, + Rod, + Reel, + Bobber, + Line, + Bait, + Lure, + Hook, + Weight, + Feeder, + Ring + } + + public enum ItemBasicType + { + None, + Currency = 1, + Item = 2, + Fish = 3, + } +} \ No newline at end of file diff --git a/Assets/Scripts/Common/Enum/ItemType.cs.meta b/Assets/Scripts/Common/Enum/ItemType.cs.meta new file mode 100644 index 000000000..c88961b3c --- /dev/null +++ b/Assets/Scripts/Common/Enum/ItemType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 96a7ec99208a4455ae850366a01e9bea +timeCreated: 1760429237 \ No newline at end of file diff --git a/Assets/Scripts/Common/Utils.meta b/Assets/Scripts/Common/Utils.meta new file mode 100644 index 000000000..b94788dd8 --- /dev/null +++ b/Assets/Scripts/Common/Utils.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: da865ce8b3954697b7c79adc6c3de5ec +timeCreated: 1760429508 \ No newline at end of file diff --git a/Assets/Scripts/Common/Utils/ItemHelper.cs b/Assets/Scripts/Common/Utils/ItemHelper.cs new file mode 100644 index 000000000..0cb9d93d8 --- /dev/null +++ b/Assets/Scripts/Common/Utils/ItemHelper.cs @@ -0,0 +1,10 @@ +namespace NBF.Utils +{ + public static class ItemHelper + { + public static ItemType GetItemType(this uint id) + { + return (ItemType)(id / 10000); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Common/Utils/ItemHelper.cs.meta b/Assets/Scripts/Common/Utils/ItemHelper.cs.meta new file mode 100644 index 000000000..4ca77f9c9 --- /dev/null +++ b/Assets/Scripts/Common/Utils/ItemHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bbfb10d099a14e8b9b8aea80b789bdf3 +timeCreated: 1760429516 \ No newline at end of file diff --git a/Assets/Scripts/Fishing2/Role/RoleBag.cs b/Assets/Scripts/Fishing2/Role/RoleBag.cs index f67fa96a0..6ab45dc66 100644 --- a/Assets/Scripts/Fishing2/Role/RoleBag.cs +++ b/Assets/Scripts/Fishing2/Role/RoleBag.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using NBC; using NBC.Entitas; +using NBF.Utils; using Newtonsoft.Json; namespace NBF.Fishing2 @@ -23,5 +24,22 @@ namespace NBF.Fishing2 $"获取背包数据成功!Items={JsonConvert.SerializeObject(Items)} Rigs={JsonConvert.SerializeObject(Rigs)}"); } } + + public Dictionary> GetItemsByType() + { + var dic = new Dictionary>(); + foreach (var item in Items) + { + var type = item.ConfigId.GetItemType(); + if (!dic.ContainsKey(type)) + { + dic.Add(type, new List()); + } + + dic[type].Add(item); + } + + return dic; + } } } \ No newline at end of file diff --git a/Assets/Scripts/Generate/NetworkProtocol/CommonProtoData.cs b/Assets/Scripts/Generate/NetworkProtocol/CommonProtoData.cs index 8d46b5c99..1c4432721 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/CommonProtoData.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/CommonProtoData.cs @@ -244,7 +244,7 @@ namespace NBC #endif } [ProtoMember(1)] - public int ConfigId { get; set; } + public uint ConfigId { get; set; } [ProtoMember(2)] public long Id { get; set; } [ProtoMember(3)] @@ -278,7 +278,7 @@ namespace NBC #endif } [ProtoMember(1)] - public int ConfigId { get; set; } + public uint ConfigId { get; set; } [ProtoMember(2)] public long Id { get; set; } [ProtoMember(3)] @@ -334,7 +334,7 @@ namespace NBC #endif } [ProtoMember(1)] - public int ConfigId { get; set; } + public uint ConfigId { get; set; } [ProtoMember(2)] public int Level { get; set; } [ProtoMember(3)] diff --git a/Assets/Scripts/Generate/NetworkProtocol/GameMessage.cs b/Assets/Scripts/Generate/NetworkProtocol/GameMessage.cs index d1129c55b..e8f7641b9 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/GameMessage.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/GameMessage.cs @@ -134,6 +134,64 @@ namespace NBC public List Removes = new List(); } /// + /// /////////// ******** 钓组 *******///////////// + /// + /// + /// 请求安装或取下配件 + /// + [ProtoContract] + public partial class C2Game_RigChangeRequest : AMessage, ICustomRouteRequest, IProto + { + public static C2Game_RigChangeRequest Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + RodId = default; + RigId = default; + IsAdd = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoIgnore] + public Game2C_RigChangeResponse ResponseType { get; set; } + public uint OpCode() { return OuterOpcode.C2Game_RigChangeRequest; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long RodId { get; set; } + [ProtoMember(2)] + public long RigId { get; set; } + [ProtoMember(3)] + public bool IsAdd { get; set; } + } + /// + /// 请求安装配件响应 + /// + [ProtoContract] + public partial class Game2C_RigChangeResponse : AMessage, ICustomRouteResponse, IProto + { + public static Game2C_RigChangeResponse Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + ErrorCode = default; + Rigs = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Game2C_RigChangeResponse; } + [ProtoMember(1)] + public ItemBindInfo Rigs { get; set; } + [ProtoMember(2)] + public uint ErrorCode { get; set; } + } + /// /// /////////// ******** 鱼护 *******///////////// /// /// diff --git a/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs b/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs index 5d4482248..8c9171724 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs @@ -7,15 +7,17 @@ namespace Fantasy public const uint C2Game_UseItemRequest = 2281711378; public const uint Game2C_UseItemResponse = 2415929106; public const uint Game2C_ItemChange = 2147493649; - public const uint C2Game_GetFishsRequest = 2281711379; - public const uint Game2C_GetFishsResponse = 2415929107; + public const uint C2Game_RigChangeRequest = 2281711379; + public const uint Game2C_RigChangeResponse = 2415929107; + public const uint C2Game_GetFishsRequest = 2281711380; + public const uint Game2C_GetFishsResponse = 2415929108; public const uint Game2C_FishChange = 2147493650; - public const uint C2Game_SellFishRequest = 2281711380; - public const uint Game2C_SellFishResponse = 2415929108; - public const uint C2Game_BuyRequest = 2281711381; - public const uint Game2C_BuyResponse = 2415929109; - public const uint C2Map_CreateRoomRequest = 2281711382; - public const uint Map2C_CreateRoomResponse = 2415929110; + public const uint C2Game_SellFishRequest = 2281711381; + public const uint Game2C_SellFishResponse = 2415929109; + public const uint C2Game_BuyRequest = 2281711382; + public const uint Game2C_BuyResponse = 2415929110; + public const uint C2Map_CreateRoomRequest = 2281711383; + public const uint Map2C_CreateRoomResponse = 2415929111; public const uint C2G_ExitRoomRequest = 268445457; public const uint G2C_ExitRoomResponse = 402663185; public const uint C2G_EnterMapRequest = 268445458; @@ -26,8 +28,8 @@ namespace Fantasy public const uint C2G_LoginRequest = 268445460; public const uint G2C_LoginResponse = 402663188; public const uint G2C_RepeatLogin = 134227729; - public const uint C2Game_GetRoleInfoRequest = 2281711383; - public const uint Game2C_GetRoleInfoResponse = 2415929111; + public const uint C2Game_GetRoleInfoRequest = 2281711384; + public const uint Game2C_GetRoleInfoResponse = 2415929112; public const uint Map2C_RoleEnterRoomNotify = 2147493652; public const uint Map2C_RoleExitRoomNotify = 2147493653; public const uint C2Map_RolePropertyChange = 2147493654; @@ -38,37 +40,37 @@ namespace Fantasy public const uint C2Map_Look = 2147493659; public const uint Map2C_MoveNotify = 2147493660; public const uint Map2C_LookeNotify = 2147493661; - public const uint C2S_GetConversationsRequest = 2281711384; - public const uint S2C_GetConversationsResponse = 2415929112; - public const uint C2S_SendMailRequest = 2281711385; - public const uint S2C_SendMailResponse = 2415929113; - public const uint C2S_DeleteMailRequest = 2281711386; - public const uint S2C_DeleteMailResponse = 2415929114; + public const uint C2S_GetConversationsRequest = 2281711385; + public const uint S2C_GetConversationsResponse = 2415929113; + public const uint C2S_SendMailRequest = 2281711386; + public const uint S2C_SendMailResponse = 2415929114; + public const uint C2S_DeleteMailRequest = 2281711387; + public const uint S2C_DeleteMailResponse = 2415929115; public const uint S2C_HaveMail = 2147493662; public const uint S2C_MailState = 2147493663; - public const uint C2S_CreateChannelRequest = 2281711387; - public const uint S2C_CreateChannelResponse = 2415929115; - public const uint C2S_JoinChannelRequest = 2281711388; - public const uint S2C_JoinChannelResponse = 2415929116; - public const uint C2S_SendMessageRequest = 2281711389; - public const uint S2C_SendMessageResponse = 2415929117; + public const uint C2S_CreateChannelRequest = 2281711388; + public const uint S2C_CreateChannelResponse = 2415929116; + public const uint C2S_JoinChannelRequest = 2281711389; + public const uint S2C_JoinChannelResponse = 2415929117; + public const uint C2S_SendMessageRequest = 2281711390; + public const uint S2C_SendMessageResponse = 2415929118; public const uint S2C_Message = 2147493664; - public const uint C2S_CreateClubRequest = 2281711390; - public const uint S2C_CreateClubResponse = 2415929118; - public const uint C2S_GetClubInfoRequest = 2281711391; - public const uint S2C_GetClubInfoResponse = 2415929119; - public const uint C2S_GetMemberListRequest = 2281711392; - public const uint S2C_GetMemberListResponse = 2415929120; - public const uint C2S_GetClubListRequest = 2281711393; - public const uint S2C_GetClubListResponse = 2415929121; - public const uint C2S_JoinClubRequest = 2281711394; - public const uint S2C_JoinClubResponse = 2415929122; - public const uint C2S_LeaveClubRequest = 2281711395; - public const uint S2C_LeaveClubResponse = 2415929123; - public const uint C2S_DissolveClubRequest = 2281711396; - public const uint S2C_DissolveClubResponse = 2415929124; - public const uint C2S_DisposeJoinRequest = 2281711397; - public const uint S2C_DisposeJoinResponse = 2415929125; + public const uint C2S_CreateClubRequest = 2281711391; + public const uint S2C_CreateClubResponse = 2415929119; + public const uint C2S_GetClubInfoRequest = 2281711392; + public const uint S2C_GetClubInfoResponse = 2415929120; + public const uint C2S_GetMemberListRequest = 2281711393; + public const uint S2C_GetMemberListResponse = 2415929121; + public const uint C2S_GetClubListRequest = 2281711394; + public const uint S2C_GetClubListResponse = 2415929122; + public const uint C2S_JoinClubRequest = 2281711395; + public const uint S2C_JoinClubResponse = 2415929123; + public const uint C2S_LeaveClubRequest = 2281711396; + public const uint S2C_LeaveClubResponse = 2415929124; + public const uint C2S_DissolveClubRequest = 2281711397; + public const uint S2C_DissolveClubResponse = 2415929125; + public const uint C2S_DisposeJoinRequest = 2281711398; + public const uint S2C_DisposeJoinResponse = 2415929126; public const uint S2C_ClubChange = 2147493665; } } diff --git a/Assets/Scripts/UI/Bag/BagItem.Designer.cs b/Assets/Scripts/UI/Bag/BagItem.Designer.cs new file mode 100644 index 000000000..03aa72b63 --- /dev/null +++ b/Assets/Scripts/UI/Bag/BagItem.Designer.cs @@ -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); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Bag/BagItem.Designer.cs.meta b/Assets/Scripts/UI/Bag/BagItem.Designer.cs.meta new file mode 100644 index 000000000..a6d6f15c5 --- /dev/null +++ b/Assets/Scripts/UI/Bag/BagItem.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3fa85a75ea9865f438ee246e23aefc66 \ No newline at end of file diff --git a/Assets/Scripts/UI/Bag/BagItem.cs b/Assets/Scripts/UI/Bag/BagItem.cs new file mode 100644 index 000000000..367ff11c5 --- /dev/null +++ b/Assets/Scripts/UI/Bag/BagItem.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class BagItem : GButton + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Bag/BagItem.cs.meta b/Assets/Scripts/UI/Bag/BagItem.cs.meta new file mode 100644 index 000000000..6de8410f5 --- /dev/null +++ b/Assets/Scripts/UI/Bag/BagItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 23a4348047aba5743b09c9d65e404a93 \ No newline at end of file diff --git a/Assets/Scripts/UI/Bag/BagPanel.cs b/Assets/Scripts/UI/Bag/BagPanel.cs index 8e55011ec..701214839 100644 --- a/Assets/Scripts/UI/Bag/BagPanel.cs +++ b/Assets/Scripts/UI/Bag/BagPanel.cs @@ -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 tabItemList = new List(); + var role = App.Main.GetComponent(); + var roleBag = role.GetComponent(); + + 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) diff --git a/Assets/Scripts/UI/Binders/MainBinder.cs b/Assets/Scripts/UI/Binders/MainBinder.cs index 8fbfb8a52..059a304c5 100644 --- a/Assets/Scripts/UI/Binders/MainBinder.cs +++ b/Assets/Scripts/UI/Binders/MainBinder.cs @@ -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)); } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/Extensions/TabItemDataExtensions.cs b/Assets/Scripts/UI/Common/Extensions/TabItemDataExtensions.cs index 4717cfb7e..444b9a0ac 100644 --- a/Assets/Scripts/UI/Common/Extensions/TabItemDataExtensions.cs +++ b/Assets/Scripts/UI/Common/Extensions/TabItemDataExtensions.cs @@ -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().Any(); + if (!hasListTitle) + { + tabItem.Items.Insert(0, new ClassifyListTitleData() + { + Title = tabItem.Key + }); + } + } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Common/List/ClassifyList.cs b/Assets/Scripts/UI/Common/List/ClassifyList.cs index 391328fc7..2c41532bf 100644 --- a/Assets/Scripts/UI/Common/List/ClassifyList.cs +++ b/Assets/Scripts/UI/Common/List/ClassifyList.cs @@ -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; diff --git a/Assets/Scripts/UI/Common/List/CommonItemList.cs b/Assets/Scripts/UI/Common/List/CommonItemList.cs index 01c5fe543..2a41d1667 100644 --- a/Assets/Scripts/UI/Common/List/CommonItemList.cs +++ b/Assets/Scripts/UI/Common/List/CommonItemList.cs @@ -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); diff --git a/Assets/Scripts/UI/Login/LoginPanel.cs b/Assets/Scripts/UI/Login/LoginPanel.cs index 65156698a..4b084833b 100644 --- a/Assets/Scripts/UI/Login/LoginPanel.cs +++ b/Assets/Scripts/UI/Login/LoginPanel.cs @@ -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) diff --git a/Config/Item.xlsx b/Config/Item.xlsx index 64f00f7db..e01c995cb 100644 Binary files a/Config/Item.xlsx and b/Config/Item.xlsx differ diff --git a/Config/~$Gear.xlsx b/Config/~$Gear.xlsx new file mode 100644 index 000000000..e69de29bb diff --git a/Config/~$Item.xlsx b/Config/~$Item.xlsx new file mode 100644 index 000000000..e69de29bb diff --git a/FGUIProject/assets/Main/Com/Items/BagItem.xml b/FGUIProject/assets/Main/Com/Items/BagItem.xml new file mode 100644 index 000000000..2da4a75d3 --- /dev/null +++ b/FGUIProject/assets/Main/Com/Items/BagItem.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + +