KazWolfe / XIVDeck

A Stream Deck plugin providing rich integration for Final Fantasy XIV!
GNU Affero General Public License v3.0
104 stars 4 forks source link

Send commands to Stream Deck? #48

Open gucciBane opened 7 months ago

gucciBane commented 7 months ago

Is it possible to send commands to the SD from FF? For instance, having a macro change the current Profile.

Very cool plugin, thanks!

KazWolfe commented 7 months ago

So, from a plugin perspective, this is possible. The communication link between the game and the Stream Deck is bidirectional already, which is how the Stream Deck knows what's on your hotbars and similar.

Profile switching specifically is somewhat more annoying, because Elgato's switchToProfile API call is currently fairly restricted:

Note that a plugin can only switch to read-only profiles declared in its manifest.json file. If the profile field is missing or empty, the Stream Deck application will switch to the previously selected profile.

While a profile switch can happen, it'd need to be a profile I make and ship alongside the plugin, with no ability for users to customize it at present. In theory it would be possible to create a plugin-controlled profile, but this would require recreating the Stream Deck configuration interface in-game (which is already a daunting proposition) and would prevent use of non-XIVDeck actions (e.g. Discord mute buttons). I'm nagging Elgato to expand this API a bit, because it would be awesome to allow the Stream Deck to auto-switch to a profile specific to a certain raid (think markers) or a PVP profile (for quick chat).

If there are other things that you'd like the Stream Deck to be aware of though, please let me know and I'll see what I can do! I have some plans for a rewrite soon that will allow for cooldowns and other hotbar info to be displayed on the Deck, as well as potentially support for arbitrary Items.

gucciBane commented 7 months ago

Oh yeah, that sounds... troublesome. PvP was what I was thinking exactly. Fair enough. I just started using it, so will toss some other ideas out of I come upon anything.

Thanks for the thorough answer!