Advertisement
Translit

Untitled

Oct 19th, 2022
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.43 KB | None | 0 0
  1. --local enchanting = IsPlayerSpell(51313)
  2. local ProfessionNames = {
  3.     enUS = {
  4.         [164] = "Blacksmithing",
  5.         [333] = "Enchanting",
  6.     },
  7.     deDE = {
  8.         [164] = "Schmiedekunst",
  9.         [333] = "Verzauberkunst",
  10.     },
  11.     frFR = {
  12.         [164] = "Forge",
  13.         [333] = "Enchantement",
  14.     },
  15.     esMX = {
  16.         [164] = "Herrería",
  17.         [333] = "Encantamiento",
  18.     },
  19.     ptBR = {
  20.         [164] = "Ferraria",
  21.         [333] = "Encantamento",
  22.     },
  23.     ruRU = {
  24.         [164] = "Кузнечное дело",
  25.         [333] = "Наложение чар",
  26.     },
  27.     zhCN = {
  28.         [164] = "锻造",
  29.         [333] = "附魔",
  30.     },
  31.     zhTW = {
  32.         [164] = "鍛造",
  33.         [333] = "附魔",
  34.     },
  35.     koKR = {
  36.         [164] = "대장기술",
  37.         [333] = "마법부여",
  38.     },
  39. }
  40. local profNames = ProfessionNames[GetLocale()]
  41. local profNames_rev = tInvert(profNames)
  42. local emptySlots = {
  43.     [1] = true, --"HeadSlot",
  44.     [3] = true, --"ShoulderSlot",
  45.     [5] = true, --"ChestSlot",
  46.     [7] = true, --"WaistSlot",
  47.     [8] = true, --"LegsSlot",
  48.     [9] = true, --"FeetSlot",
  49.     [10] = true, --"WristSlot",
  50.     [11] = false, --"Finger0Slot",
  51.     [12] = false, --"Finger1Slot",
  52.     [15] = true, --"HandsSlot",
  53.     [16] = true, --"MainHandSlot",
  54.     [17] = true, --"SecondaryHandSlot",
  55.     --[18] = true, --"RangedSlot", Check for hunter scope?
  56. }
  57. for i = 1, GetNumSkillLines() do
  58.     local name, _, _, skillRank = GetSkillLineInfo(i)
  59.     if profNames_rev[name] == 333 and skillRank and skillRank >= 420 then --Enchanting
  60.         emptySlots[11] = true
  61.         emptySlots[12] = true
  62.     end
  63. end
  64. function module:UpdatePageStrings(i, iLevelDB, inspectItem, slotInfo, which)
  65.     iLevelDB[i] = slotInfo.iLvl
  66.     local db = E.db.wratharmory[string.lower(which)]
  67.  
  68.     do
  69.         local point, relativePoint, x, y = module:GetEnchantPoints(i, db)
  70.         inspectItem.enchantText:ClearAllPoints()
  71.         inspectItem.enchantText:Point(point, slot, relativePoint, x, y)
  72.         inspectItem.enchantText:FontTemplate(LSM:Fetch('font', db.enchant.font), db.enchant.fontSize, db.enchant.fontOutline)
  73.        
  74.         local text = slotInfo.enchantTextShort
  75.         if emptySlots[i] and text == "" then
  76.             if which == "Character" or (which == "Inspect" and (i ~= 11 or i ~= 12)) then
  77.                 text = "|cFFFF0000MISSING|r"
  78.             end
  79.         end
  80.        
  81.         inspectItem.enchantText:SetText(text)
  82.         inspectItem.enchantText:SetShown(db.enchant.enable)
  83.         local enchantTextColor = (db.enchant.qualityColor and slotInfo.itemQualityColors) or db.enchant.color
  84.         if enchantTextColor and next(enchantTextColor) then
  85.             inspectItem.enchantText:SetTextColor(enchantTextColor.r, enchantTextColor.g, enchantTextColor.b)
  86.         end
  87.     end
  88.  
  89.     inspectItem.iLvlText:ClearAllPoints()
  90.     inspectItem.iLvlText:Point('BOTTOM', inspectItem, db.itemLevel.xOffset, db.itemLevel.yOffset)
  91.     inspectItem.iLvlText:FontTemplate(LSM:Fetch('font', db.itemLevel.font), db.itemLevel.fontSize, db.itemLevel.fontOutline)
  92.     inspectItem.iLvlText:SetText(slotInfo.iLvl)
  93.     inspectItem.iLvlText:SetShown(db.itemLevel.enable)
  94.     local iLvlTextColor = (db.itemLevel.qualityColor and slotInfo.itemQualityColors) or db.itemLevel.color
  95.     if iLvlTextColor and next(iLvlTextColor) then
  96.         inspectItem.iLvlText:SetTextColor(iLvlTextColor.r, iLvlTextColor.g, iLvlTextColor.b)
  97.     end
  98.  
  99.     if which == 'Inspect' then
  100.         local unit = _G.InspectFrame.unit or 'target'
  101.         if unit then
  102.             local quality = GetInventoryItemQuality(unit, i)
  103.             if quality and quality > 1 then
  104.                 inspectItem.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
  105.             else
  106.                 inspectItem.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
  107.             end
  108.         end
  109.     end
  110.  
  111.     do
  112.         local point, relativePoint, x, y, spacing = module:GetGemPoints(i, db)
  113.         local gemStep = 1
  114.         for index = 1, 5 do
  115.             local texture = inspectItem['textureSlot'..index]
  116.             texture:Size(db.gems.size)
  117.             texture:ClearAllPoints()
  118.             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)
  119.  
  120.             local backdrop = inspectItem['textureSlotBackdrop'..index]
  121.             local gem = slotInfo.gems and slotInfo.gems[gemStep]
  122.             if gem then
  123.                 texture:SetTexture(gem)
  124.                 backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
  125.                 backdrop:Show()
  126.  
  127.                 texture:SetShown(db.gems.enable)
  128.                 backdrop:SetShown(db.gems.enable)
  129.  
  130.                 gemStep = gemStep + 1
  131.             else
  132.                 texture:SetTexture()
  133.                 backdrop:Hide()
  134.             end
  135.         end
  136.     end
  137. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement