From c097425484a0d2a982219ef4feb7374ea3ddff5f Mon Sep 17 00:00:00 2001 From: Road-block Date: Wed, 31 Jan 2018 21:32:09 +0200 Subject: [PATCH] Mark alts clearer on Bids tablet. Personal EPGP message that accounts for alt,main relation. Fix alpha version. --- bids.lua | 16 ++++++++++++++-- localization.lua | 2 ++ shootyepgp.lua | 18 ++++++++++++------ shootyepgp.toc | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/bids.lua b/bids.lua index 0127eed..88a2ee1 100644 --- a/bids.lua +++ b/bids.lua @@ -180,8 +180,14 @@ function sepgp_bids:OnTooltipUpdate() local tm = self:BuildBidsTable() for i = 1, table.getn(tm) do local name, class, ep, gp, pr, main = unpack(tm[i]) + local namedesc + 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 maincat:AddLine( - "text", C:Colorize(BC:GetHexColor(class), name), + "text", namedesc, "text2", string.format("%.4g", ep), "text3", string.format("%.4g", gp), "text4", string.format("%.4g", pr), @@ -205,8 +211,14 @@ function sepgp_bids:OnTooltipUpdate() local _,to = self:BuildBidsTable() for i = 1, table.getn(to) do local name, class, ep, gp, pr, main = unpack(to[i]) + local namedesc + 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 offcat:AddLine( - "text", C:Colorize(BC:GetHexColor(class), name), + "text", namedesc, "text2", string.format("%.4g", ep), "text3", string.format("%.4g", gp), "text4", string.format("%.4g", pr), diff --git a/localization.lua b/localization.lua index 12bca37..e30da73 100644 --- a/localization.lua +++ b/localization.lua @@ -176,6 +176,7 @@ Results will print here when done.]], ["shootyepgp alts"] = true, ["Enable Alts"] = true, ["Main"] = true, + ["Alt"] = true, ["Allow Alts to use Main\'s EPGP."] = true, ["Alts EP %"] = true, ["Set the % EP Alts can earn."] = true, @@ -366,6 +367,7 @@ L:RegisterTranslations("zhCN", function() return { ["shootyepgp alts"] = "shootyepgp alts", ["Enable Alts"] = "Enable Alts", ["Main"] = "Main", + ["Alt"] = "Alt", ["Allow Alts to use Main\'s EPGP."] = "Allow Alts to use Main\'s EPGP.", ["Alts EP %"] = "Alts EP %", ["Set the % EP Alts can earn."] = "Set the % EP Alts can earn.", diff --git a/shootyepgp.lua b/shootyepgp.lua index 6571d25..afb9180 100644 --- a/shootyepgp.lua +++ b/shootyepgp.lua @@ -674,7 +674,8 @@ function sepgp:addonComms(prefix,message,channel,sender) end if (who) and (what) and (amount) then local msg - if (who == self._playerName) or (sepgp_main and (who == sepgp_main)) then + local for_main = (sepgp_main and (who == sepgp_main)) + if (who == self._playerName) or (for_main) then if what == "EP" then if amount < 0 then msg = string.format(L["You have received a %d EP penalty."],amount) @@ -758,7 +759,7 @@ function sepgp:addonComms(prefix,message,channel,sender) end if msg and msg~="" then self:defaultPrint(msg) - self:my_epgp() + self:my_epgp(for_main) end end end @@ -1090,8 +1091,13 @@ function sepgp:capcalc(ep,gp,gain) return pr_decay, cap_ep, cap_pr end -function sepgp:my_epgp_announce() - local ep,gp = (self:get_ep_v3(self._playerName) or 0), (self:get_gp_v3(self._playerName) or sepgp.VARS.basegp) +function sepgp:my_epgp_announce(use_main) + local ep,gp + if (use_main) then + ep,gp = (self:get_ep_v3(sepgp_main) or 0), (self:get_gp_v3(sepgp_main) or sepgp.VARS.basegp) + else + ep,gp = (self:get_ep_v3(self._playerName) or 0), (self:get_gp_v3(self._playerName) or sepgp.VARS.basegp) + end local pr = ep/gp local msg = string.format(L["You now have: %d EP %d GP |cffffff00%.03f|r|cffff7f00PR|r."], ep,gp,pr) self:defaultPrint(msg) @@ -1102,9 +1108,9 @@ function sepgp:my_epgp_announce() end end -function sepgp:my_epgp() +function sepgp:my_epgp(use_main) GuildRoster() - self:ScheduleEvent("shootyepgpRosterRefresh",self.my_epgp_announce,3,self) + self:ScheduleEvent("shootyepgpRosterRefresh",self.my_epgp_announce,3,self,use_main) end --------- diff --git a/shootyepgp.toc b/shootyepgp.toc index 005a092..cfb8474 100644 --- a/shootyepgp.toc +++ b/shootyepgp.toc @@ -8,7 +8,7 @@ ## X-Category: Guild ## X-Credits: shooty, Qcat(zhCN) ## Version: 3.31.1 -## X-Alpha: 3.4 +## X-Alpha: 3.40 ## OptionalDeps: Ace2 ## SavedVariables: sepgp_saychannel, sepgp_groupbyclass, sepgp_raidonly, sepgp_dbver, sepgp_debug ## SavedVariablesPerCharacter: sepgp_main, sepgp_log, sepgp_looted, sepgp_decay, sepgp_reservechannel, sepgp_progress, sepgp_discount, sepgp_altspool, sepgp_altpercent