- 追加された行はこの色です。
- 削除された行はこの色です。
*Minimapを制御するために〜Gathererの解析〜 [#v44a205a]
**Gatherer.xml [#nbcd819c]
***AddOn.xml用の定型文 [#a89d5975]
<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ファイルの指定 [#q0ce4c44]
<Script file="localization.lua"/>
<Script file="GatherIcons.lua"/>
<Script file="Gatherer.lua"/>
***GathererUIの設定 [#k8947df6]
<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>
***GatherNoteTemplateの設定 [#v3615a86]
収集したものに関する情報を記述する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>
***各種GatherNoteの設定 [#v9f160cd]
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"/>
***GatherMainTemplateの設定 [#v89f2b7b]
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>
***各種GatherMainの設定 [#nfd16f90]
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>