initial commit
This commit is contained in:
44
Core/Service/Tooltip/Sniper.lua
Normal file
44
Core/Service/Tooltip/Sniper.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
-- ------------------------------------------------------------------------------ --
|
||||
-- TradeSkillMaster --
|
||||
-- https://tradeskillmaster.com --
|
||||
-- All Rights Reserved - Detailed license information included with addon. --
|
||||
-- ------------------------------------------------------------------------------ --
|
||||
|
||||
local _, TSM = ...
|
||||
local Sniper = TSM.Tooltip:NewPackage("Sniper")
|
||||
local L = TSM.Include("Locale").GetTable()
|
||||
local ItemString = TSM.Include("Util.ItemString")
|
||||
local private = {}
|
||||
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
-- Module Functions
|
||||
-- ============================================================================
|
||||
|
||||
function Sniper.OnInitialize()
|
||||
TSM.Tooltip.Register(TSM.Tooltip.CreateInfo()
|
||||
:SetHeadings(L["TSM Sniper"])
|
||||
:SetSettingsModule("Sniper")
|
||||
:AddSettingEntry("belowPrice", false, private.PopulateBelowPriceLine)
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
-- Private Helper Functions
|
||||
-- ============================================================================
|
||||
|
||||
function private.PopulateBelowPriceLine(tooltip, itemString)
|
||||
local belowPrice = nil
|
||||
if itemString == ItemString.GetPlaceholder() then
|
||||
-- example tooltip
|
||||
belowPrice = 35
|
||||
else
|
||||
belowPrice = TSM.Operations.Sniper.GetBelowPrice(itemString)
|
||||
end
|
||||
if belowPrice then
|
||||
tooltip:AddItemValueLine(L["Sniper Below Price"], belowPrice)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user