快速使用相关
8
Assets/Resources/Fgui/CommonFlag.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f381ed33689da346a208ae0a6a0225b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Fgui/CommonFlag/CommonFlag_atlas0.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
117
Assets/Resources/Fgui/CommonFlag/CommonFlag_atlas0.png.meta
Normal file
@@ -0,0 +1,117 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19bf979e7f610ae43afaa1a34d7dcca2
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 4
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Fgui/CommonFlag/CommonFlag_fui.bytes
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3486dfd1638410e42a054756a7e00d72
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Resources/Fgui/CommonIcon.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d30a0b3f24947fc4a8d9c2255bb3d7ac
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Fgui/CommonIcon/CommonIcon_atlas0.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
117
Assets/Resources/Fgui/CommonIcon/CommonIcon_atlas0.png.meta
Normal file
@@ -0,0 +1,117 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b283ea7cefc1d804ea3ce6d18b7d1191
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 4
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Fgui/CommonIcon/CommonIcon_fui.bytes
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc494ea340a433c4996599314577ea55
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -15,6 +15,8 @@ namespace NBF
|
||||
public class Pack
|
||||
{
|
||||
public const string Common = "Common";
|
||||
public const string CommonIcon = "CommonIcon";
|
||||
public const string CommonFlag = "CommonFlag";
|
||||
public const string Main = "Main";
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,8 @@ namespace NBF.Utils
|
||||
public static string GetIcon(this uint id)
|
||||
{
|
||||
//Assets/Resources/Icons/baitfrog.png
|
||||
return $"Icons/{id}";
|
||||
////$"Icons/{id}";
|
||||
return UIPackage.GetItemURL(UIDef.Pack.CommonIcon, id.ToString());
|
||||
}
|
||||
|
||||
public static void SetIcon(this GLoader loader, uint id)
|
||||
|
||||
@@ -14,16 +14,19 @@ namespace NBF.Fishing2
|
||||
public readonly List<ItemInfo> Items = new List<ItemInfo>();
|
||||
public readonly List<ItemBindInfo> Rigs = new List<ItemBindInfo>();
|
||||
public readonly HashSet<long> BindId = new HashSet<long>();
|
||||
public readonly List<long> Slots = new List<long>();
|
||||
|
||||
public async FTask GetBagInfo()
|
||||
{
|
||||
Items.Clear();
|
||||
Rigs.Clear();
|
||||
Slots.Clear();
|
||||
var response = (Game2C_GetItemsResponse)await Net.Call(new C2Game_GetItemsRequest());
|
||||
if (response.ErrorCode == ErrorCode.Success)
|
||||
{
|
||||
Items.AddRange(response.Items);
|
||||
Rigs.AddRange(response.Rigs);
|
||||
Slots.AddRange(response.Slots);
|
||||
|
||||
UpdateBindData();
|
||||
Log.Debug(
|
||||
@@ -146,6 +149,45 @@ namespace NBF.Fishing2
|
||||
|
||||
#endregion
|
||||
|
||||
#region 插槽
|
||||
|
||||
public ItemInfo GetSlotItem(int index)
|
||||
{
|
||||
if (index < Slots.Count && index >= 0)
|
||||
{
|
||||
var itemId = Slots[index];
|
||||
if (itemId > 0)
|
||||
{
|
||||
return Items.Find(t => t.Id == itemId);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async FTask SetSlot(int index, long id)
|
||||
{
|
||||
var response = (Game2C_SetSlotResponse)await Net.Call(new C2Game_SetSlotRequest()
|
||||
{
|
||||
Index = index,
|
||||
Id = id
|
||||
});
|
||||
Log.Info($"设置插槽结果={response.ErrorCode},参数 index={index} id={id}");
|
||||
if (response.ErrorCode == ErrorCode.Success)
|
||||
{
|
||||
Slots.Clear();
|
||||
Slots.AddRange(response.Slots);
|
||||
// SetBindItemData(id, response.Rigs);
|
||||
Notices.Show("插槽设置成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
Notices.Error("插槽设置失败");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ namespace Fantasy
|
||||
ErrorCode = default;
|
||||
Items.Clear();
|
||||
Rigs.Clear();
|
||||
Slots.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Game2C_GetItemsResponse>(this);
|
||||
#endif
|
||||
@@ -59,6 +60,8 @@ namespace Fantasy
|
||||
[ProtoMember(2)]
|
||||
public List<ItemBindInfo> Rigs = new List<ItemBindInfo>();
|
||||
[ProtoMember(3)]
|
||||
public List<long> Slots = new List<long>();
|
||||
[ProtoMember(4)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
@@ -195,6 +198,61 @@ namespace Fantasy
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// /////////// ******** 快速使用插槽 *******/////////////
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// 请求设置快速使用
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Game_SetSlotRequest : AMessage, ICustomRouteRequest
|
||||
{
|
||||
public static C2Game_SetSlotRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Game_SetSlotRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Index = default;
|
||||
Id = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Game_SetSlotRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Game2C_SetSlotResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Game_SetSlotRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.GameRoute;
|
||||
[ProtoMember(1)]
|
||||
public int Index { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long Id { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求设置快速使用响应
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Game2C_SetSlotResponse : AMessage, ICustomRouteResponse
|
||||
{
|
||||
public static Game2C_SetSlotResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Game2C_SetSlotResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Slots.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Game2C_SetSlotResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Game2C_SetSlotResponse; }
|
||||
[ProtoMember(1)]
|
||||
public List<long> Slots = new List<long>();
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// /////////// ******** 鱼护 *******/////////////
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
|
||||
@@ -68,6 +68,21 @@ namespace Fantasy
|
||||
return (Game2C_RigChangeResponse)await session.Call(request);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static async FTask<Game2C_SetSlotResponse> C2Game_SetSlotRequest(this Session session, C2Game_SetSlotRequest request)
|
||||
{
|
||||
return (Game2C_SetSlotResponse)await session.Call(request);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static async FTask<Game2C_SetSlotResponse> C2Game_SetSlotRequest(this Session session, int index, long id)
|
||||
{
|
||||
using var request = Fantasy.C2Game_SetSlotRequest.Create(session.Scene);
|
||||
request.Index = index;
|
||||
request.Id = id;
|
||||
return (Game2C_SetSlotResponse)await session.Call(request);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static async FTask<Game2C_GetFishsResponse> C2Game_GetFishsRequest(this Session session, C2Game_GetFishsRequest request)
|
||||
{
|
||||
|
||||
@@ -9,15 +9,17 @@ namespace Fantasy
|
||||
public const uint Game2C_ItemChange = 2147493649;
|
||||
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 C2Game_SetSlotRequest = 2281711380;
|
||||
public const uint Game2C_SetSlotResponse = 2415929108;
|
||||
public const uint C2Game_GetFishsRequest = 2281711381;
|
||||
public const uint Game2C_GetFishsResponse = 2415929109;
|
||||
public const uint Game2C_FishChange = 2147493650;
|
||||
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 C2Game_SellFishRequest = 2281711382;
|
||||
public const uint Game2C_SellFishResponse = 2415929110;
|
||||
public const uint C2Game_BuyRequest = 2281711383;
|
||||
public const uint Game2C_BuyResponse = 2415929111;
|
||||
public const uint C2Map_CreateRoomRequest = 2281711384;
|
||||
public const uint Map2C_CreateRoomResponse = 2415929112;
|
||||
public const uint C2G_ExitRoomRequest = 268445457;
|
||||
public const uint G2C_ExitRoomResponse = 402663185;
|
||||
public const uint C2G_EnterMapRequest = 268445458;
|
||||
@@ -28,8 +30,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 = 2281711384;
|
||||
public const uint Game2C_GetRoleInfoResponse = 2415929112;
|
||||
public const uint C2Game_GetRoleInfoRequest = 2281711385;
|
||||
public const uint Game2C_GetRoleInfoResponse = 2415929113;
|
||||
public const uint Map2C_RoleEnterRoomNotify = 2147493652;
|
||||
public const uint Map2C_RoleExitRoomNotify = 2147493653;
|
||||
public const uint C2Map_RolePropertyChange = 2147493654;
|
||||
@@ -40,37 +42,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 = 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 C2S_GetConversationsRequest = 2281711386;
|
||||
public const uint S2C_GetConversationsResponse = 2415929114;
|
||||
public const uint C2S_SendMailRequest = 2281711387;
|
||||
public const uint S2C_SendMailResponse = 2415929115;
|
||||
public const uint C2S_DeleteMailRequest = 2281711388;
|
||||
public const uint S2C_DeleteMailResponse = 2415929116;
|
||||
public const uint S2C_HaveMail = 2147493662;
|
||||
public const uint S2C_MailState = 2147493663;
|
||||
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 C2S_CreateChannelRequest = 2281711389;
|
||||
public const uint S2C_CreateChannelResponse = 2415929117;
|
||||
public const uint C2S_JoinChannelRequest = 2281711390;
|
||||
public const uint S2C_JoinChannelResponse = 2415929118;
|
||||
public const uint C2S_SendMessageRequest = 2281711391;
|
||||
public const uint S2C_SendMessageResponse = 2415929119;
|
||||
public const uint S2C_Message = 2147493664;
|
||||
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 C2S_CreateClubRequest = 2281711392;
|
||||
public const uint S2C_CreateClubResponse = 2415929120;
|
||||
public const uint C2S_GetClubInfoRequest = 2281711393;
|
||||
public const uint S2C_GetClubInfoResponse = 2415929121;
|
||||
public const uint C2S_GetMemberListRequest = 2281711394;
|
||||
public const uint S2C_GetMemberListResponse = 2415929122;
|
||||
public const uint C2S_GetClubListRequest = 2281711395;
|
||||
public const uint S2C_GetClubListResponse = 2415929123;
|
||||
public const uint C2S_JoinClubRequest = 2281711396;
|
||||
public const uint S2C_JoinClubResponse = 2415929124;
|
||||
public const uint C2S_LeaveClubRequest = 2281711397;
|
||||
public const uint S2C_LeaveClubResponse = 2415929125;
|
||||
public const uint C2S_DissolveClubRequest = 2281711398;
|
||||
public const uint S2C_DissolveClubResponse = 2415929126;
|
||||
public const uint C2S_DisposeJoinRequest = 2281711399;
|
||||
public const uint S2C_DisposeJoinResponse = 2415929127;
|
||||
public const uint S2C_ClubChange = 2147493665;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ namespace NBF
|
||||
private void AddUIPackages()
|
||||
{
|
||||
App.UI.AddPackage("Common/Common");
|
||||
App.UI.AddPackage("CommonFlag/CommonFlag");
|
||||
App.UI.AddPackage("CommonIcon/CommonIcon");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -91,7 +91,6 @@ namespace FairyGUI
|
||||
{
|
||||
if (_url == value)
|
||||
return;
|
||||
|
||||
ClearContent();
|
||||
_url = value;
|
||||
LoadContent();
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using NBC;
|
||||
using NBF.Utils;
|
||||
using Log = NBC.Log;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -12,23 +14,35 @@ namespace NBF
|
||||
{
|
||||
public ItemInfo ItemInfo;
|
||||
|
||||
// private string iconStr;
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
draggable = true;
|
||||
onDragStart.Add(context =>
|
||||
{
|
||||
context.PreventDefault();
|
||||
DragDropManager.inst.StartDrag(this, this.icon, this.icon, (int)context.data);
|
||||
});
|
||||
onDragStart.Add(DragStart);
|
||||
}
|
||||
|
||||
|
||||
private void DragStart(EventContext context)
|
||||
{
|
||||
context.PreventDefault();
|
||||
DragDropManager.inst.StartDrag(this, this.icon, this.icon, (int)context.data);
|
||||
// icon = string.Empty;
|
||||
}
|
||||
|
||||
public virtual void SetData(ItemInfo itemInfo)
|
||||
{
|
||||
draggable = false;
|
||||
ItemInfo = itemInfo;
|
||||
title = itemInfo.ConfigId.GetName();
|
||||
this.SetIcon(itemInfo.ConfigId);
|
||||
Quality.SetQuality(ItemInfo.Config.Quality);
|
||||
this.SetTitleQuality(ItemInfo.Config.Quality);
|
||||
// iconStr = icon;
|
||||
}
|
||||
|
||||
public void UpdateIcon()
|
||||
{
|
||||
this.SetIcon(ItemInfo.ConfigId);
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Assets/Scripts/UI/Bag/BagSlotItem.Designer.cs
generated
@@ -11,19 +11,25 @@ namespace NBF
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7puiwj1t";
|
||||
|
||||
public Controller showType;
|
||||
public GImage back;
|
||||
public GTextField TextIndex;
|
||||
public GTextField TextCount;
|
||||
public GImage Quality;
|
||||
public GButton BtnRemove;
|
||||
public GImage Add;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
showType = GetController("showType");
|
||||
back = (GImage)GetChild("back");
|
||||
TextIndex = (GTextField)GetChild("TextIndex");
|
||||
TextCount = (GTextField)GetChild("TextCount");
|
||||
Quality = (GImage)GetChild("Quality");
|
||||
BtnRemove = (GButton)GetChild("BtnRemove");
|
||||
Add = (GImage)GetChild("Add");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,78 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Fantasy;
|
||||
using NBC;
|
||||
using NBF.Fishing2;
|
||||
using NBF.Utils;
|
||||
using Log = NBC.Log;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class BagSlotItem : GButton
|
||||
{
|
||||
public int Index { get; private set; }
|
||||
|
||||
public Action<int, long> OnChangeSlot;
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
onDrop.Add(context => { this.icon = (string)context.data; });
|
||||
onDrop.Add(OnDrop);
|
||||
BtnRemove.onClick.Set(OnRemove);
|
||||
onClick.Add(OnClick);
|
||||
}
|
||||
|
||||
private void OnClick()
|
||||
{
|
||||
if (showType.selectedIndex == 0)
|
||||
{
|
||||
// Notices.Info("拖拽放入");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRemove(EventContext context)
|
||||
{
|
||||
context.PreventDefault();
|
||||
OnChangeSlot?.Invoke(Index, 0);
|
||||
}
|
||||
|
||||
private void OnDrop(EventContext context)
|
||||
{
|
||||
var obj = context.initiator;
|
||||
if (obj is BagItem bagItem)
|
||||
{
|
||||
Log.Info($"放下了:{bagItem.ItemInfo.Id}");
|
||||
OnChangeSlot?.Invoke(Index, bagItem.ItemInfo.Id);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetData(int index, ItemInfo itemInfo = null)
|
||||
{
|
||||
Index = index;
|
||||
TextIndex.text = (index + 1).ToString();
|
||||
if (itemInfo != null)
|
||||
{
|
||||
showType.selectedIndex = 1;
|
||||
icon = itemInfo.ConfigId.GetIcon();
|
||||
if (itemInfo.Count > 1)
|
||||
{
|
||||
TextCount.text = itemInfo.Count.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
TextCount.text = string.Empty;
|
||||
}
|
||||
|
||||
Quality.SetQuality(itemInfo.Config.Quality);
|
||||
}
|
||||
else
|
||||
{
|
||||
showType.selectedIndex = 0;
|
||||
TextCount.text = string.Empty;
|
||||
icon = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/BagSlotPanel.Designer.cs
generated
@@ -24,6 +24,8 @@ namespace NBF
|
||||
public GList SlotList;
|
||||
[AutoFind(Name = "SlotSeparator")]
|
||||
public GImage SlotSeparator;
|
||||
[AutoFind(Name = "Test")]
|
||||
public GLoader Test;
|
||||
public override string[] GetDependPackages(){ return new string[] {"Common"}; }
|
||||
|
||||
public static void Show(object param = null){ App.UI.OpenUI<BagSlotPanel>(param); }
|
||||
|
||||
@@ -14,24 +14,26 @@ namespace NBF
|
||||
{
|
||||
private List<ItemInfo> _items = new List<ItemInfo>();
|
||||
|
||||
private RoleBag _roleBag;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
// List.SetVirtual();
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
var role = App.Main.GetComponent<Role>();
|
||||
_roleBag = role.GetComponent<RoleBag>();
|
||||
SetList();
|
||||
SetSlotList();
|
||||
}
|
||||
|
||||
#region 物品列表
|
||||
|
||||
private void SetList()
|
||||
{
|
||||
|
||||
|
||||
var role = App.Main.GetComponent<Role>();
|
||||
var roleBag = role.GetComponent<RoleBag>();
|
||||
_items.Clear();
|
||||
foreach (var roleBagItem in roleBag.Items)
|
||||
foreach (var roleBagItem in _roleBag.Items)
|
||||
{
|
||||
if (CanShow(roleBagItem))
|
||||
{
|
||||
@@ -51,9 +53,41 @@ namespace NBF
|
||||
if (obj is BagItem bagItem)
|
||||
{
|
||||
bagItem.SetData(itemData);
|
||||
bagItem.draggable = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 快速选择列表
|
||||
|
||||
private void SetSlotList()
|
||||
{
|
||||
SlotList.RemoveChildrenToPool();
|
||||
for (int index = 0; index < 7; index++)
|
||||
{
|
||||
if (SlotList.AddItemFromPool() is BagSlotItem slotItem)
|
||||
{
|
||||
slotItem.SetData(index, _roleBag.GetSlotItem(index));
|
||||
slotItem.OnChangeSlot = OnChangeSlotItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnChangeSlotItem(int index, long id)
|
||||
{
|
||||
_roleBag.SetSlot(index, id).OnCompleted(OnChangeSlotItemDone);
|
||||
}
|
||||
|
||||
private void OnChangeSlotItemDone()
|
||||
{
|
||||
SetSlotList();
|
||||
// SlotList.RefreshVirtualList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private bool CanShow(ItemInfo itemInfo)
|
||||
{
|
||||
if (itemInfo.ItemType == ItemType.Rod)
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace NBF
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Info($"LoadExternal={url}");
|
||||
_texture = Resources.Load<Texture>(url);
|
||||
if (_texture != null)
|
||||
onExternalLoadSuccess(new NTexture(_texture));
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace NBF
|
||||
await LoginHelper.Login(InputAccount.text);
|
||||
|
||||
BagPanel.Show();
|
||||
// BagSlotPanel.Show();
|
||||
// FishingShopPanel.Show();
|
||||
|
||||
Del();
|
||||
|
||||
@@ -256,5 +256,5 @@
|
||||
<image id="oso170" name="gb-sct.png" path="/images/" exported="true"/>
|
||||
<image id="oso171" name="zw.png" path="/images/" exported="true"/>
|
||||
</resources>
|
||||
<publish name=""/>
|
||||
<publish name="" path="../Assets/Resources/Fgui/CommonFlag" packageCount="2"/>
|
||||
</packageDescription>
|
||||
BIN
FGUIProject/assets/CommonIcon/100001.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
FGUIProject/assets/CommonIcon/100002.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
FGUIProject/assets/CommonIcon/100003.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
FGUIProject/assets/CommonIcon/100004.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
FGUIProject/assets/CommonIcon/100005.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
FGUIProject/assets/CommonIcon/100006.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
FGUIProject/assets/CommonIcon/100007.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
FGUIProject/assets/CommonIcon/100008.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
FGUIProject/assets/CommonIcon/100009.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
FGUIProject/assets/CommonIcon/100010.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
FGUIProject/assets/CommonIcon/110001.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
FGUIProject/assets/CommonIcon/30001.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
FGUIProject/assets/CommonIcon/30002.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
FGUIProject/assets/CommonIcon/30003.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FGUIProject/assets/CommonIcon/30004.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
FGUIProject/assets/CommonIcon/30005.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
FGUIProject/assets/CommonIcon/30006.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
FGUIProject/assets/CommonIcon/30007.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
FGUIProject/assets/CommonIcon/30008.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
FGUIProject/assets/CommonIcon/30009.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
FGUIProject/assets/CommonIcon/30010.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
FGUIProject/assets/CommonIcon/30011.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
FGUIProject/assets/CommonIcon/31001.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
FGUIProject/assets/CommonIcon/32003.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FGUIProject/assets/CommonIcon/32004.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FGUIProject/assets/CommonIcon/32005.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FGUIProject/assets/CommonIcon/32006.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FGUIProject/assets/CommonIcon/32007.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FGUIProject/assets/CommonIcon/33002.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
FGUIProject/assets/CommonIcon/40001.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
FGUIProject/assets/CommonIcon/40002.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
FGUIProject/assets/CommonIcon/40003.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
FGUIProject/assets/CommonIcon/40004.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
FGUIProject/assets/CommonIcon/40005.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
FGUIProject/assets/CommonIcon/40006.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
FGUIProject/assets/CommonIcon/40007.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
FGUIProject/assets/CommonIcon/40008.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
FGUIProject/assets/CommonIcon/40009.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
FGUIProject/assets/CommonIcon/40010.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
FGUIProject/assets/CommonIcon/50001.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
FGUIProject/assets/CommonIcon/50002.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
FGUIProject/assets/CommonIcon/50003.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
FGUIProject/assets/CommonIcon/50004.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
FGUIProject/assets/CommonIcon/50005.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
FGUIProject/assets/CommonIcon/50006.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
FGUIProject/assets/CommonIcon/50007.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
FGUIProject/assets/CommonIcon/50008.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
FGUIProject/assets/CommonIcon/50009.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
FGUIProject/assets/CommonIcon/50010.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
FGUIProject/assets/CommonIcon/50011.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
FGUIProject/assets/CommonIcon/50012.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
FGUIProject/assets/CommonIcon/50013.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
FGUIProject/assets/CommonIcon/50014.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
FGUIProject/assets/CommonIcon/60001.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
FGUIProject/assets/CommonIcon/60002.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
FGUIProject/assets/CommonIcon/60003.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
FGUIProject/assets/CommonIcon/60004.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
FGUIProject/assets/CommonIcon/60005.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
FGUIProject/assets/CommonIcon/60006.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
FGUIProject/assets/CommonIcon/60007.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
FGUIProject/assets/CommonIcon/60008.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
FGUIProject/assets/CommonIcon/60009.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
FGUIProject/assets/CommonIcon/60010.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
FGUIProject/assets/CommonIcon/70001.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
FGUIProject/assets/CommonIcon/70002.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
FGUIProject/assets/CommonIcon/70003.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
FGUIProject/assets/CommonIcon/70004.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
FGUIProject/assets/CommonIcon/80001.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
FGUIProject/assets/CommonIcon/80002.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
FGUIProject/assets/CommonIcon/80003.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
FGUIProject/assets/CommonIcon/80004.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
FGUIProject/assets/CommonIcon/80005.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
FGUIProject/assets/CommonIcon/80006.png
Normal file
|
After Width: | Height: | Size: 24 KiB |