Last active
December 18, 2015 00:09
-
-
Save z16/5694309 to your computer and use it in GitHub Desktop.
This is a template for a generic addon. Replace whichever parts necessary.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_addon.name = 'Template' | |
_addon.version = 0.1 | |
_addon.command = 'template' -- Main command to use | |
_addon.commands = {'tp', 'temp'} -- Possible list of other commands, such as abbreviations | |
-- If you want to use a library, require it here. Check the addons/libs/ folder | |
-- for available libraries. LuaU is a library that will load a few other | |
-- libraries. It includes almost everything most addons will need. | |
require('luau') | |
-- Define default settings here. These settings will be used, if either no | |
-- settings file exists, or if certain values in the settings file are missing. | |
-- These settings should always exist when parsing a settings file. | |
defaults = {} | |
defaults.SomeNumber = 0 | |
defaults.SomeTable = {'one', 'two', 'three'} | |
defaults.SomeText = {} | |
defaults.SomeText.font = {} | |
defaults.SomeText.font.red = 0 | |
defaults.SomeText.font.green = 102 | |
defaults.SomeText.font.blue = 204 | |
defaults.SomeText.pos = {} | |
defaults.SomeText.pos.x = 1000 | |
defaults.SomeText.pos.y = 600 | |
-- This line will parse settings from data/settings.xml and load it into the "settings" table. | |
-- If the settings file doesn't exist, it will create it (along with the folder, if necessary). | |
-- It will populate it with the default settings specified in the "defaults" table. | |
settings = config.load(defaults) | |
-- After this point, settings are usable and will automatically be repopulated when a new | |
-- character logs in. | |
-- This will create a text object with the settings specified above. | |
sometextobject = texts.new(settings.SomeText) | |
-- The following copyright message *must* be included if the addon should appear in the | |
-- Windower repository, otherwise we won't accept it. Replace every occurrence of <year> | |
-- with the current year (or years it was modified in) and <author> with your name. | |
--[[ | |
Copyright © <year>, <author> | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
* Neither the name of <author> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <author> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment