unusable: add option to choose the color

This commit is contained in:
shagu
2018-08-08 23:39:59 +02:00
parent 5e9c7b9011
commit 5d7a82127a
11 changed files with 27 additions and 4 deletions
+2
View File
@@ -82,6 +82,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("appearance", "castbar", "castbarcolor", ".7,.7,.9,.8")
pfUI:UpdateConfig("appearance", "castbar", "channelcolor", ".9,.9,.7,.8")
pfUI:UpdateConfig("appearance", "infight", "screen", "0")
pfUI:UpdateConfig("appearance", "bags", "unusable", "1")
pfUI:UpdateConfig("appearance", "bags", "unusable_color", ".9,.2,.2,1")
pfUI:UpdateConfig("appearance", "bags", "borderlimit", "1")
pfUI:UpdateConfig("appearance", "bags", "borderonlygear", "0")
pfUI:UpdateConfig("appearance", "bags", "movable", "0")
+2
View File
@@ -249,6 +249,7 @@ pfUI_translation["deDE"] = {
["Hide Totems"] = nil,
["Highlight Settings That Require Reload"] = nil,
["Highlight Target Nameplate"] = nil,
["Highlight Unusable Items"] = nil,
["Hit Indicator"] = nil,
["Hit Indicator Text Font"] = nil,
["Hit Indicator Text Size"] = nil,
@@ -444,6 +445,7 @@ pfUI_translation["deDE"] = {
["Unit Frame Text Size"] = nil,
["Unit String"] = nil,
["Unlock"] = nil,
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = nil,
["Use Defaults"] = nil,
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
+2
View File
@@ -249,6 +249,7 @@ pfUI_translation["enUS"] = {
["Hide Totems"] = nil,
["Highlight Settings That Require Reload"] = nil,
["Highlight Target Nameplate"] = nil,
["Highlight Unusable Items"] = nil,
["Hit Indicator"] = nil,
["Hit Indicator Text Font"] = nil,
["Hit Indicator Text Size"] = nil,
@@ -444,6 +445,7 @@ pfUI_translation["enUS"] = {
["Unit Frame Text Size"] = nil,
["Unit String"] = nil,
["Unlock"] = nil,
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = nil,
["Use Defaults"] = nil,
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
+2
View File
@@ -249,6 +249,7 @@ pfUI_translation["esES"] = {
["Hide Totems"] = "Ocultar Tótems",
["Highlight Settings That Require Reload"] = "Resaltar las Configuraciones que Requieren Recarga",
["Highlight Target Nameplate"] = "Resaltar las Placas Indentificativas del Objetivo",
["Highlight Unusable Items"] = nil,
["Hit Indicator"] = "Indicador de Golpe",
["Hit Indicator Text Font"] = "Fuente del Texto del Indicador de Golpe",
["Hit Indicator Text Size"] = "Tamaño del Texto del Indicador de Golpe",
@@ -444,6 +445,7 @@ pfUI_translation["esES"] = {
["Unit Frame Text Size"] = "Tamaño del Texto del Marco de Unidad",
["Unit String"] = "Cadena de Caracteres de Unidad",
["Unlock"] = "Desbloquear",
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = "Usar los Colores del Chat para los Medidores",
["Use Defaults"] = "Predeterminado",
["Use Item Rarity Color For Loot-Roll Timer"] = "Usar el Color de la Rareza del Objeto para el Temporizador para Tirar los Dados",
+2
View File
@@ -249,6 +249,7 @@ pfUI_translation["frFR"] = {
["Hide Totems"] = nil,
["Highlight Settings That Require Reload"] = nil,
["Highlight Target Nameplate"] = nil,
["Highlight Unusable Items"] = nil,
["Hit Indicator"] = nil,
["Hit Indicator Text Font"] = nil,
["Hit Indicator Text Size"] = nil,
@@ -444,6 +445,7 @@ pfUI_translation["frFR"] = {
["Unit Frame Text Size"] = "Taille de la police du texte des cadres d'unité",
["Unit String"] = "Texte des cadres d'unité",
["Unlock"] = "Débloquer l'interface",
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = nil,
["Use Defaults"] = "Utiliser le défaut",
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
+2
View File
@@ -249,6 +249,7 @@ pfUI_translation["koKR"] = {
["Hide Totems"] = nil,
["Highlight Settings That Require Reload"] = nil,
["Highlight Target Nameplate"] = nil,
["Highlight Unusable Items"] = nil,
["Hit Indicator"] = nil,
["Hit Indicator Text Font"] = nil,
["Hit Indicator Text Size"] = nil,
@@ -444,6 +445,7 @@ pfUI_translation["koKR"] = {
["Unit Frame Text Size"] = "유닛프레임 텍스트 크기",
["Unit String"] = "단위 문자열",
["Unlock"] = "잠그 해체",
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = nil,
["Use Defaults"] = "기본값 사용",
["Use Item Rarity Color For Loot-Roll Timer"] = nil,
+3 -1
View File
@@ -249,6 +249,7 @@ pfUI_translation["ruRU"] = {
["Hide Totems"] = "Скрыть тотемы",
["Highlight Settings That Require Reload"] = "Выделить параметры, требующие перезагрузки",
["Highlight Target Nameplate"] = "Выделить индикатор здоровья цели",
["Highlight Unusable Items"] = nil,
["Hit Indicator Text Font"] = "Шрифт текста индикатора попадания",
["Hit Indicator Text Size"] = "Размер текста индикатора попадания",
["Hit Indicator"] = "Индикатор попадания",
@@ -402,8 +403,8 @@ pfUI_translation["ruRU"] = {
["Show PvP Icon"] = "Показать PvP иконку",
["Show Self in Group Frames"] = "Показать себя в окне группы",
["Show Totems as Buff Indicators"] = "Показать тотемы как индикаторы баффов",
["Skin"] = "оболочка",
["Skins"] = "Оболочки",
["Skin"] = "оболочка",
["Slow"] = "Медленно",
["Small"] = "Маленький",
["Some settings need to reload the UI to take effect.\nDo you want to reloadUI now?"] = "Некоторым настройкам необходимо перезагрузить пользовательский интерфейс, чтобы вступить в силу.\nВы хотите перезагрузить пользовательский интерфейс сейчас?",
@@ -444,6 +445,7 @@ pfUI_translation["ruRU"] = {
["Unit Frame Text Size"] = "Размер текста окна юнита",
["Unit String"] = "Уровень и имя",
["Unlock"] = "Разблокировать",
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = "Использовать цвета чата для счетчиков",
["Use Defaults"] = "По умолчанию",
["Use Item Rarity Color For Loot-Roll Timer"] = "Использовать цвет кач-ва предмета для таймера распределения добычи",
+3 -1
View File
@@ -249,6 +249,7 @@ pfUI_translation["zhCN"] = {
["Hide Totems"] = "隐藏图腾",
["Highlight Settings That Require Reload"] = "用[!]突出需要重新加载UI的设置",
["Highlight Target Nameplate"] = "高亮目标姓名板",
["Highlight Unusable Items"] = nil,
["Hit Indicator Text Font"] = "命中指示器文本字体",
["Hit Indicator Text Size"] = "命中指示器文本大小",
["Hit Indicator"] = "启用命中指示器",
@@ -402,8 +403,8 @@ pfUI_translation["zhCN"] = {
["Show PvP Icon"] = "显示PVP图标",
["Show Self in Group Frames"] = "在小队列表中显示自己",
["Show Totems as Buff Indicators"] = "显示图腾作为buff指示器",
["Skin"] = "皮肤",
["Skins"] = "皮肤",
["Skin"] = "皮肤",
["Slow"] = "慢速",
["Small"] = "小",
["Some settings need to reload the UI to take effect.\nDo you want to reloadUI now?"] = "有些设置需要重新加载UI生效。\n您要重新载入UI吗?",
@@ -444,6 +445,7 @@ pfUI_translation["zhCN"] = {
["Unit Frame Text Size"] = "头像框架字体字号",
["Unit String"] = "等级和名字",
["Unlock"] = "解锁排版",
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = "使用聊天框着色(其他插件的接口,如DPSMate,KTM等)",
["Use Defaults"] = "使用默认值",
["Use Item Rarity Color For Loot-Roll Timer"] = "为战利品Roll点计时框启用物品稀有颜色",
+3 -1
View File
@@ -249,6 +249,7 @@ pfUI_translation["zhTW"] = {
["Hide Totems"] = "隱藏圖騰",
["Highlight Settings That Require Reload"] = "用[!]突出需要重新加載UI的設置",
["Highlight Target Nameplate"] = "高亮目標姓名板",
["Highlight Unusable Items"] = nil,
["Hit Indicator Text Font"] = "命中指示器文本字體",
["Hit Indicator Text Size"] = "命中指示器文本大小",
["Hit Indicator"] = "命中指示器",
@@ -402,8 +403,8 @@ pfUI_translation["zhTW"] = {
["Show PvP Icon"] = "顯示PVP圖示",
["Show Self in Group Frames"] = "在小隊清單中顯示自己",
["Show Totems as Buff Indicators"] = "顯示圖騰作為buff指示器",
["Skin"] = "皮膚",
["Skins"] = "皮膚",
["Skin"] = "皮膚",
["Slow"] = "慢速",
["Small"] = "小",
["Some settings need to reload the UI to take effect.\nDo you want to reloadUI now?"] = "有些設置需要重新載入UI生效。\n您要重新載入UI嗎?",
@@ -444,6 +445,7 @@ pfUI_translation["zhTW"] = {
["Unit Frame Text Size"] = "頭像框架字體字型大小",
["Unit String"] = "等級和名字",
["Unlock"] = "解鎖排版",
["Unusable Item Color"] = nil,
["Use Chat Colors for Meters"] = "使用聊天框著色(其他插件的介面,如DPSMate,KTM等)",
["Use Defaults"] = "使用預設值",
["Use Item Rarity Color For Loot-Roll Timer"] = "為戰利品Roll點計時框啟用物品稀有顏色",
+2
View File
@@ -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")
+4 -1
View File
@@ -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