loot: make detailed random roll announce an option

* api: SendChatMessageWide will use raid warning if player is raid leader or assist
* loot: rearrange advanced masterloot menus so random rolling and special recipients precede class menu
* loot: fix a special recipients unitpopup menu check so they won't show in the context menu when the player is solo
* loot: change the auto confirm bind when solo implementation, so player doesn't have to double-click the loot
* loot: make sure it works if the loot bind confirmation staticpopup is not at index 1
This commit is contained in:
Road-block
2018-05-15 18:52:33 +03:00
committed by Shagu
parent 002106b632
commit 42cfdd78b3
12 changed files with 39 additions and 20 deletions
+4
View File
@@ -212,7 +212,11 @@ end
function pfUI.api.SendChatMessageWide(msg)
local channel = "SAY"
if UnitInRaid("player") then
if ( IsRaidLeader() or IsRaidOfficer() ) then
channel = "RAID_WARNING"
else
channel = "RAID"
end
elseif UnitExists("party1") then
channel = "PARTY"
end
+1
View File
@@ -94,6 +94,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, "rollannounce", "0")
pfUI:UpdateConfig("loot", nil, "raritytimer", "1")
pfUI:UpdateConfig("unitframes", nil, "disable", "0")
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["deDE"] = {
["Default"] = nil,
["Delete profile"] = nil,
["Delete / Reset"] = nil,
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = nil,
["Disable Blizzard Castbar"] = nil,
["Disabled"] = nil,
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["enUS"] = {
["Default"] = nil,
["Delete profile"] = nil,
["Delete / Reset"] = nil,
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = nil,
["Disable Blizzard Castbar"] = nil,
["Disabled"] = nil,
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["esES"] = {
["Default"] = "Por Defecto",
["Delete profile"] = "Borrar Perfil",
["Delete / Reset"] = "Borrar / Restablecer",
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = "Desactivar los Errores de la IU",
["Disable Blizzard Castbar"] = "Desactivar la Barra de Lanzamiento de Blizzard",
["Disabled"] = "Desactivado",
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["frFR"] = {
["Default"] = "Défaut",
["Delete profile"] = "Supprimer le profil",
["Delete / Reset"] = "Supprimer / Réinitialiser",
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = "Désactiver tout les messages d'erreur liés à l'UI",
["Disable Blizzard Castbar"] = "Désactiver la barre d'incantation d'origine",
["Disabled"] = "Désactivé",
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["koKR"] = {
["Default"] = "기본",
["Delete profile"] = "프로파일 삭제",
["Delete / Reset"] = "지우기/초기화",
["Detailed Random Roll Announcement"] = nil,
["Disable"] = "가리기",
["Disable All UIErrors"] = "모든 UI오류 비활성화",
["Disable Blizzard Castbar"] = "블리자드 캐스트바 사용 중지",
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["ruRU"] = {
["Default"] = "По умолчанию",
["Delete profile"] = "Удалить профиль",
["Delete / Reset"] = "Удалить / Сбросить",
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = "Отключить все UI ошибки (красный текст сверху экрана)",
["Disable Blizzard Castbar"] = "Отключить панель применения Blizzard",
["Disabled"] = "Отключено",
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["zhCN"] = {
["Default"] = "默认设置",
["Delete profile"] = "删除配置",
["Delete / Reset"] = "还原",
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = "禁用所有UI错误",
["Disable Blizzard Castbar"] = "隐藏暴雪施法条",
["Disabled"] = "不显示",
+1
View File
@@ -101,6 +101,7 @@ pfUI_translation["zhTW"] = {
["Default"] = "默認設置",
["Delete profile"] = "刪除配置",
["Delete / Reset"] = "還原",
["Detailed Random Roll Announcement"] = nil,
["Disable All UIErrors"] = "禁用所有UI錯誤",
["Disable Blizzard Castbar"] = "隱藏暴雪施法條",
["Disabled"] = "不顯示",
+1
View File
@@ -945,6 +945,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["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
end
+25 -20
View File
@@ -39,15 +39,17 @@ pfUI:RegisterModule("loot", function ()
local to = table.getn(candidates)
if to >= 1 then
SendChatMessageWide(T["Random Rolling "]..GetLootSlotLink(slot))
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 = ""
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
pfUI.loot:RegisterEvent("CHAT_MSG_SYSTEM")
pfUI.loot.randomRolling = true
@@ -253,6 +255,8 @@ pfUI:RegisterModule("loot", function ()
info.notCheckable = 1
info.isTitle = 1
UIDropDownMenu_AddButton(info)
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
for order, class in ipairs(CLASS_SORT_ORDER) do
local lclass = classes_in_raid[class]
if (lclass) then
@@ -269,9 +273,9 @@ pfUI:RegisterModule("loot", function ()
UIDropDownMenu_AddButton(info)
end
end
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
elseif level == 2 then -- players
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
local players = players_in_class[UIDROPDOWNMENU_MENU_VALUE]
if (players) and next(players) then
table.sort(players)
@@ -287,8 +291,6 @@ pfUI:RegisterModule("loot", function ()
UIDropDownMenu_AddButton(info,UIDROPDOWNMENU_MENU_LEVEL)
end
end
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
end
end
@@ -405,7 +407,7 @@ pfUI:RegisterModule("loot", function ()
if not ((method == "master" and lootmasterID == 0) or IsRaidLeader()) then
UnitPopupShown[index] = 0
end
if (unit) and UnitIsPlayer(unit) and not (UnitInRaid(unit) or UnitInParty(unit)) then
if (unit) and UnitIsPlayer(unit) and not (UnitInRaid(unit) or (UnitInParty(unit) and UnitExists("party1"))) then
UnitPopupShown[index] = 0
end
end
@@ -490,6 +492,15 @@ pfUI:RegisterModule("loot", function ()
end
end
local function AutoBind(arg1)
if GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0 then
local dialog = StaticPopup_FindVisible("LOOT_BIND",arg1)
if dialog then
_G[dialog:GetName().."Button1"]:Click()
end
end
end
function pfUI.loot:CreateSlot(id)
local frame = CreateFrame("LootButton", 'pfLootButton'..id, pfUI.loot)
frame:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
@@ -664,13 +675,7 @@ pfUI:RegisterModule("loot", function ()
end
if C.loot.autopickup == "1" and event == "LOOT_BIND_CONFIRM" then
if GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0 then
local dialog = StaticPopup_Show("LOOT_BIND")
if dialog then
dialog.data = arg1
StaticPopup1Button1:Click()
end
end
QueueFunction(AutoBind,arg1)
end
end)