Skip to content

Instantly share code, notes, and snippets.

@Jakobud Jakobud/Core.lua
Last active Oct 1, 2019

Embed
What would you like to do?
WOW Classic Addon Ace-3.0 Bootstrap

Instructions

Here is the directory structure:

Interface\Addons\MyAddon\
Interface\Addons\MyAddon\MyAddon.toc
Interface\Addons\MyAddon\embeds.xml
Interface\Addons\MyAddon\Core.lua
Interface\Addons\MyAddon\Locales\Locales.xml
Interface\Addons\MyAddon\Locales\enUS.lua
etc...

Download all Ace3 libraries:

https://www.wowace.com/projects/ace3/files

Put them in Interface\Addons\MyAddon\Libs\. The directory structure should look similar to this:

Interface\Addons\MyAddon\Libs\Ace3.toc
Interface\Addons\MyAddon\Libs\Ace3.lua
Interface\Addons\MyAddon\Libs\LibStub\LibStub.lua
Interface\Addons\MyAddon\Libs\AceConsole-3.0\AceConsole-3.0.lua
Interface\Addons\MyAddon\Libs\AceLocale-3.0\AceLocale-3.0.lua
etc...
MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon")
MyAddon.version = "1.0"
local Console = LibStub("AceConsole-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("MyAddon")
-- Register slash command /myaddon
MyAddon:RegisterChatCommand("myaddon", "MyAddonCommand")
function MyAddon:MyAddonCommand(input)
-- Handle the input
end
function MyAddon:OnInitialize()
-- Code that you want to run when the addon is first loaded goes here.
self:Print(L["Hello World"])
end
function MyAddon:OnEnable()
-- Called when the addon is enabled
end
function MyAddon:OnDisable()
-- Called when the addon is disabled
end
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<!-- Localization -->
<Include file="Locales\Locales.xml"/>
<!-- LibStub for loading other addons -->
<Script file="Libs\LibStub\LibStub.lua"/>
<!-- Include Ace-3.0 libraries -->
<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml"/>
</Ui>
--localization file for english/United States
local L = LibStub("AceLocale-3.0"):NewLocale("MyAddon", "enUS", true)
L["Hello World"] = "Hello World!!!"
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="enUS.lua"/>
</Ui>
## Interface: 11302
## Title: MyAddon
## Notes: A description of what this addon does
## Author: John Doe
## Version: 1.0
embeds.xml
Core.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.