mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
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:
@@ -212,7 +212,11 @@ end
|
|||||||
function pfUI.api.SendChatMessageWide(msg)
|
function pfUI.api.SendChatMessageWide(msg)
|
||||||
local channel = "SAY"
|
local channel = "SAY"
|
||||||
if UnitInRaid("player") then
|
if UnitInRaid("player") then
|
||||||
|
if ( IsRaidLeader() or IsRaidOfficer() ) then
|
||||||
|
channel = "RAID_WARNING"
|
||||||
|
else
|
||||||
channel = "RAID"
|
channel = "RAID"
|
||||||
|
end
|
||||||
elseif UnitExists("party1") then
|
elseif UnitExists("party1") then
|
||||||
channel = "PARTY"
|
channel = "PARTY"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("loot", nil, "autopickup", "1")
|
pfUI:UpdateConfig("loot", nil, "autopickup", "1")
|
||||||
pfUI:UpdateConfig("loot", nil, "mousecursor", "1")
|
pfUI:UpdateConfig("loot", nil, "mousecursor", "1")
|
||||||
pfUI:UpdateConfig("loot", nil, "advancedloot", "1")
|
pfUI:UpdateConfig("loot", nil, "advancedloot", "1")
|
||||||
|
pfUI:UpdateConfig("loot", nil, "rollannounce", "0")
|
||||||
pfUI:UpdateConfig("loot", nil, "raritytimer", "1")
|
pfUI:UpdateConfig("loot", nil, "raritytimer", "1")
|
||||||
|
|
||||||
pfUI:UpdateConfig("unitframes", nil, "disable", "0")
|
pfUI:UpdateConfig("unitframes", nil, "disable", "0")
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["deDE"] = {
|
|||||||
["Default"] = nil,
|
["Default"] = nil,
|
||||||
["Delete profile"] = nil,
|
["Delete profile"] = nil,
|
||||||
["Delete / Reset"] = nil,
|
["Delete / Reset"] = nil,
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable All UIErrors"] = nil,
|
["Disable All UIErrors"] = nil,
|
||||||
["Disable Blizzard Castbar"] = nil,
|
["Disable Blizzard Castbar"] = nil,
|
||||||
["Disabled"] = nil,
|
["Disabled"] = nil,
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["enUS"] = {
|
|||||||
["Default"] = nil,
|
["Default"] = nil,
|
||||||
["Delete profile"] = nil,
|
["Delete profile"] = nil,
|
||||||
["Delete / Reset"] = nil,
|
["Delete / Reset"] = nil,
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable All UIErrors"] = nil,
|
["Disable All UIErrors"] = nil,
|
||||||
["Disable Blizzard Castbar"] = nil,
|
["Disable Blizzard Castbar"] = nil,
|
||||||
["Disabled"] = nil,
|
["Disabled"] = nil,
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["esES"] = {
|
|||||||
["Default"] = "Por Defecto",
|
["Default"] = "Por Defecto",
|
||||||
["Delete profile"] = "Borrar Perfil",
|
["Delete profile"] = "Borrar Perfil",
|
||||||
["Delete / Reset"] = "Borrar / Restablecer",
|
["Delete / Reset"] = "Borrar / Restablecer",
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable All UIErrors"] = "Desactivar los Errores de la IU",
|
["Disable All UIErrors"] = "Desactivar los Errores de la IU",
|
||||||
["Disable Blizzard Castbar"] = "Desactivar la Barra de Lanzamiento de Blizzard",
|
["Disable Blizzard Castbar"] = "Desactivar la Barra de Lanzamiento de Blizzard",
|
||||||
["Disabled"] = "Desactivado",
|
["Disabled"] = "Desactivado",
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["frFR"] = {
|
|||||||
["Default"] = "Défaut",
|
["Default"] = "Défaut",
|
||||||
["Delete profile"] = "Supprimer le profil",
|
["Delete profile"] = "Supprimer le profil",
|
||||||
["Delete / Reset"] = "Supprimer / Réinitialiser",
|
["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 All UIErrors"] = "Désactiver tout les messages d'erreur liés à l'UI",
|
||||||
["Disable Blizzard Castbar"] = "Désactiver la barre d'incantation d'origine",
|
["Disable Blizzard Castbar"] = "Désactiver la barre d'incantation d'origine",
|
||||||
["Disabled"] = "Désactivé",
|
["Disabled"] = "Désactivé",
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["koKR"] = {
|
|||||||
["Default"] = "기본",
|
["Default"] = "기본",
|
||||||
["Delete profile"] = "프로파일 삭제",
|
["Delete profile"] = "프로파일 삭제",
|
||||||
["Delete / Reset"] = "지우기/초기화",
|
["Delete / Reset"] = "지우기/초기화",
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable"] = "가리기",
|
["Disable"] = "가리기",
|
||||||
["Disable All UIErrors"] = "모든 UI오류 비활성화",
|
["Disable All UIErrors"] = "모든 UI오류 비활성화",
|
||||||
["Disable Blizzard Castbar"] = "블리자드 캐스트바 사용 중지",
|
["Disable Blizzard Castbar"] = "블리자드 캐스트바 사용 중지",
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["ruRU"] = {
|
|||||||
["Default"] = "По умолчанию",
|
["Default"] = "По умолчанию",
|
||||||
["Delete profile"] = "Удалить профиль",
|
["Delete profile"] = "Удалить профиль",
|
||||||
["Delete / Reset"] = "Удалить / Сбросить",
|
["Delete / Reset"] = "Удалить / Сбросить",
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable All UIErrors"] = "Отключить все UI ошибки (красный текст сверху экрана)",
|
["Disable All UIErrors"] = "Отключить все UI ошибки (красный текст сверху экрана)",
|
||||||
["Disable Blizzard Castbar"] = "Отключить панель применения Blizzard",
|
["Disable Blizzard Castbar"] = "Отключить панель применения Blizzard",
|
||||||
["Disabled"] = "Отключено",
|
["Disabled"] = "Отключено",
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["zhCN"] = {
|
|||||||
["Default"] = "默认设置",
|
["Default"] = "默认设置",
|
||||||
["Delete profile"] = "删除配置",
|
["Delete profile"] = "删除配置",
|
||||||
["Delete / Reset"] = "还原",
|
["Delete / Reset"] = "还原",
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable All UIErrors"] = "禁用所有UI错误",
|
["Disable All UIErrors"] = "禁用所有UI错误",
|
||||||
["Disable Blizzard Castbar"] = "隐藏暴雪施法条",
|
["Disable Blizzard Castbar"] = "隐藏暴雪施法条",
|
||||||
["Disabled"] = "不显示",
|
["Disabled"] = "不显示",
|
||||||
|
|||||||
Vendored
+1
@@ -101,6 +101,7 @@ pfUI_translation["zhTW"] = {
|
|||||||
["Default"] = "默認設置",
|
["Default"] = "默認設置",
|
||||||
["Delete profile"] = "刪除配置",
|
["Delete profile"] = "刪除配置",
|
||||||
["Delete / Reset"] = "還原",
|
["Delete / Reset"] = "還原",
|
||||||
|
["Detailed Random Roll Announcement"] = nil,
|
||||||
["Disable All UIErrors"] = "禁用所有UI錯誤",
|
["Disable All UIErrors"] = "禁用所有UI錯誤",
|
||||||
["Disable Blizzard Castbar"] = "隱藏暴雪施法條",
|
["Disable Blizzard Castbar"] = "隱藏暴雪施法條",
|
||||||
["Disabled"] = "不顯示",
|
["Disabled"] = "不顯示",
|
||||||
|
|||||||
@@ -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["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 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["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")
|
CreateConfig(nil, this, T["Use Item Rarity Color For Loot-Roll Timer"], C.loot, "raritytimer", "checkbox")
|
||||||
this.setup = true
|
this.setup = true
|
||||||
end
|
end
|
||||||
|
|||||||
+25
-20
@@ -39,15 +39,17 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
local to = table.getn(candidates)
|
local to = table.getn(candidates)
|
||||||
if to >= 1 then
|
if to >= 1 then
|
||||||
SendChatMessageWide(T["Random Rolling "]..GetLootSlotLink(slot))
|
SendChatMessageWide(T["Random Rolling "]..GetLootSlotLink(slot))
|
||||||
local k,names = 1, ""
|
if C.loot.rollannounce == "1" then
|
||||||
for i=1,to do
|
local k,names = 1, ""
|
||||||
names = (k==1) and (i..":"..pfUI.loot.index_to_name[candidates[i]]) or (names..", "..i..":"..pfUI.loot.index_to_name[candidates[i]])
|
for i=1,to do
|
||||||
-- fit the maximum names in a single 255 char message (15)
|
names = (k==1) and (i..":"..pfUI.loot.index_to_name[candidates[i]]) or (names..", "..i..":"..pfUI.loot.index_to_name[candidates[i]])
|
||||||
if i == to or k == 15 then
|
-- fit the maximum names in a single 255 char message (15)
|
||||||
QueueFunction(SendChatMessageWide,names)
|
if i == to or k == 15 then
|
||||||
names = ""
|
QueueFunction(SendChatMessageWide,names)
|
||||||
|
names = ""
|
||||||
|
end
|
||||||
|
k = k<15 and k+1 or 1
|
||||||
end
|
end
|
||||||
k = k<15 and k+1 or 1
|
|
||||||
end
|
end
|
||||||
pfUI.loot:RegisterEvent("CHAT_MSG_SYSTEM")
|
pfUI.loot:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||||
pfUI.loot.randomRolling = true
|
pfUI.loot.randomRolling = true
|
||||||
@@ -253,6 +255,8 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
info.notCheckable = 1
|
info.notCheckable = 1
|
||||||
info.isTitle = 1
|
info.isTitle = 1
|
||||||
UIDropDownMenu_AddButton(info)
|
UIDropDownMenu_AddButton(info)
|
||||||
|
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
||||||
|
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
||||||
for order, class in ipairs(CLASS_SORT_ORDER) do
|
for order, class in ipairs(CLASS_SORT_ORDER) do
|
||||||
local lclass = classes_in_raid[class]
|
local lclass = classes_in_raid[class]
|
||||||
if (lclass) then
|
if (lclass) then
|
||||||
@@ -269,9 +273,9 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
UIDropDownMenu_AddButton(info)
|
UIDropDownMenu_AddButton(info)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
|
||||||
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
|
||||||
elseif level == 2 then -- players
|
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]
|
local players = players_in_class[UIDROPDOWNMENU_MENU_VALUE]
|
||||||
if (players) and next(players) then
|
if (players) and next(players) then
|
||||||
table.sort(players)
|
table.sort(players)
|
||||||
@@ -287,8 +291,6 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
UIDropDownMenu_AddButton(info,UIDROPDOWNMENU_MENU_LEVEL)
|
UIDropDownMenu_AddButton(info,UIDROPDOWNMENU_MENU_LEVEL)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pfUI.loot:BuildSpecialRecipientsMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
|
||||||
pfUI.loot:BuildSpecialRollsMenu(UIDROPDOWNMENU_MENU_LEVEL)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -405,7 +407,7 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
if not ((method == "master" and lootmasterID == 0) or IsRaidLeader()) then
|
if not ((method == "master" and lootmasterID == 0) or IsRaidLeader()) then
|
||||||
UnitPopupShown[index] = 0
|
UnitPopupShown[index] = 0
|
||||||
end
|
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
|
UnitPopupShown[index] = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -490,6 +492,15 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
end
|
end
|
||||||
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)
|
function pfUI.loot:CreateSlot(id)
|
||||||
local frame = CreateFrame("LootButton", 'pfLootButton'..id, pfUI.loot)
|
local frame = CreateFrame("LootButton", 'pfLootButton'..id, pfUI.loot)
|
||||||
frame:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
frame:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||||
@@ -664,13 +675,7 @@ pfUI:RegisterModule("loot", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if C.loot.autopickup == "1" and event == "LOOT_BIND_CONFIRM" then
|
if C.loot.autopickup == "1" and event == "LOOT_BIND_CONFIRM" then
|
||||||
if GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0 then
|
QueueFunction(AutoBind,arg1)
|
||||||
local dialog = StaticPopup_Show("LOOT_BIND")
|
|
||||||
if dialog then
|
|
||||||
dialog.data = arg1
|
|
||||||
StaticPopup1Button1:Click()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user