Game authors and players, please read this thread!

Author Topic: New editor version for testing  (Read 4053 times)  Share 

Re: New editor version for testing
« Reply #40 on: 21 Jul 2012, 09:34 »

I encountered a problem when closing a plugin window and trying to reopen it.
Fixed.
There's still one odd problem. If I use the filter in my plugin and I close and reopen the window, the filter appears as if it's there, but the grid displays all the lines. This is not what's happening in previous AGS. I couldn't find an obvious place in my code where I'll do that behavior, but obviously there is some kind of event chain that will. Are you sending any events when reopening and what is the difference here and with AGS 3.2.1?

Some Windows: output, find results and call stack have an 'x' to close that pane info (was there before the change), but the docking window already has this, so I don't think it's needed, the whole gray band can be removed and provide more screen real-estate
Removed the extra header. For some reason when you start it, there's still an empty line there, but once you dock it out and in again it goes away.
I have no idea why, might be a bug in the docking suite.
Sounds like a resize problem, did you try to anchor the inner control instead of docking?

Scripts - It's a good idea to group the script and header. I think it's better to have the script open when double clicking the parent (and then not expand when double clicking). In the majority of the cases developers would like to edit the script and could expand to edit the header now there's an extra step to reach it.
I didn't find a simple way to do this. I could open up the editor but not avoid the expand. The problem is that the OnBeforeExpand event is triggered before the double click event and doesn't have a distinction between an expand caused by a double click and a regualr expand. So it's either going with windows messages (and I don't want to go there due to Mono compatability issues) or using timing calculations, or detecting the click location and deducting if the + was clicked or not, all of those are messy hacks and I didn't think the feature was important enough to justify it.
I hear you, very annoying GUI stuff. I just think you'll need to at least open the script on double click even if you do expand. Maybe it's best if you get game developers to review this, I think they won't like the extra step required to reach the script.

tzachs

  • Mittens Serf
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
  • tzachs worked on a game that was nominated for an AGS Award!
Re: New editor version for testing
« Reply #41 on: 21 Jul 2012, 14:10 »
New version in first post.

There's something I wanted to have for a long time (unless already implemented): a keyboard shortcut to switch between script header and source. Is there one? If not may that be added?
Done. Use Ctrl+M to switch ('M' for Matching script or header).
This will be the last feature I'm gonna implement for this version that's not directly related to something I did. I want to just concentrate on fixing bugs from now on.

tzachs:  I have been experimenting with docking to see two files side by side (.asc and .ash for example).  It's really nice to be able to do that but I can only get one file in the second editor pane.  Would you consider adding a feature to your version that would allow two multi-tab editor panes.  That would be a great feature to have, IMHO.
This feature is already there!
Every pane can behave as a multi-tab pane if you drag more than one document to the middle of it.
The only difference is that the tabs are in the bottom and not on top.
See this image as a proof:


There's still one odd problem. If I use the filter in my plugin and I close and reopen the window, the filter appears as if it's there, but the grid displays all the lines. This is not what's happening in previous AGS. I couldn't find an obvious place in my code where I'll do that behavior, but obviously there is some kind of event chain that will. Are you sending any events when reopening and what is the difference here and with AGS 3.2.1?
Hmmm, it's very hard to tell. There's a Refresh called on the form that happens when you show it that I think wasn't there before, but I tried to remove it and it didn't seem to solve the issue.
Also, I don't call Show on the form, but on the DockContent which is implemented in the Docking Suite, I don't know how it works there.
When closing I just hide the form, which as far as I know is how it worked in previous versions...

Sounds like a resize problem, did you try to anchor the inner control instead of docking?
I didn't try cause I figured out the problem, it was docked as Bottom and not as Fill. It's now fixed.

I hear you, very annoying GUI stuff. I just think you'll need to at least open the script on double click even if you do expand. Maybe it's best if you get game developers to review this, I think they won't like the extra step required to reach the script.
Ok, feature added, the new version opens the script on double click while still expanding it.
And btw, I believe most of the people reading these threads are game developers..

Re: New editor version for testing
« Reply #42 on: 21 Jul 2012, 15:29 »
Nice job tzachs. I can't wait to see all of this merged on the repository.

- Alan

Re: New editor version for testing
« Reply #43 on: 21 Jul 2012, 16:02 »
There's still one odd problem. If I use the filter in my plugin and I close and reopen the window, the filter appears as if it's there, but the grid displays all the lines. This is not what's happening in previous AGS. I couldn't find an obvious place in my code where I'll do that behavior, but obviously there is some kind of event chain that will. Are you sending any events when reopening and what is the difference here and with AGS 3.2.1?
Hmmm, it's very hard to tell. There's a Refresh called on the form that happens when you show it that I think wasn't there before, but I tried to remove it and it didn't seem to solve the issue.
Also, I don't call Show on the form, but on the DockContent which is implemented in the Docking Suite, I don't know how it works there.
When closing I just hide the form, which as far as I know is how it worked in previous versions...
Ok I checked this further, the UserControl Load event seems to be called, obviously I can add a flag to protect this case, but this event should be called only once so I'm worried that the fact that this event is called again will have other negative effects.

My guess is that somehow the control is closed or moved to a closed state, causing another load when displayed. However, the inner controls instances seem to be the same, so they are not completely destroyed, maybe the window handle is recreated or maybe just the event is called, not sure.

EDIT: According to MSDN this event can be called again when it's an MDI child or when someone calls RecreateHandle. So I'm guessing it's probably a call to RecreateHandle. It would be best if you can verify this is the cause, meanwhile, I'll add a boolean in my code.
« Last Edit: 21 Jul 2012, 16:13 by SpeechCenter »

Re: New editor version for testing
« Reply #44 on: 22 Jul 2012, 15:07 »
Anytime I try to change the properties of a room (like the edges or the scaling level of a walkable area or whatever), I get an error like this:

Code: Adventure Game Studio
  1. Error: Object reference not set to an instance of an object.
  2. Version: AGS 3.2.2.112
  3.  
  4. System.NullReferenceException: Object reference not set to an instance of an object.
  5.    at AGS.Editor.RoomSettingsEditor.HandleKeyPress(Keys keyData)
  6.    at AGS.Types.EditorContentPanel.KeyPressed(Keys keyData) in D:\Tools\AGS\ags\branches\dev\3.2.2\Editor\AGS.Types\EditorFeatures\EditorContentPanel.cs:line 48
  7.    at AGS.Editor.TabbedDocumentManager.ProcessKeyDown(Keys key)
  8.    at AGS.Editor.frmMain.frmMain_KeyDown(Object sender, KeyEventArgs e)
  9.    at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
  10.    at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
  11.    at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
  12.    at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
  13.    at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
  14.    at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
  15.    at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
  16.    at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
  17.    at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
  18.    at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
  19.    at System.Windows.Forms.Control.WmKeyChar(Message& m)
  20.    at System.Windows.Forms.Control.WndProc(Message& m)
  21.    at System.Windows.Forms.PropertyGridInternal.PropertyGridView.WndProc(Message& m)
  22.    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  23.    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  24.    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

This is in a new game (any template), I don't have any other games to test on right now.

EDIT: BTW, the file path shown in the error message does not exist on my computer.
« Last Edit: 22 Jul 2012, 15:15 by doomantia »

tzachs

  • Mittens Serf
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
  • tzachs worked on a game that was nominated for an AGS Award!
Re: New editor version for testing
« Reply #45 on: 22 Jul 2012, 19:15 »
New version in the first post with a fix to the crash described by doomantia.

Ok I checked this further, the UserControl Load event seems to be called, obviously I can add a flag to protect this case, but this event should be called only once so I'm worried that the fact that this event is called again will have other negative effects.

My guess is that somehow the control is closed or moved to a closed state, causing another load when displayed. However, the inner controls instances seem to be the same, so they are not completely destroyed, maybe the window handle is recreated or maybe just the event is called, not sure.

EDIT: According to MSDN this event can be called again when it's an MDI child or when someone calls RecreateHandle. So I'm guessing it's probably a call to RecreateHandle. It would be best if you can verify this is the cause, meanwhile, I'll add a boolean in my code.
Well, the stack trace shows it's coming from external code, so it's either the docking sute or dot net.
However, all docking panels are in fact MDI children, so that goes hand in hand with MSDN.

Re: New editor version for testing
« Reply #46 on: 20 Sep 2012, 11:02 »
In my latest implementation I started to using IScriptEditorControl to display the current script. This works fine in 3.2.1
I tested the plugin with the 3.2.2 branch and it seems once you move the pane out, the script edit control loses all the syntax highlighting. I checked this and it appears that when the handle is recreated the Scintilla control gets WM_DESTROY which causes all the settings to be lost.

In the editor there's a hack that calls ReInitializeScriptEditor so essentially it just recreates all the data. In the plugin interface it's much more difficult since here is no option to re-initialize everything. I tried looking for a solution, but it would be much more hacky than the editor solution and hardly maintainable. So IScriptEditorControl is basically broken.

Finally, I tried to see if anyone handled this in ScintillaNet and my first search brought this https://scintillanet.codeplex.com/workitem/11811

So if I compare the code it seems AGS uses a very old version of ScintillaNet, probably before they fixed this bug. It's possible we won't need the hack in the editor if there is a newer implementation. Unfortunately we don't use the ScintillaNet dll, but rather embed their code in AGS.Controls and beyond that they seemed to change the interface so it's not backwards compatible.

If this is not solved in the editor the real solution in the plugin would be to ignore the editor interface and just use a new version of ScintillaNet directly, but I think it's better the editor would migrate to the latest version since it would solve more problems.

Incidentally, their accompanying app references the same docking window suite you used, so it probably means there's support for that.

tzachs

  • Mittens Serf
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
  • tzachs worked on a game that was nominated for an AGS Award!
Re: New editor version for testing
« Reply #47 on: 22 Sep 2012, 12:55 »
Nothing would please me more than removing those ugly hack(s) that were made in the script editor to workaround the WM_DESTROY issue.
However moving to the new scintilla version sounds like a lot of work.

Note that it's not just an old scintilla version embedded in the code, it's an old modified version.
I wouldn't be surprised if those modifications will no longer be needed with the new version, but it would have to be handled very delicately.

Re: New editor version for testing
« Reply #48 on: 22 Sep 2012, 18:53 »
Yes, only it's not simple to compare the source to view what was changed in AGS since I'm not sure we know the version that was taken (and it's possible Scintilla skipped some tags).

Anyway, I agree with you it's not trivial, but on the other hand it's also quite isolated from most of the code.

If it seems not feasible by the time of the release we could consider adding to the interface an init function. it would mean a code change for anyone using the interface, but at least it would be relatively simple. Still, it's better if someone had the time to upgrade this component.

Re: New editor version for testing
« Reply #49 on: 05 Mar 2013, 17:04 »
Why was custom resolutions not included? 
What if your blessings come through raindrops
What if your healing comes through tears...

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: New editor version for testing
« Reply #51 on: 02 Apr 2013, 22:23 »
I don't know if anyone tested this before, I installed the latest editor version to C:\Program Files, and I am getting this error every time on exit, because Editor tries to write Layout.xml:

Quote
Error: Отказано в доступе по пути "C:\Program Files (x86)\Adventure Game Studio 3.3.0-b\Layout.xml".
Version: AGS 3.3.0.1130

System.UnauthorizedAccessException: Отказано в доступе по пути "C:\Program Files (x86)\Adventure Game Studio 3.3.0-b\Layout.xml".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   в System.IO.FileStream..ctor(String path, FileMode mode)
   в WeifenLuo.WinFormsUI.Docking.DockPanel. Persistor.SaveAsXml(DockPanel dockPanel, String fileName, Encoding encoding)
   в WeifenLuo.WinFormsUI.Docking.DockPanel. SaveAsXml(String fileName)
   в AGS.Editor.WindowsLayoutManager.SaveLay out()
   в AGS.Editor.frmMain.frmMain_FormClosing(Object sender, FormClosingEventArgs e)
   в System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   в System.Windows.Forms.Form.RaiseFormClos ingOnAppExit()
   в System.Windows.Forms.Application.ExitIn ternal()
   в System.Windows.Forms.Application.Exit(CancelEventArgs e)
   в System.Windows.Forms.Application.Exit()
   в AGS.Editor.GUIController.ShowWelcomeScr een()
   в AGS.Editor.frmMain.frmMain_Shown(Object sender, EventArgs e)
   в System.Windows.Forms.Form.OnShown(EventArgs e)
   в System.Windows.Forms.Form.CallShownEven t()
   в System.Windows.Forms.Control.InvokeMars haledCallbackDo(ThreadMethodEntry tme)
   в System.Windows.Forms.Control.InvokeMars haledCallbackHelper(Object obj)
   в System.Threading.ExecutionContext.runTr yCode(Object userData)
   в System.Runtime.CompilerServices.Runtime Helpers.ExecuteCodeWithGuaranteedCleanu p(TryCode code, CleanupCode backoutCode, Object userData)
   в System.Threading.ExecutionContext.RunIn ternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Windows.Forms.Control.InvokeMars haledCallback(ThreadMethodEntry tme)
   в System.Windows.Forms.Control.InvokeMars haledCallbacks()

It only works well if I run it with administrative rights (or install on other disk).

The worse thing is that this error completely prevents user from closing application. I was able to do so only with the use of Task manager.

tzachs

  • Mittens Serf
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
  • tzachs worked on a game that was nominated for an AGS Award!
Re: New editor version for testing
« Reply #52 on: 03 Apr 2013, 12:25 »
Thanks, fixed this in Git.
Saving the layout file to the app data folder (as described by Microsoft's best practices) instead of the executable folder, so it should work now...

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: New editor version for testing
« Reply #53 on: 03 Apr 2013, 13:09 »
Thanks, fixed this in Git.
Umm... have you pushed it to remote repository?

Re: New editor version for testing
« Reply #54 on: 03 Apr 2013, 18:51 »
Have you also looked at the exception causing the editor to be unresponsive?
I'm asking because this is what I also had the same behavior when I saw the AGS.Native error, but since it happened in start time I assumed it was related. It may be a regression, not sure.

tzachs

  • Mittens Serf
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
  • tzachs worked on a game that was nominated for an AGS Award!
Re: New editor version for testing
« Reply #55 on: 04 Apr 2013, 07:33 »
@Crimson Wizard: Yes..
@SpeechCenter: What exception?

Re: New editor version for testing
« Reply #56 on: 04 Apr 2013, 08:57 »
The worse thing is that this error completely prevents user from closing application. I was able to do so only with the use of Task manager.
I'm referring to this text, perhaps there's a need to also fix the error handling if another error/exceptions ever occur so at least the user can close the application properly.

tzachs

  • Mittens Serf
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
  • tzachs worked on a game that was nominated for an AGS Award!
Re: New editor version for testing
« Reply #57 on: 04 Apr 2013, 18:41 »
I haven't looked at it.. Just made a fix to the critical issue so that CW could release the beta.

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: New editor version for testing
« Reply #58 on: 04 Apr 2013, 19:17 »
I haven't looked at it.. Just made a fix to the critical issue so that CW could release the beta.
Well, I did. Now its time to do patches :D.