/branches/castbar/Aloft/Libs
-- make into AceTimer. |
-- @class file |
-- @name AceTimer-3.0 |
-- @release $Id: AceTimer-3.0.lua 895 2009-12-06 16:28:55Z nevcairiel $ |
-- @release $Id: AceTimer-3.0.lua 1037 2011-09-02 16:24:08Z mikk $ |
--[[ |
Basic assumptions: |
- ALLOWS unscheduling ANY timer (including the current running one) at any time, including during OnUpdate processing |
]] |
local MAJOR, MINOR = "AceTimer-3.0", 5 |
local MAJOR, MINOR = "AceTimer-3.0", 6 |
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceTimer then return end -- No upgrade needed |
-- Time to clean it out? |
local list = selfs[self] |
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (max!). For one 'self'. |
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (worst case!). For one 'self'. |
return |
end |
local n=0 |
for k,v in pairs(list) do |
newlist[k] = v |
n=n+1 |
if type(v)=="table" and v.callback then -- if the timer is actually live: count it |
n=n+1 |
end |
end |
newlist.__ops = 0 -- Reset operation count |
AceTimer.frame:SetScript("OnEvent", OnEvent) |
AceTimer.frame:RegisterEvent("PLAYER_REGEN_ENABLED") |
-- In theory, we should hide&show the frame based on there being timers or not. |
-- In theory, we could hide&show the frame based on there being timers or not. |
-- However, this job is fairly expensive, and the chance that there will |
-- actually be zero timers running is diminuitive to say the lest. |
-- actually be zero timers running is diminuitive to say the least. |
--[[ $Id: AceGUIWidget-DropDown.lua 997 2010-12-01 18:36:28Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1029 2011-06-10 23:10:58Z nevcairiel $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
do |
local widgetType = "Dropdown" |
local widgetVersion = 24 |
local widgetVersion = 25 |
--[[ Static data ]]-- |
self:SetHeight(44) |
self:SetWidth(200) |
self:SetLabel() |
end |
-- exported, AceGUI callback |
self.pullout = nil |
self:SetText("") |
self:SetLabel("") |
self:SetDisabled(false) |
self:SetMultiselect(false) |
self.label:SetText(text) |
self.label:Show() |
self.dropdown:SetPoint("TOPLEFT",self.frame,"TOPLEFT",-15,-18) |
self.frame:SetHeight(44) |
self:SetHeight(44) |
self.alignoffset = 30 |
else |
self.label:SetText("") |
self.label:Hide() |
self.dropdown:SetPoint("TOPLEFT",self.frame,"TOPLEFT",-15,0) |
self.frame:SetHeight(26) |
self:SetHeight(26) |
self.alignoffset = 12 |
end |
end |
self.SetItemValue = SetItemValue |
self.SetItemDisabled = SetItemDisabled |
self.alignoffset = 31 |
self.alignoffset = 30 |
frame:SetHeight(44) |
frame:SetWidth(200) |
frame:SetScript("OnHide",Dropdown_OnHide) |
dropdown:ClearAllPoints() |
TreeGroup Container |
Container that uses a tree control to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TreeGroup", 33 |
local Type, Version = "TreeGroup", 34 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- Lua APIs |
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type |
local math_min, math_max, floor = math.min, math.max, floor |
local select, tremove, unpack = select, table.remove, unpack |
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat |
-- WoW APIs |
local CreateFrame, UIParent = CreateFrame, UIParent |
end |
end, |
["RefreshTree"] = function(self) |
["RefreshTree"] = function(self,scrollToSelection) |
local buttons = self.buttons |
local lines = self.lines |
local tree = self.tree |
local treeframe = self.treeframe |
status.scrollToSelection = status.scrollToSelection or scrollToSelection -- needs to be cached in case the control hasn't been drawn yet (code bails out below) |
self:BuildLevel(tree, 1) |
if maxlines <= 0 then return end |
local first, last |
scrollToSelection = status.scrollToSelection |
status.scrollToSelection = nil |
if numlines <= maxlines then |
--the whole tree fits in the frame |
if numlines - status.scrollvalue < maxlines then |
status.scrollvalue = numlines - maxlines |
end |
self.noupdate = nil |
first, last = status.scrollvalue+1, status.scrollvalue + maxlines |
--show selection? |
if scrollToSelection and status.selected then |
local show |
for i,line in ipairs(lines) do -- find the line number |
if line.uniquevalue==status.selected then |
show=i |
end |
end |
if not show then |
-- selection was deleted or something? |
elseif show>=first and show<=last then |
-- all good |
else |
-- scrolling needed! |
if show<first then |
status.scrollvalue = show-1 |
else |
status.scrollvalue = show-maxlines |
end |
first, last = status.scrollvalue+1, status.scrollvalue + maxlines |
end |
end |
if self.scrollbar:GetValue() ~= status.scrollvalue then |
self.scrollbar:SetValue(status.scrollvalue) |
end |
self.noupdate = nil |
first, last = status.scrollvalue+1, status.scrollvalue + maxlines |
end |
local buttonnum = 1 |
button:Show() |
buttonnum = buttonnum + 1 |
end |
end, |
["SetSelected"] = function(self, value) |
self.filter = false |
local status = self.status or self.localstatus |
local groups = status.groups |
for i = 1, select('#', ...) do |
groups[BuildUniqueValue(select(i, ...))] = true |
local path = {...} |
for i = 1, #path do |
groups[tconcat(path, "\001", 1, i)] = true |
end |
status.selected = uniquevalue |
self:RefreshTree() |
self:RefreshTree(true) |
self:Fire("OnGroupSelected", uniquevalue) |
end, |
-- end |
-- @class file |
-- @name AceAddon-3.0.lua |
-- @release $Id: AceAddon-3.0.lua 980 2010-10-27 14:20:11Z nevcairiel $ |
-- @release $Id: AceAddon-3.0.lua 1036 2011-08-16 22:45:05Z nevcairiel $ |
local MAJOR, MINOR = "AceAddon-3.0", 10 |
local MAJOR, MINOR = "AceAddon-3.0", 11 |
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceAddon then return end -- No Upgrade needed. |
-- Event Handling |
local function onEvent(this, event, arg1) |
if event == "ADDON_LOADED" or event == "PLAYER_LOGIN" then |
-- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up |
if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then |
-- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration |
while(#AceAddon.initializequeue > 0) do |
local addon = tremove(AceAddon.initializequeue, 1) |
-- end |
-- @class file |
-- @name AceDB-3.0.lua |
-- @release $Id: AceDB-3.0.lua 940 2010-06-19 08:01:47Z nevcairiel $ |
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 21 |
-- @release $Id: AceDB-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $ |
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 22 |
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) |
if not AceDB then return end -- No upgrade needed |
local _, raceKey = UnitRace("player") |
local factionKey = UnitFactionGroup("player") |
local factionrealmKey = factionKey .. " - " .. realmKey |
local factionrealmregionKey = factionrealmKey .. " - " .. string.sub(GetCVar("realmList"), 1, 2):upper() |
local localeKey = GetLocale():lower() |
-- Actual database initialization function |
local function initdb(sv, defaults, defaultProfile, olddb, parent) |
-- Generate the database keys for each section |
["race"] = raceKey, |
["faction"] = factionKey, |
["factionrealm"] = factionrealmKey, |
["factionrealmregion"] = factionrealmregionKey, |
["profile"] = profileKey, |
["locale"] = localeKey, |
["global"] = true, |
["profiles"] = true, |
} |
for db in pairs(AceDB.db_registry) do |
db.callbacks:Fire("OnDatabaseShutdown", db) |
db:RegisterDefaults(nil) |
-- cleanup sections that are empty without defaults |
local sv = rawget(db, "sv") |
for section in pairs(db.keys) do |
if not dataTable.error then |
if #parameterStringList > 0 then |
-- result = ("tagMethod%s(data, %s, %s)"):format(identifier, functionString or "true", table.concat(parameterStringList, ", ")) |
result = ('--[[ 3 ]] (tagMethod%s(data, %s, %s) or "")'):format(identifier, functionString or "true", table.concat(parameterStringList, ", ")) |
result = ('--[[ 1 ]] (tagMethod%s(data, %s, %s) or "")'):format(identifier, functionString or "true", table.concat(parameterStringList, ", ")) |
parameterStringList = del(parameterStringList) |
else |
-- result = ("tagMethod%s(data, %s)"):format(identifier, functionString or "true") |
result = ('--[[ 2 ]] (tagMethod%s(data, %s) or "")'):format(identifier, functionString or "true") |
result = ('--[[ 0 ]] (tagMethod%s(data, %s) or "")'):format(identifier, functionString or "true") |
end |
end |
end |
local method = loadstring(functionString) |
dataTable.method = method and method() or TagErrorMethods[resultType] |
dataTable.functionString = functionString |
-- dataTable.functionString = functionString |
end |
EmptyTable(headerCode) |
## Interface: 30000 |
## Interface: 40200 |
## Version: 2.0 |
## Title: Lib: TagCompiler-2.0 |
## Notes: A library to provide configuration via simple tag syntax. |
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings. |
-- @class file |
-- @name AceLocale-3.0 |
-- @release $Id: AceLocale-3.0.lua 1005 2011-01-29 14:19:43Z mikk $ |
local MAJOR,MINOR = "AceLocale-3.0", 5 |
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $ |
local MAJOR,MINOR = "AceLocale-3.0", 6 |
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
-- Lua APIs |
local assert, tostring, error = assert, tostring, error |
local setmetatable, rawset, rawget = setmetatable, rawset, rawget |
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget |
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded |
-- List them here for Mikk's FindGlobals script |
__index = assertfalse |
}) |
-- This metatable proxy is used when registering the default locale. |
-- This metatable proxy is used when registering the default locale. |
-- It refuses to overwrite existing values |
-- Reason 1: Allows loading locales in any order |
-- Reason 2: If 2 modules have the same string, but only the first one to be |
-- Reason 2: If 2 modules have the same string, but only the first one to be |
-- loaded has a translation for the current locale, the translation |
-- doesn't get overwritten. |
-- |
-- L["string1"] = "Zeichenkette1" |
-- @return Locale Table to add localizations to, or nil if the current locale is not required. |
function AceLocale:NewLocale(application, locale, isDefault, silent) |
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed |
local gameLocale = GAME_LOCALE or gameLocale |
local app = AceLocale.apps[application] |
if silent and app then |
if silent and app and getmetatable(app) ~= readmetasilent then |
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered") |
end |
if not app then |
if silent=="raw" then |
app = {} |
AceLocale.apps[application] = app |
AceLocale.appnames[app] = application |
end |
if locale ~= gameLocale and not isDefault then |
return -- nop, we don't need these translations |
end |
registering = app -- remember globally for writeproxy and writedefaultproxy |
if isDefault then |
return writedefaultproxy |
end |
## Interface: 40000 |
## Interface: 40200 |
## LoadOnDemand: 1 |
## Title: Lib: Babble-Faction-3.0 |
## Notes: A library to help with localization of factions. |
## X-eMail: oma_daviesh@hotmail.com |
## X-Category: Library |
## X-License: MIT |
## X-Curse-Packaged-Version: 4.0-release18 |
## X-Curse-Packaged-Version: 4.2-release16 |
## X-Curse-Project-Name: LibBabble-Faction-3.0 |
## X-Curse-Project-ID: libbabble-faction-3-0 |
## X-Curse-Repository-ID: wow/libbabble-faction-3-0/mainline |
--[[ |
Name: LibBabble-Faction-3.0 |
Revision: $Rev: 135 $ |
Revision: $Rev: 147 $ |
Maintainers: ckknight, nevcairiel, Ackis |
Website: http://www.wowace.com/projects/libbabble-faction-3-0/ |
Dependencies: None |
]] |
local MAJOR_VERSION = "LibBabble-Faction-3.0" |
local MINOR_VERSION = 90000 + tonumber(("$Rev: 135 $"):match("%d+")) |
local MINOR_VERSION = 90000 + tonumber(("$Rev: 147 $"):match("%d+")) |
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end |
local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION) |
["Argent Crusade"] = "Argent Crusade", |
["Argent Dawn"] = "Argent Dawn", |
["Ashtongue Deathsworn"] = "Ashtongue Deathsworn", |
["Avengers of Hyjal"] = "Avengers of Hyjal", |
["Baradin's Wardens"] = "Baradin's Wardens", |
["Bilgewater Cartel"] = "Bilgewater Cartel", |
["Bloodsail Buccaneers"] = "Bloodsail Buccaneers", |
["Argent Crusade"] = "Argentumkreuzzug", |
["Argent Dawn"] = "Argentumdämmerung", |
["Ashtongue Deathsworn"] = "Die Todeshörigen", |
["Avengers of Hyjal"] = "Rächer des Hyjal", |
["Baradin's Wardens"] = "Wächter von Baradin", |
["Bilgewater Cartel"] = "Bilgewasserkartell", |
["Bloodsail Buccaneers"] = "Blutsegelbukaniere", |
["Argent Crusade"] = "La Croisade d'argent", |
["Argent Dawn"] = "Aube d'argent", |
["Ashtongue Deathsworn"] = "Ligemort cendrelangue", |
["Avengers of Hyjal"] = "Vengeurs dâHyjal", -- Needs review |
["Baradin's Wardens"] = "Gardiens de Baradin", |
["Bilgewater Cartel"] = "Cartel Baille-fonds", |
["Bloodsail Buccaneers"] = "La Voile sanglante", |
Exalted = "Exalté", |
Exodar = "Exodar", |
["Explorers' League"] = "Ligue des explorateurs", |
["Frenzyheart Tribe"] = "La tribu FrénécÅur", |
["Frenzyheart Tribe"] = "Tribu FrénécÅur", -- Needs review |
Friendly = "Amical", |
["Frostwolf Clan"] = "Clan Loup-de-givre", |
Gadgetzan = "Gadgetzan", |
["Argent Crusade"] = "ìë¹ììêµ°", |
["Argent Dawn"] = "ìë¹ ì¬ëª í", |
["Ashtongue Deathsworn"] = "ì¿ë¹íë°ë¥ ê²°ì¬ë¨", |
["Avengers of Hyjal"] = "íì´ìì ë³µìì", |
["Baradin's Wardens"] = "ë°ë¼ë ì§íë¨", |
["Bilgewater Cartel"] = "ë¹ì§ìí° ë¬´ìíì¬", |
["Bloodsail Buccaneers"] = "ë¶ì í´ì ë¨", |
Exalted = "íê³ í ë맹", |
Exodar = "ììë¤ë¥´", |
["Explorers' League"] = "ííê° ì°ë§¹", |
["Frenzyheart Tribe"] = "ê´ëìì¬ì¥ì¼ì¡±", |
["Frenzyheart Tribe"] = "ê´ëì¬ì¥ ì¼ì¡±", |
Friendly = "ì½ê° ì°í¸ì ", |
["Frostwolf Clan"] = "ì리ëë ë¶ì¡±", |
Gadgetzan = "ê°ì ¯ì", |
["Argent Crusade"] = "Cruzada Argenta", |
["Argent Dawn"] = "El Alba Argenta", |
["Ashtongue Deathsworn"] = "Juramorte Lengua de ceniza", |
["Avengers of Hyjal"] = "Vengadores de Hyjal", |
["Baradin's Wardens"] = "Celadores de Baradin", |
["Bilgewater Cartel"] = "Cártel Pantoque", |
["Bloodsail Buccaneers"] = "Bucaneros Velasangre", |
Alliance = "Alianza", |
["Alliance Vanguard"] = "Vanguardia de la Alianza", |
["Argent Crusade"] = "Cruzada Argenta", |
["Argent Dawn"] = "Alba Argenta", |
["Argent Dawn"] = "El Alba Argenta", |
["Ashtongue Deathsworn"] = "Juramorte Lengua de ceniza", |
["Baradin's Wardens"] = "Baradin's Wardens", -- Needs review |
["Bilgewater Cartel"] = "Bilgewater Cartel", -- Needs review |
["Avengers of Hyjal"] = "Vengadores de Hyjal", -- Needs review |
["Baradin's Wardens"] = "Celadores de Baradin", |
["Bilgewater Cartel"] = "Cártel Pantoque", |
["Bloodsail Buccaneers"] = "Bucaneros Velasangre", |
["Booty Bay"] = "BahÃa del BotÃn", |
["Brood of Nozdormu"] = "Linaje de Nozdormu", |
["Darkmoon Faire"] = "Feria de la Luna Negra", |
["Darkspear Trolls"] = "Trols Lanza Negra", |
Darnassus = "Darnassus", |
["Dragonmaw Clan"] = "Dragonmaw Clan", -- Needs review |
["Dragonmaw Clan"] = "Clan Faucedraco", |
Everlook = "Vista Eterna", |
Exalted = "Exaltado", |
Exodar = "Exodar", |
Exodar = "El Exodar", |
["Explorers' League"] = "Liga de Expedicionarios", |
["Frenzyheart Tribe"] = "Tribu Corazón Frenético", |
Friendly = "Amistoso", |
["Frostwolf Clan"] = "Clan Lobo Gélido", |
Gadgetzan = "Gadgetzan", |
["Gelkis Clan Centaur"] = "Centauro del clan Gelkis", |
["Gelkis Clan Centaur"] = "Centauros del clan Gelkis", |
Gilneas = "Gilneas", -- Needs review |
Gnomeregan = "Gnomeregan", -- Needs review |
["Gnomeregan Exiles"] = "Exiliados de Gnomeregan", |
["Guardians of Hyjal"] = "Guardians of Hyjal", -- Needs review |
["Hellscream's Reach"] = "Hellscream's Reach", -- Needs review |
["Guardians of Hyjal"] = "Guardianes de Hyjal", |
["Hellscream's Reach"] = "Mando Grito Infernal", |
["Honor Hold"] = "Bastión del Honor", |
Honored = "Honorable", |
Horde = "Horda", |
["Horde Expedition"] = "Expedición de la Horda", |
["Hydraxian Waterlords"] = "Srs. del Agua de Hydraxis", |
Ironforge = "Forjaz", |
["Keepers of Time"] = "Vigilantes del tiempo", |
["Keepers of Time"] = "Vigilantes del Tiempo", |
["Kirin Tor"] = "Kirin Tor", |
["Knights of the Ebon Blade"] = "Caballeros de la Espada de Ãbano", |
Kurenai = "Kurenai", |
["Lower City"] = "Bajo Arrabal", |
["Magram Clan Centaur"] = "Centauro del clan Magram", |
["Magram Clan Centaur"] = "Centauros del clan Magram", |
Netherwing = "Ala Abisal", |
Neutral = "Neutral", |
["Ogri'la"] = "Ogri'la", |
Stormwind = "Ventormenta", |
Syndicate = "La Hermandad", |
["The Aldor"] = "Los Aldor", |
["The Ashen Verdict"] = "The Ashen Verdict", -- Needs review |
["The Ashen Verdict"] = "El Veredicto Cinéreo", |
["The Consortium"] = "El Consorcio", |
["The Defilers"] = "Los Rapiñadores", |
["The Earthen Ring"] = "The Earthen Ring", -- Needs review |
["The Earthen Ring"] = "El Anillo de la Tierra", |
["The Frostborn"] = "Los Natoescarcha", |
["The Hand of Vengeance"] = "La Mano de la Venganza", |
["The Kalu'ak"] = "Los Kalu'ak", |
["The Violet Eye"] = "El Ojo Violeta", |
["The Wyrmrest Accord"] = "El Acuerdo del Reposo del Dragón", |
Therazane = "Therazane", -- Needs review |
["Thorium Brotherhood"] = "Hermandad del torio", |
["Thorium Brotherhood"] = "Hermandad del Torio", |
Thrallmar = "Thrallmar", |
["Thunder Bluff"] = "Cima del Trueno", |
["Timbermaw Hold"] = "Bastión Fauces de Madera", |
Tranquillien = "Tranquilien", |
Tranquillien = "Tranquillien", |
Undercity = "Entrañas", |
["Valiance Expedition"] = "Expedición de Denuedo", |
["Warsong Offensive"] = "Ofensiva Grito de Guerra", |
["Warsong Outriders"] = "Escoltas Grito de Guerra", |
["Wildhammer Clan"] = "Clan Martillo Salvaje", |
["Winterfin Retreat"] = "Retiro Aleta Invernal", |
["Wintersaber Trainers"] = "Instructores de Sableinvernales", |
["Wintersaber Trainers"] = "Instructores de sableinvernales", |
["Zandalar Tribe"] = "Tribu Zandalar", |
} |
elseif GAME_LOCALE == "ruRU" then |
["Argent Crusade"] = "СеÑебÑÑнÑй ÐвангаÑд", |
["Argent Dawn"] = "СеÑебÑÑнÑй РаÑÑвеÑ", |
["Ashtongue Deathsworn"] = "ÐеплоÑÑÑÑ-ÑлÑжиÑели", |
["Avengers of Hyjal"] = "ХиджалÑÑкие мÑÑиÑели", -- Needs review |
["Baradin's Wardens"] = "ÐаÑиÑники Тол ÐаÑада", |
["Bilgewater Cartel"] = "ÐаÑÑÐµÐ»Ñ Ð¢ÑÑмнÑÑ Ðод", |
["Bloodsail Buccaneers"] = "ÐиÑаÑÑ ÐÑовавого ÐаÑÑÑа", |
["Argent Crusade"] = "é¶è²åä¼å", |
["Argent Dawn"] = "é¶è²é»æ", |
["Ashtongue Deathsworn"] = "ç°èæ»èªè ", |
["Avengers of Hyjal"] = "æµ·å å°å¤ä»è ", |
["Baradin's Wardens"] = "å·´æä¸å ¸ç±å®", |
["Bilgewater Cartel"] = "éæ°´è´¢é", |
["Bloodsail Buccaneers"] = "è¡å¸æµ·ç", |
["Argent Crusade"] = "éç½ååè»", |
["Argent Dawn"] = "éè²é»æ", |
["Ashtongue Deathsworn"] = "ç°èæ»äº¡èªè¨è ", |
["Avengers of Hyjal"] = "æµ·å ç¾å¾©ä»è ", |
["Baradin's Wardens"] = "å·´æä¸éµè¡", |
["Bilgewater Cartel"] = "污水ä¼æ¥", |
["Bilgewater Cartel"] = "污水ä¼æ¥è¯å", |
["Bloodsail Buccaneers"] = "è¡å¸æµ·ç", |
["Booty Bay"] = "è寶海ç£", |
["Brood of Nozdormu"] = "諾è²å¤å§çåå£", |
["Timbermaw Hold"] = "æ¨åè¦å¡", |
Tranquillien = "å®å¯§å°", |
Undercity = "å¹½æå", |
["Valiance Expedition"] = "é©åé å¾é", |
["Valiance Expedition"] = "é©åé å¾è»", |
["Warsong Offensive"] = "æ°æé²æ»é¨é", |
["Warsong Outriders"] = "æ°æåµå¯é¨å µ", |
["Warsong Outriders"] = "æ°æå é£é¨", |
["Wildhammer Clan"] = "è »éæ°æ", |
["Winterfin Retreat"] = "å¬é°é¿å± å°", |
["Wintersaber Trainers"] = "å¬åè±¹è¨ç·´å¸«", |
-- Note: This library is not yet finalized. |
-- @class file |
-- @name AceTab-3.0 |
-- @release $Id: AceTab-3.0.lua 947 2010-06-29 16:44:48Z nevcairiel $ |
-- @release $Id: AceTab-3.0.lua 1031 2011-06-29 15:04:34Z nevcairiel $ |
local ACETAB_MAJOR, ACETAB_MINOR = 'AceTab-3.0', 8 |
local ACETAB_MAJOR, ACETAB_MINOR = 'AceTab-3.0', 9 |
local AceTab, oldminor = LibStub:NewLibrary(ACETAB_MAJOR, ACETAB_MINOR) |
if not AceTab then return end -- No upgrade needed |
if postfunc and type(postfunc) ~= 'function' then error("Usage: RegisterTabCompletion(descriptor, prematches, wordlist, usagefunc, listenframes, postfunc, pmoverwrite): 'postfunc' - function expected.", 3) end |
if pmoverwrite and type(pmoverwrite) ~= 'boolean' and type(pmoverwrite) ~= 'number' then error("Usage: RegisterTabCompletion(descriptor, prematches, wordlist, usagefunc, listenframes, postfunc, pmoverwrite): 'pmoverwrite' - boolean or number expected.", 3) end |
local pmtable = type(prematches) == 'table' and prematches or {} |
-- Mark this group as a fallback group if no value was passed. |
if not prematches then |
pmtable[1] = "" |
fallbacks[descriptor] = true |
-- Make prematches into a one-element table if it was passed as a string. |
elseif type(prematches) == 'string' then |
pmtable[1] = prematches |
if prematches == "" then |
local pmtable |
if type(prematches) == 'table' then |
pmtable = prematches |
notfallbacks[descriptor] = true |
else |
pmtable = {} |
-- Mark this group as a fallback group if no value was passed. |
if not prematches then |
pmtable[1] = "" |
fallbacks[descriptor] = true |
else |
notfallbacks[descriptor] = true |
-- Make prematches into a one-element table if it was passed as a string. |
elseif type(prematches) == 'string' then |
pmtable[1] = prematches |
if prematches == "" then |
fallbacks[descriptor] = true |
else |
notfallbacks[descriptor] = true |
end |
end |
end |
-- Finally, increment our match count and set firstMatch, if appropriate. |
for _, m in ipairs(cands) do |
if strfind(strlower(m), strlower(text_pmendToCursor), 1, 1) == 1 then -- we have a matching completion! |
hasNonFallback = not fallback |
hasNonFallback = hasNonFallback or (not fallback) |
matches[m] = entry.postfunc and entry.postfunc(m, prematchEnd + 1, text_all) or m |
numMatches = numMatches + 1 |
if numMatches == 1 then |
end |
end |
-- Replace the original string with the greatest common substring of all valid completions. |
this.at3curMatch = 1 |
this.at3origWord = strsub(text_precursor, this.at3matchStart, this.at3matchStart + pmolengths[desc] - 1) .. allGCBS or "" |
this.at3origMatch = allGCBS or "" |
this.at3lastWord = this.at3origWord |
this.at3lastMatch = this.at3origMatch |
if next(matches) then |
-- Replace the original string with the greatest common substring of all valid completions. |
this.at3curMatch = 1 |
this.at3origWord = strsub(text_precursor, this.at3matchStart, this.at3matchStart + pmolengths[desc] - 1) .. allGCBS or "" |
this.at3origMatch = allGCBS or "" |
this.at3lastWord = this.at3origWord |
this.at3lastMatch = this.at3origMatch |
this:HighlightText(this.at3matchStart-1, cursor) |
this:Insert(this.at3origWord) |
this.at3_last_precursor = getTextBeforeCursor(this) or '' |
this:HighlightText(this.at3matchStart-1, cursor) |
this:Insert(this.at3origWord) |
this.at3_last_precursor = getTextBeforeCursor(this) or '' |
end |
end |
end |
end |
-- make into AceSerializer. |
-- @class file |
-- @name AceSerializer-3.0 |
-- @release $Id: AceSerializer-3.0.lua 910 2010-02-11 21:54:24Z mikk $ |
local MAJOR,MINOR = "AceSerializer-3.0", 3 |
-- @release $Id: AceSerializer-3.0.lua 1038 2011-10-03 01:39:58Z mikk $ |
local MAJOR,MINOR = "AceSerializer-3.0", 4 |
local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceSerializer then return end |
local tconcat = table.concat |
-- quick copies of string representations of wonky numbers |
local serNaN = tostring(0/0) |
local serInf = tostring(1/0) |
local serNegInf = tostring(-1/0) |
local inf = math.huge |
local serNaN -- can't do this in 4.3, see ace3 ticket 268 |
local serInf = tostring(inf) |
local serNegInf = tostring(-inf) |
-- Serialization functions |
local function SerializeStringHelper(ch) -- Used by SerializeValue for strings |
elseif t=="number" then -- ^N = number (just tostring()ed) or ^F (float components) |
local str = tostring(v) |
if tonumber(str)==v or str==serNaN or str==serInf or str==serNegInf then |
if tonumber(str)==v --[[not in 4.3 or str==serNaN]] or str==serInf or str==serNegInf then |
-- translates just fine, transmit as-is |
res[nres+1] = "^N" |
res[nres+2] = str |
end |
local function DeserializeNumberHelper(number) |
if number == serNaN then |
--[[ not in 4.3 if number == serNaN then |
return 0/0 |
elseif number == serNegInf then |
return -1/0 |
else]]if number == serNegInf then |
return -inf |
elseif number == serInf then |
return 1/0 |
return inf |
else |
return tonumber(number) |
end |