Add the resulting PR value on item tooltips if the player was to win the bid.

Small performance improvement to building standings table.
This commit is contained in:
Road-block
2017-10-19 07:30:07 +03:00
parent 95560748b8
commit 0681c17925
3 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -203,7 +203,12 @@ function sepgp:AddDataToTooltip(tooltip,itemlink,itemstring,is_master)
else
line_limit = 29
end
local textRight = string.format("cost:|cff32cd32%d|r offspec:|cff20b2aa%d|r",price,math.floor(price*sepgp_discount))
local ep,gp = (sepgp:get_ep_v3(playerName) or 0), (sepgp:get_gp_v3(playerName) or sepgp.VARS.basegp)
local off_price = math.floor(price*sepgp_discount)
local pr,new_pr,new_pr_off = ep/gp, ep/(gp+price), ep/(gp+off_price)
local pr_delta = new_pr - pr
local pr_delta_off = new_pr_off - pr
local textRight = string.format("cost:|cff32cd32%d|r (|cffff0000%.02f|r |cffff7f00pr|r) offspec:|cff20b2aa%d|r (|cffff0000%.02f|r |cffff7f00pr|r)",price,new_pr,off_price,new_pr_off)
if (tooltip:NumLines() < line_limit) then
tooltip:AddLine(" ")
tooltip:AddDoubleLine("|cff9664c8shootyepgp|r",textRight)
+1 -1
View File
@@ -3,7 +3,7 @@
## Notes: Effort Points/Gear Points Loot System
## Author: Roadblock
## X-Credits: shooty for original version
## Version: 3.15
## Version: 3.16
## OptionalDeps: Ace2
## SavedVariables: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount
## SavedVariablesPerCharacter: sepgp_log, sepgp_dbver
+2 -2
View File
@@ -176,8 +176,8 @@ function sepgp_standings:BuildStandingsTable()
end
for i = 1, GetNumGuildMembers(1) do
local name, _, _, _, class, _, note, officernote, _, _ = GetGuildRosterInfo(i)
local ep = (sepgp:get_ep_v3(name) or 0) --DONE: update v3
local gp = (sepgp:get_gp_v3(name) or sepgp.VARS.basegp) --DONE: update v3
local ep = (sepgp:get_ep_v3(name,officernote) or 0) --DONE: update v3
local gp = (sepgp:get_gp_v3(name,officernote) or sepgp.VARS.basegp) --DONE: update v3
if ep > 0 then
if (sepgp_raidonly) and next(r) then
if r[name] then