Skip to content

Commit

Permalink
add upgrade hint to tooltip for items that can be upgraded using crys…
Browse files Browse the repository at this point in the history
…tallized firestones
  • Loading branch information
Road-block committed Nov 8, 2024
1 parent e292171 commit e9cfeaa
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 14 deletions.
2 changes: 1 addition & 1 deletion BastionLoot.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Author: Roadblock
## Title: BastionLoot
## Notes: In-game EPGP loot helper, supports standby, main/alt shared pool, minEP, offpecGP. Pluggable price list. Alternative +wincount mode.
## Version: 4.3.1
## Version: 4.3.2
## X-Alpha:
## X-Website: https://github.com/Road-block/BastionLoot/releases/latest
## OptionalDeps: Ace3, MizusRaidTracker
Expand Down
2 changes: 1 addition & 1 deletion BastionLoot_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Author: Roadblock
## Title: BastionLoot
## Notes: In-game EPGP loot helper, supports standby, main/alt shared pool, minEP, offpecGP. Pluggable price list. Alternative +wincount mode.
## Version: 4.3.1
## Version: 4.3.2
## X-Alpha:
## X-Website: https://github.com/Road-block/BastionLoot/releases/latest
## OptionalDeps: Ace3, MizusRaidTracker
Expand Down
1 change: 1 addition & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -591,5 +591,6 @@ You can also whisper |cffffd200!PR Name|r to any EPGP admin online to get back i
L["Show Selected Item"] = true
L["Use GP Button to Set"] = true
L["%s removed from Favorites"] = true
L["|cff00ff00Upgradeable:|r"] = true

bepgp.L = L
1 change: 1 addition & 0 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -585,5 +585,6 @@ You can whisper |cffffd200!PR Name|r to any higher rank guild member with the ad
L["Show Selected Item"] = "Show Selected Item" -- needs translation
L["Use GP Button to Set"] = "Use GP Button to Set" -- needs translation
L["%s removed from Favorites"] = "%s removed from Favorites" -- needs translation
L["|cff00ff00Upgradeable:|r"] = "|cff00ff00Upgradeable:|r" -- needs translation

bepgp.L = L
1 change: 1 addition & 0 deletions Locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -585,5 +585,6 @@ You can whisper |cffffd200!PR Name|r to any higher rank guild member with the ad
L["Show Selected Item"] = "Show Selected Item" -- needs translation
L["Use GP Button to Set"] = "Use GP Button to Set" -- needs translation
L["%s removed from Favorites"] = "%s removed from Favorites" -- needs translation
L["|cff00ff00Upgradeable:|r"] = "|cff00ff00Upgradeable:|r" -- needs translation

bepgp.L = L
35 changes: 35 additions & 0 deletions Modules/tokens_cata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
local tokens = {} -- item = token
local rewards = {} -- token = items
local last_reward_flipped = {} -- token = reward
local item_upgrades = {} -- baseitemid = token
-- crystallized firestone for now
item_upgrades[68915] = 71617
item_upgrades[68972] = 71617
item_upgrades[70929] = 71617
item_upgrades[70939] = 71617
item_upgrades[71146] = 71617
item_upgrades[71147] = 71617
item_upgrades[71148] = 71617
item_upgrades[71149] = 71617
item_upgrades[71150] = 71617
item_upgrades[71151] = 71617
item_upgrades[71152] = 71617
item_upgrades[71154] = 71617
item_upgrades[71218] = 71617
item_upgrades[71359] = 71617
item_upgrades[71360] = 71617
item_upgrades[71361] = 71617
item_upgrades[71362] = 71617
item_upgrades[71365] = 71617
item_upgrades[71366] = 71617
item_upgrades[71367] = 71617
item_upgrades[71640] = 71617

-- T11.359 (normal)
rewards[63682] = { 60341,60351, 60277,60282,60286, 60243, 60299 } -- Helm of the Forlorn Vanquisher (dk/druid/mage/rogue)
Expand Down Expand Up @@ -113,6 +136,17 @@ function bepgp_tokens_cata:GetToken(reward)
return tokens[reward] or nil
end

function bepgp_tokens_cata:ItemUpgradeString(baseItem)
if not (type(baseItem)=="number" or type(baseItem)=="string") then return end
local baseitemID = bepgp.GetItemInfoInstant(baseItem)
if not baseitemID then return end
local tokenID = item_upgrades[baseitemID]
if not tokenID then return end
local _,_,_,_,icon = bepgp.GetItemInfoInstant(tokenID)
local markup = item_icon_markup[icon]
return string.format("%s +%s",L["|cff00ff00Upgradeable:|r"],(markup or tokenID))
end

function bepgp_tokens_cata:RewardItemString(tokenItem)
if not (type(tokenItem)=="number" or type(tokenItem)=="string") then return end
local tokenID = bepgp.GetItemInfoInstant(tokenItem)
Expand Down Expand Up @@ -181,6 +215,7 @@ function bepgp_tokens_cata:CoreInit()
self:cacheTokens()
bepgp.TokensItemString = self.TokensItemString
bepgp.RewardItemString = self.RewardItemString
bepgp.ItemUpgradeString = self.ItemUpgradeString
if not self._initDone then
self:delayInit()
end
Expand Down
33 changes: 21 additions & 12 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ bepgp.VARS = {
osgp = L["Offspec GP"],
bankde = L["Bank-D/E"],
unassigned = C:Red(L["Unassigned"]),
crystalfirestone = 71617,
autoloot = {
[40752] = "BadgeHero",
[101] = "currency",
Expand Down Expand Up @@ -2271,7 +2272,7 @@ function bepgp:templateCache(id)
local data = self.data
local loot_indices = data.loot_indices
local item_id = data[loot_indices.item_id]
if item_id == 71617 then -- Crystallized Firestone
if bepgp.VARS.crystalfirestone and (item_id == bepgp.VARS.crystalfirestone) then -- Crystallized Firestone
data.firestoneData = data.firestoneData or {}
data.firestoneData.Items = bepgp:getFirestoneItems((data[loot_indices.class] or "UNKNOWN"), data)
else
Expand Down Expand Up @@ -3598,16 +3599,24 @@ function bepgp:AddTipInfo(tooltip,...)
if tipOptionGroup.favinfo and favorite then
tooltip:AddLine(self._favmap[favorite])
end
if tipOptionGroup.tkninfo and self.TokensItemString and self.RewardItemString then
wipe(item_swaps)
local required_line = self:TokensItemString(itemid)
local reward_line = self:RewardItemString(itemid)
if required_line then
tooltip:AddDoubleLine(_G.CTRL_KEY,_G.SOURCE..required_line)
item_swaps[itemid] = required_line
elseif reward_line then
tooltip:AddDoubleLine(_G.CTRL_KEY,L["Token for:"]..reward_line)
item_swaps[itemid] = reward_line
if tipOptionGroup.tkninfo then
if self.ItemUpgradeString then
local token_markup = self:ItemUpgradeString(itemid)
if token_markup then
tooltip:AddDoubleLine(" ",token_markup)
end
end
if self.TokensItemString and self.RewardItemString then
wipe(item_swaps)
local required_line = self:TokensItemString(itemid)
local reward_line = self:RewardItemString(itemid)
if required_line then
tooltip:AddDoubleLine(_G.CTRL_KEY,_G.SOURCE..required_line)
item_swaps[itemid] = required_line
elseif reward_line then
tooltip:AddDoubleLine(_G.CTRL_KEY,L["Token for:"]..reward_line)
item_swaps[itemid] = reward_line
end
end
end
if tipOptionGroup.useinfo and (type(useful)=="table" and #(useful)>0) then
Expand Down Expand Up @@ -5059,7 +5068,7 @@ function bepgp:getFirestoneItems(enClass, dialogData)
name = "Crystallized Firestone ".. TURN_IN_QUEST,
order = 0,
}
local itemAsync = Item:CreateFromItemID(71617) -- Crystallized Firestone id
local itemAsync = Item:CreateFromItemID(bepgp.VARS.crystalfirestone) -- Crystallized Firestone id
itemAsync:ContinueOnItemLoad(function()
local itemLink = itemAsync:GetItemLink()
local itemName = itemAsync:GetItemName()
Expand Down

0 comments on commit e9cfeaa

Please sign in to comment.