Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-15-21, 12:24 AM   #1
samueldcorbin
A Deviate Faerie Dragon
Join Date: Dec 2020
Posts: 14
Open Map From Slash Command

I am trying to open the world map to the zone with the player's current waypoint pinned to it.

If the map is already open, my slash command can set the zone just fine using WorldMapFrame:SetMapID(uiMapID).

If the map is closed and I'm out of combat, I can do OpenWorldMap(uiMapID), and it works fine.

If I'm in combat, however, OpenWorldMap doesn't work - it's protected. Right now, what I'm doing is waiting for PLAYER_REGEN_ENABLED to open the map, but my understanding is that it should be possible to call protected functions like this so long as the call originates from a hardware event, and entering and sending a slash command seems like a hardware event. So unless I misunderstand, it should be possible to have a slash command open the map window.

But I'm really having trouble understanding how precisely these secure handlers/templates work from the documentation I can find.

If it is possible, it would be really helpful if someone could give me a simple example of how to make a slash command open the map - that would both solve my problem and help me to understand how to deal with protected functions in general. Or, if I'm misunderstanding and it's not possible, I'm wondering if there's any other way to open the map from a non-secure environment during combat.

Last edited by samueldcorbin : 04-15-21 at 12:30 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Open Map From Slash Command

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off