diff --git a/api/config.lua b/api/config.lua index 7e959a01..76ee1a84 100644 --- a/api/config.lua +++ b/api/config.lua @@ -154,6 +154,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("loot", nil, "autopickup", "1") pfUI:UpdateConfig("loot", nil, "mousecursor", "1") pfUI:UpdateConfig("loot", nil, "advancedloot", "1") + pfUI:UpdateConfig("loot", nil, "rollannouncequal", "3") pfUI:UpdateConfig("loot", nil, "rollannounce", "0") pfUI:UpdateConfig("loot", nil, "raritytimer", "1") @@ -1017,4 +1018,4 @@ function pfUI:MigrateConfig() pfUI:UpdateConfig("buffbar", "tdebuff", "color", ".5,.1,.1,1") pfUI_config.version = pfUI.version.string -end \ No newline at end of file +end diff --git a/env/translations_deDE.lua b/env/translations_deDE.lua index 40ca12a4..0e7b3efd 100644 --- a/env/translations_deDE.lua +++ b/env/translations_deDE.lua @@ -373,6 +373,7 @@ pfUI_translation["deDE"] = { ["Profile"] = nil, ["Raid Icon Size"] = nil, ["Raid"] = nil, + ["Random Roll Announcement Rarity"] = nil, ["Random"] = nil, ["Random Rolling"] = nil, ["Range Check Interval"] = nil, diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index b00ddc65..ff8b099f 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -373,8 +373,9 @@ pfUI_translation["enUS"] = { ["Profile"] = nil, ["Raid Icon Size"] = nil, ["Raid"] = nil, - ["Random"] = nil, + ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = nil, + ["Random"] = nil, ["Range Check Interval"] = nil, ["Range Display Color"] = nil, ["Remaining"] = nil, diff --git a/env/translations_esES.lua b/env/translations_esES.lua index f980b8c9..a6f46199 100644 --- a/env/translations_esES.lua +++ b/env/translations_esES.lua @@ -373,6 +373,7 @@ pfUI_translation["esES"] = { ["Profile"] = "Perfil", ["Raid"] = "Banda", ["Raid Icon Size"] = "Tamaño de los iconos de banda", + ["Random Roll Announcement Rarity"] = nil, ["Random"] = "Aleatorio", ["Random Rolling"] = "Tirar los dados aleatoriamente", ["Range Check Interval"] = "Intervalo de comprobación de alcance", diff --git a/env/translations_frFR.lua b/env/translations_frFR.lua index f1b4c039..b6957153 100644 --- a/env/translations_frFR.lua +++ b/env/translations_frFR.lua @@ -373,6 +373,7 @@ pfUI_translation["frFR"] = { ["Profile"] = "Profil", ["Raid Icon Size"] = "Taille des icônes de Raid", ["Raid"] = "Raid", + ["Random Roll Announcement Rarity"] = nil, ["Random"] = nil, ["Random Rolling"] = nil, ["Range Check Interval"] = nil, diff --git a/env/translations_koKR.lua b/env/translations_koKR.lua index e1b135d6..24082256 100644 --- a/env/translations_koKR.lua +++ b/env/translations_koKR.lua @@ -373,6 +373,7 @@ pfUI_translation["koKR"] = { ["Profile"] = "프로파일", ["Raid"] = "레이드", ["Raid Icon Size"] = "레이드 아이콘 크기", + ["Random Roll Announcement Rarity"] = nil, ["Random"] = nil, ["Random Rolling"] = nil, ["Range Check Interval"] = nil, diff --git a/env/translations_ruRU.lua b/env/translations_ruRU.lua index 1822d651..cf051d5d 100644 --- a/env/translations_ruRU.lua +++ b/env/translations_ruRU.lua @@ -373,6 +373,7 @@ pfUI_translation["ruRU"] = { ["Profile"] = "Профиль", ["Raid Icon Size"] = "Размер иконки рейда", ["Raid"] = "Рейд", + ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = "Случайный бросок", ["Random"] = "Случайно", ["Range Check Interval"] = "Интервал проверки диапазона", diff --git a/env/translations_zhCN.lua b/env/translations_zhCN.lua index e9c7737a..e5a05d87 100644 --- a/env/translations_zhCN.lua +++ b/env/translations_zhCN.lua @@ -373,6 +373,7 @@ pfUI_translation["zhCN"] = { ["Profile"] = "配置文件", ["Raid Icon Size"] = "团队图标大小", ["Raid"] = "团队", + ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = "随机Roll点 物品:", ["Random"] = "给随机玩家", ["Range Check Interval"] = "范围检查间隔", diff --git a/env/translations_zhTW.lua b/env/translations_zhTW.lua index 3ff5b940..34c670b8 100644 --- a/env/translations_zhTW.lua +++ b/env/translations_zhTW.lua @@ -373,6 +373,7 @@ pfUI_translation["zhTW"] = { ["Profile"] = "設定檔", ["Raid Icon Size"] = "團隊圖示大小", ["Raid"] = "團隊", + ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = "隨機Roll點 物品:", ["Random"] = "給隨機玩家", ["Range Check Interval"] = "範圍檢查間隔", diff --git a/modules/gui.lua b/modules/gui.lua index b7a6ed00..5d9961a0 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -717,6 +717,12 @@ pfUI:RegisterModule("gui", function () pfUI.gui.dropdowns.num_shapeshift_slots = BarLayoutOptions(NUM_SHAPESHIFT_SLOTS) pfUI.gui.dropdowns.num_pet_action_slots = BarLayoutOptions(NUM_PET_ACTION_SLOTS) + pfUI.gui.dropdowns.loot_rarity = {} + for i=0, getn(_G.ITEM_QUALITY_COLORS)-2 do + local entry = string.format("%d:%s", i, string.format("%s%s%s", _G.ITEM_QUALITY_COLORS[i].hex, _G[string.format("ITEM_QUALITY%d_DESC",i)], FONT_COLOR_CODE_CLOSE)) + table.insert(pfUI.gui.dropdowns.loot_rarity, entry) + end + -- main tab frame pfUI.gui.tabs = CreateTabFrame(pfUI.gui, "LEFT") pfUI.gui.tabs:SetPoint("TOPLEFT", pfUI.gui, "TOPLEFT", 0, -25) @@ -1113,6 +1119,7 @@ pfUI:RegisterModule("gui", function () CreateConfig(nil, this, T["Disable Loot Confirmation Dialog (Without Group)"], C.loot, "autopickup", "checkbox") CreateConfig(nil, this, T["Enable Loot Window On MouseCursor"], C.loot, "mousecursor", "checkbox") CreateConfig(nil, this, T["Enable Advanced Master Loot Menu"], C.loot, "advancedloot", "checkbox") + CreateConfig(nil, this, T["Random Roll Announcement Rarity"], C.loot, "rollannouncequal", "dropdown", pfUI.gui.dropdowns.loot_rarity) CreateConfig(nil, this, T["Detailed Random Roll Announcement"], C.loot, "rollannounce", "checkbox") CreateConfig(nil, this, T["Use Item Rarity Color For Loot-Roll Timer"], C.loot, "raritytimer", "checkbox") this.setup = true diff --git a/modules/loot.lua b/modules/loot.lua index 74e5b048..47170a63 100644 --- a/modules/loot.lua +++ b/modules/loot.lua @@ -37,18 +37,21 @@ pfUI:RegisterModule("loot", function () local slot = pfUI.loot.selectedSlot or 0 local to = table.getn(candidates) if to >= 1 then - SendChatMessageWide(T["Random Rolling "]..GetLootSlotLink(slot)) - if C.loot.rollannounce == "1" then - local k,names = 1, "" - for i=1,to do - names = (k==1) and (i..":"..pfUI.loot.index_to_name[candidates[i]]) or (names..", "..i..":"..pfUI.loot.index_to_name[candidates[i]]) - -- fit the maximum names in a single 255 char message (15) - if i == to or k == 15 then - QueueFunction(SendChatMessageWide,names) - names = "" + local _,_,_,quality = GetLootSlotInfo(slot) + if quality >= tonumber(C.loot.rollannouncequal) then + SendChatMessageWide(T["Random Rolling "]..GetLootSlotLink(slot)) + if C.loot.rollannounce == "1" then + local k,names = 1, "" + for i=1,to do + names = (k==1) and (i..":"..pfUI.loot.index_to_name[candidates[i]]) or (names..", "..i..":"..pfUI.loot.index_to_name[candidates[i]]) + -- fit the maximum names in a single 255 char message (15) + if i == to or k == 15 then + QueueFunction(SendChatMessageWide,names) + names = "" + end + k = k<15 and k+1 or 1 end - k = k<15 and k+1 or 1 - end + end end pfUI.loot:RegisterEvent("CHAT_MSG_SYSTEM") pfUI.loot.randomRolling = true