Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: monkey0506 on Sat 02/04/2011 07:44:35

Title: Should the main AGS Editor window be exposed to the plugin API?
Post by: monkey0506 on Sat 02/04/2011 07:44:35
I'm writing a plugin for the editor that needs to use some forms, but I don't want them to show up in the taskbar as separate windows, and would prefer them to remain within the main AGS window.

Since the editor plugin API doesn't presently expose the main editor form, I'm resorting to doing this in the component's constructor:

           using (ContentDocument pane = new ContentDocument(new EditorContentPanel(), null, this))
           {
               _editor.GUIController.AddOrShowPane(pane);
               _mainForm = pane.TopLevelControl;
               _editor.GUIController.RemovePaneIfExists(pane);
           }


This is working for me, but it's not exactly optimal really.

So this has got me wondering..would exposing the main editor form to the plugin API be worthwhile? I took a brief look, and from what I can tell, the editor code itself only publicly exposes it as the IntPtr handle.

Really, even just a method for adding a form as a child control would work for my needs, but that's why I'm creating this thread (to ask what people think the best route might be for something like this (or indeed whether it would even be considered worth adding to the plugin API)).

Edit: If anyone saw the code before..suffice it to say I'm not well versed in C#. :P
Title: Re: Should the main AGS Editor window be exposed to the plugin API?
Post by: Pumaman on Sun 03/04/2011 19:01:51
Does Form.ActiveForm not work for this?
Title: Re: Should the main AGS Editor window be exposed to the plugin API?
Post by: monkey0506 on Mon 04/04/2011 02:51:23
Oh, well, yes, now that you've pointed that out. ::)

As denoted in my edit, I'm not well versed in C#, so..nevermind then.