[[AddOn]]
*AddOnの作り方 [#v096172a]
:Writing your first addon|http://wow.mmhell.com/articles/interface_modification/writing_your_first_addon.html

**ディレクトリの作成 [#v1bc757f]
AddOnディレクトリの下にAddOnの名前をつけたディレクトリを作成する。
**.tocファイルの作成 [#n27bbc6a]
ディレクトリと同じ名前の.tocファイルを作成する。
 C:\Program Files\World of Warcraft\Interface\AddOns\AutoScreen

***.tocファイル [#v5ec45d3]
AddOnに関する情報が書かれたファイル。

AutoScreen.toc
 ## Interface: 4150
 ## Title: AutoScreen
 ## Notes: Allows to take screenshots without the interface showing.
 ## Title-frFR: AutoScreen
 ## Notes-frFR: Permet de prendre un screen sans l'interface
 AutoScreen.xml

**.xmlファイルの作成 [#a753e3f0]
.tocファイルで指定した.xmlファイルを作成する。

AutoScreen.xml
 <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="AutoScreen.lua"/>
	<Frame name="AutoScreenFrame" hidden="false">
		<Scripts>
			<OnUpdate>
				AutoScreen_Update();
			</OnUpdate>
		</Scripts>
	</Frame>
 </Ui>

**.luaファイルの作成 [#q7dad6de]
.xmlファイルから呼び出される.luaファイルを作成する。

localization.lua
 -- Version : English - Dunvel
 BINDING_HEADER_AUTOSCREEN	= "Screenshot Options";
 BINDING_NAME_AUTOSCREEN_DESC= "Screenshot without interface";
 if ( GetLocale() == "frFR" ) then
	-- Traduction par Dunvel	
	BINDING_HEADER_AUTOSCREEN	= "Options Screenshots";
	BINDING_NAME_AUTOSCREEN_DESC= "Prendre un screen sans interface";
 elseif ( GetLocale() == "deDE" ) then
	-- Translation by DoctorVanGogh
    BINDING_HEADER_AUTOSCREEN   = "Screenshot Optionen";
    BINDING_NAME_AUTOSCREEN_DESC= "Screenshots ohne Interface";  
 end

AutoScreen.lua
 AutoScreen_State = 0;
 function ScreenshotWithoutInterface()
	HideUIPanel(UIParent);
	AutoScreen_State = 1;
 end
 function AutoScreen_Update()
	if (AutoScreen_State == 1) then
		Screenshot();
		AutoScreen_State = 2;
	elseif (AutoScreen_State == 2) then
		ShowUIPanel(UIParent);
		AutoScreen_State = 0;
	end
 end

**Keybindの設定 [#v24eaf6f]
Binding.xmlファイルを作成する。
 <Bindings>
	<Binding name="AUTOSCREEN_DESC" description="AUTOSCREEN_DESC" runOnUp="true" header="AUTOSCREEN">
		if ( keystate == "down" ) then
			ScreenshotWithoutInterface();
		end
	</Binding>
 </Bindings>

*AddOn API [#v7d3476e]
:WoW API|http://www.wowwiki.com/World_of_Warcraft_API
*Lua Script [#v1a342b6]
最新バージョンは5らしい
:紹介|http://www.tobysoft.net/wiki/index.php?Script%2FLua
:Reference|http://www.uri.sakura.ne.jp/~cosmic/yuno/lab/lua5_manual_ja.html
:FAQ|http://www.uri.sakura.ne.jp/~cosmic/yuno/lab/lua5_faq_ja.html
:Bug|http://www.uri.sakura.ne.jp/~cosmic/yuno/lab/lua5_bugs_ja.html

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS