mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-10 07:30:01 +00:00
unusable: add option to choose the color
This commit is contained in:
@@ -926,6 +926,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
if not this.setup then
|
||||
CreateConfig(nil, this, T["Disable Item Quality Color For \"Common\" Items"], C.appearance.bags, "borderlimit", "checkbox")
|
||||
CreateConfig(nil, this, T["Enable Item Quality Color For Equipment Only"], C.appearance.bags, "borderonlygear", "checkbox")
|
||||
CreateConfig(nil, this, T["Highlight Unusable Items"], C.appearance.bags, "unusable", "checkbox")
|
||||
CreateConfig(nil, this, T["Unusable Item Color"], C.appearance.bags, "unusable_color", "color")
|
||||
CreateConfig(nil, this, T["Enable Movable Bags"], C.appearance.bags, "movable", "checkbox")
|
||||
CreateConfig(nil, this, T["Hide Chat When Bags Are Opened"], C.appearance.bags, "hidechat", "checkbox")
|
||||
CreateConfig(nil, this, T["Bagslots Per Row"], C.appearance.bags, "bagrowlength")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
pfUI:RegisterModule("unusable", function ()
|
||||
if not pfUI.bag then return end
|
||||
|
||||
if C.appearance.bags.unusable ~= "1" then return end
|
||||
|
||||
pfUI.unusable = CreateFrame("Frame")
|
||||
pfUI.unusable:RegisterEvent("PLAYER_LEVEL_UP")
|
||||
pfUI.unusable:RegisterEvent("SKILL_LINES_CHANGED")
|
||||
@@ -12,6 +14,7 @@ pfUI:RegisterModule("unusable", function ()
|
||||
|
||||
local scanner = libtipscan:GetScanner("unusable")
|
||||
local dura_capture = string.gsub(DURABILITY_TEMPLATE, "%%[^%s]+", "(.+)")
|
||||
local r, g, b, a = strsplit(",", C.appearance.bags.unusable_color)
|
||||
|
||||
function pfUI.unusable:UpdateSlot(bag, slot)
|
||||
local frame = pfUI.bags[bag].slots[slot].frame
|
||||
@@ -28,7 +31,7 @@ pfUI:RegisterModule("unusable", function ()
|
||||
local left = scanner:Line(red_line)
|
||||
local _,_, is_durability = string.find(left,dura_capture,1)
|
||||
if not is_durability then
|
||||
_G.SetItemButtonTextureVertexColor(_G[name], 0.9, 0, 0)
|
||||
_G.SetItemButtonTextureVertexColor(_G[name],r,g,b,a)
|
||||
self.cache[bag][slot] = true
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user