AddOn

AddOnの作り方

Writing your first addon
http://wow.mmhell.com/articles/interface_modification/writing_your_first_addon.html

ディレクトリの作成

AddOnディレクトリの下にAddOnの名前をつけたディレクトリを作成する。

.tocファイルの作成

ディレクトリと同じ名前の.tocファイルを作成する。

C:\Program Files\World of Warcraft\Interface\AddOns\AutoScreen

.tocファイル

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ファイルの作成

.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ファイルの作成

.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の設定

Binding.xmlファイルを作成する。

<Bindings>
	<Binding name="AUTOSCREEN_DESC" description="AUTOSCREEN_DESC" runOnUp="true" header="AUTOSCREEN">
		if ( keystate == "down" ) then
			ScreenshotWithoutInterface();
		end
	</Binding>
</Bindings>

AddOn API

WoW API
http://www.wowwiki.com/World_of_Warcraft_API

Lua Script

最新バージョンは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