Ability to create a macro that searches by target's name
KOVIKO opened this issue ยท 6 comments
I'd like to be able to set up a macro that:
- Opens the Questie Journey window
- Opens the Advanced Search tab
- Runs a "Search By Name" (or "Search By ID") for the targeted NPC
Is this currently possible? And, if not, could it be made possible?
Hey @KOVIKO ,
This sounds a lot like Classic Target Helper (https://www.curseforge.com/wow/addons/classic-target-helper) -- is this still relevant to Questie? If not, can we close it up?
Personally, here's my macro...
If I left click, it finds the mob. If I right click, it opens my macro interface so I can change the macro to look for a different mob. It's ghetto, but works OK. I just name the macro like "1A-FIND" and it's always in the first slot.
/tar [btn:1] MOBNAME
/stopmacro [btn:1]
/m
@Gogo1951 This is not about targeting a mob, but to add map markers for the current target. Currently you have to open the Journey and search it there. We are missing a short and easy function for that.
I think the best solution would be to add a command for it like:
/questie map <targetName/targetID>
So far, the only way I've found to do this requires access to several local variables in QuestieJourney.lua
:
-- Opens QuestieJourney to the "search" tab
function toggleSearch(container, handleToggle)
if container and tabGroup then
if handleToggle and (not QuestieJourney:IsShown() or lastOpenWindow == "search") then
QuestieJourney:toggleJourneyWindow()
end
if QuestieJourney:IsShown() and lastOpenWindow ~= "search" then
tabGroup:SelectTab("search")
end
end
return QuestieJourney:IsShown()
end
-- Opens the first result of a TreeGroup
function firstResult(treeGroup)
if treeGroup and treeGroup.tree and table.getn(treeGroup.tree) then
treeGroup:SelectByValue(treeGroup.tree[1].value)
end
end
-- Run a Search By Name
function QuestieJourney:Search(query, skipToggle)
if query and toggleSearch(containerCache, not skipToggle) then
if searchBox then
searchBox:SetText(query)
end
if searchGroup then
if searchBox then
searchBox:ClearFocus();
end
DrawSearchResultTab(searchGroup, 1, query);
if searchResultTabs then
searchResultTabs:SelectTab("npc");
if resultTree then
firstResult(resultTree)
end
end
end
end
end
This allows the use of the following macros:
# Without Questie Macro
/stopmacro [noexists]
/run QuestieJourney:Search(UnitName("target"))
# With Questie Macro
/questie journey
/stopmacro [noexists]
/run QuestieJourney:Search(UnitName("target"), true)
I'd like it if this or something similar was added to the code.
Also, I added a (very hacky) version that expands the results to the entire container:
-- Hook into toggleJourneyWindow to allow use of SearchFullscreen
local needsReset = nil
local _oldToggleJourneyWindow = QuestieJourney.toggleJourneyWindow
function QuestieJourney:toggleJourneyWindow()
local value = _oldToggleJourneyWindow()
-- Reset Questie to its normal view
if needsReset then
QuestieJourney:Initialize()
needsReset = nil
end
end
-- Run a Search By Name and fullscreen it within QuestieJourney
function QuestieJourney:SearchFullscreen(query, skipToggle)
local container = journeyFrame.frame;
if container and query then
if toggleSearch(container, not skipToggle) then
DrawSearchResultTab(container, 1, query);
needsReset = true
if searchResultTabs then
searchResultTabs:SelectTab("npc");
firstResult(resultTree)
end
end
end
end
Were something like this to be implemented, it'd probably be wiser to give it its own container. But for now, I'm satisfied with the results.
I realized that the Journey window is resizable, so I've abandoned the SearchFullscreen
function, entirely. lol
@KOVIKO With the next release you will be able to use /questie tomap [<npcID>/<npcName>/reset]
to add specific notes to the map.
If none of the three commands is given the current target will be added to the map.