Baganator

Baganator

1M Downloads

Auctionator/Sell price on item icon

Barbiero opened this issue · 6 comments

commented

It would be nice if we could add the expected auction pricing on the corner of items:
Item Corner Priorities

I understand that Baganator does not include pricing from AH as part of its features, but certain addons - like CraftSim - can import AH information from DataStore and so I believe Baganator could access it too.

In my mind, we'd be able to see in a resumed manner how much each stack of items is expected to result when selling on the AH.

For example (sorry for the paint mockup):
image
This Rousing Fire stack is 10, and the AH pricing is clocked at 4g72s, so the top-right corner could show "47g" as text to indicate the expected stack cost.

In order for this to not be too big (specially on small icons), I would expect the value to be truncated to up to 3 characters(including separator dot). Some examples:

Total Price (stack count * unit price) Rendered amount Comment
1g 15s 30b 1.1g "1.1" is already 3 characters, so we don't render more
1532g 48s 1.5k same thing, "1.5" is 3 characters
25700g 26k "25.7" would be 4 characters, so we round the number.
100050g 100k Same rules as above, round to 3 characters
1000000g 1M "1000" would be 4 chars, so we move to the next SI category, where M=10^6

Of course this "3 character" rule is just a suggestion because I have a concern that this string would be too big for bag icons; Perhaps allowing users to determine the format string themselves would be best, but that would make the feature more complex than it needs to be too.

This feature doesn't need to be limited to AH either; showing stack value when selling to NPCs is also a valid use case IMO. Probably as a split option, like BoA/BoE?

I feel like this would be very helpful when you have a big list of stackable items - say, on your reagent bank - and want to know if anything there is valuable on a glance.

commented

This would be best suited as a plugin addon for Baganator. Something like this would be required:

local function FormatMoney(money)
  -- do something here to get the right length string for the copper monetary
  -- value
end

Baganator.Utilities.OnAddonLoaded("Auctionator", function()
  Baganator.API.RegisterCornerWidget("Auction House Value", "baganator_plugin_auction_house_value", function(text, details)
    if details.isBound then
      return false
    end
    local value = Auctionator.API.v1.GetAuctionPriceByItemLink("Baganator-MoneyOnIcons", details.itemLink)
    if not value then
      return false
    end
    text:SetText(FormatMoney(value * details.itemCount))
    return true
  end,
  function(itemButton)
    local text = itemButton:CreateFontString(nil, "OVERLAY", "NumberFontNormal")
    text.sizeFont = true
    return text
  end, {corner = "top_right", priority = 1})
end)
commented
commented

And the addon's toc would be

## Interface: 100205
## Interface-Wrath: 30403
## Interface-Classic: 11501
## Title: Baganator (Money On Icons)
## Version: @project-version@
## Author: plusmouse
## RequiredDeps: Baganator
## OptionalDeps: Auctionator
## IconAtlas: Auctioneer

Main.lua
commented

To get you started this addon will just add something to the bag item icons

Baganator-MoneyOnIcons-12161f4.zip

commented

Not going to be spending the time to implement this in the Baganator core addon.

commented

Thank you for the directions, I'll try and implement it myself!