update ItemBagFamily

This commit is contained in:
Bunny67
2018-07-14 13:32:14 +03:00
parent 8d2eb9adcd
commit 7142615fda
2 changed files with 114 additions and 153 deletions
+5 -14
View File
@@ -266,24 +266,16 @@ function GetMapNameByID(id)
return mapByID[tonumber(id)] return mapByID[tonumber(id)]
end end
local bagTypes = { local LBIBF = LibStub("LibBabble-ItemBagFamily-3.0")
[LBIBF["Quiver"]] = 1,
[LBIBF["Ammo Pouch"]] = 2,
[LBIBF["Soul Bag"]] = 4,
[LBIBF["Herb Bag"]] = 8,
[LBIBF["Enchanting Bag"]] = 16,
}
local LBIBF2 = LibStub("LibBabble-ItemBagFamily-3.0").ItemFamily
function GetItemFamily(id) function GetItemFamily(id)
if not id then return end if not id then return end
if type(id) == "table" or type(id) == "function" then return end if type(id) == "table" or type(id) == "function" then return end
if type(id) == "string" then if type(id) == "string" then
id = match(id, "item:(%d+)") id = tonumber(match(id, "item:(%d+)"))
end end
return LBIBF2[id] or 0 return LBIBF.ItemFamily[id] or 0
end end
function GetBagFamily(id) function GetBagFamily(id)
@@ -291,11 +283,10 @@ function GetBagFamily(id)
if type(id) == "table" or type(id) == "function" then return end if type(id) == "table" or type(id) == "function" then return end
if type(id) == "string" then if type(id) == "string" then
id = match(id, "item:(%d+)") id = tonumber(match(id, "item:(%d+)"))
end end
local _, _, _, _, _, itemType = GetItemInfo(id) return LBIBF.ItemBagFamily[id] or 0
return bagTypes[itemType] or 0
end end
local arrow local arrow
@@ -5,71 +5,118 @@ if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION) local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end if not lib then return end
local GAME_LOCALE = GetLocale() lib.ItemBagFamily = {
[8217] = 1,
lib:SetBaseTranslations { [7371] = 1,
["Quiver"] = true, [7278] = 1,
["Ammo Pouch"] = true, [5439] = 1,
["Soul Bag"] = true, [3605] = 1,
["Herb Bag"] = true, [3573] = 1,
["Enchanting Bag"] = true, [2662] = 1,
[2101] = 1,
[19319] = 1,
[18714] = 1,
[11362] = 1,
[8218] = 2,
[7372] = 2,
[7279] = 2,
[5441] = 2,
[3604] = 2,
[3574] = 2,
[2663] = 2,
[2102] = 2,
[19320] = 2,
[21340] = 4,
[21341] = 4,
[21342] = 4,
[22243] = 4,
[22244] = 4,
[22250] = 8,
[22251] = 8,
[22252] = 8,
[22246] = 16,
[22248] = 16,
[22249] = 16,
} }
if GAME_LOCALE == "enUS" then
lib:SetCurrentTranslations(true)
elseif GAME_LOCALE == "deDE" then
lib:SetCurrentTranslations {
["Quiver"] = "Köcher",
["Ammo Pouch"] = "Ammo Pouch",
["Soul Bag"] = "Seelentaschen",
["Herb Bag"] = "Kräutertaschen",
["Enchanting Bag"] = "Verzauberertaschen",
}
elseif GAME_LOCALE == "frFR" then
lib:SetCurrentTranslations {
["Quiver"] = "Carquois",
["Ammo Pouch"] = "Ammo Pouch",
["Soul Bag"] = "Sacs d'âmes",
["Herb Bag"] = "Sacs d'herbes",
["Enchanting Bag"] = "Sacs d'enchanteur",
}
elseif GAME_LOCALE == "zhCN" then
lib:SetCurrentTranslations {
["Quiver"] = "箭袋",
["Ammo Pouch"] = "Ammo Pouch",
["Soul Bag"] = "灵魂袋",
["Herb Bag"] = "草药包",
["Enchanting Bag"] = "附魔材料包",
}
elseif GAME_LOCALE == "koKR" then
lib:SetCurrentTranslations {
["Quiver"] = "화살통",
["Ammo Pouch"] = "Ammo Pouch",
["Soul Bag"] = "영혼의 주머니",
["Herb Bag"] = "약초 가방",
["Enchanting Bag"] = "마법부여 가방",
}
elseif GAME_LOCALE == "esES" then
lib:SetCurrentTranslations {
["Quiver"] = "Carcaj",
["Ammo Pouch"] = "Ammo Pouch",
["Soul Bag"] = "Bolsas de almas",
["Herb Bag"] = "Bolsas de hierbas",
["Enchanting Bag"] = "Bolsas de encantamiento",
}
elseif GAME_LOCALE == "ruRU" then
lib:SetCurrentTranslations {
["Quiver"] = "Колчан",
["Ammo Pouch"] = "Подсумок",
["Soul Bag"] = "Сумка душ",
["Herb Bag"] = "Сумка травника",
["Enchanting Bag"] = "Сумка зачаровывателя",
}
else
error(string.format("%s: Locale %q not supported", MAJOR_VERSION, GAME_LOCALE))
end
lib.ItemFamily = { lib.ItemFamily = {
[2512] = 1,
[2515] = 1,
[3030] = 1,
[3464] = 1,
[9399] = 1,
[11285] = 1,
[12654] = 1,
[18042] = 1,
[19316] = 1,
[2516] = 2,
[2519] = 2,
[3033] = 2,
[3465] = 2,
[4960] = 2,
[5568] = 2,
[8067] = 2,
[8068] = 2,
[8069] = 2,
[10512] = 2,
[10513] = 2,
[11284] = 2,
[11363] = 2,
[11630] = 2,
[13377] = 2,
[15997] = 2,
[19317] = 2,
[6265] = 4,
[765] = 8,
[785] = 8,
[1401] = 8,
[2447] = 8,
[2449] = 8,
[2450] = 8,
[2452] = 8,
[2453] = 8,
[3355] = 8,
[3356] = 8,
[3357] = 8,
[3358] = 8,
[3369] = 8,
[3818] = 8,
[3819] = 8,
[3820] = 8,
[3821] = 8,
[4625] = 8,
[5056] = 8,
[5168] = 8,
[8153] = 8,
[8831] = 8,
[8836] = 8,
[8838] = 8,
[8839] = 8,
[8845] = 8,
[8846] = 8,
[11022] = 8,
[11040] = 8,
[11514] = 8,
[11951] = 8,
[11952] = 8,
[13463] = 8,
[13464] = 8,
[13465] = 8,
[13466] = 8,
[13467] = 8,
[13468] = 8,
[16205] = 8,
[16208] = 8,
[17034] = 8,
[17035] = 8,
[17036] = 8,
[17037] = 8,
[17038] = 8,
[17760] = 8,
[18297] = 8,
[19726] = 8,
[19727] = 8,
[22094] = 8,
[6218] = 16, [6218] = 16,
[6339] = 16, [6339] = 16,
[6342] = 16, [6342] = 16,
@@ -185,81 +232,4 @@ lib.ItemFamily = {
[20757] = 16, [20757] = 16,
[20758] = 16, [20758] = 16,
[22392] = 16, [22392] = 16,
[765] = 8,
[785] = 8,
[1401] = 8,
[2447] = 8,
[2449] = 8,
[2450] = 8,
[2452] = 8,
[2453] = 8,
[3355] = 8,
[3356] = 8,
[3357] = 8,
[3358] = 8,
[3369] = 8,
[3818] = 8,
[3819] = 8,
[3820] = 8,
[3821] = 8,
[4625] = 8,
[5056] = 8,
[5168] = 8,
[8153] = 8,
[8831] = 8,
[8836] = 8,
[8838] = 8,
[8839] = 8,
[8845] = 8,
[8846] = 8,
[11022] = 8,
[11040] = 8,
[11514] = 8,
[11951] = 8,
[11952] = 8,
[13463] = 8,
[13464] = 8,
[13465] = 8,
[13466] = 8,
[13467] = 8,
[13468] = 8,
[16205] = 8,
[16208] = 8,
[17034] = 8,
[17035] = 8,
[17036] = 8,
[17037] = 8,
[17038] = 8,
[17760] = 8,
[18297] = 8,
[19726] = 8,
[19727] = 8,
[22094] = 8,
[6265] = 4,
[2516] = 2,
[2519] = 2,
[3033] = 2,
[3465] = 2,
[4960] = 2,
[5568] = 2,
[8067] = 2,
[8068] = 2,
[8069] = 2,
[10512] = 2,
[10513] = 2,
[11284] = 2,
[11363] = 2,
[11630] = 2,
[13377] = 2,
[15997] = 2,
[19317] = 2,
[2512] = 1,
[2515] = 1,
[3030] = 1,
[3464] = 1,
[9399] = 1,
[11285] = 1,
[12654] = 1,
[18042] = 1,
[19316] = 1,
} }