Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local enchanting = IsPlayerSpell(51313)
- local ProfessionNames = {
- enUS = {
- [164] = "Blacksmithing",
- [333] = "Enchanting",
- },
- deDE = {
- [164] = "Schmiedekunst",
- [333] = "Verzauberkunst",
- },
- frFR = {
- [164] = "Forge",
- [333] = "Enchantement",
- },
- esMX = {
- [164] = "Herrería",
- [333] = "Encantamiento",
- },
- ptBR = {
- [164] = "Ferraria",
- [333] = "Encantamento",
- },
- ruRU = {
- [164] = "Кузнечное дело",
- [333] = "Наложение чар",
- },
- zhCN = {
- [164] = "锻造",
- [333] = "附魔",
- },
- zhTW = {
- [164] = "鍛造",
- [333] = "附魔",
- },
- koKR = {
- [164] = "대장기술",
- [333] = "마법부여",
- },
- }
- local profNames = ProfessionNames[GetLocale()]
- local profNames_rev = tInvert(profNames)
- local emptySlots = {
- [1] = true, --"HeadSlot",
- [3] = true, --"ShoulderSlot",
- [5] = true, --"ChestSlot",
- [7] = true, --"WaistSlot",
- [8] = true, --"LegsSlot",
- [9] = true, --"FeetSlot",
- [10] = true, --"WristSlot",
- [11] = false, --"Finger0Slot",
- [12] = false, --"Finger1Slot",
- [15] = true, --"HandsSlot",
- [16] = true, --"MainHandSlot",
- [17] = true, --"SecondaryHandSlot",
- --[18] = true, --"RangedSlot", Check for hunter scope?
- }
- for i = 1, GetNumSkillLines() do
- local name, _, _, skillRank = GetSkillLineInfo(i)
- if profNames_rev[name] == 333 and skillRank and skillRank >= 420 then --Enchanting
- emptySlots[11] = true
- emptySlots[12] = true
- end
- end
- function module:UpdatePageStrings(i, iLevelDB, inspectItem, slotInfo, which)
- iLevelDB[i] = slotInfo.iLvl
- local db = E.db.wratharmory[string.lower(which)]
- do
- local point, relativePoint, x, y = module:GetEnchantPoints(i, db)
- inspectItem.enchantText:ClearAllPoints()
- inspectItem.enchantText:Point(point, slot, relativePoint, x, y)
- inspectItem.enchantText:FontTemplate(LSM:Fetch('font', db.enchant.font), db.enchant.fontSize, db.enchant.fontOutline)
- local text = slotInfo.enchantTextShort
- if emptySlots[i] and text == "" then
- if which == "Character" or (which == "Inspect" and (i ~= 11 or i ~= 12)) then
- text = "|cFFFF0000MISSING|r"
- end
- end
- inspectItem.enchantText:SetText(text)
- inspectItem.enchantText:SetShown(db.enchant.enable)
- local enchantTextColor = (db.enchant.qualityColor and slotInfo.itemQualityColors) or db.enchant.color
- if enchantTextColor and next(enchantTextColor) then
- inspectItem.enchantText:SetTextColor(enchantTextColor.r, enchantTextColor.g, enchantTextColor.b)
- end
- end
- inspectItem.iLvlText:ClearAllPoints()
- inspectItem.iLvlText:Point('BOTTOM', inspectItem, db.itemLevel.xOffset, db.itemLevel.yOffset)
- inspectItem.iLvlText:FontTemplate(LSM:Fetch('font', db.itemLevel.font), db.itemLevel.fontSize, db.itemLevel.fontOutline)
- inspectItem.iLvlText:SetText(slotInfo.iLvl)
- inspectItem.iLvlText:SetShown(db.itemLevel.enable)
- local iLvlTextColor = (db.itemLevel.qualityColor and slotInfo.itemQualityColors) or db.itemLevel.color
- if iLvlTextColor and next(iLvlTextColor) then
- inspectItem.iLvlText:SetTextColor(iLvlTextColor.r, iLvlTextColor.g, iLvlTextColor.b)
- end
- if which == 'Inspect' then
- local unit = _G.InspectFrame.unit or 'target'
- if unit then
- local quality = GetInventoryItemQuality(unit, i)
- if quality and quality > 1 then
- inspectItem.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
- else
- inspectItem.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
- end
- end
- end
- do
- local point, relativePoint, x, y, spacing = module:GetGemPoints(i, db)
- local gemStep = 1
- for index = 1, 5 do
- local texture = inspectItem['textureSlot'..index]
- texture:Size(db.gems.size)
- texture:ClearAllPoints()
- texture:Point(point, (index == 1 and inspectItem) or inspectItem['textureSlot'..(index-1)], relativePoint, index == 1 and x or spacing, index == 1 and y or 0)
- local backdrop = inspectItem['textureSlotBackdrop'..index]
- local gem = slotInfo.gems and slotInfo.gems[gemStep]
- if gem then
- texture:SetTexture(gem)
- backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
- backdrop:Show()
- texture:SetShown(db.gems.enable)
- backdrop:SetShown(db.gems.enable)
- gemStep = gemStep + 1
- else
- texture:SetTexture()
- backdrop:Hide()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement