Commit 64c6f4b2 authored by Darth Predator's avatar Darth Predator

v1.04 deleted plugin lib

parent d3521e56
## Interface: 50200
## Title: |cff1784d1ElvUI |rAura Bars Mover
## Author: Darth Predator
## Version: 1.03
## Version: 1.04
## Notes: Moveble unit aura bars for |cff1784d1ElvUI|r.
## Notes-ruRU: Возможноть перемещения полос аур в |cff1784d1ElvUI|r.
## eMail: darthpred@gmail.com
......@@ -10,7 +10,5 @@
## OptionalDeps: ElvUI_SLE
## DefaultState: Enabled
LibElvUIPlugin-1.0\locales\load_locales.xml
LibElvUIPlugin-1.0\LibElvUIPlugin-1.0.lua
core.lua
options.lua
\ No newline at end of file
if not ElvUI then return end
local MAJOR, MINOR = "LibElvUIPlugin-1.0", 9
local lib, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not lib then return end
lib.plugins = {}
lib.index = 0
--
-- GLOBALS:
--
local E = ElvUI[1]
local L = ElvUI[2]
local _
--
-- Plugin table format:
-- { name (string) - The name of the plugin,
-- version (string) - The version of the plugin,
-- optionCallback (string) - The callback to call when ElvUI_Config is loaded
-- }
--
--
-- RegisterPlugin(name,callback)
-- Registers a module with the given name and option callback, pulls version info from metadata
--
function lib:RegisterPlugin(name,callback)
local plugin = {}
plugin.name = name
plugin.version = name == MAJOR and MINOR or GetAddOnMetadata(name, "Version")
plugin.callback = callback
lib.plugins[name] = plugin
local enabled, loadable = select(4,GetAddOnInfo("ElvUI_Config"))
local loaded = IsAddOnLoaded("ElvUI_Config")
if enabled and loadable and not loaded then
if not lib.ConfigFrame then
local configFrame = CreateFrame("Frame")
configFrame:RegisterEvent("ADDON_LOADED")
configFrame:SetScript("OnEvent", function(self,event,addon)
if addon == "ElvUI_Config" then
for _, plugin in pairs(lib.plugins) do
if(plugin.callback) then
plugin.callback()
end
end
end
end)
lib.ConfigFrame = configFrame
end
else
-- Need to update plugins list
if name ~= MAJOR then
E.Options.args.plugins.args.plugins.name = lib:GeneratePluginList()
end
callback()
end
lib:SetupVersionCheck(plugin)
lib.index = lib.index + 1
return plugin
end
function lib:SetupVersionCheck(plugin)
local prefix = "EPVC"..lib.index
E["Send"..plugin.name.."VersionCheck"] = function()
local _, instanceType = IsInInstance()
if IsInRaid() then
SendAddonMessage(prefix, plugin.version, (not IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInRaid(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "RAID")
elseif IsInGroup() then
SendAddonMessage(prefix, plugin.version, (not IsInGroup(LE_PARTY_CATEGORY_HOME) and IsInGroup(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "PARTY")
end
if E["Send"..plugin.name.."MSGTimer"] then
E:CancelTimer(E["Send"..plugin.name.."MSGTimer"])
E["Send"..plugin.name.."MSGTimer"] = nil
end
end
RegisterAddonMessagePrefix(prefix)
local function SendRecieve(self, event, mprefix, message, channel, sender)
if event == "CHAT_MSG_ADDON" then
if sender == E.myname or not sender or mprefix ~= prefix or plugin.name == MAJOR then return end
if not E[plugin.name.."recievedOutOfDateMessage"] then
if plugin.version ~= 'BETA' and tonumber(message) ~= nil and tonumber(message) > tonumber(plugin.version) then
plugin.old = true
plugin.newversion = tonumber(message)
local Pname = GetAddOnMetadata(plugin.name, "Title")
E:Print(L["Your version of "] .. Pname .. L[" is out of date. You can download the latest version from http://www.tukui.org"])
E[plugin.name.."recievedOutOfDateMessage"] = true
end
end
else
E["Send"..plugin.name.."MSGTimer"] = E:ScheduleTimer("Send"..plugin.name.."VersionCheck", 12)
end
end
local f = CreateFrame('Frame')
f:RegisterEvent("GROUP_ROSTER_UPDATE")
f:RegisterEvent("CHAT_MSG_ADDON")
f:SetScript('OnEvent', SendRecieve)
end
function lib:GetPluginOptions()
E.Options.args.plugins = {
order = 10000,
type = "group",
name = L["Plugins"],
guiInline = false,
args = {
pluginheader = {
order = 1,
type = "header",
name = "LibElvUIPlugin-1.0."..MINOR..L[" - Plugins Loaded (Green means you have current version, Red means out of date)"],
},
plugins = {
order = 2,
type = "description",
name = lib:GeneratePluginList(),
},
}
}
end
function lib:GeneratePluginList()
list = ""
for _, plugin in pairs(lib.plugins) do
if plugin.name ~= MAJOR then
local author = GetAddOnMetadata(plugin.name, "Author")
local Pname = GetAddOnMetadata(plugin.name, "Title")
local color = plugin.old and E:RGBToHex(1,0,0) or E:RGBToHex(0,1,0)
list = list .. Pname
if author then
list = list .. " "..L["by"].." " .. author
end
list = list .. color .. " - " ..L["Version"].." " .. plugin.version
if plugin.old then
list = list .. L[" (Newest: "] .. plugin.newversion .. ")"
end
list = list .. "|r\n"
end
end
return list
end
lib:RegisterPlugin(MAJOR, lib.GetPluginOptions)
\ No newline at end of file
## Interface: 50200
## LoadOnDemand: 1
## Title: Lib: LibElvUIPlugin-1.0
## Notes:
## Author: Sortokk
locales\load_locales.xml
LibStub.lua
LibElvUIPlugin-1.0.lua
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
local LibStub = _G[LIBSTUB_MAJOR]
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR
function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
local oldminor = self.minors[major]
if oldminor and oldminor >= minor then return nil end
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
return self.libs[major], oldminor
end
function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
end
return self.libs[major], self.minors[major]
end
function LibStub:IterateLibraries() return pairs(self.libs) end
setmetatable(LibStub, { __call = LibStub.GetLibrary })
end
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "zhCN")
if not L then return end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
-- English localization file for enUS and enGB.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0");
local L = AceLocale:NewLocale("ElvUI", "enUS", true);
if not L then return; end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
local AceLocale = LibStub:GetLibrary("AceLocale-3.0");
local L = AceLocale:NewLocale("ElvUI", "frFR");
if not L then return; end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
-- German localisation file for deDE
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "deDE")
if not L then return end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
local AceLocale = LibStub:GetLibrary("AceLocale-3.0");
local L = AceLocale:NewLocale("ElvUI", "itIT");
if not L then return; end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "koKR")
if not L then return end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
<Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file="english.lua"/> <Script file="french.lua"/> <Script file="russian.lua"/> <Script file="german.lua"/> <Script file="taiwan.lua"/> <Script file="spanish.lua"/> <Script file="korean.lua"/> <Script file="china.lua"/> <Script file="portuguese.lua"/> <Script file="italian.lua"/></Ui>
\ No newline at end of file
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "ptBR")
if not L then return end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
--Russian localization
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "ruRU")
if not L then return; end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = " - загруженные плагины (зеленый означает, что у вас последняя версия, красный - устаревшая)"
L["Plugins"] = "Плагины"
L["Your version of "] = "Ваша версия "
L[" is out of date. You can download the latest version from http://www.tukui.org"] = " устарела. Вы можете скачать последнюю версию на http://www.tukui.org"
L["by"] = "от"
L[" (Newest: "] = " (Последняя: "
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "esES") or AceLocale:NewLocale("ElvUI", "esMX")
if not L then return end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
-- 繁體中文版由 elmush 翻譯
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("ElvUI", "zhTW")
if not L then return end
L[" - Plugins Loaded (Green means you have current version, Red means out of date)"] = true
L["Plugins"] = true
L["Your version of "] = true
L[" is out of date. You can download the latest version from http://www.tukui.org"] = true
L["by"] = true
L[" (Newest: "] = true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment