By searching in esoui sources for event_justice I found the bounty display control.
At this function it seems to update your currently active bounty currency (gold to pay):
https://github.com/esoui/esoui/blob/...isplay.lua#L49
ZO_BountyDisplay is the "class" here and via ZO_BountyDisplay:New you create the object of that class, which can be accessed ingame (and inspected via tbug too).
So searching for ZO_BountyDisplay:New ->
You will get here
https://github.com/esoui/esoui/blob/...oard.lua#L1192
STATS_BOUNTY_DISPLAY is your global object then
So you can hook that function like this I guess to react on any update, check the current currency value or use other ApI to check current bounty values and react on that with your addon:
Lua Code:
SecurePostHook("STATS_BOUNTY_DISPLAY", function()
if IsJusticeEnabled() then
--local self = STATS_BOUNTY_DISPLAY --> Justt o explain what the self in the original function ZO_BountyDisplay:OnBountyUpdated relates to!
local currentBounty = GetFullBountyPayoffAmount()
if currentBounty >= x then
-- do your bounty value related stuff 1
else
-- do your bounty value related stuff 2
end
end
end)
There might be better ways to achieve your goal, but I hope it expalins enough how to search esoui sources and get to the point where the UI controls update and show things "the ZOs way" (vanilla code).
Maybe you can find an even better point to hook into then.