Author Topic: Plugin show window  (Read 809 times)

Shenron

  • Newbie
  • *
  • Posts: 16
Plugin show window
« on: July 24, 2022, 09:06:02 AM »
Hi there,

My need is to display help triggered from a plugin command.
I'm playing Elite Dangerous and forked EliteVA plugin.
When docking is granted from a station, i would like to display where the landing pad is placed from station entrance.
Like in this map :
https://www.reddit.com/r/EliteDangerous/comments/f3uuii/starport_landing_pad_map/

Anyone even tried to display a UI from a plugin ?
Any trick or suggestion is welcome.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Plugin show window
« Reply #1 on: July 24, 2022, 02:43:59 PM »
The simplest method would likely be to either execute a command containing a "Run an Application" action, or do the equivalent from within the plugin (I.E. starting an external application), and displaying the image using an application that's already capable of doing so (E.G. a specialized image viewer, or a browser).


Third-party addons like those from HCS Voice Packs and VAICOM, and plugins from users, do display their own GUI directly, however that requires a good understanding of programming in .NET, and either WinForms or WPF.

Shenron

  • Newbie
  • *
  • Posts: 16
Re: Plugin show window
« Reply #2 on: August 12, 2022, 10:45:32 AM »
Hi,

Thank you Pfeil for your suggestion.
Finally made it working the way i wanted.

The most important thing is to run a Application instance in a STA thread.
The second point is to ensure to dispatch the UI interaction with the UI thread.

Anyone interested can check on my github, i pushed the commit here:
https://github.com/tbayart/EliteVA-legacy/commit/1eb7137762b43e0795da8b8d2e9316253d082fbb

Still work todo but the base idea is working