<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="localization.lua"/> <Script file="GatherIcons.lua"/> <Script file="Gatherer.lua"/>
<Frame name="Gatherer" parent="UIParent"> <!--name:UIの名前--> <!--parent:親UIの名前(UIParentは全てのUIの親)--> <Size> <!--UIのサイズ:0×0--> <AbsDimension x="0" y="0"/> </Size> <Scripts> <!--それぞれの割り込みタイミングで呼び出されるスクリプト--> <OnLoad> <!--ロードされたとき--> Gatherer_OnLoad(); </OnLoad> <OnEvent> <!--イベント(?)が発生したとき--> Gatherer_OnEvent(event); </OnEvent> <OnUpdate> <!--アップデート(?)が発生したとき--> Gatherer_TimeCheck(arg1); </OnUpdate> </Scripts> </Frame>
収集したものに関する情報を記述するGatherNote?のテンプレート
<Button name="GatherNoteTemplate" hidden="true" virtual="true"> <!--ButtonタイプのUI--> <!--hidden:隠すかどうか--> <!--virtual:C++のvirtual修飾子と同じか?--> <Size> <!--UIのサイズ:12×12--> <AbsDimension x="12" y="12"/> </Size> <Anchors> <!--アンカーの設定…アンカーって?--> <Anchor point="CENTER" relativeTo="MinimapBackdrop" relativePoint="TOPLEFT"> <Offset> <AbsDimension x="-51" y="60"/> </Offset> </Anchor> </Anchors> <Scripts> <OnLoad> this:RegisterEvent("VARIABLES_LOADED"); this:SetFrameLevel(this:GetFrameLevel() + 1); </OnLoad> <OnEvent> Gatherer_OnEvent(event); </OnEvent> <OnEnter> GameTooltip:SetOwner(this, "ANCHOR_BOTTOMLEFT"); local name, count, dist = Gatherer_MakeName(this:GetID()) GameTooltip:SetText(name, 1.0, 0.82, 0.0, 1,1); GameTooltip:AddLine("Count: "..count, 0.82, 1.0, 0.0); GameTooltip:AddLine(dist.." units ("..(dist*4).." secs)", 0.0, 0.82, 1.0); GameTooltip:Show(); </OnEnter> <OnLeave> GameTooltip:Hide(); </OnLeave> <OnMouseUp> Gatherer_OnClick(); </OnMouseUp> </Scripts> <NormalTexture name="$parentTexture" file="Interface\AddOns\Gatherer\IconGatherTest"/> <!--NormalTextureの設定…デフォルトのテクスチャーのことだろうか?--> </Button>
GatherNoteTemplate?を継承しGatherNote?を設定する
<Button name="GatherNote1" inherits="GatherNoteTemplate" id="1" hidden="false" parent="Minimap" toplevel="true"> <!--Minimapを親UIとするButtonタイプのUI。表示場所=toplevelという意味か?--> <Scripts> <OnUpdate> Gatherer_OnUpdate(arg1); </OnUpdate> <OnLoad> this:RegisterEvent("MINIMAP_UPDATE_ZOOM"); this:RegisterEvent("VARIABLES_LOADED"); </OnLoad> </Scripts> </Button> <!--以下その他のGatherNoteの設定--> <Button name="GatherNote2" inherits="GatherNoteTemplate" id="2" hidden="false" parent="Minimap" toplevel="true"/> : : : <Button name="GatherNote25" inherits="GatherNoteTemplate" id="25" hidden="false" parent="Minimap" toplevel="true"/>
Mainmap上での収集物の場所を表示するためのGatherMain?のテンプレート
<Button name="GatherMainTemplate" hidden="true" virtual="true"> <Size> <AbsDimension x="12" y="12"/> </Size> <Anchors> <Anchor point="CENTER"/> </Anchors> <Scripts> <OnEnter> local x, y = this:GetCenter(); local parentX, parentY = this:GetParent():GetCenter(); if ( x > parentX ) then WorldMapTooltip:SetOwner(this, "ANCHOR_LEFT"); else WorldMapTooltip:SetOwner(this, "ANCHOR_RIGHT"); end WorldMapTooltip:SetText(this.toolTip); WorldMapTooltip:Show(); </OnEnter> <OnLeave> WorldMapTooltip:Hide(); </OnLeave> </Scripts> <NormalTexture name="$parentTexture" file="Interface\AddOns\Gatherer\IconGatherTest"/> </Button>
GatherMainTemplate?を継承しGatherMain?を設定する
<Button name="GatherMain1000" inherits="GatherMainTemplate" id="1000" parent="WorldMapDetailFrame" toplevel="true"/> <!--WorldMapDetailFrameを親UIとするButtonタイプのUI--> : : : <Button name="GatherMain1500" inherits="GatherMainTemplate" id="1500" parent="WorldMapDetailFrame" toplevel="true"/> </Ui>