1 QuestHelper_File
["collect_object.lua"] = "Development Version"
3 local debug_output
= false
4 if QuestHelper_File
["collect_object.lua"] == "Development Version" then debug_output
= true end
13 mine
= UNIT_SKINNABLE_ROCK
,
14 herb
= UNIT_SKINNABLE_HERB
,
17 local function Tooltipy(self
, ...)
18 -- objects are a bitch since they have no unique ID or any standard way to detect them (that I know of).
19 -- So we kind of guess at it.
20 if self
:GetAnchorType() == "ANCHOR_NONE" then
21 if self
:GetItem() or self
:GetUnit() or self
:GetSpell() then return end
26 local lines
= GameTooltip
:NumLines()
27 if lines
> 2 then -- not a normal world item
29 elseif lines
== 2 then -- see if we're mine or herb
30 for k
, v
in pairs(minetypes
) do
31 if _G
["GameTooltipTextLeft2"]:GetText() == v
then
35 if not skintype
then return end -- we are neither!
37 QuestHelper
: Assert(lines
== 1, string.format("Zorba knew there was going to be bug here, but couldn't figure out how to check it more throughly. Please report this, and if possible, say what you just moved the mouse over! Thanks!")) -- I just know this is going to break in stupid ways later on
40 local name
= _G
["GameTooltipTextLeft1"]:GetText()
42 if string.match(name
, Patterns
.CORPSE_TOOLTIP
) then return end -- no corpses plzkthx
44 if not QHCO
[name
] then QHCO
[name
] = {} end
45 local qhci
= QHCO
[name
]
47 for k
, _
in pairs(minetypes
) do
49 qhci
[k
.. "_yes"] = (qhci
[k
.. "_yes"] or 0) + 1
51 qhci
[k
.. "_no"] = (qhci
[k
.. "_no"] or 0) + 1
55 -- We have no unique identifier, so I'm just going to record every position we see. That said, I wonder if it's a good idea to add a cooldown.
56 -- Obviously, we also have no possible range data, so, welp.
57 Merger
.Add(qhci
, GetLoc())
61 function QH_Collect_Object_Init(QHCData
, API
)
62 if not QHCData
.object
then QHCData
.object
= {} end
65 API
.Registrar_TooltipHook(Tooltipy
)
67 Patterns
= API
.Patterns
68 QuestHelper
: Assert(Patterns
)
70 API
.Patterns_Register("CORPSE_TOOLTIP", "[^%s]+")
72 GetLoc
= API
.Callback_LocationBolusCurrent
73 QuestHelper
: Assert(GetLoc
)
75 Merger
= API
.Utility_Merger
76 QuestHelper
: Assert(Merger
)