From 0681c179251ffb57106aa2b29ed1544df510c01e Mon Sep 17 00:00:00 2001 From: Road-block Date: Thu, 19 Oct 2017 07:30:07 +0300 Subject: [PATCH] Add the resulting PR value on item tooltips if the player was to win the bid. Small performance improvement to building standings table. --- shootyepgp.lua | 7 ++++++- shootyepgp.toc | 2 +- standings.lua | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/shootyepgp.lua b/shootyepgp.lua index 9f731a3..6f0fd61 100644 --- a/shootyepgp.lua +++ b/shootyepgp.lua @@ -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) diff --git a/shootyepgp.toc b/shootyepgp.toc index e22e4a3..a2b8599 100644 --- a/shootyepgp.toc +++ b/shootyepgp.toc @@ -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 diff --git a/standings.lua b/standings.lua index d3d88e0..b40d42b 100644 --- a/standings.lua +++ b/standings.lua @@ -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