修改ui样式

This commit is contained in:
Bob.Song
2026-02-04 18:55:28 +08:00
parent b6570fa8fa
commit ca9226015d
154 changed files with 13770 additions and 338 deletions

View File

@@ -2,14 +2,8 @@
<component size="1920,1080" extention="Label">
<displayList>
<loader id="n36_gii7" name="Back" xy="0,0" size="1920,1080" url="ui://6hgkvlaumbu9ye" align="center" vAlign="middle" fill="scale" clearOnPublish="true"/>
<image id="n38_xd2f" name="back" src="vbojnh" fileName="ImagesNew/Square/square128_fill.png" xy="0,0" size="1920,1080" alpha="0.96" color="#000000">
<image id="n38_xd2f" name="back" src="vbojnh" fileName="ImagesNew/Square/square128_fill.png" xy="1,0" size="1920,1080" alpha="0.7">
<relation target="" sidePair="width-width,height-height"/>
</image>
<image id="n39_mbu9" name="n39" src="vbojs9" fileName="ImagesNew/Glow/glow_horizontal/glow_horizontal_3.png" xy="0,0" size="1920,523" color="#000000">
<relation target="" sidePair="center-center,top-top"/>
</image>
<image id="n40_mbu9" name="n40" src="vbojsb" fileName="ImagesNew/Glow/glow_horizontal/glow_horizontal_1.png" xy="0,557" size="1920,523" color="#000000">
<relation target="" sidePair="center-center,bottom-bottom"/>
</image>
</displayList>
</component>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="28,28" pivot="0.5,0.5" extention="Button">
<displayList>
<loader id="n10_fcfg" name="icon" xy="0,0" size="28,28" url="ui://xo76q8wzfcfgg1" fill="scale" color="#7888a0">
<loader id="n10_fcfg" name="icon" xy="0,0" size="28,28" url="ui://xo76q8wzfcfgg1" fill="scale" color="#fe8d1d">
<relation target="" sidePair="width-width,height-height"/>
</loader>
</displayList>
<Button downEffect="scale" downEffectValue=".95"/>
<Button downEffect="scale" downEffectValue="0.95"/>
</component>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="34,28" pivot="0.5,0.5" extention="Button">
<component size="34,24" pivot="0.5,0.5" extention="Button">
<controller name="show" pages="0,,1," selected="0"/>
<displayList>
<loader id="n11_r03u" name="icon" xy="3,0" size="28,28" url="ui://6hgkvlauvbojv2" align="center" vAlign="middle" fill="scaleMatchHeight">
<loader id="n11_r03u" name="icon" xy="3,0" size="28,24" url="ui://6hgkvlauvbojv2" align="center" vAlign="middle" fill="scaleMatchHeight" color="#e2fffb">
<relation target="" sidePair="center-center,middle-middle"/>
</loader>
</displayList>

View File

@@ -2,8 +2,8 @@
<component size="79,32" pivot="0.5,0.5" extention="Button">
<controller name="show" pages="0,,1," selected="0"/>
<displayList>
<loader id="n9_r03u" name="icon" xy="0,2" size="34,28" url="ui://6hgkvlauvbojv2" align="center" vAlign="middle" fill="scaleMatchHeight"/>
<text id="n10_r03u" name="title" xy="38,2" size="41,28" font="ui://6hgkvlaugkm7w" fontSize="19" color="#ffffff" text="继续"/>
<loader id="n9_r03u" name="icon" xy="0,2" size="34,28" url="ui://6hgkvlauvbojv2" align="center" vAlign="middle" fill="scaleMatchHeight" color="#e2fffb"/>
<text id="n10_r03u" name="title" xy="38,2" size="41,28" font="ui://6hgkvlaugkm7w" fontSize="19" color="#e2fffb" text="继续"/>
</displayList>
<Button downEffect="scale" downEffectValue="0.95"/>
<relation target="n10_r03u" sidePair="rightext-right"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1007" designImage="ui://hxr7rc7pr03ue" designImageAlpha="0">
<controller name="style" pages="1,oneMenu,2,twoMenu" selected="0">
<component size="1920,1007" designImage="ui://6hgkvlaudczwyu" designImageAlpha="2">
<controller name="style" pages="1,oneMenu,2,twoMenu" selected="1">
<remark page="0" value="一级菜单"/>
<remark page="1" value="二级菜单"/>
</controller>
@@ -8,12 +8,12 @@
<component id="n3_fcfg" name="Menu" src="fcfggr" fileName="Com/Menu/CommonMenu.xml" xy="0,0">
<relation target="" sidePair="width-width,center-center,top-top"/>
</component>
<component id="n25_r03u" name="SubMenu" src="r03us" fileName="Com/Menu/CommonSubMenu.xml" xy="76,128">
<component id="n25_r03u" name="SubMenu" src="r03us" fileName="Com/Menu/CommonSubMenu.xml" xy="0,90">
<gearDisplay controller="style" pages="2"/>
</component>
<component id="n6_drkw" name="List" src="drkwh1" fileName="Com/ClassifyList.xml" xy="49,113" size="1846,892">
<gearXY controller="style" pages="1,2" values="49,113|49,216"/>
<gearSize controller="style" pages="1,2" values="1846,892,1,1|1846,790,1,1"/>
<component id="n6_drkw" name="List" src="drkwh1" fileName="Com/ClassifyList.xml" xy="42,166" size="1846,840">
<gearXY controller="style" pages="1,2" values="49,113|42,166"/>
<gearSize controller="style" pages="1,2" values="1846,892,1,1|1846,840,1,1"/>
<relation target="" sidePair="width-width,top-top,bottomext-bottom"/>
</component>
</displayList>

View File

@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,66">
<component size="1920,60" designImage="ui://6hgkvlaudczwyw">
<displayList>
<list id="n33_9lmc" name="List" xy="980,13" size="891,40" layout="row" colGap="32" defaultItem="ui://6hgkvlaur03uj0" align="right" vAlign="middle" autoClearItems="true">
<list id="n33_9lmc" name="List" xy="991,13" size="891,40" layout="row" colGap="32" defaultItem="ui://6hgkvlaur03uj0" align="right" vAlign="middle" autoClearItems="true">
<relation target="" sidePair="right-right,top-top"/>
<item title="按钮1"/>
<item title="按钮2"/>
<item/>
<item/>
</list>
<list id="n34_9mf1" name="LeftList" xy="52,13" size="713,40" layout="row" colGap="32" defaultItem="ui://6hgkvlaur03uj0" vAlign="middle" autoClearItems="true">
<list id="n34_9mf1" name="LeftList" xy="39,13" size="713,40" layout="row" colGap="32" defaultItem="ui://6hgkvlaur03uj0" vAlign="middle" autoClearItems="true">
<relation target="" sidePair="left-left,top-top"/>
<item/>
<item/>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,95" extention="Label" designImage="ui://6hgkvlaufcfgh0" designImageAlpha="0">
<component size="1920,90" extention="Label" designImage="ui://6hgkvlaudczwyv" designImageAlpha="10">
<displayList>
<image id="n14_r03u" name="n14" src="kryob" fileName="Images/Square.png" pkg="xo76q8wz" xy="0,93" pivot="0,1" size="1920,2" color="#323232">
<relation target="" sidePair="width-width,bottom-bottom"/>
<image id="n17_dczw" name="n17" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" xy="-7,20" size="894,60" color="#3d5c7a">
<relation target="n15_vboj" sidePair="middle-middle,rightext-right"/>
</image>
<list id="n15_vboj" name="List" xy="104,7" size="646,88" layout="row" overflow="hidden" scroll="horizontal" defaultItem="ui://6hgkvlauvbojt5" autoClearItems="true">
<item title="主页"/>
<item title="商店"/>
<item title="设置"/>
<item title="排行"/>
<item title="档案"/>
<item title="设置"/>
<list id="n15_vboj" name="List" xy="107,20" size="677,60" layout="row" overflow="hidden" scroll="horizontal" defaultItem="ui://6hgkvlauvbojt5" autoClearItems="true">
<item title="Home"/>
<item title="Menu1"/>
<item title="Menu2"/>
<item title="Menu3"/>
<item title="Menu4"/>
<item title="Menu5"/>
</list>
<component id="n11_r03u" name="BtnPrev" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="58,33"/>
<component id="n12_r03u" name="BtnNext" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="767,33">
<component id="n11_r03u" name="BtnPrev" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="59,36"/>
<component id="n12_r03u" name="BtnNext" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="800,36">
<relation target="n15_vboj" sidePair="middle-middle,right-right"/>
</component>
</displayList>

View File

@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,52">
<component size="1920,50" designImage="ui://6hgkvlaudczwyv" designImageOffsetY="-90" designImageAlpha="10">
<displayList>
<list id="n29_vboj" name="List" xy="50,0" size="704,52" layout="row" colGap="-36" defaultItem="ui://6hgkvlauvbojxi" autoClearItems="true">
<item url="ui://6hgkvlaumbu9y9"/>
<item/>
<image id="n30_dczw" name="n30" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" xy="-9,0" size="923,50" color="#3d5c7a">
<relation target="n29_vboj" sidePair="middle-middle,rightext-right"/>
</image>
<list id="n29_vboj" name="List" xy="111,0" size="704,50" layout="row" defaultItem="ui://6hgkvlauvbojxi" autoClearItems="true">
<item url="ui://6hgkvlaudczwyz"/>
<item/>
<item url="ui://6hgkvlaudczwyz"/>
<item/>
</list>
<component id="n27_r03u" name="BtnPrev" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="1,12"/>
<component id="n28_r03u" name="BtnNext" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="773,12">
<component id="n27_r03u" name="BtnPrev" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="59,13"/>
<component id="n28_r03u" name="BtnNext" src="r03ut" fileName="Com/Buttons/BtnInputControl.xml" xy="834,13">
<relation target="n29_vboj" sidePair="middle-middle,right-right"/>
</component>
</displayList>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080">
<displayList>
<image id="n20_oh2q" name="n20" src="oh2qyo" fileName="ImagesNew/Square/mini/square24_fill.png" xy="0,0" size="1920,1080" alpha="0.3">
<relation target="" sidePair="width-width,height-height,middle-middle"/>
</image>
</displayList>
</component>

View File

@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,90">
<component size="1920,80">
<displayList>
<text id="n17_d3lv" name="TextTitle" xy="70,11" size="114,66" font="ui://6hgkvlaugkm7v" fontSize="50" color="#07acda" letterSpacing="12" text="选项"/>
<image id="n20_mbu9" name="n20" src="kryob" fileName="Images/Square.png" pkg="xo76q8wz" xy="0,88" pivot="0,1" size="1920,2" alpha="0.1" color="#323232">
<relation target="" sidePair="width-width,bottom-bottom"/>
</image>
<text id="n17_d3lv" name="TextTitle" xy="36,12" size="83,46" font="ui://6hgkvlaugkm7v" fontSize="34" color="#303f4e" letterSpacing="12" text="选项"/>
</displayList>
</component>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="330,76">
<component size="330,85">
<controller name="style" exported="true" pages="0,tips,1,success,2,error,3,warning" selected="0">
<remark page="0" value="提示"/>
<remark page="1" value="成功"/>
@@ -7,19 +7,19 @@
<remark page="3" value="警告"/>
</controller>
<displayList>
<image id="n1_r03u" name="box" src="r03uia" fileName="Images/Panels/ChatBgLeft.png" xy="0,0" size="330,76" color="#d8fbff" pkg="xo76q8wz">
<image id="n1_r03u" name="box" src="r03uia" fileName="Images/Panels/ChatBgLeft.png" pkg="xo76q8wz" xy="0,0" size="330,85">
<gearLook controller="style" default="1,0,0,0"/>
<gearColor controller="style" pages="0,2,3" values="#d8fbff|#fd6b6d|#faad14" default="#52c41a"/>
<gearColor controller="style" pages="0,2,3" values="#ffffff|#fd6b6d|#faad14" default="#52c41a"/>
<relation target="" sidePair="width-width,height-height,left-left"/>
</image>
<text id="n2_r03u" name="TextTitle" xy="45,10" pivot="0.5,0.5" size="43,29" font="ui://6hgkvlaugkm7v" fontSize="20" color="#05cfa4" shadowColor="#000000" shadowOffset="1,1" text="成功">
<text id="n2_r03u" name="TextTitle" xy="41,6" pivot="0.5,0.5" size="51,34" font="ui://6hgkvlaugkm7v" fontSize="24" color="#05cfa4" shadowColor="#000000" shadowOffset="1,1" text="成功">
<gearColor controller="style" pages="0,1,2,3" values="#05cfa4,#000000|#52c41a,#000000|#fd6b6d,#000000|#faad14,#000000"/>
</text>
<text id="n3_r03u" name="TextContent" xy="44,39" size="270,24" font="ui://6hgkvlaugkm7w" fontSize="16" color="#d8fbff" vAlign="middle" autoSize="height" text="这个操作将不能恢复"/>
<text id="n3_r03u" name="TextContent" xy="44,43" size="270,29" font="ui://6hgkvlaugkm7w" fontSize="20" color="#303f4e" vAlign="middle" autoSize="height" text="这个操作将不能恢复"/>
<loader id="n4_r03u" name="icon" xy="14,16" size="22,22" url="ui://xo76q8wzr03uj6" fill="scale">
<gearIcon controller="style" pages="0,2,3" values="ui://xo76q8wzr03uj6|ui://xo76q8wzr03uj4|ui://xo76q8wzr03uj5" default="ui://xo76q8wzr03uj3"/>
</loader>
<component id="n5_r03u" name="BtnClose" src="fcfggb" fileName="Com/Buttons/BtnClose.xml" xy="292,12" scale="0.5,0.5" visible="false"/>
<component id="n5_r03u" name="BtnClose" src="fcfggb" fileName="Com/Buttons/BtnClose.xml" xy="297,4" scale="0.5,0.5" visible="false"/>
</displayList>
<relation target="n3_r03u" sidePair="bottomext-bottom"/>
</component>

View File

@@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="100,88" extention="Button">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="0"/>
<component size="110,60" extention="Button" designImage="ui://6hgkvlaudczwyv" designImageOffsetX="-369" designImageOffsetY="-20" designImageAlpha="0">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="2"/>
<displayList>
<image id="n4_vboj" name="n4" src="vbojsb" fileName="ImagesNew/Glow/glow_horizontal/glow_horizontal_1.png" xy="0,0" size="100,88" alpha="0.2" color="#07acda">
<gearDisplay controller="button" pages="3,4,5"/>
<relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
<image id="n11_dczw" name="n11" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" xy="0,0" size="110,60" color="#fe8d1d">
<gearLook controller="button" pages="2" values="0,0,0,0" default="1,0,0,0" tween="true"/>
</image>
<image id="n3_vboj" name="n3" src="vbojpz" fileName="ImagesNew/Line/line_h.png" xy="0,86" size="100,2" color="#07acda">
<gearDisplay controller="button" pages="3,4,5"/>
<relation target="" sidePair="width-width,center-center,bottom-bottom"/>
</image>
<text id="n10_vboj" name="title" xy="26,27" pivot="0.5,0.5" size="47,32" fontSize="22" color="#e4dbdb" align="center" vAlign="middle" text="主页">
<text id="n10_vboj" name="title" xy="29,13" pivot="0.5,0.5" size="51,34" fontSize="24" color="#ffffff" align="center" vAlign="middle" shadowColor="#33000000" shadowOffset="1,1" text="主页">
<gearColor controller="button" default="#ffffff,#000000"/>
<relation target="" sidePair="center-center,middle-middle"/>
</text>
</displayList>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="130,50" extention="Button">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="0"/>
<displayList>
<image id="n14_vboj" name="back" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" xy="0,0" size="130,50" alpha="0" color="#fe8d1d">
<gearLook controller="button" pages="2,3,4,5" values="0,0,0,0|1,0,0,0|0.9,0,0,0|1,0,0,0" tween="true"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<text id="n15_vboj" name="title" xy="50,10" pivot="0.5,0.5" size="62,29" fontSize="20" color="#ffffff" align="center" vAlign="middle" shadowColor="#33000000" shadowOffset="1,1" text="Name">
<relation target="" sidePair="center-center,middle-middle"/>
</text>
<loader id="n16_dczw" name="icon" xy="16,11" size="26,26" url="ui://6hgkvlauvbojwk" align="center" vAlign="middle" fill="scale">
<relation target="n15_vboj" sidePair="middle-middle,left-left"/>
</loader>
</displayList>
<Button mode="Radio"/>
<relation target="n15_vboj" sidePair="width-width,height-height"/>
</component>

View File

@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="210,52" extention="Button">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="2"/>
<component size="110,50" extention="Button">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="1"/>
<displayList>
<image id="n14_vboj" name="back" src="vbojxg" fileName="ImagesNew/Button/SubMenuMid.png" xy="0,0" size="210,52" alpha="0.9" color="#0c0c0c">
<gearLook controller="button" pages="2,3,4,5" values="0.9,0,0,0|1,0,0,0|0.9,0,0,0|1,0,0,0"/>
<gearColor controller="button" pages="2,3,4,5" values="#0c0c0c|#cccccc|#0c0c0c|#cccccc"/>
<image id="n14_vboj" name="back" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" xy="0,0" size="110,50" color="#fe8d1d">
<gearLook controller="button" pages="2,3,4,5" values="0,0,0,0|1,0,0,0|0.9,0,0,0|1,0,0,0" tween="true"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<text id="n15_vboj" name="title" xy="67,11" pivot="0.5,0.5" size="75,26" fontSize="18" color="#6b6d6c" align="center" vAlign="middle" text="随身武器">
<gearColor controller="button" pages="3" values="#323232,#000000" default="#6b6d6c,#000000"/>
<text id="n15_vboj" name="title" xy="24,10" pivot="0.5,0.5" size="62,29" fontSize="20" color="#ffffff" align="center" vAlign="middle" shadowColor="#33000000" shadowOffset="1,1" text="Name">
<relation target="" sidePair="center-center,middle-middle"/>
</text>
</displayList>
<Button mode="Radio"/>
<relation target="n15_vboj" sidePair="width-width,height-height"/>
</component>

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="176,52" extention="Button">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="2"/>
<displayList>
<image id="n14_vboj" name="back" src="vbojxf" fileName="ImagesNew/Button/SubMenuLeft.png" xy="0,0" size="176,52" alpha="0.9" color="#0c0c0c">
<gearLook controller="button" pages="2,3,4,5" values="0.9,0,0,0|1,0,0,0|0.9,0,0,0|1,0,0,0"/>
<gearColor controller="button" pages="2,3,4,5" values="#0c0c0c|#cccccc|#0c0c0c|#cccccc"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<text id="n15_vboj" name="title" xy="33,13" pivot="0.5,0.5" size="75,26" fontSize="18" color="#6b6d6c" align="center" vAlign="middle" text="随身武器">
<gearColor controller="button" pages="3" values="#323232,#000000" default="#6b6d6c,#000000"/>
<relation target="" sidePair="center-center,middle-middle"/>
</text>
</displayList>
<Button mode="Radio"/>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

View File

@@ -2,22 +2,18 @@
<component size="1920,1080">
<controller name="MessageStyle" pages="0,默认,1,只有确定" selected="0"/>
<displayList>
<image id="n8_r03u" name="back" src="kryob" fileName="Images/Square.png" xy="475,423" size="970,233" color="#08101b" pkg="xo76q8wz">
<image id="n8_r03u" name="back" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" xy="459,431" size="1002,218">
<relation target="" sidePair="center-center,middle-middle"/>
</image>
<image id="n5_r03u" name="n5" src="kryob" fileName="Images/Square.png" xy="477,582" size="966,2" alpha="0.3" color="#8bf3ff" pkg="xo76q8wz">
<relation target="n4_r03u" sidePair="center-center,bottom-bottom"/>
</image>
<image id="n4_r03u" name="box" src="r03ui7" fileName="Images/Panels/BasicStroke.png" xy="475,423" size="970,233" alpha="0.3" color="#8bf3ff" pkg="xo76q8wz">
<relation target="n8_r03u" sidePair="center-center,middle-middle"/>
</image>
<text id="n6_r03u" name="TextTitle" xy="878,490" pivot="0.5,0.5" size="163,35" font="ui://6hgkvlaugkm7v" fontSize="25" color="#8bf3ff" text="你确定删除吗?">
<image id="n15_oh2q" name="n15" src="dczwyx" fileName="ImagesNew/Square/mini/square24_round8px_bottom.png" xy="459,589" size="1002,61" color="#3d5c7a"/>
<text id="n6_r03u" name="TextTitle" xy="903,472" pivot="0.5,0.5" size="114,42" font="ui://6hgkvlaugkm7v" fontSize="30" color="#303f4e" align="center" vAlign="middle" text="REVERT">
<relation target="n8_r03u" sidePair="center-center,middle-middle"/>
</text>
<text id="n19_oh2q" name="TextContent" xy="934,522" size="52,30" fontSize="21" color="#303f4e" align="center" vAlign="middle" text="Back"/>
<component id="n11_r03u" name="BtnCancel" src="r03uj0" fileName="Com/Buttons/BtnTitleInputControl.xml" xy="790,604" size="85,32" group="n12_oivj">
<gearDisplay controller="MessageStyle" pages="0"/>
<relation target="n8_r03u" sidePair="center-center,bottom-bottom"/>
<Button title="退出" icon="ui://6hgkvlau9mf1jw"/>
<Button title="退出" icon="ui://6hgkvlauvbojvi"/>
</component>
<component id="n9_r03u" name="BtnConfirm" src="r03uj0" fileName="Com/Buttons/BtnTitleInputControl.xml" xy="1045,604" size="85,32" group="n12_oivj">
<relation target="n8_r03u" sidePair="center-center,bottom-bottom"/>
@@ -27,4 +23,5 @@
<relation target="" sidePair="center-center,middle-middle"/>
</group>
</displayList>
<transition name="t0"/>
</component>

View File

@@ -27,10 +27,8 @@
<component id="fcfggb" name="BtnClose.xml" path="/Com/Buttons/" exported="true"/>
<component id="fcfggj" name="BtnIcon2.xml" path="/Com/Buttons/" exported="true"/>
<component id="fcfggq" name="CurrencyGroup.xml" path="/Com/Tags/" exported="true"/>
<image id="fcfg9" name="20250521000344_1.jpg" path="/效果图/"/>
<component id="fcfggr" name="CommonMenu.xml" path="/Com/Menu/" exported="true"/>
<component id="fcfggs" name="ButtonTab.xml" path="/Com/Menu/" exported="true"/>
<image id="fcfgh0" name="20250521222909_1.jpg" path="/效果图/"/>
<component id="oomej" name="VerticalroScrollBar.xml" path="/Com/ScrollBar/" exported="true"/>
<component id="oomei" name="VerticalroScrollBar_grip.xml" path="/Com/ScrollBar/"/>
<component id="drkwh1" name="ClassifyList.xml" path="/Com/" exported="true"/>
@@ -67,7 +65,6 @@
<component id="nzfpme" name="BtnCommonIcon.xml" path="/Com/Buttons/" exported="true"/>
<component id="xd2fmf" name="Back2.xml" path="/Com/Back/" exported="true"/>
<component id="xd2fml" name="ModelViewer.xml" path="/Com/" exported="true"/>
<image id="vbojmm" name="后血武器库.jpg" path="/效果图/"/>
<component id="vbojmn" name="Test.xml" path="/ComNew/"/>
<image id="vbojmo" name="triangle.png" path="/ImagesNew/Triangle/" exported="true"/>
<image id="vbojmp" name="square128_round15px_stroke2px.png" path="/ImagesNew/Square/"/>
@@ -99,7 +96,7 @@
<image id="vbojnf" name="pattern128_8.png" path="/ImagesNew/Pattern/"/>
<image id="vbojng" name="pattern128_9.png" path="/ImagesNew/Pattern/"/>
<image id="vbojnh" name="square128_fill.png" path="/ImagesNew/Square/" exported="true" scale="9grid" scale9grid="6,6,117,116"/>
<image id="vbojni" name="square128_round10px_fill.png" path="/ImagesNew/Square/"/>
<image id="vbojni" name="square128_round10px_fill.png" path="/ImagesNew/Square/" exported="true" scale="9grid" scale9grid="32,32,64,64"/>
<image id="vbojnj" name="square128_round10px_stroke10px.png" path="/ImagesNew/Square/"/>
<image id="vbojnk" name="square128_round10px_stroke1px.png" path="/ImagesNew/Square/"/>
<image id="vbojnl" name="square128_round10px_stroke20px.png" path="/ImagesNew/Square/"/>
@@ -111,9 +108,9 @@
<image id="vbojnr" name="pattern128_67.png" path="/ImagesNew/Pattern/"/>
<image id="vbojns" name="square128_round30px_stroke3px.png" path="/ImagesNew/Square/"/>
<image id="vbojnt" name="square128_round30px_stroke8px.png" path="/ImagesNew/Square/"/>
<image id="vbojnu" name="square128_round5px_stroke3px.png" path="/ImagesNew/Square/"/>
<image id="vbojnu" name="square128_round5px_stroke3px.png" path="/ImagesNew/Square/" exported="true" scale="9grid" scale9grid="32,32,64,64"/>
<image id="vbojnv" name="square128_round5px_stroke5px.png" path="/ImagesNew/Square/"/>
<image id="vbojnw" name="square128_round5px_stroke8px.png" path="/ImagesNew/Square/"/>
<image id="vbojnw" name="square128_round5px_stroke8px.png" path="/ImagesNew/Square/" exported="true" scale="9grid" scale9grid="32,32,64,64"/>
<image id="vbojnx" name="square128_round60px_fill.png" path="/ImagesNew/Square/"/>
<image id="vbojny" name="square128_round60px_stroke10px.png" path="/ImagesNew/Square/"/>
<image id="vbojnz" name="square128_round60px_stroke1px.png" path="/ImagesNew/Square/"/>
@@ -147,7 +144,7 @@
<image id="vbojor" name="square128_round50px_stroke3px.png" path="/ImagesNew/Square/"/>
<image id="vbojos" name="square128_round50px_stroke5px.png" path="/ImagesNew/Square/"/>
<image id="vbojot" name="square128_round50px_stroke8px.png" path="/ImagesNew/Square/"/>
<image id="vbojou" name="square128_round5px_fill.png" path="/ImagesNew/Square/"/>
<image id="vbojou" name="square128_round5px_fill.png" path="/ImagesNew/Square/" exported="true" scale="9grid" scale9grid="32,32,64,64"/>
<image id="vbojov" name="square128_round30px_stroke5px.png" path="/ImagesNew/Square/"/>
<image id="vbojow" name="square128_stroke5px.png" path="/ImagesNew/Square/"/>
<image id="vbojox" name="pattern128_66.png" path="/ImagesNew/Pattern/"/>
@@ -169,7 +166,7 @@
<image id="vbojpd" name="pattern128_25.png" path="/ImagesNew/Pattern/"/>
<image id="vbojpe" name="pattern128_26.png" path="/ImagesNew/Pattern/"/>
<image id="vbojpf" name="pattern128_2.png" path="/ImagesNew/Pattern/"/>
<image id="vbojpg" name="pattern128_10.png" path="/ImagesNew/Pattern/"/>
<image id="vbojpg" name="pattern128_10.png" path="/ImagesNew/Pattern/" scale="tile"/>
<image id="vbojph" name="pattern128_1.png" path="/ImagesNew/Pattern/"/>
<image id="vbojpi" name="line_v.png" path="/ImagesNew/Line/" scale="9grid" scale9grid="0,2,1,3"/>
<image id="vbojpj" name="triangle_round.png" path="/ImagesNew/Triangle/" exported="true"/>
@@ -204,14 +201,14 @@
<image id="vbojqc" name="pattern128_56.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqd" name="pattern128_58.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqe" name="pattern128_59.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqf" name="pattern128_6.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqf" name="pattern128_6.png" path="/ImagesNew/Pattern/" scale="tile"/>
<image id="vbojqg" name="pattern128_60.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqh" name="pattern128_61.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqi" name="pattern128_62.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqj" name="pattern128_63.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqk" name="pattern128_57.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqk" name="pattern128_57.png" path="/ImagesNew/Pattern/" scale="tile"/>
<image id="vbojql" name="pattern128_48.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqm" name="pattern128_47.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqm" name="pattern128_47.png" path="/ImagesNew/Pattern/" scale="tile"/>
<image id="vbojqn" name="pattern128_46.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqo" name="pattern128_30.png" path="/ImagesNew/Pattern/"/>
<image id="vbojqp" name="pattern128_31.png" path="/ImagesNew/Pattern/"/>
@@ -229,7 +226,7 @@
<image id="vbojr1" name="pattern128_42.png" path="/ImagesNew/Pattern/"/>
<image id="vbojr2" name="pattern128_43.png" path="/ImagesNew/Pattern/"/>
<image id="vbojr3" name="pattern128_44.png" path="/ImagesNew/Pattern/"/>
<image id="vbojr4" name="pattern128_45.png" path="/ImagesNew/Pattern/"/>
<image id="vbojr4" name="pattern128_45.png" path="/ImagesNew/Pattern/" scale="tile"/>
<image id="vbojr5" name="pattern128_29.png" path="/ImagesNew/Pattern/"/>
<image id="vbojr6" name="square128_stroke8px.png" path="/ImagesNew/Square/"/>
<image id="vbojr7" name="glow_circle_1.png" path="/ImagesNew/Glow/glow_circle/"/>
@@ -484,7 +481,6 @@
<image id="mbu9y5" name="icon_arrow_5.png" path="/ImagesNew/Icon/icon_arrow/" exported="true"/>
<image id="mbu9y6" name="icon_arrow_6.png" path="/ImagesNew/Icon/icon_arrow/" exported="true"/>
<component id="mbu9y7" name="BtnMask.xml" path="/Com/Buttons/" exported="true"/>
<component id="mbu9y9" name="BtnSubMenuLeft.xml" path="/ComNew/" exported="true"/>
<component id="mbu9ya" name="ComoomTitle.xml" path="/Com/Tags/" exported="true"/>
<image id="mbu9yb" name="triangle_down.png" path="/ImagesNew/Triangle/" exported="true"/>
<image id="mbu9yc" name="triangle_left.png" path="/ImagesNew/Triangle/" exported="true"/>
@@ -496,6 +492,18 @@
<image id="mbu9yi" name="square128_stroke3px.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="5,5,10,10"/>
<image id="mbu9yj" name="square20_stroke1px.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="5,5,10,10"/>
<image id="mbu9yk" name="square20_stroke2px.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="5,5,10,10"/>
<image id="oh2qyn" name="提示2(1).png" path="/效果图/"/>
<image id="oh2qyo" name="square24_fill.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="6,6,12,12"/>
<image id="oh2qyp" name="square24_round10px_fill.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="10,10,4,4"/>
<image id="oh2qyq" name="square24_round5px_fill.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="8,8,7,6"/>
<image id="oh2qyr" name="square24_round10px_bottom.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="10,1,3,4"/>
<component id="oh2qys" name="ModalLayer.xml" path="/Com/" exported="true"/>
<image id="dczwyu" name="背包(1).png" path="/效果图/"/>
<image id="dczwyv" name="顶部菜单.png" path="/效果图/"/>
<image id="dczwyw" name="底部菜单.png" path="/效果图/"/>
<image id="dczwyx" name="square24_round8px_bottom.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="9,5,6,4"/>
<image id="dczwyy" name="square24_round8px_fill.png" path="/ImagesNew/Square/mini/" exported="true" scale="9grid" scale9grid="10,10,5,3"/>
<component id="dczwyz" name="BtnSubIconMenu.xml" path="/ComNew/" exported="true"/>
</resources>
<publish name="" path="../Assets/ResRaw/Fgui/Common" packageCount="2" genCode="true"/>
</packageDescription>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="882,48" extention="Button" designImage="ui://hxr7rc7pd3lv25" designImageOffsetX="-72" designImageOffsetY="-286" designImageAlpha="0">
<controller name="style" exported="true" pages="0,无,1,切换,2,下拉,3,进度,4,按键" selected="2"/>
<component size="1190,52" extention="Button" designImage="ui://hxr7rc7pdczw2n" designImageOffsetX="-39" designImageOffsetY="-60" designImageAlpha="0">
<controller name="style" exported="true" pages="0,无,1,切换,2,下拉,3,进度,4,按键" selected="0"/>
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver" selected="0"/>
<displayList>
<image id="n5_e9z8" name="back" src="kryob" fileName="Images/Square.png" pkg="xo76q8wz" xy="0,0" size="874,48" alpha="0.1" color="#1c1c1c">
<gearColor controller="button" pages="2,3,4,5" values="#1c1c1c|#5e5e5e|#5e5e5e|#5e5e5e"/>
<image id="n5_e9z8" name="back" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" pkg="6hgkvlau" xy="1,0" size="1040,52">
<gearColor controller="button" pages="2,3,4,5" values="#ffffff|#5e5e5e|#5e5e5e|#5e5e5e"/>
</image>
<image id="n17_d3lv" name="n17" src="mbu9yj" fileName="ImagesNew/Square/mini/square20_stroke1px.png" pkg="6hgkvlau" xy="0,0" size="874,48" color="#252523">
<gearColor controller="button" pages="2,3,4,5" values="#252523|#afb0ab|#afb0ab|#afb0ab"/>
</image>
<text id="n6_e9z8" name="TextName" xy="9,10" size="79,28" font="ui://6hgkvlaugkm7x" fontSize="19" color="#9d9d9d" text="菜单字幕"/>
<text id="n7_e9z8" name="TextInfo" xy="500,10" pivot="0.5,0.5" size="299,28" fontSize="19" color="#e1e0dc" align="center" autoSize="none" text="x2">
<text id="n6_e9z8" name="TextName" xy="20,11" size="111,29" font="ui://6hgkvlaugkm7w" fontSize="20" color="#303f4e" text="LANGUAGE"/>
<text id="n7_e9z8" name="TextInfo" xy="605,2" pivot="0.5,0.5" size="299,28" fontSize="19" color="#e1e0dc" align="center" autoSize="none" text="x2">
<gearDisplay controller="style" pages="1"/>
<gearXY controller="style" pages="1,2,3,4" values="500,2|500,10|500,2|500,2" default="605,2"/>
</text>
<component id="n9_e9z8" name="Slider" src="e9z8k4" fileName="Com/Slider/CommonSlider.xml" pkg="6hgkvlau" xy="494,18" size="348,12">
<component id="n9_e9z8" name="Slider" src="e9z8k4" fileName="Com/Slider/CommonSlider.xml" pkg="6hgkvlau" xy="788,18" size="348,12">
<gearDisplay controller="style" pages="3"/>
<relation target="" sidePair="right-right%"/>
<Slider value="100" max="100"/>

View File

@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080" extention="Label" designImage="ui://hxr7rc7pvboj21" designImageAlpha="30">
<component size="1920,1080" extention="Label" designImage="ui://hxr7rc7pdczw2l" designImageAlpha="30">
<displayList>
<component id="n14_gii7" name="n14" src="8hy8la" fileName="Com/Back/Back1.xml" pkg="6hgkvlau" xy="0,0">
<component id="n14_gii7" name="n14" src="8hy8la" fileName="Com/Back/UIBlurBackground.xml" pkg="6hgkvlau" xy="0,0">
<relation target="" sidePair="width-width,height-height"/>
</component>
<component id="n16_d3lv" name="MenuList" src="r03us" fileName="Com/Menu/CommonSubMenu.xml" pkg="6hgkvlau" xy="72,108">
<component id="n21_mbu9" name="Title" src="mbu9ya" fileName="Com/Tags/ComoomTitle.xml" pkg="6hgkvlau" xy="0,0"/>
<component id="n16_d3lv" name="MenuList" src="r03us" fileName="Com/Menu/CommonSubMenu.xml" pkg="6hgkvlau" xy="0,90">
<relation target="" sidePair="left-left,top-top"/>
</component>
<component id="n3_e9z8" name="Introduce" src="e9z89" fileName="Com/IntroduceTag.xml" xy="985,179" size="890,828">
<relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
</component>
<list id="n10_e9z8" name="List" xy="72,179" size="886,828" overflow="scroll" scrollBarFlags="4" clipSoftness="10,10" lineGap="10" defaultItem="ui://hxr7rc7pe9z88" autoClearItems="true">
<list id="n10_e9z8" name="List" xy="41,147" size="1200,868" overflow="scroll" scrollBarFlags="4" clipSoftness="10,10" lineGap="10" defaultItem="ui://hxr7rc7pe9z88" autoClearItems="true">
<relation target="" sidePair="left-left,top-top,rightext-right,bottomext-bottom"/>
<item url="ui://hxr7rc7pj6rn17"/>
<item/>
@@ -28,10 +29,9 @@
<item/>
<item/>
</list>
<component id="n11_e9z8" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,1014">
<component id="n11_e9z8" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,1020">
<relation target="" sidePair="width-width,center-center,bottom-bottom"/>
</component>
<component id="n13_j6rn" name="Mask" src="j6rn18" fileName="Com/SettingMask.xml" xy="0,0" visible="false"/>
<component id="n21_mbu9" name="Title" src="mbu9ya" fileName="Com/Tags/ComoomTitle.xml" pkg="6hgkvlau" xy="0,0" size="1920,90"/>
</displayList>
</component>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080" designImage="ui://hxr7rc7pj2ni2a" designImageOffsetY="-45" designImageAlpha="30">
<component size="1920,1080" designImageOffsetY="-45" designImageAlpha="30">
<displayList>
<component id="n4_j2ni" name="n4" src="mbu9y7" fileName="Com/Buttons/BtnMask.xml" pkg="6hgkvlau" xy="0,0" size="1920,1080">
<relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
</component>
<image id="n0_j2ni" name="n0" src="vbojnh" fileName="ImagesNew/Square/square128_fill.png" pkg="6hgkvlau" xy="1,366" size="1920,348" color="#000000"/>
<text id="n1_j2ni" name="n1" xy="841,460" size="247,46" font="ui://6hgkvlaugkm7v" fontSize="34" color="#e9e9e9" align="center" vAlign="middle" autoSize="none" text="正在等待输入...">
<image id="n5_dczw" name="back" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" pkg="6hgkvlau" xy="459,431" size="1002,218">
<relation target="" sidePair="center-center,middle-middle"/>
</image>
<image id="n6_dczw" name="n6" src="dczwyx" fileName="ImagesNew/Square/mini/square24_round8px_bottom.png" pkg="6hgkvlau" xy="459,595" size="1002,61" color="#3d5c7a"/>
<text id="n1_j2ni" name="n1" xy="842,447" size="247,46" font="ui://6hgkvlaugkm7v" fontSize="34" color="#303f4e" align="center" vAlign="middle" autoSize="none" text="正在等待输入...">
<relation target="" sidePair="center-center,middle-middle"/>
</text>
<text id="n2_j2ni" name="TextTime" xy="944,507" size="33,66" fontSize="50" color="#07acda" align="center" vAlign="middle" text="5">
<text id="n2_j2ni" name="TextTime" xy="945,510" size="33,66" fontSize="50" color="#fe8d1d" align="center" vAlign="middle" text="5">
<relation target="" sidePair="center-center,middle-middle"/>
</text>
<component id="n3_j2ni" name="BtnCancel" src="r03uj0" fileName="Com/Buttons/BtnTitleInputControl.xml" pkg="6hgkvlau" xy="920,587">
<component id="n3_j2ni" name="BtnCancel" src="r03uj0" fileName="Com/Buttons/BtnTitleInputControl.xml" pkg="6hgkvlau" xy="920,608">
<Button title="取消" icon="ui://6hgkvlauvbojvi"/>
</component>
</displayList>

View File

@@ -1,29 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="284,320" overflow="hidden" extention="Button" designImage="ui://hxr7rc7pcmiv2c" designImageOffsetX="-175" designImageOffsetY="-539" designImageAlpha="0">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver,6,disabled,7,selectedDisabled" selected="2"/>
<component size="284,320" overflow="hidden" extention="Button" designImage="ui://hxr7rc7pdczw2e" designImageAlpha="0">
<controller name="button" pages="2,up,3,down,4,over,5,selectedOver,6,disabled,7,selectedDisabled" selected="3"/>
<displayList>
<image id="n10_r03u" name="back" src="mbu9yj" fileName="ImagesNew/Square/mini/square20_stroke1px.png" pkg="6hgkvlau" xy="0,0" size="284,320">
<gearLook controller="button" pages="2,3,4,5" values="1,0,0,0|1,0,0,0|1,0,0,0|1,0,0,0" default="0.8,0,0,0"/>
<gearColor controller="button" pages="2,3,4,5,6,7" values="#727270|#ffffff|#ffffff|#ffffff|#6fa8c0|#6fa8c0"/>
<image id="n19_cmiv" name="n19" src="dczwyy" fileName="ImagesNew/Square/mini/square24_round8px_fill.png" pkg="6hgkvlau" xy="0,0" size="284,320">
<relation target="" sidePair="width-width,height-height"/>
</image>
<image id="n19_cmiv" name="n19" src="vbojnh" fileName="ImagesNew/Square/square128_fill.png" pkg="6hgkvlau" xy="0,0" size="284,320" alpha="0.15" color="#afb0ab">
<gearLook controller="button" pages="3,4,5" values="0.1,0,0,0|0.15,0,0,0|0.1,0,0,0" default="0.2,0,0,0"/>
<gearColor controller="button" pages="3,4,5" values="#afb0ab|#afb0ab|#afb0ab" default="#323232"/>
<relation target="" sidePair="width-width,height-height"/>
<image id="n20_dczw" name="select" src="vbojnu" fileName="ImagesNew/Square/square128_round5px_stroke3px.png" pkg="6hgkvlau" xy="0,0" size="284,320" color="#fe8d1d">
<gearLook controller="button" pages="2,3,4,5" values="0,0,0,0|1,0,0,0|1,0,0,0|1,0,0,0" default="0,0,0,0" tween="true"/>
</image>
<text id="n7_oome" name="title" xy="24,7" size="242,32" fontSize="22" color="#e9e9e9" autoSize="height" text="Title"/>
<loader id="n13_r03u" name="icon" xy="42,66" size="200,200" align="center" vAlign="middle" fill="scale" clearOnPublish="true">
<text id="n7_oome" name="title" xy="24,10" size="242,32" fontSize="22" color="#16202f" autoSize="height" text="Title"/>
<loader id="n13_r03u" name="icon" xy="42,61" size="200,200" align="center" vAlign="middle" fill="scale" clearOnPublish="true">
<relation target="" sidePair="center-center,middle-middle"/>
</loader>
<text id="n15_r03u" name="TextPrice" xy="217,280" pivot="1,1" size="27,29" fontSize="20" color="#e1e0dc" align="right" text="11">
<text id="n15_r03u" name="TextPrice" xy="217,280" pivot="1,1" size="27,29" fontSize="20" color="#16202f" align="right" text="11">
<relation target="" sidePair="right-right,bottom-bottom"/>
</text>
<loader id="n16_r03u" name="n16" xy="246,285" size="20,20" url="ui://xo76q8wzr03uj9" align="center" vAlign="middle" fill="scale" color="#8bf3ff">
<loader id="n16_r03u" name="n16" xy="246,285" size="20,20" url="ui://xo76q8wzr03uj9" align="center" vAlign="middle" fill="scale" color="#16202f">
<relation target="" sidePair="right-right,bottom-bottom"/>
</loader>
<image id="n17_fpwl" name="Quality" src="kryob" fileName="Images/Square.png" pkg="xo76q8wz" xy="13,14" size="4,20" color="#ff6c00"/>
<text id="n18_fpwl" name="TextAmount" xy="18,280" size="75,29" fontSize="20" color="#e9e9e9" align="right" text="个数1">
<image id="n17_fpwl" name="Quality" src="kryob" fileName="Images/Square.png" pkg="xo76q8wz" xy="13,17" size="4,20" color="#ff6c00"/>
<text id="n18_fpwl" name="TextAmount" xy="18,280" size="75,29" fontSize="20" color="#16202f" align="right" text="个数1">
<relation target="" sidePair="left-left,bottom-bottom"/>
</text>
</displayList>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@@ -68,21 +68,6 @@
<image id="fcfg4" name="自动贩卖机.jpg" path="/Shop/x效果图/"/>
<image id="fcfg5" name="咖啡店.jpg" path="/Shop/x效果图/"/>
<image id="fcfg6" name="食品店.jpg" path="/Shop/x效果图/"/>
<image id="r03uc" name="20250521000344_1.jpg" path="/Shop/x效果图/"/>
<image id="r03ud" name="20250521221501_1.jpg" path="/Shop/x效果图/"/>
<image id="r03ue" name="20250521221613_1.jpg" path="/Shop/x效果图/"/>
<image id="r03uf" name="20250521221623_1.jpg" path="/Shop/x效果图/"/>
<image id="r03ug" name="20250521221650_1.jpg" path="/Shop/x效果图/"/>
<image id="r03uh" name="20250521221757_1.jpg" path="/Shop/x效果图/"/>
<image id="r03ui" name="20250521221819_1.jpg" path="/Shop/x效果图/"/>
<image id="r03uj" name="20250521221928_1.jpg" path="/Shop/x效果图/"/>
<image id="r03uk" name="20250521221948_1.jpg" path="/Shop/x效果图/"/>
<image id="r03ul" name="20250521222125_1.jpg" path="/Shop/x效果图/"/>
<image id="r03um" name="20250521222215_1.jpg" path="/Shop/x效果图/"/>
<image id="r03un" name="20250521222223_1.jpg" path="/Shop/x效果图/"/>
<image id="r03uo" name="20250521222232_1.jpg" path="/Shop/x效果图/"/>
<image id="r03up" name="20250521222522_1.jpg" path="/Shop/x效果图/"/>
<image id="r03uq" name="20250521222909_1.jpg" path="/Shop/x效果图/"/>
<component id="fcfg8" name="FishingShopPanel.xml" path="/Shop/" exported="true"/>
<component id="uiwj1s" name="BagSelectPanel.xml" path="/Bag/" exported="true"/>
<component id="uiwj1t" name="BagSlotItem.xml" path="/Bag/" exported="true"/>
@@ -92,17 +77,18 @@
<component id="fpwl1y" name="ShopBuyItem.xml" path="/Shop/Com/" exported="true"/>
<component id="fpwl1z" name="BtnBuy.xml" path="/Shop/Com/" exported="true"/>
<image id="vboj20" name="成绩.jpg" path="/Assets/效果图/"/>
<image id="vboj21" name="设置.jpg" path="/Assets/效果图/设置/"/>
<image id="d3lv22" name="20260131233807_1.jpg" path="/Assets/效果图/设置/"/>
<image id="d3lv23" name="20260131233825_1.jpg" path="/Assets/效果图/设置/"/>
<image id="d3lv24" name="20260131233827_1.jpg" path="/Assets/效果图/设置/"/>
<image id="d3lv25" name="20260131233729_1.jpg" path="/Assets/效果图/设置/"/>
<component id="mbu927" name="CommonComboBox_item.xml" path="/Settings/"/>
<component id="mbu928" name="CommonComboBox_popup.xml" path="/Settings/"/>
<component id="mbu929" name="CommonComboBox.xml" path="/Settings/" exported="true"/>
<image id="j2ni2a" name="等待输入.jpg" path="/Assets/效果图/设置/"/>
<component id="j2ni2b" name="SettingWaitInputPanel.xml" path="/Settings/" exported="true"/>
<image id="cmiv2c" name="20260201110006_1.jpg" path="/Assets/效果图/商店/"/>
<image id="dczw2d" name="商店(1).png" path="/Shop/x效果图/"/>
<image id="dczw2e" name="shopItem.png" path="/Shop/x效果图/"/>
<image id="dczw2f" name="完成提示(1).png" path="/Assets/效果图/"/>
<image id="dczw2l" name="设置1(1).png" path="/Assets/效果图/设置/"/>
<image id="dczw2m" name="合成(1).png" path="/Assets/效果图/设置/"/>
<image id="dczw2n" name="设置3.png" path="/Assets/效果图/设置/"/>
<image id="dczw2o" name="设置4.png" path="/Assets/效果图/设置/"/>
</resources>
<publish name="" path="../Assets/ResRaw/Fgui/Main" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -6,6 +6,14 @@ var System = CS.System;
const CodeWriter_1 = require("./CodeWriter");
const GenCodeSettings_1 = require("./GenCodeSettings");
const LanguageSettings_1 = require("./LanguageSettings");
const tweenSetting = (function () {
try {
return require('../whoot-tween/TweenSettings').default || require('../whoot-tween/TweenSettings');
}
catch {
return null;
}
})();
const File = System.IO.File;
const Directory = System.IO.Directory;
const App = FairyEditor.App;
@@ -119,6 +127,8 @@ function genCSCode(handler) {
console.log("生成Binder,count=" + componentClassNameArr.length);
genBinder(codePkgName, componentClassNameArr);
genLanguage();
// 生成动效配置
genTween();
}
function getScriptName(className, comUrl) {
if (allCustomNameByUrl.hasOwnProperty(comUrl)) {
@@ -487,3 +497,72 @@ function genLanguage() {
}
writer.save(savePath);
}
/**
* 生成动效配置
* 结构参考多语言生成:按包 -> 组件URL -> 子项id写入 C# 配置类
*/
function genTween() {
let binderName = 'UITweenConfig';
if (!tweenSetting || !tweenSetting.getAllPackage) {
console.warn('UITweenConfig 生成被跳过:未找到 ../whoot-tween/TweenSettings.js 或接口不完整');
return;
}
let tweenMap = tweenSetting.getAllPackage();
let codeConfig = new WhootCodeWriterConfig();
codeConfig.fileMark = "/**注册组件动效绑定。本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/";
let writer = new CodeWriter_1.default(codeConfig);
writer.reset();
writer.writeln('using System.Collections.Generic;');
writer.writeln('using FairyGUI;');
writer.writeln('using NBC;');
writer.writeln();
if (setNamespaceName) {
writer.writeln('namespace %s', namespaceName);
writer.startBlock();
}
writer.writeln('public class %s : UIComponentTweenPack', binderName);
writer.startBlock();
writer.writeln('public %s()', binderName);
writer.startBlock();
writer.writeln('AddData();');
writer.endBlock();
writer.writeln();
writer.writeln('private void AddData()');
writer.startBlock();
let keys = tweenMap.keys();
for (let key of keys) {
let pack = tweenMap.get(key);
let tweenData = pack.components;
for (let comUrl in tweenData) {
let comObj = tweenData[comUrl];
if (comObj == undefined)
continue;
writer.writeln('// %s', key);
writer.writeln('Add("%s", new UIComponentTween()', comUrl);
writer.startBlock();
for (let childId in comObj) {
var cfg = comObj[childId];
let useable = cfg['useable'];
let tweenKey = cfg['key'];
if (useable != 1)
continue;
writer.writeln('{ "%s", "%s" },', childId, tweenKey);
}
writer.endBlock();
writer.writeln(');');
}
writer.writeln();
}
writer.endBlock(); // AddData
writer.endBlock(); // class
if (setNamespaceName) {
writer.endBlock(); // namespace
}
let fileName = binderName + '.cs';
let savePath = exportCodePath + '/' + fileName;
console.log("生成 tween=", fileName);
if (existScriptPaths.hasOwnProperty(fileName)) {
savePath = existScriptPaths[fileName];
}
writer.save(savePath);
}

View File

@@ -5,6 +5,14 @@ import CodeWriter, { ICodeWriterConfig } from './CodeWriter';
import genSetting, { ComponentData, MemberData } from './GenCodeSettings'
import languageSetting, { LanguageComponentChildData } from './LanguageSettings'
// Tween 使用运行时 require避免跨项目编译输出位置错乱本地定义最小类型接口
interface TweenComponentChildData { id: string; key: string; useable: number }
// 注意:运行时从相对路径加载已编译的 JSCustomAttributer/TweenSettings.js
declare const require: any;
const tweenSetting: any = (function(){
try { return require('../whoot-tween/TweenSettings').default || require('../whoot-tween/TweenSettings'); } catch { return null; }
})();
const File = System.IO.File;
const Directory = System.IO.Directory;
const App = FairyEditor.App;
@@ -137,6 +145,8 @@ function genCSCode(handler: FairyEditor.PublishHandler) {
console.log("生成Binder,count="+componentClassNameArr.length)
genBinder(codePkgName, componentClassNameArr);
genLanguage();
// 生成动效配置
genTween();
}
function getScriptName(className: string, comUrl: string) {
@@ -587,4 +597,87 @@ function genLanguage() {
writer.save(savePath);
}
/**
* 生成动效配置
* 结构参考多语言生成:按包 -> 组件URL -> 子项id写入 C# 配置类
*/
function genTween() {
let binderName = 'UITweenConfig';
if (!tweenSetting || !tweenSetting.getAllPackage) {
console.warn('UITweenConfig 生成被跳过:未找到 ../whoot-tween/TweenSettings.js 或接口不完整');
return;
}
let tweenMap = tweenSetting.getAllPackage();
let codeConfig: WhootCodeWriterConfig = new WhootCodeWriterConfig();
codeConfig.fileMark = "/**注册组件动效绑定。本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/"
let writer = new CodeWriter(codeConfig);
writer.reset();
writer.writeln('using System.Collections.Generic;');
writer.writeln('using FairyGUI;');
writer.writeln('using NBC;');
writer.writeln();
if (setNamespaceName) {
writer.writeln('namespace %s', namespaceName);
writer.startBlock();
}
writer.writeln('public class %s : UIComponentTweenPack', binderName);
writer.startBlock();
writer.writeln('public %s()', binderName);
writer.startBlock();
writer.writeln('AddData();');
writer.endBlock();
writer.writeln();
writer.writeln('private void AddData()');
writer.startBlock();
let keys = tweenMap.keys();
for (let key of keys) {
let pack = tweenMap.get(key);
let tweenData = pack.components;
for (let comUrl in tweenData) {
let comObj = tweenData[comUrl];
if (comObj == undefined) continue;
writer.writeln('// %s', key);
writer.writeln('Add("%s", new UIComponentTween()', comUrl);
writer.startBlock();
for (let childId in comObj) {
var cfg = comObj[childId] as TweenComponentChildData | any;
let useable = cfg['useable'];
let tweenKey = cfg['key'];
if (useable != 1) continue;
writer.writeln('{ "%s", "%s" },', childId, tweenKey);
}
writer.endBlock();
writer.writeln(');');
}
writer.writeln();
}
writer.endBlock(); // AddData
writer.endBlock(); // class
if (setNamespaceName) {
writer.endBlock(); // namespace
}
let fileName = binderName + '.cs'
let savePath = exportCodePath + '/' + fileName
console.log("生成 tween=", fileName)
if (existScriptPaths.hasOwnProperty(fileName)) {
savePath = existScriptPaths[fileName]
}
writer.save(savePath);
}
export { genCSCode };

View File

@@ -0,0 +1,28 @@
interface ICodeWriterConfig {
blockStart?: string;
blockEnd?: string;
blockFromNewLine?: boolean;
usingTabs?: boolean;
endOfLine?: string;
fileMark?: string;
}
export default class CodeWriter {
private blockStart;
private blockEnd;
private blockFromNewLine;
private indentStr;
private endOfLine;
private lines;
private indent;
private fileMark;
constructor(config?: ICodeWriterConfig);
writeMark(): void;
writeln(fmt?: string, ...args: any[]): CodeWriter;
startBlock(): CodeWriter;
endBlock(): CodeWriter;
incIndent(): CodeWriter;
decIndent(): CodeWriter;
reset(): void;
toString(): string;
save(filePath: string): void;
}

View File

@@ -0,0 +1,460 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomAttributer = void 0;
const csharp_1 = require("csharp");
const puerts_1 = require("puerts");
const index_1 = require("./index");
const App = csharp_1.FairyEditor.App;
// 动效设置(参考 LanguageSettings 的存储方式)
const TweenSettings_1 = require("./TweenSettings");
class CustomAttributer extends csharp_1.FairyEditor.View.PluginInspector {
list;
components = [];
pattern = "*";
parent = false;
textMode;
mode = index_1.EMode.WRITE;
modeCtr;
// private btn_save: FairyGUI.GButton;
// private btn_reset: FairyGUI.GButton;
customData = "";
customDataObj = {};
constructor(data) {
super();
this.panel = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", "Main").asCom;
// this.panel.GetChild("btn_save").asButton.visible = false;
// this.panel.GetChild("btn_reset").asButton.visible = false;
// this.panel.GetChild("btn_copy").asButton.visible = false;
let { components, mode, pattern, parent } = data;
this.components = components;
this.pattern = pattern;
this.parent = parent;
this.list = this.panel.GetChild("list_components").asList;
//this.textMode = this.panel.GetChild("text_mode").asTextField;
this.mode = mode || index_1.EMode.WRITE; // todo
if (this.components.length > 0) {
this.list.numItems = 0;
}
this.modeCtr = this.panel.GetController("op");
// this.btn_save = this.panel.GetChild("btn_save").asButton;
// this.btn_save.onClick.Add(() => {
// this.setCustomData();
// })
// this.btn_reset = this.panel.GetChild("btn_reset").asButton;
// this.btn_reset.onClick.Add(() => {
// this.showList(true);
// })
this.updateAction = () => { return this.updateUI(); };
}
lastSelectedComponent = "";
lastData = "";
updateUI() {
let curDoc = App.activeDoc;
let { inspectingTarget } = curDoc;
let id = this.parent ? curDoc.docURL : inspectingTarget.id;
// 实时获取自定义数据
let propName = this.parent ? "remark" : "customData";
this.customData = inspectingTarget.GetProperty(propName);
try {
this.customDataObj = JSON.parse(this.customData) || {};
}
catch (e) {
// console.log("自定义数据异常或没有发现自定义数据,无法渲染列表");
this.customDataObj = {};
}
// 根据匹配规则验证是否显示inspector
// 正则 & 字符串 通配符
let name = this.parent ? curDoc.displayTitle : inspectingTarget.name;
let pattern = isMatch(name, this.pattern);
if ((pattern && this.lastSelectedComponent != id) || this.customData !== this.lastData) { // 判断是否满足条件的组件以及是上一次选中的组件或者数据是否被修改
this.showList();
}
this.lastData = this.customData;
this.lastSelectedComponent = id;
return pattern;
}
showList(reset = false) {
this.list.numItems = 0;
// todo
// if (this.mode == EMode.WRITE) {
// this.textMode.SetVar("mode", "设置").FlushVars();
// this.modeCtr.SetSelectedPage("write");
// } else {
// this.textMode.SetVar("mode", "读取").FlushVars();
// this.modeCtr.SetSelectedPage("read");
// }
// 根据自定义属性和配置文件混合比较【以自定义属性为主】渲染列表数据
for (let item of this.components) {
let { type, name, id, key } = item;
let com = getComponent(type);
if (!key) {
console.log("未定义唯一keyID", id);
return;
}
if (!com) {
console.log("发现未定义扩展组件ID", id);
}
com.title = name || key;
const component = com.GetChild("component");
com.name = key;
this.renderItem(component, item, reset);
// 监听组件变更并保存到 json参考 LanguageCustomInspector 的做法)
this.bindPersistEvents(component, item);
this.list.AddChild(com);
}
this.list.ResizeToFit();
// 更新关联关系
for (let item of this.components) {
let { associate, key } = item;
// 找到关联组件
let associateCom, curCom;
for (let i = 0; i < this.list.numChildren; i++) {
let com = this.list.GetChildAt(i);
if (com.name == associate) {
associateCom = com;
}
if (com.name == key) {
curCom = com;
}
}
if (associateCom && !associateCom.GetChild("component").selected && curCom) {
this.list.RemoveChild(curCom);
}
}
}
/**
* 给渲染出来的控件绑定事件:
* -已暂时停用更新自定义属性SetProperty
* - 将动效设置保存到项目设置目录下的 jsonwhootTween/<package>.json
*/
bindPersistEvents(component, item) {
const persist = () => {
// 暂时不写回到自定义数据,仅保存到 json
// this.setCustomData();
// 将与动效相关的设置保存到 json
this.trySaveTweenSetting(item, component);
};
// 根据控件类型选择合适的触发时机
if (component instanceof csharp_1.FairyGUI.GComboBox) {
component.onChanged.Add(persist);
}
else if (component instanceof csharp_1.FairyEditor.Component.NumericInput) {
// 数字输入使用失焦触发
component.onFocusOut.Add(persist);
}
else if (component instanceof csharp_1.FairyGUI.GSlider) {
component.onChanged.Add(persist);
}
else if (component instanceof csharp_1.FairyGUI.GButton) { // SWITCH / RADIOBOX
component.onChanged.Add(persist);
}
else if (component instanceof csharp_1.FairyEditor.Component.ColorInput) {
component.onChanged.Add(persist);
}
else if (component instanceof csharp_1.FairyGUI.GLabel) { // 文本输入类:失焦时保存
component.onFocusOut.Add(persist);
}
}
/**
* 将与动效相关的设置保存到 json 文件。
* 规则:
* - 仅对下拉框ComboBox做持久化其 value 代表动效 key
* - 当选中值为 "null" 视为未启用useable=false否则为启用
*/
trySaveTweenSetting(item, component) {
try {
if (!(component instanceof csharp_1.FairyGUI.GComboBox))
return;
// 读取当前对象与文档信息
let sels = App.activeDoc.inspectingTargets;
let obj = sels.get_Item(0);
let activeDoc = App.activeDoc;
let packageName = activeDoc.packageItem.owner.name;
let docUrl = activeDoc.docURL;
let objId = obj.id;
// 父级组件通常没有有效的 id这里为父级使用文档级占位 id
if ((!objId || objId === "") && this.parent) {
objId = "__root__";
}
// 当前选择的动效 key
const selectedIndex = component.selectedIndex;
const selectedValue = component.values?.get_Item(selectedIndex);
// 条件:无(值为"null"或组件ID为空非父级场景不记录
if ((!objId || objId === "") && !this.parent)
return;
if (selectedValue == null)
return;
if (selectedValue === "null") {
// 选择“无”时,删除已存在的记录
TweenSettings_1.default.remove(packageName, docUrl, objId);
return;
}
const useable = true; // 只有有效选择才记录,直接标记为可用
// 保存到 whootTween/<package>.json
TweenSettings_1.default.update(packageName, docUrl, objId, selectedValue, useable);
// 保存后做一次清理:把已删除的组件从 json 中移除
this.cleanupDeletedComponents(packageName, docUrl);
}
catch (e) {
console.error("保存动效设置到 json 失败:", e);
}
}
/**
* 收集当前文档中仍然存在的组件ID递归并触发清理
*/
cleanupDeletedComponents(packageName, docUrl) {
try {
const ids = [];
const visited = {};
const collect = (node) => {
if (!node)
return;
const nid = node.id;
if (nid && !visited[nid]) {
visited[nid] = true;
ids.push(nid);
}
if (node instanceof csharp_1.FairyEditor.FComponent) {
const cnt = node.numChildren;
for (let i = 0; i < cnt; i++) {
const child = node.GetChildAt(i);
collect(child);
}
}
};
const activeDoc = App.activeDoc;
if (activeDoc && activeDoc.content) {
collect(activeDoc.content);
}
// 仅当有 id 列表时尝试清理(保留 __root__
TweenSettings_1.default.cleanupDoc(packageName, docUrl, ids);
}
catch (err) {
console.error('清理已删除组件记录失败', err);
}
}
renderItem(component, item, reset) {
let { value, key } = item;
if (!reset) {
let defaultVal = this.getValueByName(key);
value = defaultVal != undefined ? defaultVal : value;
}
// 下拉框
if (component instanceof csharp_1.FairyGUI.GComboBox && item.type == index_1.EComponent.COMBOBOX) {
let data = item.data;
let valueArr = csharp_1.System.Array.CreateInstance((0, puerts_1.$typeof)(csharp_1.System.String), data.values.length);
for (let i = 0; i < data.values.length; i++) {
let v = data.values[i];
valueArr.set_Item(i, v);
}
let itemArr = csharp_1.System.Array.CreateInstance((0, puerts_1.$typeof)(csharp_1.System.String), data.items.length);
for (let i = 0; i < data.items.length; i++) {
let v = data.items[i];
itemArr.set_Item(i, v);
}
component.items = itemArr;
component.values = valueArr;
// 优先使用外部配置TweenSettings进行回填
const extVal = this.getExternalTweenKey();
if (extVal && data.values.indexOf(extVal) >= 0) {
component.value = extVal;
}
else {
// 兼容customData 可能保存的是值字符串或索引
if (typeof value === 'string' && data.values.indexOf(value) >= 0) {
component.value = value;
}
else {
const idx = Number(value);
const finalIdx = isNaN(idx) ? 0 : idx;
component.value = data.values[finalIdx] ?? data.values[0];
}
}
}
else if (component instanceof csharp_1.FairyGUI.GLabel &&
(item.type == index_1.EComponent.TEXTINPUT ||
item.type == index_1.EComponent.TEXTAREA ||
item.type == index_1.EComponent.RESOURCEINPUT)) { // 文本输入框
component.title = value + "" || "";
}
else if (item.type == index_1.EComponent.COLORINPUT && component instanceof csharp_1.FairyEditor.Component.ColorInput) { // 颜色输入框
let colorValue = value + "" || "#000000";
component.colorValue = csharp_1.FairyEditor.ColorUtil.FromHexString(colorValue);
}
else if (component instanceof csharp_1.FairyGUI.GSlider && item.type == index_1.EComponent.SLIDER) { // 滑动块
let data = item.data;
component.min = +data.min || 0;
component.max = +data.max || 100;
component.value = +value || 0;
}
else if (component instanceof csharp_1.FairyEditor.Component.NumericInput && item.type == index_1.EComponent.NUMBERINPUT) { // 数字输入框
let data = item.data;
component.min = +data.min || 0;
component.max = +data.max || 100;
component.step = +data.step || 0;
component.value = +value || 0;
}
else if (component instanceof csharp_1.FairyGUI.GButton && item.type == index_1.EComponent.SWITCH) { // 切换器
component.selected = Boolean(value);
}
else if (component instanceof csharp_1.FairyGUI.GButton && item.type == index_1.EComponent.RADIOBOX) { // 单选框
let data = item.data;
component.GetChildAt(0).text = data.items[0];
component.GetChildAt(1).text = data.items[1];
component.selected = Boolean(value);
}
}
/**
* 读取当前对象在 TweenSettings 中的外部配置 key
*/
getExternalTweenKey() {
try {
let sels = App.activeDoc.inspectingTargets;
// puerts 映射的 IList$1 没有 Count 属性,这里直接尝试取第 0 项
if (!sels)
return null;
let obj = sels.get_Item(0);
let activeDoc = App.activeDoc;
let packageName = activeDoc.packageItem.owner.name;
let docUrl = activeDoc.docURL;
let objId = obj.id;
if ((!objId || objId === "") && this.parent) {
objId = "__root__";
}
let data = TweenSettings_1.default.get(packageName, docUrl, objId);
if (data && data.useable == 1 && data.key) {
return data.key;
}
}
catch (e) {
console.error('读取 TweenSettings 外部配置失败', e);
}
return null;
}
getListItemVal() {
for (let i = 0; i < this.list.numChildren; i++) {
let item = this.list.GetChildAt(i);
let component = item.GetChild("component");
let value = component.title;
if (component instanceof csharp_1.FairyEditor.Component.ColorInput) {
value = csharp_1.FairyEditor.ColorUtil.ToHexString(component.colorValue);
}
else if (component instanceof csharp_1.FairyGUI.GComboBox) {
// value = component.selectedIndex;
value = component.values.get_Item(component.selectedIndex);
}
else if (component instanceof csharp_1.FairyEditor.Component.NumericInput) {
value = component.value;
}
else if (this.components[i].type == index_1.EComponent.SWITCH) {
value = component.selected;
}
else if (this.components[i].type == index_1.EComponent.RADIOBOX) {
value = component.selected ? 1 : 0;
}
else if (this.components[i].type == index_1.EComponent.SLIDER) {
value = component.value;
}
let key = this.components[i].key;
if (this.customDataObj) {
this.customDataObj[key] = value;
}
}
return JSON.stringify(this.customDataObj) || "";
}
getValueByName(name) {
// let value = "";
// if (this.customDataObj?.[name]) {
// value = this.customDataObj[name];
// }
// return value;
return this.customDataObj[name];
}
setCustomData() {
let propName = this.parent ? "remark" : "customData";
let data = this.getListItemVal();
App.activeDoc.inspectingTarget.docElement.SetProperty(propName, data);
}
}
exports.CustomAttributer = CustomAttributer;
let isCharacterMatch = (s, p) => {
let dp = [];
for (let i = 0; i <= s.length; i++) {
let child = [];
for (let j = 0; j <= p.length; j++) {
child.push(false);
}
dp.push(child);
}
dp[s.length][p.length] = true;
for (let i = p.length - 1; i >= 0; i--) {
if (p[i] != "*")
break;
else
dp[s.length][i] = true;
}
for (let i = s.length - 1; i >= 0; i--) {
for (let j = p.length - 1; j >= 0; j--) {
if (s[i] == p[j] || p[j] == "?") {
dp[i][j] = dp[i + 1][j + 1];
}
else if (p[j] == "*") {
dp[i][j] = dp[i + 1][j] || dp[i][j + 1];
}
else {
dp[i][j] = false;
}
}
}
return dp[0][0];
};
let isRegMatch = (source, pattern) => {
const patt = new RegExp(pattern);
return patt.test(source);
};
let isMatch = (source, pattern) => {
if (pattern.includes("*") || pattern.includes("?")) {
return isCharacterMatch(source, pattern);
}
else if (pattern.includes("/")) {
return isRegMatch(source, pattern);
}
else {
return source.includes(pattern);
}
};
let getComponent = (componentType) => {
let component;
switch (componentType) {
case index_1.EComponent.TEXTINPUT:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.TEXTINPUT).asCom;
break;
case index_1.EComponent.TEXTAREA:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.TEXTAREA).asCom;
break;
case index_1.EComponent.COMBOBOX:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.COMBOBOX).asCom;
break;
case index_1.EComponent.COLORINPUT:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.COLORINPUT).asCom;
break;
case index_1.EComponent.NUMBERINPUT:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.NUMBERINPUT).asCom;
break;
case index_1.EComponent.RESOURCEINPUT:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.RESOURCEINPUT).asCom;
break;
case index_1.EComponent.SLIDER:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.SLIDER).asCom;
break;
case index_1.EComponent.RADIOBOX:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.RADIOBOX).asCom;
break;
case index_1.EComponent.SWITCH:
component = csharp_1.FairyGUI.UIPackage.CreateObject("TweenAttributer", index_1.EComponent.SWITCH).asCom;
break;
default:
break;
}
return component;
};

View File

@@ -0,0 +1,475 @@
import { FairyGUI, FairyEditor, System } from 'csharp';
import { $generic, $typeof } from 'puerts';
import { IConfig, IComponent, EComponent, EMode, IInspector } from './index';
const App = FairyEditor.App;
// 动效设置(参考 LanguageSettings 的存储方式)
const TweenSettings_1 = require("./TweenSettings");
class CustomAttributer extends FairyEditor.View.PluginInspector {
private list: FairyGUI.GList;
private components: IComponent[] = [];
private pattern: string = "*";
private parent: boolean = false;
private textMode: FairyGUI.GTextField;
private mode: EMode = EMode.WRITE;
private modeCtr: FairyGUI.Controller;
// private btn_save: FairyGUI.GButton;
// private btn_reset: FairyGUI.GButton;
private customData: string = "";
private customDataObj: {} = {};
public constructor(data: IInspector) {
super();
this.panel = FairyGUI.UIPackage.CreateObject("TweenAttributer", "Main").asCom;
// this.panel.GetChild("btn_save").asButton.visible = false;
// this.panel.GetChild("btn_reset").asButton.visible = false;
// this.panel.GetChild("btn_copy").asButton.visible = false;
let { components, mode, pattern, parent } = data;
this.components = components;
this.pattern = pattern;
this.parent = parent;
this.list = this.panel.GetChild("list_components").asList;
//this.textMode = this.panel.GetChild("text_mode").asTextField;
this.mode = mode || EMode.WRITE; // todo
if (this.components.length > 0) {
this.list.numItems = 0;
}
this.modeCtr = this.panel.GetController("op");
// this.btn_save = this.panel.GetChild("btn_save").asButton;
// this.btn_save.onClick.Add(() => {
// this.setCustomData();
// })
// this.btn_reset = this.panel.GetChild("btn_reset").asButton;
// this.btn_reset.onClick.Add(() => {
// this.showList(true);
// })
this.updateAction = () => { return this.updateUI(); };
}
private lastSelectedComponent: string = "";
private lastData: string = "";
private updateUI(): boolean {
let curDoc = App.activeDoc;
let { inspectingTarget } = curDoc;
let id = this.parent ? curDoc.docURL : inspectingTarget.id;
// 实时获取自定义数据
let propName = this.parent ? "remark" : "customData";
this.customData = inspectingTarget.GetProperty(propName);
try {
this.customDataObj = JSON.parse(this.customData) || {};
} catch (e) {
// console.log("自定义数据异常或没有发现自定义数据,无法渲染列表");
this.customDataObj = {};
}
// 根据匹配规则验证是否显示inspector
// 正则 & 字符串 通配符
let name = this.parent ? curDoc.displayTitle : inspectingTarget.name;
let pattern = isMatch(name, this.pattern);
if ((pattern && this.lastSelectedComponent != id) || this.customData !== this.lastData) { // 判断是否满足条件的组件以及是上一次选中的组件或者数据是否被修改
this.showList();
}
this.lastData = this.customData;
this.lastSelectedComponent = id;
return pattern;
}
private showList(reset: boolean = false) {
this.list.numItems = 0;
// todo
// if (this.mode == EMode.WRITE) {
// this.textMode.SetVar("mode", "设置").FlushVars();
// this.modeCtr.SetSelectedPage("write");
// } else {
// this.textMode.SetVar("mode", "读取").FlushVars();
// this.modeCtr.SetSelectedPage("read");
// }
// 根据自定义属性和配置文件混合比较【以自定义属性为主】渲染列表数据
for (let item of this.components) {
let { type, name, id, key } = item;
let com = getComponent(type);
if (!key) {
console.log("未定义唯一keyID", id);
return
}
if (!com) {
console.log("发现未定义扩展组件ID", id);
}
(<FairyGUI.GButton>com).title = name || key;
const component = com.GetChild("component");
com.name = key;
this.renderItem(component, item, reset);
// 监听组件变更并保存到 json参考 LanguageCustomInspector 的做法)
this.bindPersistEvents(component, item);
this.list.AddChild(com);
}
this.list.ResizeToFit();
// 更新关联关系
for (let item of this.components) {
let { associate, key } = item;
// 找到关联组件
let associateCom,curCom;
for(let i = 0;i<this.list.numChildren;i++){
let com = this.list.GetChildAt(i);
if(com.name == associate){
associateCom = com;
}
if(com.name == key){
curCom = com;
}
}
if(associateCom && !associateCom.GetChild("component").selected && curCom){
this.list.RemoveChild(curCom);
}
}
}
/**
* 给渲染出来的控件绑定事件:
* -已暂时停用更新自定义属性SetProperty
* - 将动效设置保存到项目设置目录下的 jsonwhootTween/<package>.json
*/
private bindPersistEvents(component: FairyGUI.GObject, item: IComponent) {
const persist = () => {
// 暂时不写回到自定义数据,仅保存到 json
// this.setCustomData();
// 将与动效相关的设置保存到 json
this.trySaveTweenSetting(item, component);
};
// 根据控件类型选择合适的触发时机
if (component instanceof FairyGUI.GComboBox) {
component.onChanged.Add(persist);
} else if (component instanceof FairyEditor.Component.NumericInput) {
// 数字输入使用失焦触发
(component as FairyEditor.Component.NumericInput).onFocusOut.Add(persist);
} else if (component instanceof FairyGUI.GSlider) {
component.onChanged.Add(persist);
} else if (component instanceof FairyGUI.GButton) { // SWITCH / RADIOBOX
component.onChanged.Add(persist);
} else if (component instanceof FairyEditor.Component.ColorInput) {
component.onChanged.Add(persist);
} else if (component instanceof FairyGUI.GLabel) { // 文本输入类:失焦时保存
(component as FairyGUI.GLabel).onFocusOut.Add(persist);
}
}
/**
* 将与动效相关的设置保存到 json 文件。
* 规则:
* - 仅对下拉框ComboBox做持久化其 value 代表动效 key
* - 当选中值为 "null" 视为未启用useable=false否则为启用
*/
private trySaveTweenSetting(item: IComponent, component: any) {
try {
if (!(component instanceof FairyGUI.GComboBox)) return;
// 读取当前对象与文档信息
let sels = App.activeDoc.inspectingTargets;
let obj = sels.get_Item(0);
let activeDoc = App.activeDoc;
let packageName = activeDoc.packageItem.owner.name;
let docUrl = activeDoc.docURL;
let objId = obj.id;
// 父级组件通常没有有效的 id这里为父级使用文档级占位 id
if ((!objId || objId === "") && this.parent) {
objId = "__root__";
}
// 当前选择的动效 key
const selectedIndex = component.selectedIndex;
const selectedValue = component.values?.get_Item(selectedIndex);
// 条件:无(值为"null"或组件ID为空非父级场景不记录
if ((!objId || objId === "") && !this.parent) return;
if (selectedValue == null) return;
if (selectedValue === "null") {
// 选择“无”时,删除已存在的记录
TweenSettings_1.default.remove(packageName, docUrl, objId);
return;
}
const useable = true; // 只有有效选择才记录,直接标记为可用
// 保存到 whootTween/<package>.json
TweenSettings_1.default.update(packageName, docUrl, objId, selectedValue, useable);
// 保存后做一次清理:把已删除的组件从 json 中移除
this.cleanupDeletedComponents(packageName, docUrl);
} catch (e) {
console.error("保存动效设置到 json 失败:", e);
}
}
/**
* 收集当前文档中仍然存在的组件ID递归并触发清理
*/
private cleanupDeletedComponents(packageName: string, docUrl: string) {
try {
const ids: string[] = [];
const visited: { [k: string]: boolean } = {};
const collect = (node: FairyEditor.FObject) => {
if (!node) return;
const nid = (node as any).id as string;
if (nid && !visited[nid]) {
visited[nid] = true;
ids.push(nid);
}
if (node instanceof FairyEditor.FComponent) {
const cnt = (node as FairyEditor.FComponent).numChildren;
for (let i = 0; i < cnt; i++) {
const child = (node as FairyEditor.FComponent).GetChildAt(i);
collect(child);
}
}
}
const activeDoc = App.activeDoc;
if (activeDoc && activeDoc.content) {
collect(activeDoc.content);
}
// 仅当有 id 列表时尝试清理(保留 __root__
TweenSettings_1.default.cleanupDoc(packageName, docUrl, ids);
} catch (err) {
console.error('清理已删除组件记录失败', err);
}
}
private renderItem(component: FairyGUI.GObject, item: IComponent, reset: boolean) {
let { value, key } = item;
if (!reset) {
let defaultVal = this.getValueByName(key);
value = defaultVal != undefined ? defaultVal : value;
}
// 下拉框
if (component instanceof FairyGUI.GComboBox && item.type == EComponent.COMBOBOX) {
let data = item.data;
let valueArr = System.Array.CreateInstance($typeof(System.String), data.values.length) as System.Array$1<string>;
for (let i = 0; i < data.values.length; i++) {
let v = data.values[i];
valueArr.set_Item(i, v);
}
let itemArr = System.Array.CreateInstance($typeof(System.String), data.items.length) as System.Array$1<string>;
for (let i = 0; i < data.items.length; i++) {
let v = data.items[i];
itemArr.set_Item(i, v);
}
component.items = itemArr;
component.values = valueArr;
// 优先使用外部配置TweenSettings进行回填
const extVal = this.getExternalTweenKey();
if (extVal && (data.values as string[]).indexOf(extVal) >= 0) {
component.value = extVal;
} else {
// 兼容customData 可能保存的是值字符串或索引
if (typeof value === 'string' && (data.values as string[]).indexOf(value) >= 0) {
component.value = value as string;
} else {
const idx = Number(value);
const finalIdx = isNaN(idx) ? 0 : idx;
component.value = data.values[finalIdx] ?? data.values[0];
}
}
} else if (component instanceof FairyGUI.GLabel &&
(
item.type == EComponent.TEXTINPUT ||
item.type == EComponent.TEXTAREA ||
item.type == EComponent.RESOURCEINPUT
)) { // 文本输入框
component.title = value + "" || "";
} else if (item.type == EComponent.COLORINPUT && component instanceof FairyEditor.Component.ColorInput) { // 颜色输入框
let colorValue = value + "" || "#000000";
component.colorValue = FairyEditor.ColorUtil.FromHexString(colorValue);
} else if (component instanceof FairyGUI.GSlider && item.type == EComponent.SLIDER) { // 滑动块
let data = item.data;
component.min = +data.min || 0;
component.max = +data.max || 100;
component.value = +value || 0;
} else if (component instanceof FairyEditor.Component.NumericInput && item.type == EComponent.NUMBERINPUT) { // 数字输入框
let data = item.data;
component.min = +data.min || 0;
component.max = +data.max || 100;
component.step = +data.step || 0;
component.value = +value || 0;
} else if (component instanceof FairyGUI.GButton && item.type == EComponent.SWITCH) { // 切换器
component.selected = Boolean(value);
} else if (component instanceof FairyGUI.GButton && item.type == EComponent.RADIOBOX) { // 单选框
let data = item.data;
component.GetChildAt(0).text = data.items[0];
component.GetChildAt(1).text = data.items[1];
component.selected = Boolean(value);
}
}
/**
* 读取当前对象在 TweenSettings 中的外部配置 key
*/
private getExternalTweenKey(): string | null {
try {
let sels = App.activeDoc.inspectingTargets;
// puerts 映射的 IList$1 没有 Count 属性,这里直接尝试取第 0 项
if (!sels) return null;
let obj = sels.get_Item(0);
let activeDoc = App.activeDoc;
let packageName = activeDoc.packageItem.owner.name;
let docUrl = activeDoc.docURL;
let objId = obj.id;
if ((!objId || objId === "") && this.parent) {
objId = "__root__";
}
let data = TweenSettings_1.default.get(packageName, docUrl, objId);
if (data && data.useable == 1 && data.key) {
return data.key as string;
}
} catch (e) {
console.error('读取 TweenSettings 外部配置失败', e);
}
return null;
}
private getListItemVal(): string {
for (let i = 0; i < this.list.numChildren; i++) {
let item = this.list.GetChildAt(i) as FairyGUI.GComponent;
let component = item.GetChild("component") as any;
let value = component.title;
if (component instanceof FairyEditor.Component.ColorInput) {
value = FairyEditor.ColorUtil.ToHexString(component.colorValue);
} else if (component instanceof FairyGUI.GComboBox) {
// value = component.selectedIndex;
value = component.values.get_Item(component.selectedIndex);
} else if (component instanceof FairyEditor.Component.NumericInput) {
value = component.value;
} else if (this.components[i].type == EComponent.SWITCH) {
value = (component as FairyGUI.GButton).selected;
} else if (this.components[i].type == EComponent.RADIOBOX) {
value = (component as FairyGUI.GButton).selected ? 1 : 0;
} else if (this.components[i].type == EComponent.SLIDER) {
value = (component as FairyGUI.GSlider).value;
}
let key = this.components[i].key;
if (this.customDataObj) {
this.customDataObj[key] = value;
}
}
return JSON.stringify(this.customDataObj) || "";
}
private getValueByName(name: string): string {
// let value = "";
// if (this.customDataObj?.[name]) {
// value = this.customDataObj[name];
// }
// return value;
return this.customDataObj[name];
}
private setCustomData() {
let propName = this.parent ? "remark" : "customData";
let data = this.getListItemVal();
App.activeDoc.inspectingTarget.docElement.SetProperty(propName, data);
}
}
let isCharacterMatch = (s: string, p: string): boolean => {
let dp = [];
for (let i = 0; i <= s.length; i++) {
let child = [];
for (let j = 0; j <= p.length; j++) {
child.push(false);
}
dp.push(child);
}
dp[s.length][p.length] = true;
for (let i = p.length - 1; i >= 0; i--) {
if (p[i] != "*") break;
else dp[s.length][i] = true;
}
for (let i = s.length - 1; i >= 0; i--) {
for (let j = p.length - 1; j >= 0; j--) {
if (s[i] == p[j] || p[j] == "?") {
dp[i][j] = dp[i + 1][j + 1];
} else if (p[j] == "*") {
dp[i][j] = dp[i + 1][j] || dp[i][j + 1];
} else {
dp[i][j] = false;
}
}
}
return dp[0][0];
};
let isRegMatch = (source: string, pattern: string): boolean => {
const patt = new RegExp(pattern);
return patt.test(source);
}
let isMatch = (source: string, pattern: string): boolean => {
if (pattern.includes("*") || pattern.includes("?")) {
return isCharacterMatch(source, pattern);
} else if (pattern.includes("/")) {
return isRegMatch(source, pattern);
} else {
return source.includes(pattern);
}
}
let getComponent = (componentType: EComponent): FairyGUI.GComponent => {
let component: FairyGUI.GComponent;
switch (componentType) {
case EComponent.TEXTINPUT:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.TEXTINPUT).asCom;
break;
case EComponent.TEXTAREA:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.TEXTAREA).asCom;
break;
case EComponent.COMBOBOX:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.COMBOBOX).asCom;
break;
case EComponent.COLORINPUT:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.COLORINPUT).asCom;
break;
case EComponent.NUMBERINPUT:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.NUMBERINPUT).asCom;
break;
case EComponent.RESOURCEINPUT:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.RESOURCEINPUT).asCom;
break;
case EComponent.SLIDER:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.SLIDER).asCom;
break;
case EComponent.RADIOBOX:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.RADIOBOX).asCom;
break;
case EComponent.SWITCH:
component = FairyGUI.UIPackage.CreateObject("TweenAttributer", EComponent.SWITCH).asCom;
break;
default:
break;
}
return component;
}
export { CustomAttributer };

View File

@@ -0,0 +1,326 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TweenSettings = exports.TweenPackageData = exports.TweenComponentChildData = void 0;
const csharp_1 = require("csharp");
const App = csharp_1.FairyEditor.App;
const File = csharp_1.System.IO.File;
const Directory = csharp_1.System.IO.Directory;
class TweenComponentChildData {
id;
key;
useable;
}
exports.TweenComponentChildData = TweenComponentChildData;
// class TweenComponentData {
// url: string;
// childs: object = {};
// }
class TweenPackageData {
name;
components = {};
}
exports.TweenPackageData = TweenPackageData;
class TweenSettings {
static instance;
static getInstance() {
if (!this.instance) {
this.instance = new TweenSettings();
}
return this.instance;
}
componentsSettingBasePath = "";
_TweenMap = new Map();
_TweenKeyValues = {};
constructor() {
this.init();
// this._TweenKeyValues['k1'] = "hahha1"
// this._TweenKeyValues['k2'] = "hahha2"
// this._TweenKeyValues['k3'] = "hahha3"
//'CustomProperties'
let path = App.project.settingsPath + "/CustomProperties.json";
if (File.Exists(path)) {
let jsonStr = File.ReadAllText(path);
let settings = JSON.parse(jsonStr);
let TweenKey = "en";
if (settings.hasOwnProperty("TweenKey")) {
TweenKey = settings['TweenKey'];
}
if (settings.hasOwnProperty("TweenPath")) {
let TweenPath = App.project.basePath + "/" + settings['TweenPath'];
console.log("动效路径=", TweenPath);
if (File.Exists(TweenPath)) {
let TweenStr = File.ReadAllText(TweenPath);
let datas = JSON.parse(TweenStr);
if (datas != null && datas.length > 0) {
for (const data of datas) {
this._TweenKeyValues[data['key']] = data[TweenKey];
}
}
}
}
}
}
init() {
console.log("初始化加载动效配置===");
this.componentsSettingBasePath = App.project.settingsPath + "/whootTween";
if (!csharp_1.System.IO.Directory.Exists(this.componentsSettingBasePath)) {
console.log("whoot配置文件目录不存在创建");
csharp_1.System.IO.Directory.CreateDirectory(this.componentsSettingBasePath);
}
this.readAll();
}
/**
* 清理无效的配置
*/
clearFailureConfig() {
// App.d
}
getTween(key) {
let value = this._TweenKeyValues[key];
if (value == null) {
return key;
}
return value;
}
/**
* 获取所有动效配置
* @returns
*/
getAllPackage() {
return this._TweenMap;
}
/**
* 获取一个动效配置
* @param packageName
* @param docUrl
* @param componentId
*/
get(packageName, docUrl, componentId) {
let pack = this._TweenMap.get(packageName);
if (pack != null) {
let doc = pack.components[docUrl];
if (doc != null) {
let child = doc[componentId];
return child;
}
}
return null;
}
/**
* 获取一个组件的动效配置
* @param packageName
* @param docUrl
* @returns
*/
getDoc(packageName, docUrl) {
let pack = this._TweenMap.get(packageName);
if (pack != null) {
let doc = pack.components[docUrl];
if (doc != null) {
return doc;
}
}
return null;
}
/**
* 获取一个包的动效配置
* @param packageName
*/
getPackage(packageName) {
let pack = this._TweenMap.get(packageName);
if (pack) {
return pack.components;
}
return {};
}
/**
* 更新一个动效配置
* @param packageName
* @param docUrl
* @param componentId
* @param TweenKey
* @param useable 是否可用的
*/
update(packageName, docUrl, componentId, TweenKey, useable = true) {
let chang = false;
let pack = this._TweenMap.get(packageName);
if (pack == null) {
pack = new TweenPackageData();
pack.name = packageName;
this._TweenMap.set(packageName, pack);
chang = true;
}
let doc = pack.components[docUrl];
if (doc == null) {
doc = {};
pack.components[docUrl] = doc; //.set(docUrl, doc)
chang = true;
}
let child = doc[componentId];
if (child == null) {
child = new TweenComponentChildData();
child.id = componentId;
doc[componentId] = child; //.set(componentId, child)
}
let u = useable ? 1 : 0;
if (child.key != TweenKey || child.useable != u) {
child.key = TweenKey;
child.useable = u;
chang = true;
}
if (chang) {
//有数据变化,变更文件
this.saveFile(packageName);
}
return chang;
}
/**
* 删除一个动效配置(当选择“无”或需清除时)
* @param packageName
* @param docUrl
* @param componentId
*/
remove(packageName, docUrl, componentId) {
let changed = false;
const pack = this._TweenMap.get(packageName);
if (!pack)
return false;
const doc = pack.components[docUrl];
if (!doc)
return false;
if (doc.hasOwnProperty(componentId)) {
delete doc[componentId];
changed = true;
}
if (changed) {
// 若当前文档节点已空,清理条目
if (Object.keys(doc).length === 0) {
delete pack.components[docUrl];
}
this.saveFile(packageName);
}
return changed;
}
//region 工具方法
updateItemTitle(obj, key) {
// console.log("obj类型=", obj.GetType())
if (obj instanceof csharp_1.FairyEditor.FTextInput) {
let textInput = obj;
textInput.promptText = this.getTween(key);
}
else if (obj instanceof csharp_1.FairyEditor.FButton) {
let button = obj;
button.title = this.getTween(key);
}
else if (obj instanceof csharp_1.FairyEditor.FLabel) {
let lable = obj;
lable.title = this.getTween(key);
}
else {
obj.text = this.getTween(key);
}
}
//endregion
//region file
//获取所有的文件的路径
getAllDirector(path, list) {
console.log("开始读取所有配置=", path);
let files = Directory.GetFiles(path, "*.json");
for (let f = 0; f < files.Length; f++) {
list.push(files.get_Item(f));
}
}
/**
* 读取全部
*/
readAll() {
try {
let list = [];
this.getAllDirector(this.componentsSettingBasePath, list);
this._TweenMap.clear();
console.log("初始化所有动效配置");
for (let index = 0; index < list.length; index++) {
let p = list[index];
let jsonStr = File.ReadAllText(p);
let data = JSON.parse(jsonStr);
this._TweenMap.set(data.name, data);
}
}
catch {
console.error("读取动效配置文件失败");
}
}
/**
* 将所有配置保存成配置文件
*/
saveAllFile() {
let keys = this._TweenMap.keys();
for (const key of keys) {
this.saveFile(key);
}
}
/**
* 清理某个文档下已删除的组件配置
* @param packageName 包名
* @param docUrl 文档URL
* @param existComponentIds 该文档中仍然存在的组件id列表
* @returns 是否有变更
*/
cleanupDoc(packageName, docUrl, existComponentIds) {
const pack = this._TweenMap.get(packageName);
if (!pack)
return false;
const doc = pack.components[docUrl];
if (!doc)
return false;
// 归一到 JS 数组
let ids = [];
if (existComponentIds["Length"] != null) {
// System.Array
const len = existComponentIds.Length;
for (let i = 0; i < len; i++) {
ids.push(existComponentIds.get_Item(i));
}
}
else {
ids = existComponentIds;
}
const idSet = {};
for (const id of ids) {
if (id)
idSet[id] = true;
}
let changed = false;
for (const key in doc) {
if (!doc.hasOwnProperty(key))
continue;
if (key === "__root__")
continue; // 保留父级占位符
if (!idSet[key]) {
delete doc[key];
changed = true;
}
}
if (changed) {
if (Object.keys(doc).length === 0) {
delete pack.components[docUrl];
}
this.saveFile(packageName);
}
return changed;
}
/**
* 保存json文件
* @param packageName
*/
saveFile(packageName) {
let path = this.componentsSettingBasePath + "/" + packageName + ".json";
let data = this._TweenMap.get(packageName);
if (data != null) {
let jsonStr = JSON.stringify(data);
File.WriteAllText(path, jsonStr);
}
}
}
exports.TweenSettings = TweenSettings;
exports.default = TweenSettings.getInstance();

View File

@@ -0,0 +1,343 @@
import { FairyGUI, FairyEditor, System } from 'csharp';
const App = FairyEditor.App;
const File = System.IO.File;
const Directory = System.IO.Directory;
export class TweenComponentChildData {
id: string;
key: string;
useable: number;
}
// class TweenComponentData {
// url: string;
// childs: object = {};
// }
export class TweenPackageData {
name: string;
components: object = {};
}
export class TweenSettings {
private static instance: TweenSettings;
static getInstance() {
if (!this.instance) {
this.instance = new TweenSettings();
}
return this.instance;
}
public componentsSettingBasePath: string = "";
private readonly _TweenMap: Map<string, TweenPackageData> = new Map<string, TweenPackageData>();
private readonly _TweenKeyValues: object = {};
constructor() {
this.init()
// this._TweenKeyValues['k1'] = "hahha1"
// this._TweenKeyValues['k2'] = "hahha2"
// this._TweenKeyValues['k3'] = "hahha3"
//'CustomProperties'
let path = App.project.settingsPath + "/CustomProperties.json"
if (File.Exists(path)) {
let jsonStr = File.ReadAllText(path);
let settings = JSON.parse(jsonStr) as object
let TweenKey = "en"
if (settings.hasOwnProperty("TweenKey")) {
TweenKey = settings['TweenKey'];
}
if (settings.hasOwnProperty("TweenPath")) {
let TweenPath = App.project.basePath + "/" + settings['TweenPath']
console.log("动效路径=", TweenPath)
if (File.Exists(TweenPath)) {
let TweenStr = File.ReadAllText(TweenPath);
let datas = JSON.parse(TweenStr) as Array<object>
if (datas != null && datas.length > 0) {
for (const data of datas) {
this._TweenKeyValues[data['key']] = data[TweenKey]
}
}
}
}
}
}
private init() {
console.log("初始化加载动效配置===")
this.componentsSettingBasePath = App.project.settingsPath + "/whootTween"
if (!System.IO.Directory.Exists(this.componentsSettingBasePath)) {
console.log("whoot配置文件目录不存在创建")
System.IO.Directory.CreateDirectory(this.componentsSettingBasePath)
}
this.readAll()
}
/**
* 清理无效的配置
*/
clearFailureConfig() {
// App.d
}
getTween(key: string): string {
let value = this._TweenKeyValues[key]
if (value == null) {
return key
}
return value;
}
/**
* 获取所有动效配置
* @returns
*/
getAllPackage(): Map<string, TweenPackageData> {
return this._TweenMap;
}
/**
* 获取一个动效配置
* @param packageName
* @param docUrl
* @param componentId
*/
get(packageName, docUrl, componentId): TweenComponentChildData {
let pack = this._TweenMap.get(packageName)
if (pack != null) {
let doc = pack.components[docUrl]
if (doc != null) {
let child = doc[componentId]
return child as TweenComponentChildData
}
}
return null;
}
/**
* 获取一个组件的动效配置
* @param packageName
* @param docUrl
* @returns
*/
getDoc(packageName, docUrl): object {
let pack = this._TweenMap.get(packageName)
if (pack != null) {
let doc = pack.components[docUrl]
if (doc != null) {
return doc as object
}
}
return null;
}
/**
* 获取一个包的动效配置
* @param packageName
*/
getPackage(packageName): object {
let pack = this._TweenMap.get(packageName)
if (pack) {
return pack.components;
}
return {};
}
/**
* 更新一个动效配置
* @param packageName
* @param docUrl
* @param componentId
* @param TweenKey
* @param useable 是否可用的
*/
update(packageName, docUrl, componentId, TweenKey, useable: boolean = true): boolean {
let chang = false
let pack = this._TweenMap.get(packageName)
if (pack == null) {
pack = new TweenPackageData()
pack.name = packageName
this._TweenMap.set(packageName, pack)
chang = true
}
let doc = pack.components[docUrl]
if (doc == null) {
doc = {};
pack.components[docUrl] = doc;//.set(docUrl, doc)
chang = true
}
let child = doc[componentId]
if (child == null) {
child = new TweenComponentChildData();
child.id = componentId
doc[componentId] = child//.set(componentId, child)
}
let u = useable ? 1 : 0
if (child.key != TweenKey || child.useable != u) {
child.key = TweenKey
child.useable = u
chang = true
}
if (chang) {
//有数据变化,变更文件
this.saveFile(packageName)
}
return chang
}
/**
* 删除一个动效配置(当选择“无”或需清除时)
* @param packageName
* @param docUrl
* @param componentId
*/
remove(packageName: string, docUrl: string, componentId: string): boolean {
let changed = false;
const pack = this._TweenMap.get(packageName);
if (!pack) return false;
const doc = pack.components[docUrl] as any;
if (!doc) return false;
if (doc.hasOwnProperty(componentId)) {
delete doc[componentId];
changed = true;
}
if (changed) {
// 若当前文档节点已空,清理条目
if (Object.keys(doc).length === 0) {
delete pack.components[docUrl];
}
this.saveFile(packageName);
}
return changed;
}
//region 工具方法
updateItemTitle(obj: FairyEditor.FObject, key: string) {
// console.log("obj类型=", obj.GetType())
if (obj instanceof FairyEditor.FTextInput) {
let textInput = obj as FairyEditor.FTextInput
textInput.promptText = this.getTween(key)
} else if (obj instanceof FairyEditor.FButton) {
let button = obj as FairyEditor.FButton
button.title = this.getTween(key)
} else if (obj instanceof FairyEditor.FLabel) {
let lable = obj as FairyEditor.FLabel
lable.title = this.getTween(key)
} else {
obj.text = this.getTween(key)
}
}
//endregion
//region file
//获取所有的文件的路径
private getAllDirector(path: string, list: Array<string>) {
console.log("开始读取所有配置=", path)
let files = Directory.GetFiles(path, "*.json")
for (let f = 0; f < files.Length; f++) {
list.push(files.get_Item(f))
}
}
/**
* 读取全部
*/
private readAll() {
try {
let list: Array<string> = []
this.getAllDirector(this.componentsSettingBasePath, list)
this._TweenMap.clear()
console.log("初始化所有动效配置")
for (let index = 0; index < list.length; index++) {
let p = list[index];
let jsonStr = File.ReadAllText(p);
let data: TweenPackageData = JSON.parse(jsonStr);
this._TweenMap.set(data.name, data)
}
} catch {
console.error("读取动效配置文件失败")
}
}
/**
* 将所有配置保存成配置文件
*/
private saveAllFile() {
let keys = this._TweenMap.keys()
for (const key of keys) {
this.saveFile(key)
}
}
/**
* 清理某个文档下已删除的组件配置
* @param packageName 包名
* @param docUrl 文档URL
* @param existComponentIds 该文档中仍然存在的组件id列表
* @returns 是否有变更
*/
public cleanupDoc(packageName: string, docUrl: string, existComponentIds: System.Array$1<string> | Array<string>): boolean {
const pack = this._TweenMap.get(packageName)
if (!pack) return false;
const doc = pack.components[docUrl] as any;
if (!doc) return false;
// 归一到 JS 数组
let ids: Array<string> = [];
if ((existComponentIds as any)["Length"] != null) {
// System.Array
const len = (existComponentIds as System.Array$1<string>).Length;
for (let i = 0; i < len; i++) {
ids.push((existComponentIds as any).get_Item(i));
}
} else {
ids = existComponentIds as Array<string>;
}
const idSet: { [k: string]: boolean } = {};
for (const id of ids) {
if (id) idSet[id] = true;
}
let changed = false;
for (const key in doc) {
if (!doc.hasOwnProperty(key)) continue;
if (key === "__root__") continue; // 保留父级占位符
if (!idSet[key]) {
delete doc[key];
changed = true;
}
}
if (changed) {
if (Object.keys(doc).length === 0) {
delete pack.components[docUrl];
}
this.saveFile(packageName);
}
return changed;
}
/**
* 保存json文件
* @param packageName
*/
private saveFile(packageName: string) {
let path = this.componentsSettingBasePath + "/" + packageName + ".json";
let data = this._TweenMap.get(packageName)
if (data != null) {
let jsonStr = JSON.stringify(data);
File.WriteAllText(path, jsonStr)
}
}
//endregion
}
export default TweenSettings.getInstance();

View File

@@ -0,0 +1,92 @@
{
"remote": "",
"inspectors": [
{
"title": "通用动效【组件】",
"parent": false,
"pattern": "*",
"mode": 1,
"components": [
{
"type": "ComboBox",
"id": 1001,
"name": "Tween",
"key": "ComboBox",
"data": {
"items": [
"无",
"渐显",
"缩放",
"Pop",
"滑入(左)",
"滑入(右)",
"滑入(顶)",
"滑入(底)",
"跳动",
"旋转",
"抖动"
],
"values": [
"null",
"Fade",
"Scale",
"Pop",
"SlideInL",
"SlideInR",
"SlideInT",
"SlideInB",
"Bounce",
"Rotate",
"Shake"
]
},
"associate":"Switch",
"value": 0
}
]
},
{
"title": "通用动效【界面】",
"parent": true,
"pattern": "*",
"mode": 1,
"components": [
{
"type": "ComboBox",
"id": 1001,
"name": "Tween",
"key": "ComboBox",
"data": {
"items": [
"无",
"渐显",
"缩放",
"Pop",
"滑入(左)",
"滑入(右)",
"滑入(顶)",
"滑入(底)",
"跳动",
"旋转",
"抖动"
],
"values": [
"null",
"Fade",
"Scale",
"Pop",
"SlideInL",
"SlideInR",
"SlideInT",
"SlideInB",
"Bounce",
"Rotate",
"Shake"
]
},
"value": 0
}
]
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,101 @@
export interface IConfig {
remote: boolean, // 远程配置地址
inspectors:IInspector[]
}
export interface IInspector{
title: string,//inspectorName
parent: boolean,// 父级组件
pattern?: string,//匹配符
mode?: EMode,// 1设置模式 2读取模式【暂未实现】
components: IComponent[],
}
export type IComponent = IComboBox |IRadioBox| INumberInput | ITextinput | ITextarea | IColorInput | ISwitch | IResourceInput | ISlider;
export interface IBaseComponent {
id?: string,
name?: string,
key:string, // 唯一值
associate?:string //关联组件id
// value?: number | string // 默认值,该值为空即使用组件默认值
}
export interface IComboBox extends IBaseComponent {
type: EComponent.COMBOBOX,
data: {
items: string[],
values: string[]
},
value:number
}
export interface ITextinput extends IBaseComponent {
type: EComponent.TEXTINPUT,
value:string
}
export interface ITextarea extends IBaseComponent {
type: EComponent.TEXTAREA,
value:string
}
export interface IColorInput extends IBaseComponent {
type: EComponent.COLORINPUT,
value:string
}
export interface ISwitch extends IBaseComponent {
type: EComponent.SWITCH,
value:boolean
}
export interface IResourceInput extends IBaseComponent {
type: EComponent.RESOURCEINPUT,
value:string
}
export interface ISlider extends IBaseComponent {
type: EComponent.SLIDER,
data:{
min:number,
max:number
},
value:number
}
export interface INumberInput extends IBaseComponent {
type: EComponent.NUMBERINPUT,
data: {
min:number,
max:number,
step?:number
},
value:number
}
export interface IRadioBox extends IBaseComponent {
type: EComponent.RADIOBOX,
data: {
items:string[]
},
value:number
}
export enum EComponent {
TEXTINPUT = "Textinput",
TEXTAREA = "Textarea",
COMBOBOX = "ComboBox",
COLORINPUT = "ColorInput",
NUMBERINPUT = "NumberInput",
SLIDER = "Slider",
RESOURCEINPUT = "ResourceInput",
RADIOBOX = "RadioBox",
SWITCH = "Switch",
}
export enum EMode {
WRITE = 1,
READ = 2
}

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EMode = exports.EComponent = void 0;
var EComponent;
(function (EComponent) {
EComponent["TEXTINPUT"] = "Textinput";
EComponent["TEXTAREA"] = "Textarea";
EComponent["COMBOBOX"] = "ComboBox";
EComponent["COLORINPUT"] = "ColorInput";
EComponent["NUMBERINPUT"] = "NumberInput";
EComponent["SLIDER"] = "Slider";
EComponent["RESOURCEINPUT"] = "ResourceInput";
EComponent["RADIOBOX"] = "RadioBox";
EComponent["SWITCH"] = "Switch";
})(EComponent = exports.EComponent || (exports.EComponent = {}));
var EMode;
(function (EMode) {
EMode[EMode["WRITE"] = 1] = "WRITE";
EMode[EMode["READ"] = 2] = "READ";
})(EMode = exports.EMode || (exports.EMode = {}));

View File

@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const csharp_1 = require("csharp");
const TweenCoustomInspector_1 = require("./TweenCoustomInspector");
const TweenSettings = require('./TweenSettings').default;
const App = csharp_1.FairyEditor.App;
// 首先读取本地文件配置获取是否本地配置还是远程配置
// local
let filePath = `${csharp_1.FairyEditor.App.project.basePath}/plugins/whoot-tween/config.json`;
let config;
try {
let sw = new csharp_1.System.IO.StreamReader(filePath);
let data = sw.ReadToEnd();
sw.Close();
console.log("获取到本地配置:", data);
config = JSON.parse(data);
}
catch (e) {
console.warn(e);
}
if (config.remote) {
// remote
let url = config.remote;
let request = csharp_1.System['Net']['WebRequest'].Create(url);
request.Method = "GET";
request.ContentType = "text/html;charset=UTF-8";
let response = request.GetResponse();
let responseStream = response.GetResponseStream();
let streamReader = new csharp_1.System.IO.StreamReader(responseStream);
let res = streamReader.ReadToEnd();
try {
console.log("获取到远程配置:", config);
config = JSON.parse(res);
}
catch (e) {
console.warn(e);
}
}
App.pluginManager.LoadUIPackage(App.pluginManager.basePath + "/" + eval("__dirname") + '/TweenAttributer');
for (let i = 0; i < config.inspectors.length; i++) {
let inspector = config.inspectors[i];
let { parent, title } = inspector;
App.inspectorView.AddInspector(() => new TweenCoustomInspector_1.CustomAttributer(inspector), title, title);
App.docFactory.ConnectInspector(title, "mixed", parent, false);
}
// 当层级结构变化(增删控件)时,自动清理 JSON 中已删除组件的记录
const onHierarchyChanged = (_ctx) => {
try {
const activeDoc = App.activeDoc;
if (!activeDoc)
return;
const packageName = activeDoc.packageItem.owner.name;
const docUrl = activeDoc.docURL;
const ids = [];
const visited = {};
const collect = (node) => {
if (!node)
return;
const nid = node.id;
if (nid && !visited[nid]) {
visited[nid] = true;
ids.push(nid);
}
if (node instanceof csharp_1.FairyEditor.FComponent) {
const cnt = node.numChildren;
for (let i = 0; i < cnt; i++) {
const child = node.GetChildAt(i);
collect(child);
}
}
};
const docAny = activeDoc;
if (docAny && docAny.content)
collect(docAny.content);
TweenSettings.cleanupDoc(packageName, docUrl, ids);
}
catch (err) {
console.error('HierarchyChanged 自动清理失败', err);
}
};
// 订阅层级变化事件
// @ts-ignore
App.On(csharp_1.FairyEditor.EditorEvents.HierarchyChanged, onHierarchyChanged);

View File

@@ -0,0 +1,85 @@
import { FairyGUI, FairyEditor, System } from 'csharp';
import { $generic, $typeof } from 'puerts';
import { IConfig, IComponent, EComponent, EMode, IInspector } from './index';
import { CustomAttributer } from './TweenCoustomInspector';
const TweenSettings = require('./TweenSettings').default as any;
const App = FairyEditor.App;
// 首先读取本地文件配置获取是否本地配置还是远程配置
// local
let filePath = `${FairyEditor.App.project.basePath}/plugins/whoot-tween/config.json`;
let config: IConfig;
try {
let sw = new System.IO.StreamReader(filePath);
let data = sw.ReadToEnd();
sw.Close();
console.log("获取到本地配置:", data);
config = JSON.parse(data);
} catch (e) {
console.warn(e);
}
if (config.remote) {
// remote
let url = config.remote;
let request = System['Net']['WebRequest'].Create(url);
request.Method = "GET";
request.ContentType = "text/html;charset=UTF-8";
let response = request.GetResponse();
let responseStream = response.GetResponseStream();
let streamReader = new System.IO.StreamReader(responseStream);
let res = streamReader.ReadToEnd();
try {
console.log("获取到远程配置:", config);
config = JSON.parse(res);
} catch (e) {
console.warn(e);
}
}
App.pluginManager.LoadUIPackage(App.pluginManager.basePath + "/" + eval("__dirname") + '/TweenAttributer')
for (let i = 0; i < config.inspectors.length; i++) {
let inspector = config.inspectors[i];
let { parent, title } = inspector;
App.inspectorView.AddInspector(() => new CustomAttributer(inspector), title, title);
App.docFactory.ConnectInspector(title, "mixed", parent, false);
}
// 当层级结构变化(增删控件)时,自动清理 JSON 中已删除组件的记录
const onHierarchyChanged = (_ctx?: any) => {
try {
const activeDoc = App.activeDoc as FairyEditor.View.IDocument;
if (!activeDoc) return;
const packageName = activeDoc.packageItem.owner.name;
const docUrl = activeDoc.docURL;
const ids: string[] = [];
const visited: { [k: string]: boolean } = {};
const collect = (node: FairyEditor.FObject) => {
if (!node) return;
const nid = (node as any).id as string;
if (nid && !visited[nid]) {
visited[nid] = true;
ids.push(nid);
}
if (node instanceof FairyEditor.FComponent) {
const cnt = (node as FairyEditor.FComponent).numChildren;
for (let i = 0; i < cnt; i++) {
const child = (node as FairyEditor.FComponent).GetChildAt(i);
collect(child);
}
}
};
const docAny = activeDoc as any;
if (docAny && docAny.content) collect(docAny.content);
TweenSettings.cleanupDoc(packageName, docUrl, ids);
} catch (err) {
console.error('HierarchyChanged 自动清理失败', err);
}
};
// 订阅层级变化事件
// @ts-ignore
App.On(FairyEditor.EditorEvents.HierarchyChanged, onHierarchyChanged);

View File

@@ -0,0 +1,11 @@
{
"name": "WhootPlugins-Tween",
"displayName": "Whoot unity 通用动效",
"description": "Whoot前端框架FGUI扩展插件-通用动效",
"version": "1.0",
"author": {
"name": "Tim"
},
"icon": "",
"main": "main.js"
}

View File

@@ -0,0 +1,25 @@
declare module "puerts" {
import {$Ref, $Task, System} from "csharp"
function $ref<T>(x? : T) : $Ref<T>;
function $unref<T>(x: $Ref<T>) : T;
function $set<T>(x: $Ref<T>, val:T) : void;
function $promise<T>(x: $Task<T>) : Promise<T>;
function $generic<T extends new (...args:any[]) => any> (genericType :T, ...genericArguments: (new (...args:any[]) => any)[]) : T;
function $typeof(x : new (...args:any[]) => any) : System.Type;
function $extension(c : Function, e: Function) : void;
function on(eventType: string, listener: Function, prepend?: boolean) : void;
function off(eventType: string, listener: Function) : void;
function emit(eventType: string, ...args:any[]) : boolean;
}
declare function require(name: string): any;

View File

@@ -0,0 +1,130 @@
## 自定义数据表单生成器[CustomAttributer]
- 编辑器版本FairyGUI-Editor_2021.3.0
- 一个可配置自定义数据表单生成器,支持组件和父级组件,本地&远程配置内含9种自定义表单项。
![入口](../../assets/CustomAttributer/1.png)
### 如何配置表单
修改本插件同目录下的config.json文件即可
### 内置表单项
```
TEXTINPUT // 文本输入框
TEXTAREA // 文字输入区
COMBOBOX // 下拉框
COLORINPUT // 颜色输入框
NUMBERINPUT // 数字输入框
SLIDER // 滑动块
RESOURCEINPUT // 资源选择器
RADIOBOX // 单选框
SWITCH // 切换器
```
### 表单配置参数参考
```
{
"remote": "", // 自定义远程路径
"inspectors":[
{
"title": "自定义数据表单",
"parent": false, // 修改的组件主体类型true:父级|false:子级
"pattern": "*", // 组件名称匹配,支持正则
"mode": 1, // 插件模式1【设置模式】|0【读取模式】todo
"components": [
{
"type": "ComboBox",
"id": 1001,
"name": "属性一",
"key":"ComboBox",
"data": {
"items": [
"选项一",
"选项二",
"选项三"
],
"values": [
"选项一",
"选项二",
"选项三"
]
},
"value": 0
},
{
"type": "ColorInput",
"name": "属性二",
"key":"ColorInput",
"id": 1002,
"values": "#ffffff"
},
{
"type": "Slider",
"name": "属性三",
"id": 1003,
"key":"Slider",
"value": 50,
"data":{
"min":0,
"max":100
}
},
{
"type": "NumberInput",
"name": "属性四",
"key":"NumberInput",
"id": 1004,
"value": 50,
"data":{
"min":0,
"max":100,
"step":1
}
},
{
"type": "ResourceInput",
"name": "属性五",
"key":"ResourceInput",
"id": 1005,
"value": ""
},
{
"type": "RadioBox",
"name": "属性六",
"key":"RadioBox",
"id": 1006,
"value": 0,
"data":{
"items":["选项A","选项B"]
}
},
{
"type": "Switch",
"name": "属性七",
"key":"Switch",
"id": 1007,
"value": true
},
{
"type": "Textinput",
"name": "属性八",
"key":"Textinput",
"id": 1008,
"value": "默认内容"
},
{
"type": "Textarea",
"name": "属性九",
"key":"Textarea",
"id": 1009,
"value": "默认内容"
}
]
}
]
}
```
### todo
- [x] 多组件配置
- [ ] 表单子项关联显隐
- [ ] 【读取模式】一键复制组件属性

View File

@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"sourceMap": false,
"typeRoots": [
"./node_modules/@types"
],
"outDir": "./"
},
"include": ["./*"],
"exclude": ["./node_modules/**/*"]
}

View File

@@ -4,27 +4,24 @@
"textColor": "#000000",
"fontAdjustment": false,
"colorScheme": [
"主色调蓝 #07ACDA",
"分割线 #323232",
"普通文字 #E9E9E9",
"Item文字#f1f2f4",
"边框 #464646",
"边框选中 #AFB0AB",
"边框2 #727270",
"普通文字颜色 #9d9d9d",
"二级导航背景 #CCCCCC",
"二级导航文字默认 #6B6D6C",
"二级导航文字选中 #323232",
"底部导航文字 #C3C3C3",
"普通文字 #E4DBDB",
"白背景 #FFFFFF",
"蓝背景 #3D5C7A",
"橙色选中 #FE8D1D",
"Item文字标题 #16202f",
"文字蓝色描边 #123052",
"文字颜色 #303F4E",
"浅蓝字 #E2FFFB",
"品质-蓝色 #008AFF",
"品质-绿色 #44EDBF",
"品质-紫色 #7E00FF",
"品质-金色 #FF6C00"
],
"fontSizeScheme": [
"主导航文字 22",
"底部导航文字 19"
"主导航文字 24",
"导航文字 20",
"底部导航文字 19",
"弹出大标题 30",
"弹出文字 21"
],
"fontScheme": [
"默认字体"

View File

@@ -0,0 +1 @@
{"name":"Common","components":{"ui://6hgkvlauips61":{"__root__":{"id":"__root__","key":"Fade","useable":1}}}}