-
Notifications
You must be signed in to change notification settings - Fork 7
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
Request for C_Map.GetBestAreaForUnit or Similar Functionality #660
Comments
Should it be a separate API or another return value in the existing API? Does an event exist to alert when one changes sub-zones? |
Should it be a separate API or an additional return value in the existing API?It depends on what you mean by a "separate API." If you're suggesting adding a completely new namespace (like If you're talking about adding new functions within the As for adding a new return value to Does an event exist to alert when one changes sub-zones?Yes, the "ZONE_CHANGED" event is already triggered when a player changes sub-zones. |
No, not a new namespace. I'm asking whether it's sufficient to change the existing API to return two values, the zone and sub-zone. This somewhat depends on whether clients will commonly need both (which saves a server round-trip by only requiring one call) or if looking up the sub-zone on the server is expensive and rarely needed. Existing callers can ignore the additional return value, so that shouldn't break existing client code. Or perhaps we could look at what clients typically need after a ZONE_CHANGED event and package all that info into a table to be returned in one new call, further reducing network traffic. |
Ah, got it. I can't speak much to the first part, as I’m not as familiar with the client-side handling, so I'll leave that to others who know it better. However, regarding the second part about the "ZONE_CHANGED" event, I think that's a solid idea. Including the areaID as an argument in the ZONE_CHANGED event (and perhaps also the parent uiMapID if needed) would be really useful. |
While the API provides a reliable method to retrieve the map ID for the current location using
C_Map.GetBestMapForUnit("player")
, there’s no equivalent method for retrieving the sub-zone ID. Sub-zone IDs do exist in the game's internal tables, as evidenced by resources like Wago.tools AreaTable, but there is no built-in function to get the current sub-zone ID in a straightforward way.For example, when a player moves from The Orecreg to Wanderer's Landing within the Isle of Dorn, developers are currently limited to using
GetSubZoneText()
to retrieve the sub-zone name, which is localized and not suitable for addons that aim for multi-language support or reliable sub-zone-specific logic.A method akin to
C_Map.GetBestMapForUnit("player")
but for sub-zones would greatly improve addon development. Something likeC_Map.GetBestAreaForUnit("player")
could return a unique, non-localized sub-zone ID that corresponds to the current sub-zone the player is in.The text was updated successfully, but these errors were encountered: