UI变量




这个教程描述怎样添加游戏原本没有的数值,以及整理了游戏原有的UI变量代码。



所有数值都有一个相同点,都是使用下面的语句

<gadget name="自己定义名称" type="formatText" anchortooltiptopright="" size1024="XY大小" donthighlight="" datarefreshrate="100" textcolor="RGB颜色" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="鼠标移动到该UI上显示的注释">显示值,具体看下表</gadget>

currentUnitid 单位ID,外挂必备,也可以用来看出部分外挂操作。搞触发程序也非常需要这个东西。
currentUnitScenarioName 单位剧情名,编写触发程序可能会用上。
currentUnitname 单位名称
currentUnitHPFloat 单位当前生命值
currentUnitMaximumHPFloat 单位最大生命值(受到光环影响不会改变)
currentUnitCapacity 驻守单位数量/可驻守单位数量
currentUnitLOSFloat 单位视野(受到光环影响不会改变)
currentUnitMaxVelocityFloat 单位行走速度(受到光环影响不会改变)
currentUnitBuildingWorkRateFloat 训练单位、研究科技倍率
currentUnitTrainPointsFloat 单位训练时间(选中建筑时,该数值会显示为30)
currentUnitBuildPointsFloat 建筑建造时间(选中单位时,该数值会显示为10)
currentUnitLimberPercent 按钮切换的百分比数值
currentUnitOwnerID 当前选中单位的玩家ID
currentUnitInv
   
totalpop 当前占用人口数
popcap 总人口数
populationHelp 详细人口数量(例如:1城镇中心=10人口,2村庄=40人口,最大人口=50)
gameVersion 游戏版本
productID 产品ID
gametime 游戏已开始时间
gamespeed 游戏运行速度(慢速、标准、快速)
aiDifficulty AI难度
numDancers 跳舞农民数量
danceDescription 跳舞详细效率数值或效果数值
danceQuickValue 跳舞效率数值或效果数值
numTradePostsNeeded 贸易垄断所需贸易站数量
numTradePostSites 地图贸易站总数
numTradePostsControlled 已控制贸易站数量
{resource(XXXX)} 资源数量,XXXX为资源
{numUnits(XXXXX)} 单位数量,XXXXX为单位标签或调用名
{numIdle(XXXXX)} 空闲单位数量,XXXXX为单位标签或调用名
{numGatherers(XXXX)} 采集XXXX的单位数量,XXXX为资源
{marketBuy(XXXX)} 市场购买XXXX所需钱币数量,XXXX为资源
{marketSell(XXXX)} 市场出售XXXX可换钱币数量,XXXX为资源
{playerColor(X)} 玩家X颜色【X值:0为大自然,1为玩家1,2为玩家2,3为玩家3,…,8为玩家8】
{playerAge(X)} 玩家X的时代
{playerScore(X)} 玩家X的分数,1资源=1分
{playerTeamScore(X)} 玩家X所在的队伍分数,1资源=1分
{playerTeam(X)} 玩家X所在的队伍
{playerCivilization(X)} 玩家X的文明
{playerName(X)} 玩家X的昵称
{playerCulture(X)} 玩家X的文化
{playerHomeCityLevel(X)} 玩家X的主城等级
{playerHomeCityName(X)} 玩家X的主城名称
{XPShipmentProgressionString(X)} 玩家X的经验槽(您还需要 %1d 经验值才能运送第 %2d 批支援。)
xpProgressionString (还需要 %2d 的经验值即可达到等级 %3d 的主城。)

例如我要显示单位的视野,可以这样写:


<gadget name="LOS" type="formatText" anchortooltiptopright="" size1024="XY坐标大小自己定" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's Line of Sight."> LOS:currentUnitLOSFloat</gadget>

传送门
  uiunitselectionmin.xml - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)
<!-- converted from XMB to XML -->
<layout>

<gadget name="unitselectionpanel" type="unitselectionpanel" size1024="342 629 700 768" z="105">
<gadget name="unitselectionpanel-showCommands" type="button" size1024="674 641 701 696" z="125" foreground="" mouseovertext="$$42185$ Commands">
<command>uiShowCommandPanel()</command>
</gadget>
<gadget name="unitselectionpanel-showStats" type="button" size1024="674 702 701 757" z="125" foreground="" mouseovertext="$$42184$ Information">
<command>uiShowStatPanel()</command>
</gadget>
<gadget name="unitselectionpanel-unit" type="gadget" background="ui\ingame\ingame_ui_small_02_ypack" size1024="342 628 700 768" z="105" texturecoords="0 0 0.6875 0.26953125">
<gadget name="unitselectionpanel-unitPortrait" type="button" background="" size1024="345 699 405 759" z="106"/>
<gadget name="unitselectionpanel-unitHealthBarGreen" type="progressBar" size1024="345 759 405 767" z="110" progressbarbackground="ui\ingame\ui_health_bar" progressbarbackgroundsize="104 8" progressbarmask="ui\ingame\ingame_ui_health_green"/>
<gadget name="unitselectionpanel-unitHealthBarYellow" type="progressBar" size1024="345 759 405 767" z="110" progressbarbackground="ui\ingame\ui_health_bar" progressbarbackgroundsize="104 8" progressbarmask="ui\ingame\ingame_ui_health_yellow"/>
<gadget name="unitselectionpanel-unitHealthBarRed" type="progressBar" size1024="345 759 405 767" z="110" progressbarbackground="ui\ingame\ui_health_bar" progressbarbackgroundsize="104 8" progressbarmask="ui\ingame\ingame_ui_health_red"/>
<gadget name="unitselectionpanel-unitTypeName" type="formatText" textwrapon="" textcenterhoriz="" texttruecentervert="" background="" transparent="" textcolor="255 255 255" textfont="SmallIngame" textfontsize="12" size1024="328 650 476 714" z="107"/>
<gadget name="unitselectionpanel-unitPlayerName" type="formatText" textwrapon="" textcenterhoriz="" texttruecentervert="" background="" transparent="" textcolor="255 255 255" textfont="ScoreFont" textfontsize="12" size1024="450 650 620 714" z="107"/>
<gadget name="unitselectionpanel-unitHitPointsLabel" type="formatText" textwrapon="" texttruecentervert="" background="" transparent="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="408 680 408 680" z="107"/>
<gadget name="unitHP2" type="formatText" anchortooltiptopright="" size1024="408 696 444 716" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="HitPoints">$$24320$:</gadget>
<gadget name="unitHP1" type="formatText" anchortooltiptopright="" size1024="445 696 552 716" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's HitPoints.">currentUnitHPFloat/currentUnitMaximumHPFloat</gadget>
<gadget name="unitselectionpanel-unitHitPointsValue" type="formatText" textwrapon="" textcentervert="" background="" transparent="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="460 680 460 680" z="107"/>
<gadget name="unitselectionpanel-unitResistsLabel" type="formatText" texttruecentervert="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="529 700 557 714" z="107"/>
<gadget name="unitselectionpanel-unitResistsValue" type="formatText" textcentervert="" textmarkup="" formattextusedatareplace="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="558 700 592 714" z="107"/>
<gadget name="unitselectionpanel-unitResourceLabel" type="formatText" size1024="408 714 543 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitResourceValue" type="formatText" size1024="476 714 575 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitResourceRateLabel" type="formatText" size1024="573 714 700 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitResourceRateValue" type="formatText" size1024="632 714 722 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-StackLabel0" type="formatText" size1024="408 714 703 733" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-StackLabel1" type="formatText" size1024="408 731 703 750" texttruecentervert="" textmarkup="" formattextusedatareplace="" textcentervert="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-StackLabel2" type="formatText" size1024="408 748 703 767" texttruecentervert="" textmarkup="" formattextusedatareplace="" textcentervert="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitPortraitCountBackground" type="gadget" background="ui\ingame\ingame_ui_small_02_ypack" transparent="" size1024="429 727 461 759" z="107" texturecoords="0.861328125 0.62890625 0.923828125 0.69140625"/>
<gadget name="unitselectionpanel-unitPortraitCount" textfont="TimerDisplays" textfontsize="16" type="formatText" formattextbottomfill="" textjustifyright="" transparent="" textcolor="255 255 255" size1024="430 737 460 757" z="108"/>
</gadget>
<gadget name="unitselectionpanel-stackQueue" type="gadget" size1024="361 631 615 665" z="107">
<gadget name="unitselectionpanel-buttonArea" type="gadget" size1024="402 632 640 666" z="107"/>
<gadget name="unitselectionpanel-unitStackButton0" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton1" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton2" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton3" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton4" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton5" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton6" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton7" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton8" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButtonBig0" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 633 403 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButtonBigBackground" type="gadget" size1024="369 631 405 667" z="107" activateondown="" background="ui\ingame\ingame_ui_small_02_ypack" texturecoords="0.857421875 0.72265625 0.927734375 0.79296875"/>
<gadget name="unitid" type="formatText" anchortooltiptopright="" size1024="343 623 450 658" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's (in-game) ID number.">GameID:currentUnitid</gadget>
<gadget name="Scenarioid" type="formatText" anchortooltiptopright="" size1024="343 640 500 670" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's Scenario Name ID number.">ScenarioName:currentUnitScenarioName</gadget>
<gadget name="unitspeed" type="formatText" size1024="573 747 604 768" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's speed (in m/s)." formattextusedatareplace="" textmarkup="" textcolor="255 255 0">$$24323$:</gadget>
<gadget name="unitspeed2" type="formatText" anchortooltiptopright="" size1024="603 747 630 768" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's speed (in m/s).">currentUnitMaxVelocityFloat</gadget>
<gadget name="unitHPdel" type="formatText" anchortooltiptopright="" size1024="517 696 572 716" donthighlight="" datarefreshrate="100" hidden="" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's maximum hit points.">HP:currentUnitHPFloat</gadget>
<gadget name="unitlos1" type="formatText" anchortooltiptopright="" size1024="585 696 614 716" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's Line of Sight.">$$24324$:</gadget>
<gadget name="unitlos2" type="formatText" anchortooltiptopright="" size1024="603 696 660 716" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's Line of Sight.">currentUnitLOSFloat</gadget><!--我分开写了-->
<gadget name="unitContain2" type="formatText" anchortooltiptopright="" size1024="625 677 685 697" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's capacity details.">$$00016$ :</gadget>
<gadget name="unitContain21" type="formatText" anchortooltiptopright="" size1024="676 677 715 697" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's capacity details.">currentUnitCapacity</gadget>
<gadget name="unitTrainPoints1" type="formatText" anchortooltiptopright="" size1024="625 696 685 716" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's work rate.">$$00015$ Rate:</gadget>
<gadget name="unitTrainPoints2" type="formatText" anchortooltiptopright="" size1024="676 696 800 716" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's work rate.">currentUnitBuildingWorkRateFloat</gadget>
<gadget name="unitTrainPoints1" type="formatText" anchortooltiptopright="" size1024="625 732 685 748" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's train points.">$$00013$:</gadget>
<gadget name="unitTrainPoints2" type="formatText" anchortooltiptopright="" size1024="676 732 800 748" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's train points.">currentUnitTrainPointsFloat</gadget>
<gadget name="unitBuildPoints1" type="formatText" anchortooltiptopright="" size1024="625 747 685 767" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current building's build points.">$$00014$:</gadget>
<gadget name="unitBuildPoints2" type="formatText" anchortooltiptopright="" size1024="676 747 800 767" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current building's build points.">currentUnitBuildPointsFloat</gadget>
</gadget>
<gadget name="Score1" type="gadget" hidden="" size1024="870 350 1024 495" z="5" background="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 350 1024 365" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(1)}>Team{playerTeam(1)} {playerCivilization(1)} {playerName(1)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 365 1024 380" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(1)}>{playerAge(1)}:{playerScore(1)}/{playerTeamScore(1)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 380 1024 395" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(1)}>{XPShipmentProgressionString(1)}</color>
]]></gadget>
</gadget>
<gadget name="Score2" type="gadget" hidden="" size1024="870 395 1024 440" z="5" background="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 395 1024 410" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(2)}>Team{playerTeam(2)} {playerCivilization(2)} {playerName(2)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 410 1024 425" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(2)}>{playerAge(2)}:{playerScore(2)}/{playerTeamScore(2)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 425 1024 440" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(2)}>{XPShipmentProgressionString(2)}</color>
]]></gadget>
</gadget>
<gadget name="Score3" type="gadget" size1024="870 440 1024 485" z="5" background="" hidden="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 440 1024 455" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(3)}>Team{playerTeam(3)} {playerCivilization(3)} {playerName(3)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 455 1024 470" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(3)}>{playerAge(3)}:{playerScore(3)}/{playerTeamScore(3)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 470 1024 485" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(3)}>{XPShipmentProgressionString(3)}</color>
]]></gadget>
</gadget>
<gadget name="Score4" type="gadget" size1024="870 485 1024 530" z="5" background="" hidden="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 485 1024 500" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(4)}>Team{playerTeam(4)} {playerCivilization(4)} {playerName(4)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 500 1024 515" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(4)}>{playerAge(4)}:{playerScore(4)}/{playerTeamScore(4)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 515 1024 530" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(4)}>{XPShipmentProgressionString(4)}</color>
]]></gadget>
</gadget>
<gadget name="Score5" type="gadget" size1024="870 530 1024 575" z="5" background="" hidden="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 530 1024 545" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(5)}>Team{playerTeam(5)} {playerCivilization(5)} {playerName(5)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 545 1024 560" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(5)}>{playerAge(5)}:{playerScore(5)}/{playerTeamScore(5)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 560 1024 575" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(5)}>{XPShipmentProgressionString(5)}</color>
]]></gadget>
</gadget>
</gadget>
</layout>






表格的代码还可以写在stringtabley.xml与randommapstringsy.xml里面。至于能不能作为单位名称出现,我还没试过。

  randommapstringsy.xml - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)

<String _locID="32714">您目前的人口为 totalpop / 可容纳的总人口数为 popcap。\npopulationHelp</String>

如果想让不同国家写上不同颜色,可以使其套上该玩家的颜色,例如下面的截图





写出截图效果的语句如下:



<gadget name="Score1" type="gadget" size1024="870 350 1024 495" z="5" background="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 350 1024 365" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[ <color={playerColor(1)}>Team{playerTeam(1)} {playerCivilization(1)} {playerName(1)}</color>
]]>
</gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 365 1024 380" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[ <color={playerColor(1)}>{playerAge(1)}:{playerScore(1)}/{playerTeamScore(1)}</color>
]]>
</gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 380 1024 395" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[ <color={playerColor(1)}>{XPShipmentProgressionString(1)}</color>
]]>
</gadget>
</gadget>
<gadget name="Score2" type="gadget" size1024="870 395 1024 440" z="5" background="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 395 1024 410" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[ <color={playerColor(2)}>Team{playerTeam(2)} {playerCivilization(2)} {playerName(2)}</color>
]]>
</gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 410 1024 425" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[ <color={playerColor(2)}>{playerAge(2)}:{playerScore(2)}/{playerTeamScore(2)}</color>
]]>
</gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 425 1024 440" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[ <color={playerColor(2)}>{XPShipmentProgressionString(2)}</color>
]]>
</gadget>
</gadget>

红色字就是套用了玩家X的颜色,也可以采用另一种格式(直接使用转义字符表示“<”与“>”),例如:


<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 425 1024 440" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10">&lt;color={playerColor(2)}&gt;{XPShipmentProgressionString(2)}&lt;/color&gt; </gadget>

传送门
  uiunitselectionmin.xml - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)
<!-- converted from XMB to XML -->
<layout>

<gadget name="unitselectionpanel" type="unitselectionpanel" size1024="342 629 700 768" z="105">
<gadget name="unitselectionpanel-showCommands" type="button" size1024="674 641 701 696" z="125" foreground="" mouseovertext="$$42185$ Commands">
<command>uiShowCommandPanel()</command>
</gadget>
<gadget name="unitselectionpanel-showStats" type="button" size1024="674 702 701 757" z="125" foreground="" mouseovertext="$$42184$ Information">
<command>uiShowStatPanel()</command>
</gadget>
<gadget name="unitselectionpanel-unit" type="gadget" background="ui\ingame\ingame_ui_small_02_ypack" size1024="342 628 700 768" z="105" texturecoords="0 0 0.6875 0.26953125">
<gadget name="unitselectionpanel-unitPortrait" type="button" background="" size1024="345 699 405 759" z="106"/>
<gadget name="unitselectionpanel-unitHealthBarGreen" type="progressBar" size1024="345 759 405 767" z="110" progressbarbackground="ui\ingame\ui_health_bar" progressbarbackgroundsize="104 8" progressbarmask="ui\ingame\ingame_ui_health_green"/>
<gadget name="unitselectionpanel-unitHealthBarYellow" type="progressBar" size1024="345 759 405 767" z="110" progressbarbackground="ui\ingame\ui_health_bar" progressbarbackgroundsize="104 8" progressbarmask="ui\ingame\ingame_ui_health_yellow"/>
<gadget name="unitselectionpanel-unitHealthBarRed" type="progressBar" size1024="345 759 405 767" z="110" progressbarbackground="ui\ingame\ui_health_bar" progressbarbackgroundsize="104 8" progressbarmask="ui\ingame\ingame_ui_health_red"/>
<gadget name="unitselectionpanel-unitTypeName" type="formatText" textwrapon="" textcenterhoriz="" texttruecentervert="" background="" transparent="" textcolor="255 255 255" textfont="SmallIngame" textfontsize="12" size1024="328 650 476 714" z="107"/>
<gadget name="unitselectionpanel-unitPlayerName" type="formatText" textwrapon="" textcenterhoriz="" texttruecentervert="" background="" transparent="" textcolor="255 255 255" textfont="ScoreFont" textfontsize="12" size1024="450 650 620 714" z="107"/>
<gadget name="unitselectionpanel-unitHitPointsLabel" type="formatText" textwrapon="" texttruecentervert="" background="" transparent="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="408 680 408 680" z="107"/>
<gadget name="unitHP2" type="formatText" anchortooltiptopright="" size1024="408 696 444 716" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="HitPoints">$$24320$:</gadget>
<gadget name="unitHP1" type="formatText" anchortooltiptopright="" size1024="445 696 552 716" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's HitPoints.">currentUnitHPFloat/currentUnitMaximumHPFloat</gadget>
<gadget name="unitselectionpanel-unitHitPointsValue" type="formatText" textwrapon="" textcentervert="" background="" transparent="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="460 680 460 680" z="107"/>
<gadget name="unitselectionpanel-unitResistsLabel" type="formatText" texttruecentervert="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="529 700 557 714" z="107"/>
<gadget name="unitselectionpanel-unitResistsValue" type="formatText" textcentervert="" textmarkup="" formattextusedatareplace="" textcolor="255 255 255" textfont="StatText" textfontsize="10" size1024="558 700 592 714" z="107"/>
<gadget name="unitselectionpanel-unitResourceLabel" type="formatText" size1024="408 714 543 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitResourceValue" type="formatText" size1024="476 714 575 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitResourceRateLabel" type="formatText" size1024="573 714 700 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitResourceRateValue" type="formatText" size1024="632 714 722 734" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-StackLabel0" type="formatText" size1024="408 714 703 733" texttruecentervert="" textmarkup="" formattextusedatareplace="" textwrapon="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-StackLabel1" type="formatText" size1024="408 731 703 750" texttruecentervert="" textmarkup="" formattextusedatareplace="" textcentervert="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-StackLabel2" type="formatText" size1024="408 748 703 767" texttruecentervert="" textmarkup="" formattextusedatareplace="" textcentervert="" textfont="StatText" textfontsize="10" z="107"/>
<gadget name="unitselectionpanel-unitPortraitCountBackground" type="gadget" background="ui\ingame\ingame_ui_small_02_ypack" transparent="" size1024="429 727 461 759" z="107" texturecoords="0.861328125 0.62890625 0.923828125 0.69140625"/>
<gadget name="unitselectionpanel-unitPortraitCount" textfont="TimerDisplays" textfontsize="16" type="formatText" formattextbottomfill="" textjustifyright="" transparent="" textcolor="255 255 255" size1024="430 737 460 757" z="108"/>
</gadget>
<gadget name="unitselectionpanel-stackQueue" type="gadget" size1024="361 631 615 665" z="107">
<gadget name="unitselectionpanel-buttonArea" type="gadget" size1024="402 632 640 666" z="107"/>
<gadget name="unitselectionpanel-unitStackButton0" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton1" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton2" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton3" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton4" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton5" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton6" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton7" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButton8" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 641 395 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButtonBig0" textfont="TimerDisplays" textfontsize="12" type="button" size1024="371 633 403 665" z="108" activateondown=""/>
<gadget name="unitselectionpanel-unitStackButtonBigBackground" type="gadget" size1024="369 631 405 667" z="107" activateondown="" background="ui\ingame\ingame_ui_small_02_ypack" texturecoords="0.857421875 0.72265625 0.927734375 0.79296875"/>
<gadget name="unitid" type="formatText" anchortooltiptopright="" size1024="343 623 450 658" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's (in-game) ID number.">GameID:currentUnitid</gadget>
<gadget name="Scenarioid" type="formatText" anchortooltiptopright="" size1024="343 640 500 670" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's Scenario Name ID number.">ScenarioName:currentUnitScenarioName</gadget>
<gadget name="unitspeed" type="formatText" size1024="573 747 604 768" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's speed (in m/s)." formattextusedatareplace="" textmarkup="" textcolor="255 255 0">$$24323$:</gadget>
<gadget name="unitspeed2" type="formatText" anchortooltiptopright="" size1024="603 747 630 768" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's speed (in m/s).">currentUnitMaxVelocityFloat</gadget>
<gadget name="unitHPdel" type="formatText" anchortooltiptopright="" size1024="517 696 572 716" donthighlight="" datarefreshrate="100" hidden="" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's maximum hit points.">HP:currentUnitHPFloat</gadget>
<gadget name="unitlos1" type="formatText" anchortooltiptopright="" size1024="585 696 614 716" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's Line of Sight.">$$24324$:</gadget>
<gadget name="unitlos2" type="formatText" anchortooltiptopright="" size1024="603 696 660 716" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="10" background="" mouseovertext="The current unit's Line of Sight.">currentUnitLOSFloat</gadget>
<gadget name="unitContain2" type="formatText" anchortooltiptopright="" size1024="625 677 685 697" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's capacity details.">$$00016$ :</gadget>
<gadget name="unitContain21" type="formatText" anchortooltiptopright="" size1024="676 677 715 697" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's capacity details.">currentUnitCapacity</gadget>
<gadget name="unitTrainPoints1" type="formatText" anchortooltiptopright="" size1024="625 696 685 716" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's work rate.">$$00015$ Rate:</gadget>
<gadget name="unitTrainPoints2" type="formatText" anchortooltiptopright="" size1024="676 696 800 716" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's work rate.">currentUnitBuildingWorkRateFloat</gadget>
<gadget name="unitTrainPoints1" type="formatText" anchortooltiptopright="" size1024="625 732 685 748" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's train points.">$$00013$:</gadget>
<gadget name="unitTrainPoints2" type="formatText" anchortooltiptopright="" size1024="676 732 800 748" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current unit's train points.">currentUnitTrainPointsFloat</gadget>
<gadget name="unitBuildPoints1" type="formatText" anchortooltiptopright="" size1024="625 747 685 767" donthighlight="" datarefreshrate="100" textcolor="255 255 0" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current building's build points.">$$00014$:</gadget>
<gadget name="unitBuildPoints2" type="formatText" anchortooltiptopright="" size1024="676 747 800 767" donthighlight="" datarefreshrate="100" textcolor="0 255 255" textfont="StatText" textfontsize="16" textcentervert="" z="2" background="" mouseovertext="The current building's build points.">currentUnitBuildPointsFloat</gadget>
</gadget>
<gadget name="Score1" type="gadget" hidden="" size1024="870 350 1024 495" z="5" background="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 350 1024 365" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(1)}>Team{playerTeam(1)} {playerCivilization(1)} {playerName(1)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 365 1024 380" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(1)}>{playerAge(1)}:{playerScore(1)}/{playerTeamScore(1)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 380 1024 395" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(1)}>{XPShipmentProgressionString(1)}</color>
]]></gadget>
</gadget>
<gadget name="Score2" type="gadget" hidden="" size1024="870 395 1024 440" z="5" background="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 395 1024 410" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(2)}>Team{playerTeam(2)} {playerCivilization(2)} {playerName(2)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 410 1024 425" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(2)}>{playerAge(2)}:{playerScore(2)}/{playerTeamScore(2)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 425 1024 440" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(2)}>{XPShipmentProgressionString(2)}</color>
]]></gadget>
</gadget>
<gadget name="Score3" type="gadget" size1024="870 440 1024 485" z="5" background="" hidden="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 440 1024 455" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(3)}>Team{playerTeam(3)} {playerCivilization(3)} {playerName(3)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 455 1024 470" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(3)}>{playerAge(3)}:{playerScore(3)}/{playerTeamScore(3)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 470 1024 485" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(3)}>{XPShipmentProgressionString(3)}</color>
]]></gadget>
</gadget>
<gadget name="Score4" type="gadget" size1024="870 485 1024 530" z="5" background="" hidden="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 485 1024 500" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(4)}>Team{playerTeam(4)} {playerCivilization(4)} {playerName(4)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 500 1024 515" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(4)}>{playerAge(4)}:{playerScore(4)}/{playerTeamScore(4)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 515 1024 530" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(4)}>{XPShipmentProgressionString(4)}</color>
]]></gadget>
</gadget>
<gadget name="Score5" type="gadget" size1024="870 530 1024 575" z="5" background="" hidden="" transparent="" textcentervert="" textmarkup="" formattextusedatareplace="" datarefreshrate="200">
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 530 1024 545" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(5)}>Team{playerTeam(5)} {playerCivilization(5)} {playerName(5)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 545 1024 560" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(5)}>{playerAge(5)}:{playerScore(5)}/{playerTeamScore(5)}</color>
]]></gadget>
<gadget name="Score" type="formatText" transparent="" background="" textcentervert="" size1024="870 560 1024 575" textfont="NumbersFont" textfontsize="12" textmarkup="" formattextusedatareplace="" datarefreshrate="200" z="10"><![CDATA[
<color={playerColor(5)}>{XPShipmentProgressionString(5)}</color>
]]></gadget>
</gadget>

</gadget>
</layout>
我设定了这些变量都镶嵌一个带有hidden=""元素的gadget里面,所以这些变量需要利用gadgetReal(<stringName>) 或gadgetToggle(<stringName>)打开。