Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Passing custom waypoint to pfQuest arrow #225

Closed
ReynoldsCahoon opened this issue Jan 4, 2024 · 2 comments
Closed

[Feature Request] Passing custom waypoint to pfQuest arrow #225

ReynoldsCahoon opened this issue Jan 4, 2024 · 2 comments

Comments

@ReynoldsCahoon
Copy link

ReynoldsCahoon commented Jan 4, 2024

I'm using the addon TourGuideVanilla to create a custom leveling guide. TourGuideVanilla has the ability to pass 'notes' to the TomTom addon to point the tracking arrow to a destination, which can range from anything to a quest provider, a reminder to set a hearthstone location, a POI to loot a quest object to begin a quest, etc.

I'd like to be able to do this with pfQuest, as the navigation arrow is formatted better, and provides contextual cues during questing (like a loot bag indicator, and quest completion indicators) that TomTom doesn't provide. Is there a way to pass custom information to the arrow to provide a more seamless experience when using this in conjunction with a leveling guide?

As an example, if I complete a quest, TourGuideVanilla will detect that the quest is complete, and move on to the next step in the guide, which doesn't have to be another quest. It can be things like buy an item, set hearth, use hearth, grab a flight path, etc.

It would be nice if I could pass a Quest ID (for priority), an NPC ID, a set of coordinates, a custom icon, or other non-quest data to pfQuest's arrow tracker.

@ReynoldsCahoon
Copy link
Author

A relevant issue from TourGuideVanilla's github.

@shagu
Copy link
Owner

shagu commented Jan 4, 2024

First of all, unlike to TomTom, which only purpose is to be used by other addons,
the pfQuest arrow was designed only to fit the pfQuest internal goals.

Keep this in mind if working with it.
I support to provide a better API and making it accessible to other addons,
(as long as it will not require a rewrite) but in the current state, there's not much here.

However, I made 3 commits today, in order to quite get what you need:

  • make it possible to set your own description to the arrow: e0ba851

  • make it possible to set nodes with custom icons to the route/arrow: fa6d5dc

  • make it possible to receive a list of all cusotm nodes (in order to pin the arrow to it): 6ff70d5

So be sure to have the latest master-branch of pfQuest before continuing trying the examples below.

Creating a Custom Node / Arrow Target

To create your own custom node, you would need to define a table with all the informations and then pass it to pfMap:AddNode():

local meta = {
  -- internal identifier
  ["addon"] = "MyAddon",

  -- location data
  ["zone"] = 215,
  ["x"] = 50,
  ["y"] = 25,

  -- custom icon
  ["texture"] = "Interface\\AddOns\\pfQuest\\img\\icon_horde",

  -- title
  ["title"] = "Set your Hearthstone",

  -- the spawn we're looking for
  ["spawn"] = "Shagu",
  ["description"] = "Speak with Shagu to set your Hearthstone",

  -- in case we expect an item from it
  -- ["item"] = "Some Item",
  -- ["droprate"] = 29,

  -- if we want it as a cluster node
  ["cluster"] = true,

  -- if we want this on the arrow
  ["arrow"] = true,
}

-- add to the map/route
pfMap:AddNode(meta)

Deleting a Custom Node / Arrow Target

To remove a custom node:

-- delete a specific "MyAddon" node
pfMap:DeleteNode("MyAddon", "Set your Hearthstone")

Pin a Custom Node to the Route

To pin a node, the route module needs the map-pin object, which can be obtained via pfMap:GetNodes().
Then set the target to it, if it isn't yet. Because the SetTarget() function would toggle it otherwise.

-- retrieve all nodes with the title
local nodes = pfMap:GetNodes("MyAddon", "Set your Hearthstone")

-- pin the route to the first of the nodes
pfQuest.route.SetTarget((not pfQuest.route.IsTarget(nodes[1]) and nodes[1]))
pfMap.queue_update = GetTime()

Note: You can't pin directly after creating the waypoint, as the map-node is not generated directly.
To smoothen the FPS on node creation, it is slightly delayed across multiple frames. So you gotta wait a tiny bit before you can pin it

Screenshot

The custom node in the example would look like this:
image

@shagu shagu closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants