UI与快捷键



本章主要为UI的教程,在最后面也有讲到快捷键的设定。因为决定版重制了UI,本章节的UI教程不适用于决定版的UI(剧情编辑器除外);后面又因为决定版反作弊问题,删除了不应该删除的东西,所以本章节很多内容,都无法在决定版生效(例如决定版剧情编辑器自带的战雾Fog()与黑色地图Blackmap()这两个按钮已经无法正常使用)注意:因为这里的元素是可自选增加的,容易语法错误,特意提示:元素与元素之间要用空格隔开,否则会语法错误(显示缺少空白)。
例如:type="button"z="21"是错误的,type="button" z="21"是正确的。
z前面多了一个空格 ,没有空格是错误的。每一个元素末尾的“"”后面必须加空格。


命令与命令之间也要用空格隔开,如果该命令没有任何数值,那么就在后面加上英文括号()。
例如:Fog() Blackmap() 注意,两个命令之间用空格隔开了。



如果需要在UI输入中文字符,请将xml文件另存为UTF-8格式,否则会显示字符非法。
如果需要在UI输入中文字符,请将xml文件另存为UTF-8格式,否则会显示字符非法。
如果需要在UI输入中文字符,请将xml文件另存为UTF-8格式,否则会显示字符非法。
重要的事情说3遍。



我一开始没有任何教程下研究修改UI,也是看的头都疼,因为实在是太乱了,等到后面习惯就好了。

UI常见的几种形式:


普通按钮type="button":

<gadget name="自定义调用名" type="button" z="21" size1024="0 0 24 24【UIXY坐标】" mouseovertext="【鼠标移动到按钮上的注释。】" foreground="按钮图标路径" sound="UI_DefaultPregameClickSet【按下按钮的声音,对应soundsets.xml】" background="背景图片路径"> $$ <command>输入命令</command> </gadget> 例1: <gadget name="UI01" type="button" z="21" size1024="0 0 24 24" mouseovertext="123456789" foreground="" sound="UI_DefaultPregameClickSet" background=""> Button <command>输入命令</command> </gadget> 例2: <gadget name="UI02" type="button" z="21" size1024="24 0 48 24" mouseovertext="$$99998$" foreground="" sound="UI_DefaultPregameClickSet" background="UI\abcd\1234"> $$99999$ <command>输入命令</command> </gadget> 例3: <gadget name="UI03" type="button" z="21" size1024="48 0 72 24" mouseovertext="$$99997$" foreground="UI\fog" sound="UI_DefaultPregameClickSet" background=""> $$99996$ Fog <command>Fog()</command> </gadget> 模板: <gadget name="" type="button" z="21" size1024="48 0 72 24" mouseovertext="$$$$" foreground="" sound="UI_DefaultPregameClickSet" background=""> $$$$ <command></command> </gadget>

可下沉按钮type="stateButton"

<gadget name="自定义调用名" type="stateButton" size1024="730 0 810 26【UIXY坐标】" bevelbutton="" z="10" statebuttonuseinternalstates="按下按钮,或依照顺序显示stateentry background定义的图标,这个元素没有任何数值,双引号之间是空白的" textfont="SmallButtonFont【字体,这个不是随意设定的,要对应Fonst3.xml定义的字体】" textfontsize="10【字体大小,这个也不是随意设定的,要对应Fonst3.xml定义的字体大小】" textcolor="255 255 255【文字的RGB颜色】" texturecoords="0 0 0.826771653543307 0.67741935483871【裁剪图标】" textcenterhoriz="" mouseovertext="【鼠标移动到按钮上的注释。】"> $$ <command>输入命令</command> <stateentry background="ui\ingame\button"/> <stateentry background="ui\ingame\button_clicked"/> <stateentry background="ui\ingame\button_rollover"/> <stateentry background="ui\ingame\button_disable"/> </gadget> 例1: <gadget name="UI04" type="stateButton" size1024="72 0 96 24" bevelbutton="" z="10" statebuttonuseinternalstates="" textfont="SmallButtonFont" textfontsize="10" textcolor="255 255 255" texturecoords="0 0 0.826771653543307 0.67741935483871" textcenterhoriz="" mouseovertext=""> $$99996$ Fog <command>Fog()</command> <stateentry background="ui\ingame\button"/> <stateentry background="ui\ingame\button_clicked"/> <stateentry background="ui\ingame\button_rollover"/> <stateentry background="ui\ingame\button_disable"/> </gadget> 模板: <gadget name="UI04" type="stateButton" size1024="72 0 96 24" bevelbutton="" z="10" statebuttonuseinternalstates="" textfont="SmallButtonFont" textfontsize="10" textcolor="255 255 255" texturecoords="0 0 0.826771653543307 0.67741935483871" textcenterhoriz="" mouseovertext="$$$$"> $$$$ <command>Fog()</command> <stateentry background="ui\ingame\button"/> <stateentry background="ui\ingame\button_clicked"/> <stateentry background="ui\ingame\button_rollover"/> <stateentry background="ui\ingame\button_disable"/> </gadget>

可下拉窗口按钮(type="textField")

<gadget name="自定义调用名" type="textField" size1024="622 1 675 25【UIXY坐标】" tooltiptext="【鼠标移动到按钮上的注释。】" textcolor="0 0 0【文字的RGB颜色】" textfont="Arial nobold nodrop【字体,这个不是随意设定的,要对应Fonst3.xml定义的字体】" textfontsize="12【字体大小,这个也不是随意设定的,要对应Fonst3.xml定义的字体大小】"> <dropdown command="输入命令(这里的命令的双引号必须改成单引号或转义字符)">显示名称</dropdown> <dropdown command="输入命令(这里的命令的双引号必须改成单引号或转义字符)">多添加一个语句多一个按钮</dropdown> </gadget> 例1: <gadget name="UI05" type="textField" size1024="96 0 120 24" tooltiptext="$$00100$" textcolor="0 0 0" textfont="Arial nobold nodrop" textfontsize="12"> <dropdown command="Fog()">去除战雾(事实上用下拉窗口是不可能实现的除去战雾的,因为一个下拉窗口按1下执行两次命令,去除战雾后,又开启了战雾。)</dropdown> <dropdown command="Blackmap()">除去黑色地图(这个也一样)</dropdown> </gadget> 模板1: <gadget name="" type="textField" size1024="622 1 675 25" tooltiptext="" textcolor="0 0 0" textfont="Arial nobold nodrop" textfontsize="12"> <dropdown command=""></dropdown> <dropdown command=""></dropdown> </gadget> 模板2: <gadget name="" type="textField" size1024="622 1 675 25" tooltiptext="" textcolor="0 0 0" textfont="Arial nobold nodrop" textfontsize="12">$$$ <dropdown command=""></dropdown> <dropdown command=""></dropdown> </gadget>

按钮菜单(type="menu")

<gadget name="自定义调用名" type="menu" size1024="810 26 890 52【UIXY坐标】" bevel="" textfont="Arial nobold nodrop" mouseovertext="【鼠标移动到按钮上的注释。】" textfontsize="12" buttonsize1024="80 26【按钮XY大小】"> <submenu title="按钮" accelerator="" clampforeground="" clampbackground="" mouseovertext="【鼠标移动到按钮上的注释。】" textcenterhoriz=""> <submenu title="按钮1" accelerator="">输入命令</submenu> <submenu title="按钮2" accelerator="">输入命令</submenu> <submenu title="按钮3" accelerator="">输入命令</submenu> <submenu title="多添加一个语句多一个按钮" accelerator="">输入命令</submenu> </submenu> 例1: <gadget name="UI06" type="menu" size1024="810 26 890 52" bevel="" textfont="Arial nobold nodrop" mouseovertext="" textfontsize="12" buttonsize1024="80 26"> <submenu title="按钮" accelerator="" clampforeground="" clampbackground="" mouseovertext="$$00300$" textcenterhoriz=""> <submenu title="战雾" accelerator="">Fog()</submenu> <submenu title="黑色地图" accelerator="">Blackmap()</submenu> </submenu> 模板: <gadget name="" type="menu" size1024="810 26 890 52" bevel="" textfont="Arial nobold nodrop" mouseovertext="" textfontsize="12" buttonsize1024="80 26"> <submenu title="$$$$" accelerator="" clampforeground="" clampbackground="" mouseovertext="$$$$" textcenterhoriz=""> <submenu title="$$$$" accelerator=""></submenu> <submenu title="$$$$" accelerator=""></submenu> </submenu>

显示单位的调用名(type="animationgadget")

模板: <gadget name="ProtoNames" type="animationgadget" bevel="" background="ui\editor\editor_background" history="" titlebar="Proto:" tooltiptext="Displays the proto name after 'Proto:'" size1024="488 47 890 67"/>

镶嵌格式,例如我在窗口里面添加两个按钮,再写上一段文字 (type="gadget"):

<gadget name="自定义调用名" type="gadget" size1024="0 0 512 384【UIXY坐标】" background="ui\editor\editor_background【背景图片路径】" moveable="【可移动该窗口】" closebutton="关闭按钮" closeonesc="可按esc键关闭" titlebar="窗口标题"> <gadget name="自定义调用名" type="button" z="21" size1024="10 0 100 20【UIXY坐标】" mouseovertext="【鼠标移动到按钮上的注释。】" foreground="按钮图标路径" sound="UI_DefaultPregameClickSet【按下按钮的声音,对应soundsets.xml】" background="背景图片路径" bevelbutton=""> $$ <command>输入命令</command> </gadget> <gadget name="自定义调用名2" type="button" z="21" sizerel1024="10 0 100 20【子目录UIXY坐标,这里与上面那个不一样】" mouseovertext="【鼠标移动到按钮上的注释。】" foreground="按钮图标路径" sound="UI_DefaultPregameClickSet【按下按钮的声音,对应soundsets.xml】" background="背景图片路径" bevelbutton=""> $$ <command>输入命令</command> </gadget> <gadget name="自定义调用名3" type="formatText" textfont="AboutBoxVersion" textfontsize="18" textcolor="0 0 0" size1024="10 86 300 114" formattextusedatareplace="">$$00020$$</gadget> <gadget name="自定义调用名4" type="formatText" textfont="AboutBoxVersion" textfontsize="18" textcolor="0 0 0" sizerel1024="10 86 300 114" formattextusedatareplace="">$$00020$$</gadget> </gadget> 例1: <gadget name="XiaoYu" type="gadget" size1024="512 384 1024 768" background="ui\editor\editor_background" moveable="" closebutton="" closeonesc="" titlebar="窗口标题"> <gadget name="QQ927067964" type="button" z="21" size1024="10 0 100 20" mouseovertext="按钮1(size1024)从屏幕左上角0,0开始计算" foreground="" sound="UI_DefaultPregameClickSet" background="" bevelbutton=""> 按钮1(size1024) <command/> </gadget> <gadget name="QQGroup85442352" type="button" z="21" sizerel1024="10 0 100 20" mouseovertext="按钮1(sizerel1024)自定义的UI窗口左上角0,0开始计算,注意是re(小写的L),不是re(壹)" foreground="" sound="UI_DefaultPregameClickSet" background="" bevelbutton=""> 按钮1(sizerel1024) <command/> </gadget> <gadget name="Text1" type="formatText" textfont="AboutBoxVersion" textfontsize="18" textcolor="255 255 255" size1024="10 86 300 114" formattextusedatareplace="">$$00020$</gadget> <gadget name="Text2" type="formatText" textfont="AboutBoxVersion" textfontsize="18" textcolor="255 255 255" sizerel1024="10 86 300 114" formattextusedatareplace="">$$00020$</gadget> </gadget> 模板:抱歉,没有模板,实际上就是将多个UI镶嵌在一个gadget里面了,基本上每一个UI文件都是将所有UI镶嵌在第一个gadget里面。
例1效果图:











xml属性作用整理

 type="gadget"
窗口,英文翻译为"小玩意; 小配件; 小装置;",但解释为窗口更合适
 type="dialog"
另一种窗口,打开该窗口后无法点击窗口外的地方,不能用gadgettoggle关闭
 moveable=""
可以移动该窗口
 closeonesc=""
可按ESC关闭
 closebutton=""
给窗口增加关闭按钮
 titlebar=""
窗口标题(该标题居中显示)
 type="button"
 bevelbutton=""
图标会自动生成边框(例如:══》),如果按下按钮(图标)会下沉
 type="textField"
 alphasort=""
会按数字、大小写、拼音自动排列顺序
 fieldNameTextColor="R G B"
标题RGB颜色;补充一下:textField可以输入标题的,会显示在下拉菜单的左边,在第一个<dropdown前面输入的文字会变成标题。例如剧情编辑器放置单位的玩家1、玩家2选项就是这样。
 fieldTextBoxColor="R G B"
下拉菜单背景RGB颜色
 fieldTextBoxArt="ui\xxxxxxx"
下拉菜单背景图片路径
 fieldReadOnly=""
只读,不允许编辑文字(原本就是不能编辑)。【意义不明系列】
 fieldAllowDropEdits=""
允许编辑文字。【意义不明系列】
 fieldMaskText=""
加密输入的文字,像输入密码那种******。【意义不明系列】
 type="stateButton"
 statebuttonuseinternalstates=""
按下按钮,或依照顺序显示stateentry background定义的图标
 textfont="SmallButtonFont"
stateButton专用字体
 textfontsize="10"
stateButton专用字体大小
 type="textBox" 
显示文字
 type="formatText"
显示文字,formatText会在UI范围内自动换行,textBox不会
 textcentervert=""
上下居中显示文字
 textCenterHoriz=""
左右居中显示文字
 textJustifyRight=""
文字右对齐格式
以下绿色背景的元素为通用元素,除了(type="menu")之外,可以与任何Type一起使用。
 size1024="Xstart Ystart Xstop Ystop"
UI占用屏幕位置,屏幕范围X是0-1024,Y是0-768
 sizeRel1024="Xstart2 Ystart2 Xstop2 Ystop2"
在子UI情况下,上一级的UI中的size1024的位置起点为0,0,然后定义子目录UI位置
 mouseovertext=""
鼠标移动到该UI上显示注释
 tooltiptext=""
鼠标移动到该UI上显示注释
 hidden=""
默认隐藏这个UI,需要用命令gadgetToggle或gadgetReal打开。
 textcolor="R G B"
文字颜色
 background="路径"
背景图片路径
 backgroundcolor"R G B"
背景颜色
 resizevert=""
能上下缩放
 resizehorz=""
能左右缩放
 foreground="路径"
按钮图标
 type="menu"
菜单按钮
 titlebar=""
按钮名称
 separator=""
显示一条黑线,该按钮不可使用
 disabled=""
文字变灰色,该按钮不可使用









命令表格(含组合命令)

命令与命令组合能获得强大的效果,例如表格的一键训练村民,就是结合了几个快捷键。
效果/作用 命令(UI命令与快捷键的命令是通用的。)
打开/关闭XXXXX按钮、窗口 gadgetToggle("XXXXX")
打开XXXXX按钮、窗口 gadgetReal("XXXXX")
关闭XXXXX按钮、窗口 gadgetUnReal("XXXXX")
变更视角角度 configSetInt("limitPitch",X)
变更视角高度 configSetInt("minZoom",X)
恢复默认视角 configSetInt("limitPitch",47) configSetInt("minZoom",29)
单机去除战雾 Fog
单机显示地图 Blackmap
释放技能 doAbilityInSelected("技能调用名")
选中的单位停止一切行动 doCommandInSelected("Stop")
赎回探险家 doCommandInSelected("RansomExplorer")
攻击移动模式 editMode("attackMove")
巡逻模式(只能直线巡逻) editMode("Guard")
守护模式(跟着某单位走) editMode("Patrol")
放置墙 editMode("wall")
取消所有模式 editMode("None")
移动所以军事单位 editMode("moveAllMilitary") uiSetProtoCursor("WaypointFlag")
在地图显示闪光信号,来警告盟友注意某个特定地点。 editMode("flare") uiSetProtoCursor("WaypointFlag")
放置单位 editMode("PlaceUnit") uiSetProtoCursor(单位调用名, true)
复制单位 uiCopyToClipboard
贴上单位 editMode("UnitPaste")
保存当前视角为game saveCamera("game")
打开已保存的视角game loadCamera("game")
屏幕中间显示白色注释 echoLocalized(StringID,)
从主城运送卡片【X范围为0~24】 homeCityTrain2(-1,X)
暂停游戏 pause
开启盟友与敌人颜色 renderFriendOrFoe
改良科技 researchTechInSelected("科技调用名")
截图 screenshot
显示菜单 showGameMenu()
训练单个单位/建造单个建筑 tis("单位标签或调用名")
训练X个单位 tis("单位标签或调用名",X)
开启/关闭右边的分数 toggleScore
开启/关闭游戏时间 toggleTime
进入主城 toggleHomeCityView
寻找敲了警钟的城镇中心 uiFindTownBellTC()
查看已经选取的单位 uiLookAtSelection
显示聊天窗口 uiShowChatWindow() uiIgnoreNextKey
向上查看历史聊天记录 uiChatScrollBack
向下查看历史聊天记录 uiChatScrollForward
清理、显示聊天记录 uiClearChat
显示目标窗口 uiShowObjectivesDialog
显示进贡窗口 uiShowTributeDialog()
显示玩家摘要窗口 uiShowPlayerSummaryDialog
旋转单位 uiWheelRotatePlacedUnit
寻找上一个事件 uiZoomToMinimapEvent()
设定战术 setSquadMode("battle.xml战术调用名")
设定战术 unitSetTactic("tactics战术")
释放驻守在建筑的单位 uiEjectGarrisonedUnits()
寻找单个单位 uiFindType("标签或调用名")
寻找空闲单位 uiFindIdleType("标签或调用名")
寻找与被选取单位类型相同的所有单位 uiFindAllOfSelectedType()
寻找所有同一类型单位 uiFindAllOfType("标签或调用名")
删除单位 uiDeleteSelectedUnit
确认删除单位 uiDeleteAllSelectedUnits
创建编队X【X范围为0-9】 uiCreateNumberGroup(X)
增加到编队X【X范围为0-9】 uiAddSelectNumberGroup(X)
选取编队X【X范围为0-9】 uiSelectNumberGroup(X)
选中当前屏幕内所有单位 uiScreenSelect()
查找单位或建筑 uiFindType("标签或调用名")
寻找单个单位 uiFindType("调用名或标签")
寻找所有同类型单位 uiFindAllOfType("标签或调用名")
敲警钟 unitTownBell()
回去工作 unitReturnToWork()
让微型地图依序显示所有单位、只有军事单位,或者只有经济单位。 setMinimapUnitFilter(-1)
升级时代快捷键 uiPoliticianUIInSelected("PoliticianPhilosopherPrince") uiPoliticianUIInSelected("PoliticianPresidente") uiPoliticianUIInSelected("TribalSiouxChief2") uiPoliticianUIInSelected("TribalIroquoisChief2") uiPoliticianUIInSelected("TribalAztecChief2")
建造奇观快捷键 uiPoliticianUIInSelected("YPWonderChineseWhitePagoda2") uiPoliticianUIInSelected("YPWonderChineseWhitePagoda3") uiPoliticianUIInSelected("YPWonderChineseWhitePagoda4") uiPoliticianUIInSelected("YPWonderChineseWhitePagoda5") uiPoliticianUIInSelected("YPWonderIndianAgra2") uiPoliticianUIInSelected("YPWonderIndianAgra3") uiPoliticianUIInSelected("YPWonderIndianAgra4") uiPoliticianUIInSelected("YPWonderIndianAgra5") uiPoliticianUIInSelected("YPWonderJapaneseGiantBuddha2") uiPoliticianUIInSelected("YPWonderJapaneseGiantBuddha3") uiPoliticianUIInSelected("YPWonderJapaneseGiantBuddha4") uiPoliticianUIInSelected("YPWonderJapaneseGiantBuddha5")
一键训练村民(不改变当前视角) saveCamera("game") uiFindAllOfType("TownCenter") tis("Settler") tis("Coureur") tis("SettlerNative") tis("ypSettlerAsian") tis("ypSettlerIndian") tis("ypSettlerJapanese") loadCamera("game")
一键训练畜牧(不改变当前视角) saveCamera("game") uiFindAllOfType("AbstractFarm") tis("Cow",5) tis("Llama",5) tis("ypWaterBuffalo",5) tis("ypSacredCow",5) tis("sheep",5) tis("ypGoat",5) loadCamera("game")
一键删除墙柱(不改变当前视角) saveCamera("game") uiFindAllOfTypeidle("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits loadCamera("game")
一键训练土著(不改变当前视角) saveCamera("game") uiFindAllOfType("TradingPost") tis("AbstractNativeWarrior",5) loadCamera("game")
一键开城门(不改变当前视角) saveCamera("game") uiFindAllOfTypeidle("WallStraight5") uiTransformSelectedUnit("CWallGate") editMode("none") uiFindAllOfTypeidle("WallStraight2") uiTransformSelectedUnit("CWallGate") loadCamera("game")
一键选取9个单位(不改变当前视角) saveCamera("game") uiFindType("调用名或标签") uiCreateNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiFindType("调用名或标签") uiAddSelectNumberGroup(0) uiSelectNumberGroup(0) loadCamera("game")
删除所有单位与建筑 saveCamera("game") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("CWallGate") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("Building") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("Building") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("Ship") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("Ship") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight2") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallStraight5") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("WallConnector") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("ypMonastery") uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") uiFindAllOfType("unit") doAbilityInSelected("")  uiDeleteSelectedUnit gadgetUnReal("ConfirmDelete") uiDeleteAllSelectedUnits editMode("None") loadCamera("game")










部分UI文件作用

后面带min的文件为最少化界面的UI。
uiarmybanners.xml 编队
uicommandpanelnew.xml 游戏中右下方操作界面
uicommandpanelnewmin.xml 游戏中右下方操作界面
uihomecitycommandpanel.xml 游戏中主城界面
uimainnew.xml 游戏界面
uiminimappanelnew.xml 游戏中小地图界面(小地图及其附近按钮,还有主城按钮)
uiminimappanelnewmin.xml 游戏中小地图界面(小地图及其附近按钮,还有主城按钮)
uiMPGameSetupPage.xml 联机房间的界面
uinativecommandpanel2.xml 选中土著部落右下方的界面
uipregamenew.xml 打开游戏时的主界面
uiunitselection.xml 游戏中,下方的(选取单位)界面
uiunitselectionmin.xml 游戏中,下方的(选取单位)界面
uiunitstatpanel3.xml 游戏中,单位信息界面(游戏选项有按alt键显示)
uiunitstatpanel3min.xml 游戏中,单位信息界面,此文件已废弃
uiwonderpowerpanel.xml 游戏中,奇观能力界面
uiwonderpowerpanelmin.xml 游戏中,奇观能力界面
uixsdebugger.xml XS Debugger界面
uieditormenu.xml 剧情编辑器界面
uiunittrainingpanel.xml 游戏中,左方单位训练队列界面(训练单位、运送卡片)
uiunittrainingpanelmin.xml 游戏中,左方单位训练队列界面(训练单位、运送卡片)
uigamepalettes 剧情编辑器,放置单位界面
uiconsulatedlg.xml 游戏中,领事馆选择盟友界面
uioptions.xml 游戏选项
DefaultKeyMapY.xml 游戏快捷键(这个不是UI文件)







非教程,你可以自己研究,帝国3的UI与下面的元素有关。

这个是在data2.bar里面找到的UI类的Xml定义文件,仅供摆设。

文件原路径是data2.bar\uilayout.dtd。
<!--Generated by XML Authority-->

<!ELEMENT background (#PCDATA)>

<!ELEMENT gadget (#PCDATA | gadget | command | button | dropdown | submenu | stateEntry)*>
<!ATTLIST gadget  name                              CDATA     #REQUIRED
                  type                               (gadget | 
                                                      button | 
                                                      checkButton | 
                                                      stateButton | 
                                                      meshButton | 
                                                      textBox | 
                                                      formatText |
                                                      editBox |
                                                      dialog | 
                                                      textField | 
                                                      list | 
                                                      pictureTextButton | 
                                                      colorDropdown |
                                                      commandPanel | 
                                                      displayPanel | 
                                                      favorDisplay | 
                                                      debugUnitPanel | 
                                                      armyBanner | 
                                                      heroBanner | 
                                                      idleBanner | 
                                                      scale | 
                                                      slider | 
                                                      soundgadget | 
                                                      soundeditdialog | 
                                                      menu |
                                                      palette |
                                                      animationgadget | 
                                                      animationslider |
                                                      radioset |
                                                      xsdebugger |
                                                      simpleTextBox |
                                                      progressBar )  #REQUIRED
                  text                              CDATA     #IMPLIED
                  textColor                         CDATA     #IMPLIED
                  textFont                          CDATA     #IMPLIED
                  textFontSize                      CDATA     #IMPLIED
                  background                        CDATA     #IMPLIED
                  backgroundMesh                    CDATA     #IMPLIED
                  size1024                          CDATA     #IMPLIED
                  sizeRel1024                       CDATA     #IMPLIED
                  Z                                 CDATA     #IMPLIED
                  titlebar                          CDATA     #IMPLIED
                  closeButton                       CDATA     #IMPLIED
                  bevel                             CDATA     #IMPLIED
                  sunkenbevel                       CDATA     #IMPLIED
                  foreground                        CDATA     #IMPLIED
                  centerVert                        CDATA     #IMPLIED
                  centerHoriz                       CDATA     #IMPLIED
                  bevelButton                       CDATA     #IMPLIED
                  textCenterHoriz                   CDATA     #IMPLIED
                  textCenterVert                    CDATA     #IMPLIED
                  textJustifyRight                  CDATA     #IMPLIED
                  fieldVal                          CDATA     #IMPLIED
                  history                           CDATA     #IMPLIED
                  transparent                       CDATA     #IMPLIED
                  meshScale                         CDATA     #IMPLIED
                  meshYaw                           CDATA     #IMPLIED
                  hidden                            CDATA     #IMPLIED
                  columnOrder                       CDATA     #IMPLIED
                  showSelect                        CDATA     #IMPLIED
                  scrollHoriz                       CDATA     #IMPLIED
                  scrollVert                        CDATA     #IMPLIED
                  allowDoubleClick                  CDATA     #IMPLIED
                  allowRightClick                   CDATA     #IMPLIED
                  selectedColor                     CDATA     #IMPLIED
                  buttonSize1024                    CDATA     #IMPLIED
                  dontHighlight                     CDATA     #IMPLIED
                  picture                           CDATA     #IMPLIED
                  pictureSize1024                   CDATA     #IMPLIED
                  dataRefreshRate                   CDATA     #IMPLIED
                  tileBackground                    CDATA     #IMPLIED
                  mouseoverText                     CDATA     #IMPLIED
                  tooltipText                       CDATA     #IMPLIED
                  commandPanelButtonSize1024        CDATA     #IMPLIED
                  commandPanelButtonSeparation1024  CDATA     #IMPLIED
                  pictureSeparation1024             CDATA     #IMPLIED
                  border1024                        CDATA     #IMPLIED
                  pictureBorder1024                 CDATA     #IMPLIED
                  pictureTextBottom                 CDATA     #IMPLIED
                  backgroundAlpha                   CDATA     #IMPLIED
                  backgroundColor                   CDATA     #IMPLIED
                  favorDisplaySize1024              CDATA     #IMPLIED
                  favorDisplayOffset1024            CDATA     #IMPLIED
                  favorTextSize1024                 CDATA     #IMPLIED
                  favorTextOffset1024               CDATA     #IMPLIED
                  favorDisplay                      CDATA     #IMPLIED
                  favorMaxDisplay                   CDATA     #IMPLIED
                  favorTotalDisplay                 CDATA     #IMPLIED
                  timeout                           CDATA     #IMPLIED
                  noDataReplace                     CDATA     #IMPLIED
                  singleEdit                        CDATA     #IMPLIED
                  commandHistory                    CDATA     #IMPLIED
                  grabInput                         CDATA     #IMPLIED
                  enterKey                          CDATA     #IMPLIED
                  contextExclusive                  CDATA     #IMPLIED
                  verticalButtons                   CDATA     #IMPLIED
                  useMask                           CDATA     #IMPLIED
                  maskVertical                      CDATA     #IMPLIED
                  maskInvert                        CDATA     #IMPLIED
                  maskFlip                          CDATA     #IMPLIED
                  maskColor                         CDATA     #IMPLIED
                  maskAlpha                         CDATA     #IMPLIED
                  bannerSize                        CDATA     #IMPLIED
                  bannerProto                       CDATA     #IMPLIED
                  idleType                          CDATA     #IMPLIED
                  showNonIdle                       CDATA     #IMPLIED
                  displayPanelSelectionSize1024     CDATA     #IMPLIED
                  displayPanelInventorySize1024     CDATA     #IMPLIED
                  displayPanelQueuePortraitSize1024 CDATA     #IMPLIED
                  displayPanelPercentTextSize1024   CDATA     #IMPLIED
                  displayPanelQueueSize1024         CDATA     #IMPLIED
                  displayPanelMultiPortraitButtonSeparation    CDATA    #IMPLIED
                  textWrapOn                        CDATA     #IMPLIED
                  textMarkUp                        CDATA     #IMPLIED
                  useHyperlinks                     CDATA     #IMPLIED
                  root                              CDATA     #IMPLIED
                  sound                             CDATA     #IMPLIED
                  tickmarkBitmap                    CDATA     #IMPLIED
                  tickmarkColor                     CDATA     #IMPLIED
                  emptyBitmap                       CDATA     #IMPLIED
                  emptyColor                        CDATA     #IMPLIED
                  separation1024                    CDATA     #IMPLIED
                  maxValue                          CDATA     #IMPLIED
                  textureReplace                    CDATA     #IMPLIED
                  clampForeground                   CDATA     #IMPLIED
                  clampBackground                   CDATA     #IMPLIED
                  dropDownDistance                  CDATA     #IMPLIED
                  dropDownVisItems                  CDATA     #IMPLIED
                  rightCheck                        CDATA     #IMPLIED
                  checkCheckedArt                   CDATA     #IMPLIED
                  checkUnCheckedArt                 CDATA     #IMPLIED
                  checkHighlightArt                 CDATA     #IMPLIED
                  checkBorder1024                   CDATA     #IMPLIED  
                  fade                              CDATA     #IMPLIED
                  textScrollbar                     CDATA     #IMPLIED
                  lockTitlebarMove                  CDATA     #IMPLIED
                  showValue                         CDATA     #IMPLIED
                  configIndex                       CDATA     #IMPLIED
                  includeButtons                    CDATA     #IMPLIED
                  numberField                       CDATA     #IMPLIED
                  floatField                        CDATA     #IMPLIED
                  intField                          CDATA     #IMPLIED
                  sliderButtons                     CDATA     #IMPLIED
                  sliderEndButtons                  CDATA     #IMPLIED
                  sliderClickInc                    CDATA     #IMPLIED
                  sliderSlowUpdate                  CDATA     #IMPLIED
                  sliderVertical                    CDATA     #IMPLIED
                  sliderLeftBtnSet                  CDATA     #IMPLIED
                  sliderRightBtnSet                 CDATA     #IMPLIED
                  sliderUpBtnSet                    CDATA     #IMPLIED
                  sliderDownBtnSet                  CDATA     #IMPLIED
                  sliderPipArt                      CDATA     #IMPLIED
                  sliderPipTextureCoords            CDATA     #IMPLIED
                  sliderAreaArt                     CDATA     #IMPLIED
                  paletteUseDropdown                CDATA     #IMPLIED
                  paletteUserTab                    CDATA     #IMPLIED
                  paletteListBackground             CDATA     #IMPLIED
                  paletteButtonBackground           CDATA     #IMPLIED
                  paletteElemSize1024               CDATA     #IMPLIED
                  paletteContentSize1024            CDATA     #IMPLIED
                  paletteTitleLeft                  CDATA     #IMPLIED  
                  paletteTitleRight                 CDATA     #IMPLIED
                  paletteTitleTop                   CDATA     #IMPLIED
                  paletteTitleBottom                CDATA     #IMPLIED  
                  radioSetRightButtons              CDATA     #IMPLIED
                  radioSetTitle                     CDATA     #IMPLIED
                  radioSetTitleLeft                 CDATA     #IMPLIED  
                  radioSetDefaultButtonIndex        CDATA     #IMPLIED
                  radioSetButtonSize1024            CDATA     #IMPLIED
                  radioSetHorizLayout               CDATA     #IMPLIED
                  radioCheckedArt                   CDATA     #IMPLIED
                  radioUnCheckedArt                 CDATA     #IMPLIED
                  radioHighlightArt                 CDATA     #IMPLIED
                  radioBtnBorder1024                CDATA     #IMPLIED
                  alphaSort                         CDATA     #IMPLIED
                  animateMesh                       CDATA     #IMPLIED
                  meshIsometric                     CDATA     #IMPLIED
                  autoClose                         CDATA     #IMPLIED
                  resizeHorz                        CDATA     #IMPLIED
                  resizeVert                        CDATA     #IMPLIED
                  moveable                          CDATA     #IMPLIED
                  refreshOnReal                     CDATA     #IMPLIED
                  scaleHorizontal                   CDATA     #IMPLIED
                  fieldRequireEnter                 CDATA     #IMPLIED
                  fieldReadOnly                     CDATA     #IMPLIED
                  fieldAlphaOnly                    CDATA     #IMPLIED
                  fieldMaskText                     CDATA     #IMPLIED
                  fieldNameTextColor                CDATA     #IMPLIED
                  fieldNameTextFont                 CDATA     #IMPLIED
                  fieldNameTextFontSize             CDATA     #IMPLIED
                  fieldTextBoxColor                 CDATA     #IMPLIED
                  fieldTextBoxArt                   CDATA     #IMPLIED
                  fieldHideOnInactive               CDATA     #IMPLIED
                  fieldAllowDropEdits               CDATA     #IMPLIED
                  context                           CDATA     #IMPLIED
                  cursorAlwaysOn                    CDATA     #IMPLIED
                  normalCursorAlwaysOn              CDATA     #IMPLIED
                  mouseOverColor                    CDATA     #IMPLIED
                  listActivateOnAlphaJump           CDATA     #IMPLIED
                  checkbutton                       CDATA     #IMPLIED
                  persistentPosition                CDATA     #IMPLIED
                  persistentAlpha                   CDATA     #IMPLIED
                  textSimpleAddScrollsToBottom      CDATA     #IMPLIED
                  stateButtonDefaultState           CDATA     #IMPLIED
                  stateButtonUseInternalStates      CDATA     #IMPLIED
                  editBoxAlphaOnly                  CDATA     #IMPLIED
                  editBoxPosIntOnly                 CDATA     #IMPLIED
                  editBoxNumericOnly                CDATA     #IMPLIED
                  editBoxReadOnly                   CDATA     #IMPLIED
                  editBoxMaskChars                  CDATA     #IMPLIED
                  editBoxPrompt                     CDATA     #IMPLIED
                  editBoxMaxChars                   CDATA     #IMPLIED
                  antiBlurReduction                 CDATA     #IMPLIED
                  useButtonSet                      CDATA     #IMPLIED
                  leftCapArt                        CDATA     #IMPLIED  
                  rightCapArt                       CDATA     #IMPLIED
                  topCapArt                         CDATA     #IMPLIED
                  bottomCapArt                      CDATA     #IMPLIED
                  formatTextConvertUserLF           CDATA     #IMPLIED
                  formatTextUseDataReplace          CDATA     #IMPLIED>

<!ELEMENT command (#PCDATA)>

<!ELEMENT layout (gadget+ | background? | position*)+>

<!ELEMENT button (#PCDATA)>
<!ATTLIST button  command   CDATA  #IMPLIED>

<!ELEMENT dropdown (#PCDATA)>
<!ATTLIST dropdown  command   CDATA  #IMPLIED>

<!ELEMENT position (#PCDATA)>
<!ATTLIST position  name     CDATA  #REQUIRED
                    size1024 CDATA  #REQUIRED >

<!ELEMENT submenu (#PCDATA| submenu)*>
<!ATTLIST submenu  title       CDATA  #REQUIRED
                   separator   CDATA  #IMPLIED
                   accelerator CDATA  #IMPLIED
                   disabled    CDATA  #IMPLIED
                   configIndex CDATA  #IMPLIED >

<!ELEMENT stateEntry (#PCDATA)>
<!ATTLIST stateEntry  background       CDATA    #IMPLIED
                      backgroundColor  CDATA    #IMPLIED >