Quantcast
Open Map From Slash Command - Page 2 - WoWInterface
Thread Tools Display Modes
04-20-21, 03:04 AM   #21
samueldcorbin
A Deviate Faerie Dragon
Join Date: Dec 2020
Posts: 14
Originally Posted by Taudier View Post
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.

Last edited by samueldcorbin : 04-20-21 at 03:10 AM.
  Reply With Quote
04-20-21, 03:08 AM   #22
Taudier
A Cyclonian
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 44
YES

because entering /sam is like pressing action 1, action 2 and action 3 then enter
  Reply With Quote
04-20-21, 03:14 AM   #23
samueldcorbin
A Deviate Faerie Dragon
Join Date: Dec 2020
Posts: 14
Originally Posted by Taudier View Post
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.
  Reply With Quote
04-20-21, 03:48 AM   #24
Taudier
A Cyclonian
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 44
or you can rename your addon click It is the only secure text input as far I know, maybe /cast macro? also

Last edited by Taudier : 04-20-21 at 03:55 AM.
  Reply With Quote
04-20-21, 03:58 AM   #25
samueldcorbin
A Deviate Faerie Dragon
Join Date: Dec 2020
Posts: 14
Originally Posted by Taudier View Post
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.
  Reply With Quote
04-20-21, 04:17 AM   #26
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,026
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.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 04-20-21 at 04:20 AM.
  Reply With Quote
04-20-21, 12:56 PM   #27
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,831
@Taudier

Dude. Settle.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  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