From 4b7a6b1dc8de7f4baffe3c98edc0acd82c2f6d50 Mon Sep 17 00:00:00 2001 From: BobSong <605277374@qq.com> Date: Fri, 23 May 2025 00:26:58 +0800 Subject: [PATCH] fk --- Assets/Resources/Fgui/Common/Common_fui.bytes | Bin 15958 -> 16350 bytes Assets/Resources/Fgui/Shop/Shop_fui.bytes | Bin 1425 -> 1476 bytes Assets/Scripts/UI/Binders/CommonBinder.cs | 1 + Assets/Scripts/UI/Binders/ShopBinder.cs | 1 + Assets/Scripts/UI/ListTitleItem.Designer.cs | 25 +++++++ .../Scripts/UI/ListTitleItem.Designer.cs.meta | 2 + Assets/Scripts/UI/ListTitleItem.cs | 15 ++++ Assets/Scripts/UI/ListTitleItem.cs.meta | 2 + Assets/Scripts/UI/Shops/FishingShopPanel.cs | 64 +++++++++++++++++- .../Scripts/UI/Shops/ShopGearItem.Designer.cs | 27 ++++++++ .../UI/Shops/ShopGearItem.Designer.cs.meta | 2 + Assets/Scripts/UI/Shops/ShopGearItem.cs | 15 ++++ Assets/Scripts/UI/Shops/ShopGearItem.cs.meta | 2 + .../assets/Common/Com/Items/ListTitleItem.xml | 9 +++ FGUIProject/assets/Common/CommonMenu.xml | 23 +++++-- FGUIProject/assets/Common/package.xml | 1 + FGUIProject/assets/Shop/FishingShopPanel.xml | 15 ++-- .../Shop/{TestItem.xml => ShopGearItem.xml} | 0 FGUIProject/assets/Shop/TitleItem.xml | 7 -- FGUIProject/assets/Shop/package.xml | 3 +- FGUIProject/settings/whoot/146ra2lqoome9.json | 1 + FGUIProject/settings/whoot/6hgkvlauoomea.json | 1 + 22 files changed, 194 insertions(+), 22 deletions(-) create mode 100644 Assets/Scripts/UI/ListTitleItem.Designer.cs create mode 100644 Assets/Scripts/UI/ListTitleItem.Designer.cs.meta create mode 100644 Assets/Scripts/UI/ListTitleItem.cs create mode 100644 Assets/Scripts/UI/ListTitleItem.cs.meta create mode 100644 Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs create mode 100644 Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs.meta create mode 100644 Assets/Scripts/UI/Shops/ShopGearItem.cs create mode 100644 Assets/Scripts/UI/Shops/ShopGearItem.cs.meta create mode 100644 FGUIProject/assets/Common/Com/Items/ListTitleItem.xml rename FGUIProject/assets/Shop/{TestItem.xml => ShopGearItem.xml} (100%) delete mode 100644 FGUIProject/assets/Shop/TitleItem.xml create mode 100644 FGUIProject/settings/whoot/146ra2lqoome9.json create mode 100644 FGUIProject/settings/whoot/6hgkvlauoomea.json diff --git a/Assets/Resources/Fgui/Common/Common_fui.bytes b/Assets/Resources/Fgui/Common/Common_fui.bytes index 39ae1c18455c87b1233d38af5f7732be3906b966..e7f06c1640ed79d4152d04b513e5d56e953e885c 100644 GIT binary patch delta 2011 zcmZvcYiv|S7>3{3vzOks(01D`&|SLQJ#DvJSPG#Hq17T9Ef&3TR7u+RJjDYqCW;;AO@ofRWi*Jafw*W#?oZDXSgjEle0a= zY5z~$=ZWO1#3VQoi*a9cvRX=Jd^ILXcXp`x>C9H=48MWdn1i`i18lEwqB^lK{@Vat zq5CQ$s(1Rin{L@Q46_bUfk7;v1z;G^h23}q^Jp3zy*SzS5(Q5L+_z}aV)=S{nmVFL z1>|z0yQdEGRZKls^uo@p=jr0T~jCv^s*LRCRZAj-gdYj^l(@ zC-IF|r|_*-r*THBv-nP{BzzxN73c5+_Q$KLWL1^-R&^dfb{=CtyP%CLj4~sR3-}2a zt&Uy7&$ukR=JybnE&D32(N?`|$FEvl$8XG@$(;C{8~8)dzKK7zx`n^Ax{W(=RndVM zE_Pn0P&Z!3a(RZ_d(I$i!r;#B`B_e3XUS`1N7r9KYzPRjvq7t#nedkR!qw#tspbHQ|t* z9SO?0O0X!oDI7{*=Qzp!f}9`Db5J?PQw3bNl-D`I(l?bh9*}`Zz_`I_(~C^k@A0kV z(V~EHoxVf#wOcDaXysj{&lfRWzgX)$V)-u7R~s>tFDReQ!8IMSCG0ac)87&?jV7{< z+(x>KO=CORpWI1Sle@@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d52e731993b72..ecc227018a7ca33aa5d4bea029ce210efd5c8ad2 100644 GIT binary patch delta 481 zcmY*UOD_Xa6#nkqX-C_s(o&3izp806X-R{y5JUvg)QXLC(Wu858YEV%#8RCFiJ#zS z5F0;0to#KFvFtdvjfIeT6EKS&y@@?n-YOd>)_7OeXo3ZW8WUf-o9-gS&G<*#*H_Ptva;aEZ LIW0MKso(tqlk8wJ delta 444 zcmZ8dOG^S#6#nkq866#a+e6dd_7K9d5DQ#H4+|lJf~X*n7{^GR-kS*e0WGxi4_ei- zZAhE?6a9fUK|et|j?kiW?|07m&OI;ghfy)gi;;0SqE0$Sux>!%J1p5qsP!6XSJ?<@ zfQyeCIy~^gfDbKbMH|}DK~*IzJJCfma*8xLDgEeXKQ49n$YkCFgUT{4y!6hj7k%_2 z_e6kVN)H{XotF5N2%^6+jpw`X05#dzGo#vgXv$x@Lsewlf|p8R z3CkQ=K?Vr16UIR0HCp)&xd)jIVVGLQTrmAFIo(Vi!6+Sw=%~}O>=E#DyH%vIj!oR) z7WdwIjlX6L5qc3(`VuK8-~`8MS{aCP=>+sd-a5H1WUt^_wu?o(1kJXK<^uE`^Wt*j v(kw#6D6TyOpyiHoRub)N#~1nIlC_<;Pq(rqvp|pPe#`89;yfEKoH@n6>t|Gt diff --git a/Assets/Scripts/UI/Binders/CommonBinder.cs b/Assets/Scripts/UI/Binders/CommonBinder.cs index f2a69153c..408e47da7 100644 --- a/Assets/Scripts/UI/Binders/CommonBinder.cs +++ b/Assets/Scripts/UI/Binders/CommonBinder.cs @@ -9,6 +9,7 @@ namespace NBF public static void BindAll() { UIObjectFactory.SetPackageItemExtension(CommonMenu.URL, typeof(CommonMenu)); + UIObjectFactory.SetPackageItemExtension(ListTitleItem.URL, typeof(ListTitleItem)); } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/Binders/ShopBinder.cs b/Assets/Scripts/UI/Binders/ShopBinder.cs index e76fbeb9a..ed1ebec53 100644 --- a/Assets/Scripts/UI/Binders/ShopBinder.cs +++ b/Assets/Scripts/UI/Binders/ShopBinder.cs @@ -8,6 +8,7 @@ namespace NBF { public static void BindAll() { + UIObjectFactory.SetPackageItemExtension(ShopGearItem.URL, typeof(ShopGearItem)); } } } \ No newline at end of file diff --git a/Assets/Scripts/UI/ListTitleItem.Designer.cs b/Assets/Scripts/UI/ListTitleItem.Designer.cs new file mode 100644 index 000000000..f568b9ea2 --- /dev/null +++ b/Assets/Scripts/UI/ListTitleItem.Designer.cs @@ -0,0 +1,25 @@ +/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/ + + +using FairyGUI; +using FairyGUI.Utils; +using NBC; + +namespace NBF +{ + public partial class ListTitleItem + { + public const string URL = "ui://6hgkvlauoomea"; + + public GImage back; + + public override void ConstructFromXML(XML xml) + { + base.ConstructFromXML(xml); + + back = (GImage)GetChild("back"); + OnInited(); + UILanguage.TrySetComponentLanguage(this); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/ListTitleItem.Designer.cs.meta b/Assets/Scripts/UI/ListTitleItem.Designer.cs.meta new file mode 100644 index 000000000..755046038 --- /dev/null +++ b/Assets/Scripts/UI/ListTitleItem.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8042079334b43394ca275c4a2189dbfb \ No newline at end of file diff --git a/Assets/Scripts/UI/ListTitleItem.cs b/Assets/Scripts/UI/ListTitleItem.cs new file mode 100644 index 000000000..7a570fe41 --- /dev/null +++ b/Assets/Scripts/UI/ListTitleItem.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class ListTitleItem : GComponent + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/ListTitleItem.cs.meta b/Assets/Scripts/UI/ListTitleItem.cs.meta new file mode 100644 index 000000000..b6211f138 --- /dev/null +++ b/Assets/Scripts/UI/ListTitleItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d1c42293e0f4ae546ba4419aa2ed199c \ No newline at end of file diff --git a/Assets/Scripts/UI/Shops/FishingShopPanel.cs b/Assets/Scripts/UI/Shops/FishingShopPanel.cs index 7b0c6529b..cfc683f6f 100644 --- a/Assets/Scripts/UI/Shops/FishingShopPanel.cs +++ b/Assets/Scripts/UI/Shops/FishingShopPanel.cs @@ -1,21 +1,51 @@ // 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖 +using System.Collections.Generic; using FairyGUI; -using UnityEngine; using NBC; using UIPanel = NBC.UIPanel; namespace NBF { + public class ListDataBase + { + public string title; + } + + public class ShopGearData : ListDataBase + { + } + public partial class FishingShopPanel : UIPanel { public override string UIPackName => "Shop"; public override string UIResName => "FishingShopPanel"; + private List _data = new List(); + protected override void OnInit() { base.OnInit(); this.AutoAddClick(OnClick); + Menu.OnClose += Hide; + + for (int i = 0; i < 10; i++) + { + var data = new ListDataBase(); + data.title = "Title" + i; + _data.Add(data); + for (int j = 0; j < 30; j++) + { + var item = new ShopGearData(); + item.title = $"Item {i}-" + j; + _data.Add(item); + } + } + + // List.SetVirtual(); + List.itemProvider = GetListItemResource; + List.itemRenderer = OnRenderItem; + List.numItems = _data.Count; } protected override void OnShow() @@ -23,6 +53,38 @@ namespace NBF base.OnShow(); } + void OnRenderItem(int index, GObject obj) + { + if (obj is ListTitleItem titleItem) + { + titleItem.width = List.width - 60; + titleItem.height = 47; + } + // else + // { + // obj.width = 224; + // obj.height = 320; + // } + } + + //根据索引的不同,返回不同的资源URL + string GetListItemResource(int index) + { + var itemData = _data[index]; + + if (itemData is ShopGearData shopItem) + { + return ShopGearItem.URL; + } + + if (itemData is ListDataBase item) + { + return ListTitleItem.URL; + } + + return List.defaultItem; + } + private void OnClick(GComponent btn) { // if (btn == BtnClose) diff --git a/Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs b/Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs new file mode 100644 index 000000000..726c5f1a9 --- /dev/null +++ b/Assets/Scripts/UI/Shops/ShopGearItem.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 ShopGearItem + { + public const string URL = "ui://146ra2lqoome9"; + + public GGraph select; + public GGraph over; + + public override void ConstructFromXML(XML xml) + { + base.ConstructFromXML(xml); + + select = (GGraph)GetChild("select"); + over = (GGraph)GetChild("over"); + OnInited(); + UILanguage.TrySetComponentLanguage(this); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs.meta b/Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs.meta new file mode 100644 index 000000000..738a7ce60 --- /dev/null +++ b/Assets/Scripts/UI/Shops/ShopGearItem.Designer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f1c9e707edc525b419a4d8469675a653 \ No newline at end of file diff --git a/Assets/Scripts/UI/Shops/ShopGearItem.cs b/Assets/Scripts/UI/Shops/ShopGearItem.cs new file mode 100644 index 000000000..68884d10d --- /dev/null +++ b/Assets/Scripts/UI/Shops/ShopGearItem.cs @@ -0,0 +1,15 @@ +// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 + +using UnityEngine; +using FairyGUI; +using NBC; + +namespace NBF +{ + public partial class ShopGearItem : GButton + { + private void OnInited() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/UI/Shops/ShopGearItem.cs.meta b/Assets/Scripts/UI/Shops/ShopGearItem.cs.meta new file mode 100644 index 000000000..23d31ebb1 --- /dev/null +++ b/Assets/Scripts/UI/Shops/ShopGearItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 88f8461d076edc549bc841c01f0e42a3 \ No newline at end of file diff --git a/FGUIProject/assets/Common/Com/Items/ListTitleItem.xml b/FGUIProject/assets/Common/Com/Items/ListTitleItem.xml new file mode 100644 index 000000000..e896adae7 --- /dev/null +++ b/FGUIProject/assets/Common/Com/Items/ListTitleItem.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/FGUIProject/assets/Common/CommonMenu.xml b/FGUIProject/assets/Common/CommonMenu.xml index 5d0c39b5f..5666b0455 100644 --- a/FGUIProject/assets/Common/CommonMenu.xml +++ b/FGUIProject/assets/Common/CommonMenu.xml @@ -2,7 +2,8 @@ - + + @@ -10,12 +11,20 @@ - - - - + + - - + + + + + + + + + + + + \ No newline at end of file diff --git a/FGUIProject/assets/Common/package.xml b/FGUIProject/assets/Common/package.xml index cb4a426a5..30be1fa69 100644 --- a/FGUIProject/assets/Common/package.xml +++ b/FGUIProject/assets/Common/package.xml @@ -114,6 +114,7 @@ + \ No newline at end of file diff --git a/FGUIProject/assets/Shop/FishingShopPanel.xml b/FGUIProject/assets/Shop/FishingShopPanel.xml index 78bf8bbe6..bdf5c48c7 100644 --- a/FGUIProject/assets/Shop/FishingShopPanel.xml +++ b/FGUIProject/assets/Shop/FishingShopPanel.xml @@ -1,13 +1,18 @@ - + + + - - - + + + + + + @@ -33,7 +38,7 @@ - + diff --git a/FGUIProject/assets/Shop/TestItem.xml b/FGUIProject/assets/Shop/ShopGearItem.xml similarity index 100% rename from FGUIProject/assets/Shop/TestItem.xml rename to FGUIProject/assets/Shop/ShopGearItem.xml diff --git a/FGUIProject/assets/Shop/TitleItem.xml b/FGUIProject/assets/Shop/TitleItem.xml deleted file mode 100644 index fbb943f1d..000000000 --- a/FGUIProject/assets/Shop/TitleItem.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/FGUIProject/assets/Shop/package.xml b/FGUIProject/assets/Shop/package.xml index 85ff93e31..456635e3a 100644 --- a/FGUIProject/assets/Shop/package.xml +++ b/FGUIProject/assets/Shop/package.xml @@ -9,8 +9,7 @@ - - + \ No newline at end of file diff --git a/FGUIProject/settings/whoot/146ra2lqoome9.json b/FGUIProject/settings/whoot/146ra2lqoome9.json new file mode 100644 index 000000000..248f41442 --- /dev/null +++ b/FGUIProject/settings/whoot/146ra2lqoome9.json @@ -0,0 +1 @@ +{"url":"ui://146ra2lqoome9","name":"ShopGearItem","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}} \ No newline at end of file diff --git a/FGUIProject/settings/whoot/6hgkvlauoomea.json b/FGUIProject/settings/whoot/6hgkvlauoomea.json new file mode 100644 index 000000000..db5406667 --- /dev/null +++ b/FGUIProject/settings/whoot/6hgkvlauoomea.json @@ -0,0 +1 @@ +{"url":"ui://6hgkvlauoomea","name":"ListTitleItem","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}} \ No newline at end of file