This commit is contained in:
Cinecom
2025-01-28 15:40:41 +01:00
parent a03b1cce58
commit 162982a709
6 changed files with 166 additions and 81 deletions
BIN
View File
Binary file not shown.
+28 -11
View File
@@ -214,7 +214,7 @@ function sepgp_bids:OnTooltipUpdate()
local coloredRank = (rankName == "Core Raider" or rankName == "Officer" or rankName == "Supreme leader") and C:Green("(" .. rankName .. ")") or C:Colorize("aaaaaa", "(" .. rankName .. ")")
local namedesc
if (main) then
if main ~= "" then
namedesc = string.format("%s(%s)", C:Colorize(BC:GetHexColor(class), name), L["Alt"])
else
namedesc = C:Colorize(BC:GetHexColor(class), name)
@@ -253,19 +253,32 @@ function sepgp_bids:OnTooltipUpdate()
"hideBlankLine", true
)
local _,to = self:BuildBidsTable()
-- Offspec list
for i = 1, table.getn(to) do
local name, class, ep, gp, pr, main = unpack(to[i])
local name, class, ep, gp, pr, main, prio_flag = unpack(to[i])
local rankName = self:getGuildRank(name)
local coloredRank = (rankName == "Core Raider") and C:Green("(" .. rankName .. ")") or C:Colorize("aaaaaa", "("..rankName..")")
local coloredRank = (rankName == "Core Raider" or rankName == "Officer" or rankName == "Supreme leader") and C:Green("(" .. rankName .. ")") or C:Colorize("aaaaaa", "(" .. rankName .. ")")
local namedesc
if (main) then
if main ~= "" then
namedesc = string.format("%s(%s)", C:Colorize(BC:GetHexColor(class), name), L["Alt"])
else
namedesc = C:Colorize(BC:GetHexColor(class), name)
end
if rankName ~= "" then
namedesc = namedesc.." "..coloredRank
namedesc = namedesc .. " " .. coloredRank
end
if prio_flag == "OSPRIO" then
namedesc = C:Red("[PRIO] ") .. namedesc
prio_tag = "[PRIO] "
else
prio_tag = ""
end
-- Then you build ep/gp text, etc.
local text2, text4
if sepgp_minep > 0 and ep < sepgp_minep then
text2 = C:Red(string.format("%.4g", ep))
@@ -273,17 +286,21 @@ function sepgp_bids:OnTooltipUpdate()
else
text2 = string.format("%.4g", ep)
text4 = string.format("%.4g", pr)
end
end
name = prio_tag .. name
offcat:AddLine(
"text", namedesc,
"text", namedesc,
"text2", text2,
"text3", string.format("%.4g", gp),
"text4", text4,
"text5", (main or ""),
"func", "announceWinnerOS", "arg1", self, "arg2", name, "arg3", pr
"text5", main or "",
"func", "announceWinnerOS", "arg1", self, "arg2", name, "arg3", pr
)
end
end
end
-- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_groupbyarmor,sepgp_groupbyrole,sepgp_raidonly,sepgp_decay,sepgp_minep,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted
-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_alts,sepgp_logs
-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_alts,sepgp_logs
+6 -3
View File
@@ -3,6 +3,8 @@ local L = AceLibrary("AceLocale-2.2"):new("shootyepgp")
L:RegisterTranslations("enUS", function() return {
--["Term"] = true, -- Example
-- common
["Click $MS or $MSOS or $OS for %s"] = true,
["or $MSOS"] = true,
["Refresh"] = true,
["Refresh window"] = true,
["Clear"] = true,
@@ -78,8 +80,9 @@ Results will print here when done.]],
["PHYS DPS"] = true,
-- shootyepgp
["{shootyepgp}Type \"+\" if on main, or \"+<YourMainName>\" (without quotes) if on alt within %dsec."] = true,
["|cffFF3333|Hshootybid:1:$ML|h[Mainspec/NEED]|h|r"] = true,
["|cff009900|Hshootybid:2:$ML|h[Offspec/GREED]|h|r"] = true,
["|cff0066ff|Hshootybid:1:$ML|h[MAINSPEC]|h|r"] = true,
["|cff3ade2f|Hshootybid:2:$ML|h[OFFSPEC]|h|r"] = true,
["|cff3ade2f|Hshootybid:3:$ML|h[|r|cffff0000PRIO|r |cff3ade2fOFFSPEC]|h|r"] = true,
["Bids"] = true,
["Show Bids Table."] = true,
["ClearLoot"] = true,
@@ -104,7 +107,7 @@ Results will print here when done.]],
["Whisper %s a + for %s (mainspec)"] = true,
["Whisper %s a - for %s (offspec)"] = true,
["Whisper %s a + or - for %s (mainspec or offspec)"] = true,
["Click $MS or $OS for %s"] = true,
["Click $MS or $PRIOOS or $OS for %s"] = true,
["or $OS "] = true,
["$MS or "] = true,
["You have received a %d EP penalty."] = true,
-1
View File
@@ -222,7 +222,6 @@ local prices = {
---------------------------
--- Temple of Ahn'Qiraj ---
---------------------------
[55554] = {300,"T2.5"}; --Carapace Handguards
[555533] = {300,"T2.5"}; --Gloves of the Primordial Burrower
[20926] = {60,"T2.5"}; --Vek'nilash's Circlet
[20927] = {60,"T2.5"}; --Ouro's Intact Hide
+129 -63
View File
@@ -51,7 +51,7 @@ sepgp.VARS = {
}
sepgp.VARS.reservecall = string.format(L["{shootyepgp}Type \"+\" if on main, or \"+<YourMainName>\" (without quotes) if on alt within %dsec."],sepgp.VARS.timeout)
sepgp._playerName = (UnitName("player"))
local out = "|cff9664c8shootyepgp:|r %s"
local out = "|cff999999EPGP<ERROR>:|r %s"
local raidStatus,lastRaidStatus
local lastUpdate = 0
local needInit,needRefresh = true
@@ -62,8 +62,9 @@ local partyUnit,raidUnit = {},{}
local hexColorQuality = {}
local reserves_blacklist,bids_blacklist = {},{}
local bidlink = {
["ms"]=L["|cffFF3333|Hshootybid:1:$ML|h[Mainspec/NEED]|h|r"],
["os"]=L["|cff009900|Hshootybid:2:$ML|h[Offspec/GREED]|h|r"]
["ms"]=L["|cff0066ff|Hshootybid:1:$ML|h[MAINSPEC]|h|r"],
["os"]=L["|cff3ade2f|Hshootybid:2:$ML|h[OFFSPEC]|h|r"],
["prioos"] = L["|cff3ade2f|Hshootybid:3:$ML|h[|r|cffff0000PRIO|r |cff3ade2fOFFSPEC]|h|r"]
}
local options
do
@@ -782,7 +783,7 @@ function sepgp:AddDataToTooltip(tooltip,itemlink,itemstring,is_master)
tooltip:AddDoubleLine("|cff9664c8shootyepgp|r",textRight)
tooltip:AddDoubleLine("|cff999999EPGP<ERROR>|r",textRight)
tooltip:AddDoubleLine(" ",textRight2)
if (is_master) then
tooltip:AddDoubleLine(left1,right1)
@@ -799,7 +800,7 @@ function sepgp:AddDataToTooltip(tooltip,itemlink,itemstring,is_master)
sepgp.extratip:SetPoint("TOPLEFT", tooltip, "BOTTOMLEFT", 0, -5)
sepgp.extratip:SetPoint("TOPRIGHT", tooltip, "BOTTOMRIGHT", 0, -5)
end
sepgp.extratip:SetText("|cff9664c8shootyepgp|r")
sepgp.extratip:SetText("|cff999999EPGP<ERROR>|r")
sepgp.extratip:AddDoubleLine(" ",textRight)
sepgp.extratip:AddDoubleLine(" ",textRight2)
if (is_master) then
@@ -861,6 +862,8 @@ function sepgp:SetItemRef(link, name, button)
bid = "+"
elseif bid == "2" then
bid = "-"
elseif bid == "3" then
bid = "OSPRIO"
else
bid = nil
end
@@ -997,27 +1000,46 @@ function sepgp:defaultPrint(msg)
DEFAULT_CHAT_FRAME:AddMessage(string.format(out,msg))
end
function sepgp:bidPrint(link,masterlooter,need,greed,bid)
local mslink = string.gsub(bidlink["ms"],"$ML",masterlooter)
local oslink = string.gsub(bidlink["os"],"$ML",masterlooter)
local msg = string.format(L["Click $MS or $OS for %s"],link)
function sepgp:bidPrint(link, masterlooter, need, greed, bid)
-- Build each clickable link
local mslink = string.gsub(bidlink["ms"], "$ML", masterlooter)
local oslink = string.gsub(bidlink["os"], "$ML", masterlooter)
local priooslink = string.gsub(bidlink["prioos"], "$ML", masterlooter)
-- Start with a string that has placeholders for all three
local msg = string.format(L["Click $MS or $PRIOOS or $OS for %s"], link)
PlaySoundFile("Interface\\AddOns\\shootyepgp\\Sounds\\loot.wav")
-- Decide which placeholders to keep/remove based on need/greed/bid
if (need and greed) then
msg = string.gsub(msg,"$MS",mslink)
msg = string.gsub(msg,"$OS",oslink)
-- Keep all three
msg = string.gsub(msg, "$MS", mslink)
msg = string.gsub(msg, "$PRIOOS", priooslink)
msg = string.gsub(msg, "$OS", oslink)
elseif (need) then
msg = string.gsub(msg,"$MS",mslink)
msg = string.gsub(msg,L["or $OS "],"")
-- Only show MS + MSOS, remove the OS part
msg = string.gsub(msg, "$MS", mslink)
msg = string.gsub(msg, "$PRIOOS", priooslink)
msg = string.gsub(msg, " or $OS", "")
elseif (greed) then
msg = string.gsub(msg,"$OS",oslink)
msg = string.gsub(msg,L["$MS or "],"")
-- Only show OS, remove MS + MSOS
msg = string.gsub(msg, "$OS", oslink)
-- remove "$MS or $MSOS or " (or your exact localized phrase)
msg = string.gsub(msg, "$MS or $PRIOOS or ", "")
elseif (bid) then
msg = string.gsub(msg,"$MS",mslink)
msg = string.gsub(msg,"$OS",oslink)
-- If 'bid' is true, we keep all (same as need+greed)
msg = string.gsub(msg, "$MS", mslink)
msg = string.gsub(msg, "$PRIOOS", priooslink)
msg = string.gsub(msg, "$OS", oslink)
end
local _, count = string.gsub(msg,"%$","%$")
-- If there's still an un-replaced placeholder, exit
local _, count = string.gsub(msg, "%$", "%$")
if (count > 0) then return end
-- Decide which chat frame to print in
local chatframe
if (SELECTED_CHAT_FRAME) then
if SELECTED_CHAT_FRAME then
chatframe = SELECTED_CHAT_FRAME
else
if not DEFAULT_CHAT_FRAME:IsVisible() then
@@ -1025,12 +1047,19 @@ function sepgp:bidPrint(link,masterlooter,need,greed,bid)
end
chatframe = DEFAULT_CHAT_FRAME
end
if (chatframe) then
-- Output to chat
if chatframe then
chatframe:AddMessage(" ")
chatframe:AddMessage(string.format(out,msg),NORMAL_FONT_COLOR.r,NORMAL_FONT_COLOR.g,NORMAL_FONT_COLOR.b)
chatframe:AddMessage(string.format(out, msg),
NORMAL_FONT_COLOR.r,
NORMAL_FONT_COLOR.g,
NORMAL_FONT_COLOR.b
)
end
end
function sepgp:simpleSay(msg)
SendChatMessage(string.format("shootyepgp: %s",msg), sepgp_saychannel)
end
@@ -1870,55 +1899,92 @@ end
local lootBid = {}
lootBid.ms = {"(%+)",".+(%+).*",".*(%+).+",".*(%+).*","(ms)","(need)"}
lootBid.os = {"(%-)",".+(%-).*",".*(%-).+",".*(%-).*","(os)","(greed)"}
lootBid.msos = {".*[oO][sS][pP][rR][iI][oO].*"}
function sepgp:captureBid(text, sender)
if not (running_bid) then return end
if not running_bid then return end
if not (IsRaidLeader() or self:lootMaster()) then return end
if not sepgp.bid_item.link then return end
local mskw_found,oskw_found
local lowtext = string.lower(text)
for _,f in ipairs(lootBid.ms) do
mskw_found = string.find(text,f)
if (mskw_found) then break end
local mskw_found, oskw_found, msoskw_found
-- Check for + (mainspec)
for _, f in ipairs(lootBid.ms) do
if string.find(text, f) then
mskw_found = true
break
end
end
for _,f in ipairs(lootBid.os) do
oskw_found = string.find(text,f)
if (oskw_found) then break end
-- Check for - (offspec)
for _, f in ipairs(lootBid.os) do
if string.find(text, f) then
oskw_found = true
break
end
end
if (mskw_found) or (oskw_found) then
if self:inRaid(sender) then
if bids_blacklist[sender] == nil then
for i = 1, GetNumGuildMembers(1) do
local name, _, _, _, class, _, note, officernote, _, _ = GetGuildRosterInfo(i)
if name == sender then
local ep = (self:get_ep_v3(name,officernote) or 0)
local gp = (self:get_gp_v3(name,officernote) or sepgp.VARS.basegp)
local main_name
if (sepgp_altspool) then
local main, main_class, main_rank, main_offnote = self:parseAlt(name,officernote)
if (main) then
ep = (self:get_ep_v3(main,main_offnote) or 0)
gp = (self:get_gp_v3(main,main_offnote) or sepgp.VARS.basegp)
main_name = main
end
-- Check for OSPRIO
for _, f in ipairs(lootBid.msos) do
if string.find(text, f) then
msoskw_found = true
break
end
end
if mskw_found or oskw_found or msoskw_found then
if self:inRaid(sender) and not bids_blacklist[sender] then
local prio_flag = "OSPRIO"
for i = 1, GetNumGuildMembers() do
local name, _, _, _, class, _, note, officernote, _, _ = GetGuildRosterInfo(i)
if name == sender then
local ep = (self:get_ep_v3(name, officernote) or 0)
local gp = (self:get_gp_v3(name, officernote) or sepgp.VARS.basegp)
local main_name
-- If pooling alts into main's EPGP
if sepgp_altspool then
local alt_main, alt_class, _, alt_officernote = self:parseAlt(name, officernote)
if alt_main then
ep = (self:get_ep_v3(alt_main, alt_officernote) or 0)
gp = (self:get_gp_v3(alt_main, alt_officernote) or sepgp.VARS.basegp)
main_name = alt_main
end
if (mskw_found) then
bids_blacklist[sender] = true
if (sepgp_altspool) and (main_name) then
table.insert(sepgp.bids_main,{name,class,ep,gp,ep/gp,main_name})
else
table.insert(sepgp.bids_main,{name,class,ep,gp,ep/gp})
end
elseif (oskw_found) then
bids_blacklist[sender] = true
if (sepgp_altspool) and (main_name) then
table.insert(sepgp.bids_off,{name,class,ep,gp,ep/gp,main_name})
else
table.insert(sepgp.bids_off,{name,class,ep,gp,ep/gp})
end
end
sepgp_bids:Toggle(true)
return
end
-- Mark them so we don't double-add
bids_blacklist[sender] = true
if mskw_found then
-- It's a + (Mainspec)
if main_name then
table.insert(sepgp.bids_main, {name, class, ep, gp, ep / gp, main_name, ""})
else
table.insert(sepgp.bids_main, {name, class, ep, gp, ep / gp, "", ""})
end
elseif oskw_found then
-- It's a - (Offspec)
if main_name then
table.insert(sepgp.bids_off, {name, class, ep, gp, ep / gp, main_name, ""})
else
table.insert(sepgp.bids_off, {name, class, ep, gp, ep / gp, "", ""})
end
elseif msoskw_found then
-- It's OSPRIO -> Also place in the Offspec table,
-- but with "OSPRIO" flag so we can detect it in the GUI
if main_name then
table.insert(sepgp.bids_off, {name, class, ep, gp, ep / gp, main_name, prio_flag})
else
table.insert(sepgp.bids_off, {name, class, ep, gp, ep / gp, "", prio_flag})
end
end
-- Refresh the bids window
sepgp_bids:Toggle(true)
return
end
end
end
+3 -3
View File
@@ -3,11 +3,11 @@
## Title-zhCN: shootyepgp EPGP插件 | |cff808080<ERROR> edition|r
## Notes: Effort Points/Gear Points Loot System
## Notes-zhCN: 贡献点/装备点拾取制度系统
## Author: Roadblock
## X-Website: https://github.com/Road-block/shootyepgp/releases/latest
## Author: Roadblock / Horyoshi
## X-Website: https://github.com/cinecom/shootyepgp/
## X-Category: Guild
## X-Credits: shooty, Qcat(zhCN)
## Version: 3.60 <ERROR>
## Version: 3.82 <ERROR>
## X-Alpha:
## OptionalDeps: Ace2
## SavedVariables: sepgp_saychannel, sepgp_groupbyclass, sepgp_groupbyarmor, sepgp_groupbyrole, sepgp_raidonly, sepgp_dbver, sepgp_debug, sepgp_fubar