Commit 147bc28c authored by Merathilis's avatar Merathilis

Put the merchant itemlevel stuff in the skin file. No need to have it in multiple places.

parent 07614f11
......@@ -134,12 +134,6 @@ local function AddOptions()
name = L["Combat State"],
desc = L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."],
},
MerchantiLevel = {
order = 9,
type = "toggle",
name = L["Show Merchant ItemLevel"],
desc = L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"],
},
},
},
info = {
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = "Aktiviert/Deaktiviert den Sta
L["Options"] = "Einstellungen"
L["Combat State"] = "Kampfstatus"
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = "Aktiviert/Deaktiviert die '+'/'-' Kampf Nachricht wenn du den Kampf betrittst oder verlässt."
L["Show Merchant ItemLevel"] = "Zeige ItemLevel beim Händlern"
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = "Zeigt das ItemLevel bei den Händlern an, um die Schriftart zu ändern, musst du sie in ElvUI - Taschen - ItemLevel ändern."
L["Desciption"] = "Beschreibung"
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r ist eine Erweiterung für ElvUI. Es ergänzt:
......
......@@ -17,8 +17,6 @@ L["Enable/Disable the Splash Screen on Login."] = true
L["Options"] = true
L["Combat State"] = true
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = true
L["Show Merchant ItemLevel"] = true
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = true
L["Desciption"] = true
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r is an extension of ElvUI. It adds:
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = true
L["Options"] = true
L["Combat State"] = true
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = true
L["Show Merchant ItemLevel"] = true
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = true
L["Desciption"] = true
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r is an extension of ElvUI. It adds:
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = true
L["Options"] = true
L["Combat State"] = true
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = true
L["Show Merchant ItemLevel"] = true
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = true
L["Desciption"] = true
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r is an extension of ElvUI. It adds:
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = true
L["Options"] = true
L["Combat State"] = true
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = true
L["Show Merchant ItemLevel"] = true
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = true
L["Desciption"] = true
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r is an extension of ElvUI. It adds:
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = true
L["Options"] = true
L["Combat State"] = true
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = true
L["Show Merchant ItemLevel"] = true
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = true
L["Desciption"] = true
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r is an extension of ElvUI. It adds:
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = "在登录时启用/禁用启
L["Options"] = "选项"
L["Combat State"] = "战斗状态"
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = "如果你进入/离开战斗,启用/禁用'+'/'-'战斗信息."
L["Show Merchant ItemLevel"] = "显示商人物品等级"
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = "在商人框体上显示物品等级, 更改字体你需要在ElvUI-背包-物品等级"
L["Desciption"] = "描述"
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r 是ElvUI的扩展. 它增加了:
......
......@@ -16,8 +16,6 @@ L["Enable/Disable the Splash Screen on Login."] = true
L["Options"] = true
L["Combat State"] = true
L["Enable/Disable the '+'/'-' combat message if you enter/leave the combat."] = true
L["Show Merchant ItemLevel"] = true
L["Display the item level on the MerchantFrame, to change the font you have to set it in ElvUI - Bags - ItemLevel"] = true
L["Desciption"] = true
L["MER_DESC"] = [=[|cffff7d0aMerathilisUI|r is an extension of ElvUI. It adds:
......
......@@ -14,7 +14,6 @@
<Script file="itemLevel.lua"/>
<Script file="lfgInfo.lua"/>
<Script file="mailinputbox.lua"/>
<Script file="merchant.lua"/>
<Script file="movers.lua"/>
<Script file="nameHover.lua"/>
<Script file="raidManager.lua"/>
......
local MER, E, L, V, P, G = unpack(select(2, ...))
-- Cache global variables
-- Lua functions
local _G = _G
local select = select
local find = find
-- WoW API / Variables
local BuyMerchantItem = BuyMerchantItem
local IsAltKeyDown = IsAltKeyDown
local GetItemInfo = GetItemInfo
local GetMouseFocus = GetMouseFocus
local GetMerchantNumItems = GetMerchantNumItems
local GetMerchantItemInfo = GetMerchantItemInfo
local GetMerchantItemLink = GetMerchantItemLink
local GetMerchantItemMaxStack = GetMerchantItemMaxStack
-- Global variables that we don't cache, list them here for the mikk's Find Globals script
-- GLOBALS: MerchantFrame, GameTooltip, MERCHANT_ITEMS_PER_PAGE, LE_ITEM_CLASS_WEAPON, LE_ITEM_CLASS_ARMOR
----------------------------------------------------------------------------------------
-- Show item level for weapons and armor in merchant
----------------------------------------------------------------------------------------
local function MerchantItemlevel()
if E.db.mui.general.MerchantiLevel ~= true then return end
local numItems = GetMerchantNumItems()
for i = 1, MERCHANT_ITEMS_PER_PAGE do
local index = (MerchantFrame.page - 1) * MERCHANT_ITEMS_PER_PAGE + i
if index > numItems then return end
local button = _G["MerchantItem"..i.."ItemButton"]
if button and button:IsShown() then
if not button.text then
button.text = MER:CreateText(button, "OVERLAY", 10)
button.text:SetPoint("BOTTOMRIGHT", 0, 2)
else
button.text:SetText("")
end
local itemLink = GetMerchantItemLink(index)
if itemLink then
local _, _, quality, itemlevel, _, _, _, _, _, _, _, itemClassID = GetItemInfo(itemLink)
local color = BAG_ITEM_QUALITY_COLORS[quality or 1]
if (itemlevel and itemlevel > 1) and (quality and quality > 1) and (itemClassID == LE_ITEM_CLASS_WEAPON or itemClassID == LE_ITEM_CLASS_ARMOR) then
button.text:SetText(itemlevel)
button.text:SetTextColor(color.r, color.g, color.b)
end
end
end
end
end
hooksecurefunc("MerchantFrame_UpdateMerchantInfo", MerchantItemlevel)
......@@ -212,7 +212,28 @@ local function UpdateMerchantInfo()
local merchantButton = _G["MerchantItem" .. i];
local merchantMoney = _G["MerchantItem" .. i .. "MoneyFrame"];
local merchantAltCurrency = _G["MerchantItem" .. i .. "AltCurrencyFrame"];
if (index <= visibleMerchantItems) then
-- ItemLevel
if itemButton and itemButton:IsShown() then
if not itemButton.text then
itemButton.text = MER:CreateText(itemButton, "OVERLAY", 10)
itemButton.text:SetPoint("BOTTOMRIGHT", 0, 2)
else
itemButton.text:SetText("")
end
local itemLink = GetMerchantItemLink(index)
if itemLink then
local _, _, quality, itemlevel, _, _, _, _, _, _, _, itemClassID = GetItemInfo(itemLink)
local color = BAG_ITEM_QUALITY_COLORS[quality or 1]
if (itemlevel and itemlevel > 1) and (quality and quality > 1) and (itemClassID == LE_ITEM_CLASS_WEAPON or itemClassID == LE_ITEM_CLASS_ARMOR) then
itemButton.text:SetText(itemlevel)
itemButton.text:SetTextColor(color.r, color.g, color.b)
end
end
end
name, texture, price, quantity, numAvailable, isPurchasable, isUsable, extendedCost = GetMerchantItemInfo(indexes[index]);
if (name ~= nil) then
local canAfford = CanAffordMerchantItem(index);
......
......@@ -18,7 +18,6 @@ MP.general = {
FlightMode = true,
FlightPoint = true,
CombatState = true,
MerchantiLevel = true,
Movertransparancy = .75,
style = true,
panels = true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment