3.1.0
updated AceLocale lib
This commit is contained in:
+1
-3
@@ -3,8 +3,7 @@
|
||||
## Notes: Shows possible loot from dungeon bosses and other sources.
|
||||
## Author: Shagu (pfUI update code), Lexie (Turtle WoW fixes/updates), Otari (overhaul/revamp, menu changes, bugfixes/updates)
|
||||
## LegacyAuthor: Daviesh, Pompa (Turtle WoW World Bosses), Xerron (Turtle WoW World Bosses), Gurky (Turtle WoW 1.16/1.16.1 Dungeons)
|
||||
## Version: 3.0.9
|
||||
## SavedVariables: AtlasLoot_updateavailable
|
||||
## Version: 3.1.0
|
||||
## SavedVariablesPerCharacter: AtlasLootCharDB
|
||||
## OptionalDeps: Alphamap, AtlasLoader, LootLink, ItemSync, HewdropLib, Ace2, EquipCompare, EQCompare
|
||||
|
||||
@@ -17,7 +16,6 @@ Libs\AceAddon\AceAddon-2.0.lua
|
||||
Libs\Hewdrop\Hewdrop-2.0.lua
|
||||
|
||||
Locale\Locale.xml
|
||||
# Bossnames\BossNames.xml
|
||||
Sets\Sets.xml
|
||||
Crafting\Crafting.xml
|
||||
PvP\PvP.xml
|
||||
|
||||
+37
-37
@@ -214,37 +214,37 @@ function AtlasLoot_OnVariablesLoaded()
|
||||
AtlasLootItemsFrame:Hide();
|
||||
end
|
||||
--Check and migrate old WishList entry format to the newer one
|
||||
if version < 40301 then
|
||||
--Check if we really need to do a migration since it will load all modules
|
||||
--We also create a helper table here which store IDs that need to search for
|
||||
local idsToSearch = {};
|
||||
for i = 1, table.getn(AtlasLootCharDB["WishList"]) do
|
||||
if (type(AtlasLootCharDB["WishList"][i][1]) == "number") then
|
||||
if (AtlasLootCharDB["WishList"][i][1] > 0 and not AtlasLootCharDB["WishList"][i][5]) then
|
||||
tinsert(idsToSearch, i, AtlasLootCharDB["WishList"][i][1]);
|
||||
end
|
||||
end
|
||||
end
|
||||
if table.getn(idsToSearch) > 0 then
|
||||
--Let's do this
|
||||
for _, dataSource in ipairs(AtlasLoot_SearchTables) do
|
||||
if AtlasLoot_Data[dataSource] then
|
||||
for dataID, lootTable in pairs(AtlasLoot_Data[dataSource]) do
|
||||
for _, entry in ipairs(lootTable) do
|
||||
for k, v in pairs(idsToSearch) do
|
||||
if(entry[1] == v)then
|
||||
AtlasLootCharDB["WishList"][k][5] = dataID.."|"..dataSource;
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
AtlasLootCharDB.AutoQuery = false;
|
||||
AtlasLootOptions_Init();
|
||||
end
|
||||
-- if version < 40301 then
|
||||
-- --Check if we really need to do a migration since it will load all modules
|
||||
-- --We also create a helper table here which store IDs that need to search for
|
||||
-- local idsToSearch = {};
|
||||
-- for i = 1, table.getn(AtlasLootCharDB["WishList"]) do
|
||||
-- if (type(AtlasLootCharDB["WishList"][i][1]) == "number") then
|
||||
-- if (AtlasLootCharDB["WishList"][i][1] > 0 and not AtlasLootCharDB["WishList"][i][5]) then
|
||||
-- tinsert(idsToSearch, i, AtlasLootCharDB["WishList"][i][1]);
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- if table.getn(idsToSearch) > 0 then
|
||||
-- --Let's do this
|
||||
-- for _, dataSource in ipairs(AtlasLoot_SearchTables) do
|
||||
-- if AtlasLoot_Data[dataSource] then
|
||||
-- for dataID, lootTable in pairs(AtlasLoot_Data[dataSource]) do
|
||||
-- for _, entry in ipairs(lootTable) do
|
||||
-- for k, v in pairs(idsToSearch) do
|
||||
-- if(entry[1] == v)then
|
||||
-- AtlasLootCharDB["WishList"][k][5] = dataID.."|"..dataSource;
|
||||
-- break;
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- AtlasLootCharDB.AutoQuery = false;
|
||||
-- AtlasLootOptions_Init();
|
||||
-- end
|
||||
--Adds an AtlasLoot button to the Feature Frame in Cosmos
|
||||
if(EarthFeature_AddButton) then
|
||||
EarthFeature_AddButton(
|
||||
@@ -360,14 +360,14 @@ function AtlasLootOptions_Fresh()
|
||||
AtlasLootCharDB.Opaque = false;
|
||||
AtlasLootCharDB.ItemIDs = false;
|
||||
AtlasLootCharDB.FirstTime = true;
|
||||
AtlasLootCharDB.ItemSpam = true;
|
||||
AtlasLootCharDB.ItemSpam = false;
|
||||
AtlasLootCharDB.MinimapButton = true;
|
||||
AtlasLootCharDB.MinimapButtonPosition = 315;
|
||||
AtlasLootCharDB.MinimapButtonRadius = 78;
|
||||
AtlasLootCharDB.HidePanel = false;
|
||||
AtlasLootCharDB.LastBoss = "DUNGEONSMENU1";
|
||||
AtlasLootCharDB.LastBossText = AL["Dungeons & Raids"];
|
||||
AtlasLootCharDB.AutoQuery = false;
|
||||
-- AtlasLootCharDB.AutoQuery = false;
|
||||
AtlasLootCharDB.PartialMatching = true;
|
||||
end
|
||||
|
||||
@@ -2070,8 +2070,8 @@ function AtlasLootOptions_ResetPosition()
|
||||
end
|
||||
|
||||
function AtlasLootOptions_DefaultSettings()
|
||||
AtlasLootCharDB.SafeLinks = true;
|
||||
AtlasLootCharDB.AllLinks = false;
|
||||
AtlasLootCharDB.SafeLinks = false;
|
||||
AtlasLootCharDB.AllLinks = true;
|
||||
AtlasLootCharDB.DefaultTT = true;
|
||||
AtlasLootCharDB.LootlinkTT = false;
|
||||
AtlasLootCharDB.ItemSyncTT = false;
|
||||
@@ -2082,7 +2082,7 @@ function AtlasLootOptions_DefaultSettings()
|
||||
AtlasLootCharDB.ItemSpam = true;
|
||||
AtlasLootCharDB.MinimapButton = true;
|
||||
AtlasLootCharDB.HidePanel = false;
|
||||
AtlasLootCharDB.AutoQuery = false;
|
||||
-- AtlasLootCharDB.AutoQuery = false;
|
||||
AtlasLootCharDB.PartialMatching = true;
|
||||
AtlasLootCharDB.LastBoss = "DUNGEONSMENU1";
|
||||
AtlasLootCharDB.LastBossText = AL["Dungeons & Raids"];
|
||||
@@ -3148,7 +3148,7 @@ function AtlasLootItem_OnEnter()
|
||||
getglobal("AtlasLootTooltipTextRight"..i):SetText("");
|
||||
end
|
||||
end
|
||||
if (this.itemID ~= 0) then
|
||||
if (this.itemID and this.itemID ~= 0) then
|
||||
if string.sub(this.itemID, 1, 1) == "s" then
|
||||
isItem = false;
|
||||
isEnchant = false;
|
||||
|
||||
@@ -8125,7 +8125,6 @@ AtlasLoot_Data["AtlasLootItems"] = {
|
||||
{ 20381, "INV_Misc_MonsterScales_11", "=q2=Dreamscale", "", "5%" },
|
||||
{ 61197, "INV_Stone_05", "=q3=Fading Dream Fragment", "", "0.35%" },
|
||||
{ 0, "", "", "" },
|
||||
{ 54001, "INV_Crate_02", "=q2=Dream Frog", "=ds=#e15#", "0.08%" },
|
||||
|
||||
{ 54001, "INV_Crate_02", "=q3=Dream Frog", "=ds=#e15#", "0.08%" },
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--[[
|
||||
Name: AceLocale-2.2
|
||||
Revision: $Rev: 13951 $
|
||||
Revision: $Rev: 17638 $
|
||||
Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
|
||||
Inspired By: Ace 1.x by Turan (turan@gryphon.com)
|
||||
Website: http://www.wowace.com/
|
||||
@@ -12,17 +12,18 @@ Dependencies: AceLibrary
|
||||
]]
|
||||
|
||||
local MAJOR_VERSION = "AceLocale-2.2"
|
||||
local MINOR_VERSION = "$Revision: 13951 $"
|
||||
local MINOR_VERSION = "$Revision: 17638 $"
|
||||
|
||||
if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
|
||||
if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
|
||||
|
||||
if loadstring("return function(...) return ... end") and AceLibrary:HasInstance(MAJOR_VERSION) then return end -- lua51 check
|
||||
local AceLocale = {}
|
||||
|
||||
local DEFAULT_LOCALE = "enUS"
|
||||
local _G = getfenv(0)
|
||||
|
||||
local BASE_TRANSLATIONS, DEBUGGING, TRANSLATIONS, BASE_LOCALE, TRANSLATION_TABLES, REVERSE_TRANSLATIONS, STRICTNESS, DYNAMIC_LOCALES, CURRENT_LOCALE
|
||||
local BASE_TRANSLATIONS, DEBUGGING, TRANSLATIONS, BASE_LOCALE, TRANSLATION_TABLES, REVERSE_TRANSLATIONS, STRICTNESS, DYNAMIC_LOCALES, CURRENT_LOCALE, NAME
|
||||
|
||||
local rawget = rawget
|
||||
local rawset = rawset
|
||||
@@ -63,7 +64,7 @@ local function clearCache(self)
|
||||
rawset(self, REVERSE_TRANSLATIONS, nil)
|
||||
|
||||
for k in pairs(self) do
|
||||
if cache[k] ~= nil then
|
||||
if rawget(cache, k) ~= nil then
|
||||
self[k] = nil
|
||||
end
|
||||
end
|
||||
@@ -141,16 +142,26 @@ AceLocale.prototype = { class = AceLocale }
|
||||
|
||||
function AceLocale.prototype:EnableDebugging()
|
||||
if rawget(self, BASE_TRANSLATIONS) then
|
||||
AceLocale:error("Cannot enable debugging after a translation has been registered.")
|
||||
AceLocale.error(self, "Cannot enable debugging after a translation has been registered.")
|
||||
end
|
||||
rawset(self, DEBUGGING, true)
|
||||
end
|
||||
|
||||
function AceLocale.prototype:EnableDynamicLocales()
|
||||
if rawget(self, BASE_TRANSLATIONS) then
|
||||
AceLocale:error("Cannot enable dynamic locales after a translation has been registered.")
|
||||
function AceLocale.prototype:EnableDynamicLocales(override)
|
||||
AceLocale.argCheck(self, override, 2, "boolean", "nil")
|
||||
if not override and rawget(self, BASE_TRANSLATIONS) then
|
||||
AceLocale.error(self, "Cannot enable dynamic locales after a translation has been registered.")
|
||||
end
|
||||
if not rawget(self, DYNAMIC_LOCALES) then
|
||||
rawset(self, DYNAMIC_LOCALES, true)
|
||||
if rawget(self, BASE_LOCALE) then
|
||||
if not rawget(self, TRANSLATION_TABLES) then
|
||||
rawset(self, TRANSLATION_TABLES, {})
|
||||
end
|
||||
self[TRANSLATION_TABLES][self[BASE_LOCALE]] = self[BASE_TRANSLATIONS]
|
||||
self[TRANSLATION_TABLES][self[CURRENT_LOCALE]] = self[TRANSLATIONS]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function AceLocale.prototype:RegisterTranslations(locale, func)
|
||||
@@ -163,6 +174,12 @@ function AceLocale.prototype:RegisterTranslations(locale, func)
|
||||
|
||||
if rawget(self, BASE_TRANSLATIONS) and GetLocale() ~= locale then
|
||||
if rawget(self, DEBUGGING) or rawget(self, DYNAMIC_LOCALES) then
|
||||
if not rawget(self, TRANSLATION_TABLES) then
|
||||
rawset(self, TRANSLATION_TABLES, {})
|
||||
end
|
||||
if self[TRANSLATION_TABLES][locale] then
|
||||
AceLocale.error(self, "Cannot provide the same locale more than once. %q provided twice.", locale)
|
||||
end
|
||||
local t = func()
|
||||
func = nil
|
||||
if type(t) ~= "table" then
|
||||
@@ -240,11 +257,33 @@ end
|
||||
|
||||
function AceLocale.prototype:GetLocale()
|
||||
if not rawget(self, TRANSLATION_TABLES) then
|
||||
AceLocale.error(self, "Cannot call `SetLocale' without first calling `RegisterTranslations'.")
|
||||
AceLocale.error(self, "Cannot call `GetLocale' without first calling `RegisterTranslations'.")
|
||||
end
|
||||
return self[CURRENT_LOCALE]
|
||||
end
|
||||
|
||||
local function iter(t, position)
|
||||
return (next(t, position))
|
||||
end
|
||||
|
||||
function AceLocale.prototype:IterateAvailableLocales()
|
||||
if not rawget(self, DYNAMIC_LOCALES) then
|
||||
AceLocale.error(self, "Cannot call `IterateAvailableLocales' without first calling `EnableDynamicLocales'.")
|
||||
end
|
||||
if not rawget(self, TRANSLATION_TABLES) then
|
||||
AceLocale.error(self, "Cannot call `IterateAvailableLocales' without first calling `RegisterTranslations'.")
|
||||
end
|
||||
return iter, self[TRANSLATION_TABLES], nil
|
||||
end
|
||||
|
||||
function AceLocale.prototype:HasLocale(locale)
|
||||
if not rawget(self, DYNAMIC_LOCALES) then
|
||||
AceLocale.error(self, "Cannot call `HasLocale' without first calling `EnableDynamicLocales'.")
|
||||
end
|
||||
AceLocale.argCheck(self, locale, 2, "string")
|
||||
return rawget(self, TRANSLATION_TABLES) and self[TRANSLATION_TABLES][locale] ~= nil
|
||||
end
|
||||
|
||||
function AceLocale.prototype:SetStrictness(strict)
|
||||
AceLocale.argCheck(self, strict, 2, "boolean")
|
||||
local mt = getmetatable(self)
|
||||
@@ -350,7 +389,7 @@ function AceLocale.prototype:Debug()
|
||||
return
|
||||
end
|
||||
local words = {}
|
||||
local locales = {"enUS", "deDE", "frFR", "koKR", "zhCN", "zhTW", "esES"}
|
||||
local locales = {"enUS", "ruRU", "deDE", "frFR", "koKR", "zhCN", "zhTW", "esES"}
|
||||
local localizations = {}
|
||||
DEFAULT_CHAT_FRAME:AddMessage("--- AceLocale Debug ---")
|
||||
for _,locale in ipairs(locales) do
|
||||
@@ -444,6 +483,16 @@ local function activate(self, oldLib, oldDeactivate)
|
||||
DYNAMIC_LOCALES = self.DYNAMIC_LOCALES
|
||||
CURRENT_LOCALE = self.CURRENT_LOCALE
|
||||
|
||||
|
||||
local GetTime = GetTime
|
||||
local timeUntilClear = GetTime() + 5
|
||||
scheduleClear = function()
|
||||
if next(newRegistries) then
|
||||
self.frame:Show()
|
||||
timeUntilClear = GetTime() + 5
|
||||
end
|
||||
end
|
||||
|
||||
if not self.registry then
|
||||
self.registry = {}
|
||||
else
|
||||
@@ -465,14 +514,6 @@ local function activate(self, oldLib, oldDeactivate)
|
||||
end
|
||||
end
|
||||
|
||||
local GetTime = GetTime
|
||||
local timeUntilClear = GetTime() + 5
|
||||
scheduleClear = function()
|
||||
if next(newRegistries) then
|
||||
self.frame:Show()
|
||||
timeUntilClear = GetTime() + 5
|
||||
end
|
||||
end
|
||||
self.frame:SetScript("OnEvent", scheduleClear)
|
||||
self.frame:SetScript("OnUpdate", function() -- (this, elapsed)
|
||||
if timeUntilClear - GetTime() <= 0 then
|
||||
|
||||
@@ -1050,6 +1050,7 @@ AtlasLoot_TableNames = {
|
||||
["WORLDBOSSMENU"] = { "dummy", "dummy" },
|
||||
["JEWELCRAFTMENU"] = { "dummy", "dummy" },
|
||||
["WishList"] = { AL["WishList"], "AtlasLootCharDB" },
|
||||
["SearchResult"] = { AL["Search"], "AtlasLootCharDB" },
|
||||
--If all else fails!
|
||||
["EmptyInstance"] = { "AtlasLoot", "AtlasLootFallback" },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user