客户端代码修改提交

This commit is contained in:
2025-10-14 17:58:49 +08:00
parent c3284032cc
commit 7f599ba51d
27 changed files with 294 additions and 43 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1a0c4fc0d6264961aeae4fd1036c8e26
timeCreated: 1760429230

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 96a7ec99208a4455ae850366a01e9bea
timeCreated: 1760429237

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: da865ce8b3954697b7c79adc6c3de5ec
timeCreated: 1760429508

View File

@@ -0,0 +1,10 @@
namespace NBF.Utils
{
public static class ItemHelper
{
public static ItemType GetItemType(this uint id)
{
return (ItemType)(id / 10000);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bbfb10d099a14e8b9b8aea80b789bdf3
timeCreated: 1760429516

View File

@@ -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<ItemType, List<ItemInfo>> GetItemsByType()
{
var dic = new Dictionary<ItemType, List<ItemInfo>>();
foreach (var item in Items)
{
var type = item.ConfigId.GetItemType();
if (!dic.ContainsKey(type))
{
dic.Add(type, new List<ItemInfo>());
}
dic[type].Add(item);
}
return dic;
}
}
}

View File

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

View File

@@ -134,6 +134,64 @@ namespace NBC
public List<long> Removes = new List<long>();
}
/// <summary>
/// /////////// ******** 钓组 *******/////////////
/// </summary>
/// <summary>
/// 请求安装或取下配件
/// </summary>
[ProtoContract]
public partial class C2Game_RigChangeRequest : AMessage, ICustomRouteRequest, IProto
{
public static C2Game_RigChangeRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2Game_RigChangeRequest>();
}
public override void Dispose()
{
RodId = default;
RigId = default;
IsAdd = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Game_RigChangeRequest>(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; }
}
/// <summary>
/// 请求安装配件响应
/// </summary>
[ProtoContract]
public partial class Game2C_RigChangeResponse : AMessage, ICustomRouteResponse, IProto
{
public static Game2C_RigChangeResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Game2C_RigChangeResponse>();
}
public override void Dispose()
{
ErrorCode = default;
Rigs = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_RigChangeResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_RigChangeResponse; }
[ProtoMember(1)]
public ItemBindInfo Rigs { get; set; }
[ProtoMember(2)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// /////////// ******** 鱼护 *******/////////////
/// </summary>
/// <summary>

View File

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

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

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3fa85a75ea9865f438ee246e23aefc66

View File

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

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 23a4348047aba5743b09c9d65e404a93

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

0
Config/~$Gear.xlsx Normal file
View File

0
Config/~$Item.xlsx Normal file
View File

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="350,260" extention="Button">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver,6,disabled,7,selectedDisabled" selected="0"/>
<displayList>
<image id="n10_r03u" name="back" src="kryob" fileName="Images/Square.png" pkg="6hgkvlau" xy="0,0" size="350,260" alpha="0.2" color="#5c748b">
<gearLook controller="button" pages="2,3,4,5" values="0.2,0,0,0|0.15,0,0,0|0.15,0,0,0|0.15,0,0,0" default="0.55,0,0,0"/>
<gearColor controller="button" pages="2,3,4,5,6,7" values="#5c748b|#8bf3ff|#8bf3ff|#8bf3ff|#6fa8c0|#6fa8c0"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<image id="n12_r03u" name="ba" src="r03uif" fileName="Images/Panels/RarityBg.png" pkg="6hgkvlau" xy="0,0" size="194,260" alpha="0.6" color="#ff6c00">
<relation target="" sidePair="height-height,left-left"/>
</image>
<text id="n7_oome" name="title" xy="15,7" size="283,32" alpha="0.7" fontSize="22" color="#ffffff" vAlign="middle" autoSize="ellipsis" text="Title"/>
<loader id="n13_r03u" name="n13" xy="50,55" size="250,190" align="center" vAlign="middle" fill="scale" clearOnPublish="true"/>
</displayList>
<Button mode="Radio"/>
</component>

View File

@@ -49,6 +49,7 @@
<component id="n5ne1e" name="ChatTestPanel.xml" path="/" exported="true"/>
<component id="n5ne1f" name="ChatItem.xml" path="/" exported="true"/>
<component id="9zbo1g" name="LoginPanel.xml" path="/" exported="true"/>
<component id="uq3a1h" name="BagItem.xml" path="/Com/Items/" exported="true"/>
</resources>
<publish name="" path="../Assets/Resources/Fgui/Main" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -0,0 +1 @@
{"url":"ui://hxr7rc7puq3a1h","name":"BagItem","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}