-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoe.lua
More file actions
executable file
·43 lines (34 loc) · 723 Bytes
/
oe.lua
File metadata and controls
executable file
·43 lines (34 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
local Addon = select(2, ...)
local OE = {}
Addon.OE = OE
function OE.IsLoaded()
if OEMarketInfo then
return true
end
return false
end
function OE.GetItemValue(itemLink, priceSource)
if not OE.IsLoaded() then
return 0
end
local o = {}
OEMarketInfo(itemLink, o)
if priceSource == "OERealm" then
return o['market']
elseif priceSource == "OERegion" then
return o['region']
end
-- failsafe
return 0
end
function OE.GetAvailablePriceSources()
if not OE.IsLoaded() then
return
end
local ps = {}
local keys = { "OERealm", "OERegion" }
for _, v in ipairs(keys) do
ps[v] = Addon.CONST.PRICE_SOURCE[v]
end
return ps
end