WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Open Map From Slash Command (https://www.wowinterface.com/forums/showthread.php?t=58694)

samueldcorbin 04-20-21 03:04 AM

Quote:

Originally Posted by Taudier (Post 338944)
I'm afraid there is no simple example


then you can create half dozen of buttons like the one I posted above
or thouhand if you have parameters
or use the btn option like : /click [btn:1] MAP

I might be misunderstanding without an example, but are you suggesting I rebind the chat-entry key, then rebind the entire keyboard and basically reimplement the WoW line editor via key-by-key functions to detect when the player has entered something like "/sam" (and optionally parameters)?

Again, having a button doesn't really work for this. The addon's UI isn't controlled by buttons, it includes a half dozen chat commands that share a configurable prefix, and it would be pretty awkward to create a single button and stick it somewhere on the screen just for this, or to make them do /click rather than the established, configurable command prefix, or to have them set a keybind just for this (this particular slash command also takes parameters for a related purpose, so that would be problematic from that perspective to).

It seems like the best solution is just to add it to a queue to open after combat, which is how I originally had it implemented anyway.

Taudier 04-20-21 03:08 AM

YES

because entering /sam is like pressing action 1, action 2 and action 3 then enter

samueldcorbin 04-20-21 03:14 AM

Quote:

Originally Posted by Taudier (Post 338946)
YES

because entering /sam is like pressing action 1, action 2 and action 3 then enter

For one, the command can take parameters, so that would be hugely more difficult.

For another, /sam is not actually like pressing "enter+/+s+a+m+enter" in a row because you can enter slash commands in all sorts of other ways. You can copy-paste a slash command into the box. You can write "/sab" and then realize you typed it wrong, hit backspace, and type "m". You'd have to re-implement the entire line editor, via key-by-key state transitions, to make it actually behave like a slash command, and I'm not sure it'd even be possible to handle things like copy-paste.

Taudier 04-20-21 03:48 AM

or you can rename your addon click :) It is the only secure text input as far I know, maybe /cast macro? also

samueldcorbin 04-20-21 03:58 AM

Quote:

Originally Posted by Taudier (Post 338948)
or you can rename your addon click :) It is the only secure text input as far I know, maybe /cast macro? also

Hah. I think I'm just going to stick with my original implementation that opens the map at the end of combat (or, if they open it early manually, sets the map and pre-empts the queued call).

I don't really understand why they make it difficult to open basic UI frames during combat lockdown, but that seems like the least bad option.

SDPhantom 04-20-21 04:17 AM

Most of the "protections" are to prevent people from writing "bot" addons. There are also some blocks they added to prevent people from running malicious code. Malicious code from an addon isn't capable of causing harm to your computer, but historically was capable of selling/destroying all of your items or manipulating mail and trading to give stuff to another player.

While ShowUIPanel() by itself seems innocuous, it has to deal with shuffling windows around and closing ones that don't "fit" on the screen. Many of them like the Spellbook are protected and as such, requires ShowUIPanel() to be run from secure code.

Seerah 04-20-21 12:56 PM

@Taudier

Dude. Settle.


All times are GMT -6. The time now is 05:39 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI