Adventure Game Studio | Forums

AGS Development => Editor Development => Topic started by: tzachs on Sun 08/07/2012 22:43:48

Title: New editor version for testing
Post by: tzachs on Sun 08/07/2012 22:43:48
Please backup your game before using this version!!!!!!!!


Download here! (http://shutupload.com/dl/01ef76316162/)

Edit: replaced with a new version that also fixes the bug described here (http://www.adventuregamestudio.co.uk/yabb/index.php?issue=311.0)

Edit 2: replaced with a newer version that fixes a bug and implements a few suggestions, both described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46378.msg623829#msg623829)

Edit 3: replaced with a newer version that fixes a crash when clicking "go to definition", described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46378.msg624048#msg624048)

Edit 4 (18/7/12): More fixes described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46378.msg624624#msg624624)!

Edit 5 (20/7/12): More fixes described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46378.msg624779#msg624779)!

Edit 6 (21/7/12): More fixes & improvements described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46378.msg624779#msg624779)!

Edit 7 (22/7/12): Fixed the crash described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=46378.msg624950#msg624950)!

Edit 8 (29/7/12): Committed the changes to the 3.2.2 branch.

Hi, I've added a few features for the editor.
Please test and/or provide feedback.
Once I see everything is well I'll commit to 3.2.2 development branch.

The features:

Folders:
Added folders for characrers, dialogs, inventory items, guis, rooms, scripts and views.
Added new menu items for all folders to move up/down,
and the ability to drag/drop files to be before other files.

For scripts:
- Script and header files are now combined into one and can be expanded/collapsed, similar to room settings & script.
- I removed the ability to move files up/down, this can now be done with normal drag/drop (and not only for scripts).
- Also removed the "exclude script" option, it made things a mess and I couldn't understand why it is needed.
If anybody knows, please tell me.
- The order of the scripts (for script dependencies) is the same as it was before, a script can use all the scripts
above it.

For rooms:
- The "Sort room by number" now sorts within folders. I actually don't understand why this feature is needed, if anyone
knows please tell me.


Find all usages:
Added a menu item to find all usages for characters, dialogs, views, inventory items and global variables.
It won't actually find scripts that use the character id (or dialog/view id), just scripts that use the actual
script name of that specific object.

(http://i.imgur.com/x0aLP.png)
An example of the folders and the "Find all usages" menu item

Navigate (in tree):
Added a menu item for almost all document tabs, to navigate to their node on the project tree
(can be useful for large projects).

(http://i.imgur.com/4kJX7.png)
An example of the "Navigate" feature.

Goto Line:
In script editor, pressing Ctrl+G will now open the "Goto line" dialog, you can select a line number and the
editor will jump to that line. Since "Ctrl+G" was already used as a shortcut to open the global script,
I replaced that shortcut with Ctrl+Shift+G (and also replaced the shortcut to open the global header
from Ctrl+H to Ctrl+Shift+H for consistency).

(http://i.imgur.com/fD5r5.png)
An example of the "Goto Line" feature

Mono:
I've refactored some code to make it more Mono-compatible, so that it could run properly when compiled with Mono
(cross platform implementation of .Net).
There's still a lot more work to be done (even without mentioning the native dll), but it's at least a step
in the right direction.

The changes I've done-
Title: Re: New editor version for testing
Post by: Ryan Timothy B on Sun 08/07/2012 23:32:55
Sounds like a lot of good contributions.

Speaking of the "Find all usages", would it be possible to use your code to also have a "Refactor > Rename" ability? Where it actually changes all instances in script of that old object name to the new name.
Title: Re: New editor version for testing
Post by: Crimson Wizard on Mon 09/07/2012 00:47:12
Looks really good.

Quote from: tzachs on Sun 08/07/2012 22:43:48
For rooms:
- The "Sort room by number" now sorts within folders. I actually don't understand why this feature is needed, if anyone
knows please tell me.
"Sort room by number" is useful if you added rooms with lower number after rooms with higher number. But with folders it will be obviously easier to group them. Actually I hope one day it will be possible to reference rooms by script name, rather than number.
Title: Re: New editor version for testing
Post by: Ryan Timothy B on Mon 09/07/2012 03:30:02
In all honesty everything should be accessible via script names. Completely eliminating the hard-coded numbering.
Title: Re: New editor version for testing
Post by: tzachs on Mon 09/07/2012 08:03:23
Quote from: Ryan Timothy on Sun 08/07/2012 23:32:55
Speaking of the "Find all usages", would it be possible to use your code to also have a "Refactor > Rename" ability? Where it actually changes all instances in script of that old object name to the new name.
Yes, this could be done. Feel free to add an issue to the new tracker (http://www.adventuregamestudio.co.uk/yabb/index.php?project=5)...
I'm a bit concerned though, since the current implementation of "Find All Usages" is not as sophisticated as it should be and might cause undesired behaviors in some edge cases, so we probably should add a preview window that shows all changes with a check box list so you'd be able to uncheck unwanted changes.

Quote from: Crimson Wizard on Mon 09/07/2012 00:47:12
"Sort room by number" is useful if you added rooms with lower number after rooms with higher number. But with folders it will be obviously easier to group them.
Ahh, thanks, I forgot about being able to create rooms with high numbers..
Title: Re: New editor version for testing
Post by: Snarky on Mon 09/07/2012 10:39:34
Quote from: tzachs on Sun 08/07/2012 22:43:48
- Also removed the "exclude script" option, it made things a mess and I couldn't understand why it is needed.
If anybody knows, please tell me.

Wow, excellent work Tzachs!

I haven't used the exclude script option much in current AGS, but I can see it being very useful if (as I hope) the editor moves away from importing all resources into the project file, and instead just stores them as pointers to individual files that are kept in folders in the file system, like in most IDEs. Then you might often want to exclude a file from the project while keeping it in the folder (for example something you're working on that isn't ready yet, or the source files for the graphics).
Title: Re: New editor version for testing
Post by: Calin Leafshade on Mon 09/07/2012 10:45:02
AGS has a cascading input catching system that is almost never used (dunno why, its awesome)

So, lets assume you have an android version of your game and a mouse based version.

You could have the android touch script higher in the list and when on_mouse_click() gets run you can catch the input (ClaimEvent()) and not let it progress down the scripts.

Now when you want to release your mouse version you can just exclude the android script from the project and the input will just pass through to the mouse script below.

Granted, the same behaviour can be handled with an if/else statement or a #define but why should it if you can keep the two pieces of code entirely separate.
Title: Re: New editor version for testing
Post by: tzachs on Mon 09/07/2012 18:17:44
Well, what both of you are saying would make sense if that feature was implemented in the same way it's implemented in visual studio, for example, where an excluded project is greyed out and not compiled, but you can always load it back in with a right click->reload...

But in AGS, the script is actually removed from the tree. As it is, I don't see it as useful at all, and if you really want it just copy the script file to a safe place and then delete the script, it's the same thing.
Maybe in the future we can implement it by greying it out and just not sending it to compile, shouldn't be too hard to do...

Hmmm, actually, I've just looked at the code again, and the feature was for rooms, not for scripts, which makes it even less useful, I think (unless someone will correct me).
Title: Re: New editor version for testing
Post by: Crimson Wizard on Mon 09/07/2012 19:01:36
Quote from: Calin Leafshade on Mon 09/07/2012 10:45:02
AGS has a cascading input catching system that is almost never used (dunno why, its awesome)
Hah! Something I never knew about. I usually used straight opposite way to handle mouse click: called something like MyScript::OnMouseClick from global script.
Title: Re: New editor version for testing
Post by: xenogia on Tue 10/07/2012 01:15:07
I'm glad your making it more MONO friendly.  This gives me hopes for a better linux build.
Title: Re: New editor version for testing
Post by: steptoe on Tue 10/07/2012 22:09:39
Hi

shame you never included a template.

Will put one in to try later.


8-)

Title: Re: New editor version for testing
Post by: Crimson Wizard on Tue 10/07/2012 22:16:07
Quote from: steptoe on Tue 10/07/2012 22:09:39
Hi

shame you never included a template.

Will put one in to try later.


8-)



By the way, is it possible to make "Empty Game" template built-in?
Title: Re: New editor version for testing
Post by: tzachs on Wed 11/07/2012 09:24:10
Yes, when we'll incorporate NAnt or some other build tool, we'll be able to control what goes where and can copy the template on a post build event.
This will also come in handy for doing automatic daily builds and neat stuff like that.

On another note, I've replaced the version on the first post with a new one that also fixes the bug described here (http://www.adventuregamestudio.co.uk/yabb/index.php?issue=311.0).
Title: Re: New editor version for testing
Post by: JJS on Wed 11/07/2012 09:46:24
I have a bug:

Create a folder in "Inventory items". Double-click on the empty folder. It will give you an error message:

Code (text) Select

Error: Die Eingabezeichenfolge hat das falsche Format.
Version: AGS 3.2.2.112

System.FormatException: Die Eingabezeichenfolge hat das falsche Format.
   bei System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   bei System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   bei System.Convert.ToInt32(String value)
   bei AGS.Editor.Components.InventoryComponent.ItemCommandClick(String controlID)
   bei AGS.Editor.Components.BaseComponentWithFolders`2.CommandClick(String controlID)
   bei AGS.Editor.ProjectTree.ProcessClickOnNode(String nodeID, MouseButtons button)
   bei AGS.Editor.ProjectTree.projectTree_NodeMouseDoubleClick(Object sender, TreeNodeMouseClickEventArgs e)
   bei System.Windows.Forms.TreeView.OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
   bei System.Windows.Forms.TreeView.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



Also a suggestion:

If you drag an item, I would expect the folder under the item to get highlighted if the item can be dropped there. Right now the first item that the mouse is dragged over gets highlighted and after that there is no feedback. It would be extra sweet if folders with subfolders would automatically expand when hovering over them while dragging so that the item can be dropped into a subfolder.
Title: Re: New editor version for testing
Post by: Shane 'ProgZmax' Stevens on Thu 12/07/2012 01:30:32
Quote
Added folders for characrers, dialogs, inventory items, guis, rooms, scripts and views.
Added new menu items for all folders to move up/down,
and the ability to drag/drop files to be before other files.

Well, that's pretty much all the editor improvements I had wanted to make but never got around to so thanks for that!
Title: Re: New editor version for testing
Post by: tzachs on Thu 12/07/2012 19:14:54
Thanks guys!

JJS, nice catch on the bug.
I updated the version on the first post with a fix.

I also implemented both your suggestions: hovered nodes during dragging will be highlighted with a light gray, and a folder will be expanded during a drag if you hover over it for more than 0.5 seconds.
Let me know if that's what you had in mind.
Title: Re: New editor version for testing
Post by: Crimson Wizard on Thu 12/07/2012 20:59:29
I have a question regarding "Windows" menu.

If I have several pages open, for example a number of "Fonts", and I choose a page in "Windows", the order of pages in the menu will be resorted so that the selected one is always the first. Is it how it is supposed to be?

EDIT: Also, perhaps you will be able to implement this: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=45623.msg624000#msg624000
Title: Re: New editor version for testing
Post by: Joseph DiPerla on Thu 12/07/2012 22:43:37
Nicely done Tzachs! Really like the changes you have done.
Title: Re: New editor version for testing
Post by: JJS on Fri 13/07/2012 07:32:38
Quote from: tzachs on Thu 12/07/2012 19:14:54Let me know if that's what you had in mind.
Nice! It works exactly as I had envisioned.

A couple more things:

When right-clicking a function/variable and selecting "Go to definition" I get this error message:

Code (text) Select
Error: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Version: AGS 3.2.2.112

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei AGS.Editor.ScriptEditor.GoToDefinition(String structName, String memberName)
   bei AGS.Editor.ScriptEditor.ContextMenuChooseOption(Object sender, EventArgs e)
   bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   bei System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
   bei System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



Also I must admit that I haven't worked with the Editor in a long time, but I found these things about the translation system a bit weird:
- When you don't rename the translation from "New translation" you don't get the prompt to initialize the translation file and it stays just empty. I found this pretty irritating as I didn't care what it was named and just wanted to quickly test it out.
- When double-clicking a translation file, there is a message box that tells you to open the file externally. I think it should either give the option to open the file directly with the standard text editor ("AGS cannot open this file directly. Do you want to display it in the standard text editor instead? YES/NO") or the file should be displayed as a text file in the AGS editor. This should be possible as there is already a text editor for the scripts.

Well, I should probably have created issues tracker entries about these as they are not really related to this version...
Title: Re: New editor version for testing
Post by: tzachs on Fri 13/07/2012 18:05:27
I put up a new version in the first post that fixes the crash when clicking on "go to definition", and also saw that using it on a global variable didn't do anything so I fixed that too (it will now open the global variables pane and select the variable).
I didn't implement any of the other suggested features, sorry guys!

Quote from: Crimson Wizard on Thu 12/07/2012 20:59:29
I have a question regarding "Windows" menu.

If I have several pages open, for example a number of "Fonts", and I choose a page in "Windows", the order of pages in the menu will be resorted so that the selected one is always the first. Is it how it is supposed to be?
That's a rather philosophical question, isn't it?  ;)
Actually, I didn't even think about it when I implemented it, it was definitely not intentional, I just implemented it in the easiest way I could think of...
But now that you mentioned it, I took a look at Visual Studio 2008 to see how it's implemented there, and it's exactly the same!
So I'll claim it's a feature, and unless it really bothers people, I see no reason to change it.
Title: Re: New editor version for testing
Post by: RickJ on Sat 14/07/2012 20:50:07
tzachs: found a couple of apparent bugs ..

1. No default templates n your distribution so can't create a new game.  Perhaps at least provide a blank template.

2. Loading a game from a previous AGS version (3.2.0), editor doesn't detect, inform, or perform upgrade. 

3. When  testing the game from the editor, in a windowed mode, the screen flashes black (more than once) before going back to normal and running the game.

4. Running the compiled version (i.e. the exe) gives an error complaining about font-0.
   (Isn't there anything anyone can do about not being able to clip the error messages out of the message box?)
Title: Re: New editor version for testing
Post by: tzachs on Sat 14/07/2012 21:26:10
Quote from: RickJ on Sat 14/07/2012 20:50:07
2. Loading a game from a previous AGS version (3.2.0), editor doesn't detect, inform, or perform upgrade. 
I'll add an information message when loading the game.

Quote from: RickJ on Sat 14/07/2012 20:50:07
3. When  testing the game from the editor, in a windowed mode, the screen flashes black (more than once) before going back to normal and running the game.
Hmm, that doesn't happen to me, I can't think of anything that I've done that can cause that.
Maybe it's related to #4.

Quote from: RickJ on Sat 14/07/2012 20:50:07
4. Running the compiled version (i.e. the exe) gives an error complaining about font-0.
   (Isn't there anything anyone can do about not being able to clip the error messages out of the message box?)
Also doesn't happen to me, can you provide a screenshot with the error message?
Title: Re: New editor version for testing
Post by: Crimson Wizard on Sat 14/07/2012 21:30:41
Quote from: RickJ on Sat 14/07/2012 20:50:07
(Isn't there anything anyone can do about not being able to clip the error messages out of the message box?)
You actually can do that, just press Ctrl+C when the error window has focus.
Unless there's some error with error window ;)
Title: Re: New editor version for testing
Post by: RickJ on Sat 14/07/2012 22:07:14
Quote from: tzachs on Sat 14/07/2012 21:26:10
Quote from: RickJ on Sat 14/07/2012 20:50:07
3. When  testing the game from the editor, in a windowed mode, the screen flashes black (more than once) before going back to normal and running the game.
Hmm, that doesn't happen to me, I can't think of anything that I've done that can cause that.
Maybe it's related to #4.
I just checked, it also happens using AGS3.2.1.  I didn't remember this happening before either.  But I am running on Win7-Dell-x64 now?  Any ideas?

Quote from: tzachs on Sat 14/07/2012 21:26:10
Quote from: RickJ on Sat 14/07/2012 20:50:07
4. Running the compiled version (i.e. the exe) gives an error complaining about font-0.
   (Isn't there anything anyone can do about not being able to clip the error messages out of the message box?)
Also doesn't happen to me, can you provide a screenshot with the error message?
Turns out I copied the exe out of the _Debug folder to the compiled folder to get this error.  If I turnoff debug mode and rebuild AGS puts the proper exe in the compiled folder and it works as it should.  Sorry for the false alarm.
Title: Re: New editor version for testing
Post by: Crimson Wizard on Sat 14/07/2012 22:24:40
Does that flickering happen when you use DirectDraw5 renderer or Direct3D 9? I had certain troubles with DD5 on Windows 7, including graphic corruption in some games.
Title: Re: New editor version for testing
Post by: RickJ on Sat 14/07/2012 22:42:41
@CW:  That was it!  Changed from DD5 to D3D9 and all works perfectly now.  Thank you so much...
Title: Re: New editor version for testing
Post by: RickJ on Mon 16/07/2012 01:44:51
Found a couple of things you may want to look at.  They are probably not due to your changes but anyway  ...

1.  Add object to a room.  Double click blue cup to get sprite dialog.  Use sprite dialog to add a sprite folder (yeah I know WTF do that?). Folder gets added but now go to Sprite manager it's not there.  Go back to the add sprite dialog and it is there. 

2.  Add a room and then delete it.  Add another room and sometimes get a crash; other times get message "room4.crm already exists, overwrite?", click yes and all is well     
Title: Re: New editor version for testing
Post by: tzachs on Mon 16/07/2012 19:44:11
Quote from: RickJ on Mon 16/07/2012 01:44:51
2.  Add a room and then delete it.  Add another room and sometimes get a crash; other times get message "room4.crm already exists, overwrite?", click yes and all is well     
It is probably due to something I did, but I can't reproduce it.
I suspect that the "room already exists" message is because the crash you had before happened before AGS deleted the file, so if you can provide a screenshot of the crash error message (or more details on the crash), it would be appreciated.

I fixed the other bug, will release a new version once we figure out this bug..
Title: Re: New editor version for testing
Post by: Crimson Wizard on Mon 16/07/2012 21:05:30
I somehow made the Project Explorer disappear and never appear again.
When I opened the Editor it said something about corrupted tree in the XML document. Unfortunately I did not save the message because I thought was related to game project, and that project was saved by different version of editor (the one that I compiled). Minutes later I realized that something is not right, but it was too late.
Anyway, when I opened the editor next time, it worked normally except one thing - there was no Project Explorer and it won't display even though it was enabled in Windows menu (I tried unchecking/rechecking menu item and restarting editor several times).
Guided rather by intuition I deleted the Layout.xml and editor returned to default. :/


//-------------------------------
EDIT:
Regarding RickJ's bug report. I could reproduce that:
1. Create a new room.
2. IMPORTANT: open new room's script.
3. Do not edit anything. Close room's script.
4. Delete room.
5. Create room with the same number again. Editor will say:
Quote
The file 'room3.asc' has been modified externally. Do you want to reload it?
Say "Yes".
6. Crash:

Quote
Error: Ð"осÑ,уп к ликвидированному объекÑ,у невозможен.
Имя объекÑ,а: "ScintillaControl".
Version: AGS 3.2.2.112

System.ObjectDisposedException: Ð"осÑ,уп к ликвидированному объекÑ,у невозможен.
Имя объекÑ,а: "ScintillaControl".
   Ð² System.Windows.Forms.Control.CreateHandle()
   Ð² System.Windows.Forms.Control.get_Handle()
   Ð² Scintilla.ScintillaControl.SendMessageDirect(UInt32 msg, IntPtr wParam, IntPtr lParam)
   Ð² Scintilla.ScintillaControl.SendMessageDirect(UInt32 msg)
   Ð² Scintilla.ScintillaControl.get_IsReadOnly()
   Ð² AGS.Editor.ScintillaWrapper.SetText(String newText, Boolean clearModified)
   Ð² AGS.Editor.ScintillaWrapper.SetText(String newText)
   Ð² AGS.Editor.ScriptEditor.PromptUserThatFileHasChangedExternally()
   Ð² AGS.Editor.ScriptEditor.Events_FileChangedInGameFolder(String fileName)
   Ð² AGS.Editor.EditorEvents.FileChangedInGameFolderHandler.Invoke(String fileName)
   Ð² AGS.Editor.EditorEvents.OnFileChangedInGameFolder(String fileName)
   Ð² AGS.Editor.AGSEditor._fileWatcher_Changed(Object sender, FileSystemEventArgs e)
   Ð² System.IO.FileSystemWatcher.OnChanged(FileSystemEventArgs e)
   Ð² System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32 action, String name)
   Ð² System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
   Ð² System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

(Sorry for cyrillics, but I am not going to translate that ;))
Title: Re: New editor version for testing
Post by: SpeechCenter on Mon 16/07/2012 21:31:15
Great additions!

However, I tried loading my plugin with it and it doesn't work so your changes break backwards compatibility.

Certainly part of the problem is changing EditorContentPanel base class, it's now not UserControl and obviously plugins depend on it (since they also implement panels that derive from it). Some of the base methods don't exist now and this will require some code changes to keep the plugins compatible (I know my plugin will).

Are there any other changes that break backwards compatibility? While it's fixable, the main problem this will create is the requirement to maintain a different version of the plugins for different AGS versions. It may make sense in a major release (version 4), but not when we talk about 3.2.1 vs. 3.2.2.
So I think it's important to make sure only new methods are added and not change plugin exposed base classes or existing available methods.

Besides the technical difficulty this creates, why do we really need the document windows to be dockable? I understand why the other Windows should be, but why all the ones showing content? Note that if the goal is to mimic VS then the content Windows do not dock the same way as the other Windows. So if we really think it's needed, I'd go the same direction Microsoft did.

Title: Re: New editor version for testing
Post by: SpeechCenter on Tue 17/07/2012 18:15:38
I ran ApiChange (https://apichange.codeplex.com/) on AGS.Types.dll and these are the problems I see:
Changes that will definitely break backwards compatibility

Changes that may break backwards compatibility

So in short, I think the first 2 items are definitely a priority to fix before merging and the rest should be tested
Here are the full results of the run.
QuoteAGS.Types.dll has 76 changes
   Removed 2 public type/s
      - public class AGS.Types.BaseListSelectTypeConverter<T>
      - public class AGS.Types.RoomList
   Added 11 public type/s
      + public class AGS.Types.BaseListSelectTypeConverter
      + public class AGS.Types.DialogFolder
      + public class AGS.Types.CharacterFolder
      + public interface AGS.Types.ISourceControlProvider
      + public class AGS.Types.UnloadedRoomFolder
      + public class AGS.Types.GUIFolder
      + public class AGS.Types.ScriptFolder
      + public class AGS.Types.InventoryItemFolder
      + public class AGS.Types.DockData
      + public class AGS.Types.ScriptAndHeader
      + public interface AGS.Types.IGlobalVariablesController
   public class AGS.Types.UnloadedRoom
      + interface: AGS.Types.IToXml
      + interface: System.IComparable
      + public virtual void ToXml(XmlTextWriter writer)
      + public virtual int CompareTo(Object other)
      - public void ToXml(XmlTextWriter writer)
   public class AGS.Types.FontTypeConverter
      Base type changed: AGS.Types.BaseListSelectTypeConverter`1<AGS.Types.Font> -> AGS.Types.BaseListSelectTypeConverter
   public class AGS.Types.BaseFolderCollection<T,U>
      + protected List<TFolder> _subFolders
      + protected List<TFolderItem> _items
      - protected List<U> _subFolders
      - protected List<T> _items
      + public TFolder CreateChildFolder(String name)
      + public virtual IList<TFolder> get_SubFolders()
      + public IList<TFolderItem> get_Items()
      + public IEnumerable<TFolderItem> get_AllItemsFlat()
      + public void Clear()
      + public bool MoveFolderUp(TFolder folder)
      + public bool MoveFolderDown(TFolder folder)
      + public int GetAllItemsCount()
      + public void Sort(Boolean recursive)
      + public void RunActionOnAllFolderItems(Action<TFolderItem> action)
      + public void .ctor(XmlNode node,XmlNode parentNodeForBackwardsCompatability)
      + protected TFolder CreateFolder(XmlNode node)
      + protected TFolderItem CreateItem(XmlNode node)
      + protected virtual string get_RootNodeName()
      + protected virtual void FromXmlBackwardsCompatability(XmlNode parentNodeForBackwardsCompatability)
      + protected void Init(String name)
      + protected TFolderItem FindItem(EqualsDelegate<TFolderItem,TFolder,TId> isItem,TId id,Boolean recursive)
      - public virtual IList<U> get_SubFolders()
      - public IList<T> get_Items()
      - protected U CreateFolder(XmlNode node)
      - protected T CreateItem(XmlNode node)
   public class AGS.Types.ViewFolder
      + public virtual AGS.Types.ViewFolder CreateChildFolder(String name)
   public class AGS.Types.EditorContentPanel
      Base type changed: System.Windows.Forms.UserControl -> WeifenLuo.WinFormsUI.Docking.DockContent
      + protected virtual void OnClosing(CancelEventArgs e)
   public class AGS.Types.AudioClipTypeConverter
      Base type changed: AGS.Types.BaseListSelectTypeConverter`1<AGS.Types.AudioClip> -> AGS.Types.BaseListSelectTypeConverter
   public interface AGS.Types.IAGSEditor
      + public void set_SourceControlProvider(ISourceControlProvider value)
   public class AGS.Types.Character
      + interface: AGS.Types.IToXml
      + public virtual void ToXml(XmlTextWriter writer)
      - public void ToXml(XmlTextWriter writer)
   public class AGS.Types.GUI
      + interface: AGS.Types.IToXml
   public class AGS.Types.AudioClipTypeTypeConverter
      Base type changed: AGS.Types.BaseListSelectTypeConverter`1<AGS.Types.AudioClipType> -> AGS.Types.BaseListSelectTypeConverter
   public class AGS.Types.Script
      + interface: AGS.Types.IToXml
      + public virtual void ToXml(XmlTextWriter writer)
      - public void ToXml(XmlTextWriter writer)
   public class AGS.Types.InventoryItem
      + interface: AGS.Types.IToXml
      + public virtual void ToXml(XmlTextWriter writer)
      - public void ToXml(XmlTextWriter writer)
   public class AGS.Types.RoomListTypeConverter
      Base type changed: AGS.Types.BaseListSelectTypeConverter`1<AGS.Types.Font> -> AGS.Types.BaseListSelectTypeConverter
   public class AGS.Types.ContentDocument
      + public AGS.Types.DockData get_PreferredDockData()
      + public void set_PreferredDockData(DockData value)
      + public string get_TreeNodeID()
      + public void set_TreeNodeID(String value)
      + public string get_IconKey()
      + public void set_IconKey(String value)
      + public void .ctor(EditorContentPanel control,String name,IEditorComponent owner,String iconKey)
      + public void .ctor(EditorContentPanel control,String name,IEditorComponent owner,String iconKey,Dictionary<string,object> propertyGridObjectList)
      - public void .ctor(EditorContentPanel control,String name,IEditorComponent owner)
      - public void .ctor(EditorContentPanel control,String name,IEditorComponent owner,Dictionary<string,object> propertyGridObjectList)
   public class AGS.Types.Dialog
      + interface: AGS.Types.IToXml
      + public virtual void ToXml(XmlTextWriter writer)
      - public void ToXml(XmlTextWriter writer)
   public class AGS.Types.AudioClipFolder
      + public virtual AGS.Types.AudioClipFolder CreateChildFolder(String name)
   public class AGS.Types.Game
      + public AGS.Types.CharacterFolder get_RootCharacterFolder()
      + public AGS.Types.DialogFolder get_RootDialogFolder()
      + public AGS.Types.ScriptFolder get_RootScriptFolder()
      + public AGS.Types.InventoryItemFolder get_RootInventoryItemFolder()
      + public AGS.Types.GUIFolder get_RootGUIFolder()
      + public AGS.Types.UnloadedRoomFolder get_RootRoomFolder()
From 1 assemblies were 2 types removed and 17 changed.
Title: Re: New editor version for testing
Post by: Monsieur OUXX on Wed 18/07/2012 09:27:44
Would it be possible to base this Editor branch on Alan Drake's one (the one that has programming facilitators, such as code collapsing, etc.).
That would be pretty much the ultimate edition.

Also, can you say if it's possible to revert a project saved in that version to a "regular" AGS? What become of the script/resources folders for example?
Title: Re: New editor version for testing
Post by: dbuske on Wed 18/07/2012 13:55:26
The download link is down.
Title: Re: New editor version for testing
Post by: tzachs on Wed 18/07/2012 22:12:03
A new version is up (in the first post) with lots of fixes.
There were a lot of changes, so I wouldn't be surprised if there are more bugs, please help me find them!

Quote from: RickJ on Sat 14/07/2012 20:50:07
1. No default templates n your distribution so can't create a new game.  Perhaps at least provide a blank template.
2. Loading a game from a previous AGS version (3.2.0), editor doesn't detect, inform, or perform upgrade. 
Fixed!

Quote from: RickJ on Mon 16/07/2012 01:44:51
1.  Add object to a room.  Double click blue cup to get sprite dialog.  Use sprite dialog to add a sprite folder (yeah I know WTF do that?). Folder gets added but now go to Sprite manager it's not there.  Go back to the add sprite dialog and it is there. 
Fixed!

Quote from: Crimson Wizard on Mon 16/07/2012 21:05:30
I somehow made the Project Explorer disappear and never appear again.
Fixed!
Well, sort of. I couldn't reproduce the corrupted tree error message, but I did find a scenario where you can vanish a window. Basically if you exit AGS when the window was floating, the Docking Suite apparently doesn't save/load it correctly, and then it doesn't get shown.
The fix is to see when it doesn't get shown and open it as a floating document. It's not perfect, it still won't load the floating documents exactly as you closed them, though.

Quote from: Crimson Wizard on Mon 16/07/2012 21:05:30
Regarding RickJ's bug report. I could reproduce that:
Fixed!
Great job on the exact reproduction scenario, that really really helped.


Quote from: SpeechCenter on Tue 17/07/2012 18:15:38
I ran ApiChange (https://apichange.codeplex.com/) on AGS.Types.dll and these are the problems I see:
Ooooh, great tool!
I actually wasn't aware at all about breaking plugins, I falsely assumed that only interfaces are exposed and that I'm safe as long as I don't touch them.

Quote from: SpeechCenter on Tue 17/07/2012 18:15:38
Changes that will definitely break backwards compatibility

  • ContentDocument 2 constructors now have an additional parameter. Need instead to keep existing constructors and add new ones, plugins will almost always create such a class.
  • EditorContentPanel change base class. As I mentioned in previous message this is a major problem. I believe it should still derive from UserControl and if we want to add docking functionality to documents, the editor should use another class that contains the EditorContentPanel which implements the docking. Also note that the dll you used is MIT licensed, which is fine, but requires copyright notice. It's better to have only the editor depend on it and not AGS.Types so it will be easier to include AGS.Types with plugins and also it sounds to me like a better design to refrain from adding specific editor GUI elements to this DLL
Fixed!
The Types dll doesn't know about the docking suite and uses new interfaces, EditorContentPanel is a user control again, and ContentDocument has the 2 constructors back.
Can you please check your plugin with the new version and see that it works?
Thanks.

Quote from: SpeechCenter on Tue 17/07/2012 18:15:38
Changes that may break backwards compatibility

  • Removal of RoomList - I'm not sure this is really in use since it doesn't really have a lot of functionality, but if plugins do use it they'll break
  • Change BaseListSelectTypeConverter<T> to BaseListSelectTypeConverter - this affects this type and several derived types. Again, I understand why the change but if any plugin does anything related to this class or derived classes then it may break
  • BaseFolderCollection - change in generic parameter names to something more descriptive, maybe it will be ok (didn't test), but it is possible it breaks compatibility, needs to be tested with a plugin that uses this class
  • IToXml - use in Character, GUI, Script, InventoryItem, UnloadedRoom - I really don't know if keeping the method name but just changing it to be from an interface breaks anything (didn't test) and it's possible a plugin really has to call this method which is rare. Still worth verifying
I'm hoping we're safe here, but I'll do a plugin marathon when I get some more free time to make sure.

Quote from: SpeechCenter on Mon 16/07/2012 21:31:15
Besides the technical difficulty this creates, why do we really need the document windows to be dockable? I understand why the other Windows should be, but why all the ones showing content? Note that if the goal is to mimic VS then the content Windows do not dock the same way as the other Windows. So if we really think it's needed, I'd go the same direction Microsoft did.
Actually that's a feature I miss in Visual Studio when I want to do a delicate refactoring job that requires moving code between classes...
Also, in AGS it's a very common scenario (at least for me) to be switching back and forth from the room designer to the script in order to write down locations, or from the sprites to the script to get the sprite numbers.

Quote from: Monsieur OUXX on Wed 18/07/2012 09:27:44
Would it be possible to base this Editor branch on Alan Drake's one (the one that has programming facilitators, such as code collapsing, etc.).
That would be pretty much the ultimate edition.
I definitely hope we'll get there. Call me naive (and CW will probably yell at me for saying this  ;) ), but I'm still waiting for CJ giving permissions to people and Alan among them...

Quote from: Monsieur OUXX on Wed 18/07/2012 09:27:44
Also, can you say if it's possible to revert a project saved in that version to a "regular" AGS? What become of the script/resources folders for example?
It's possible with some manual work.
The new xml format simply has <CharacterFolder> / <ScriptFolder> / etc around the various items to indicate which items belong to which folder.
By removing the folder elements from the xml you can get it back to a flat folder-less state like the 'regular' AGS knows how to deal with.

Quote from: dbuske on Wed 18/07/2012 13:55:26
The download link is down.
Tested the new link, should be fine now.
Title: Re: New editor version for testing
Post by: BigMc on Wed 18/07/2012 22:25:41
Quote from: tzachs on Wed 18/07/2012 22:12:03
Quote from: Monsieur OUXX on Wed 18/07/2012 09:27:44
Would it be possible to base this Editor branch on Alan Drake's one (the one that has programming facilitators, such as code collapsing, etc.).
That would be pretty much the ultimate edition.
I definitely hope we'll get there. Call me naive (and CW will probably yell at me for saying this  ;) ), but I'm still waiting for CJ giving permissions to people and Alan among them...

Why don't you join the other developers on github? Alan is already there. As long as you agree that you both did good changes there really shouldn't be a problem.
Title: Re: New editor version for testing
Post by: Crimson Wizard on Wed 18/07/2012 22:27:45
Quote from: tzachs on Wed 18/07/2012 22:12:03
Call me naive (and CW will probably yell at me for saying this  ;) ), but I'm still waiting for CJ giving permissions to people and Alan among them...
I won't yell. My intent was to push you towards releasing public beta, but that's what you just did.
I do believe there should be a message by CJ made in public, since it's kinda weird that he told he is not going to participate in development further only in PM.
(Well, I believe Calin knows about that too - he did mention that when we spoke few months ago).
On other hand, people change their plans all the time. Maybe he will reappear after a while to take the AGS back...

By the way, regarding Alan's Editor changes. How much work it would be to allow Editor users select a colour scheme? Personally I like the darker colours more (much better for my eyes) but that does not mean everyone will appreciate hard-coded scheme.
Title: Re: New editor version for testing
Post by: SpeechCenter on Thu 19/07/2012 03:36:48
Hey tzachs,

Great refactoring job, I managed to load the plugin and it loads without a problem.

I encountered a problem when closing a plugin window and trying to reopen it. The way it used to work was that AGS would not dispose the window when closing the document, essentially giving the plugin the choice of whether to destroy the window or just hide it. This allowed me to easily keep the GUI content the same (filter, scroll location, etc). Now I get this error so it seems the ContentDocument is disposed. Should I change anything or can you keep 3.2.1 behavior here too? This is the exception I get.

QuoteError: Cannot access a disposed object.
Object name: 'DockingContainer'.
Version: AGS 3.2.2.112

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'DockingContainer'.
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Form.CreateHandle()
   at System.Windows.Forms.Control.get_Handle()
   at WeifenLuo.WinFormsUI.Docking.DockContentHandler.set_DockPanel(DockPanel value)
   at WeifenLuo.WinFormsUI.Docking.DockContentHandler.Show(DockPanel dockPanel, DockState dockState)
   at WeifenLuo.WinFormsUI.Docking.DockContent.Show(DockPanel dockPanel, DockState dockState)
   at AGS.Editor.DockingContainer.Show(IDockingPanel panel, DockData dockData)
   at AGS.Editor.TabbedDocumentManager.SetActiveDocument(ContentDocument pane, Boolean updatePaneOrder)
   at AGS.Editor.frmMain.AddOrShowPane(ContentDocument pane)
   at AGS.Editor.GUIController.AddOrShowPane(ContentDocument pane)
   at AGS.Plugin.SpeechCenter.SpeechCenterComponent.AGS.Types.IEditorComponent.CommandClick(String controlID)
   at AGS.Editor.ProjectTree.ProcessClickOnNode(String nodeID, MouseButtons button)
   at AGS.Editor.ProjectTree.projectTree_NodeMouseDoubleClick(Object sender, TreeNodeMouseClickEventArgs e)
   at System.Windows.Forms.TreeView.OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

After trying to restart I get an error that prevents from loading the editor:
System.InvalidOperationException: Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content
(this is from Loadlayout while reading xml and exception is in DockPane.set_ActiveContent)

Something else which is odd when I keep the windows open, sometimes when I double click the plugin icon (while its pane is open, but another one is currently displayed) it doesn't focus on its pane. It's not simple to reproduce, I need to open many other documents and switch between them to make this happen. I didn't debug it to see if the plugin is called, but what I do is call IAGSEditor.GUIController.AddOrShowPane with the existing content document in IEditorComponent.CommandClick for the root node id, so maybe the event is not called or AddOrShowPane changed.

Since I played with the editor a little, here are a few notes:
Title: Re: New editor version for testing
Post by: tzachs on Fri 20/07/2012 14:06:30
New version in the first post.

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
I encountered a problem when closing a plugin window and trying to reopen it.
Fixed.

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
After trying to restart I get an error that prevents from loading the editor:
Fixed (I think).

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
Something else which is odd when I keep the windows open, sometimes when I double click the plugin icon (while its pane is open, but another one is currently displayed) it doesn't focus on its pane.
Fixed (I think).

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
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.

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
I would try to make the docking tool window header (Explorer Window, Properties, Output, etc) maybe 1-2 pixels smaller in height, the header is usually less important, but currently it's the same size as any other GUI element
I didn't find a way to achieve that. I can change the font but the height remains the same, so I didn't see the point and also it was harder to read the title.

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
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.

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
I think it's better to have the output window default layout docked at the bottom of the content documents and not the main window to allow the properties and project tree more space.
I've attached a default layout.xml which does that.
I didn't find a way to do this programatically, though (well, I guess I could by saving the layout file as a resource and using it as a default, but again, messy), so if you delete the file it will be as it was.

Quote from: BigMc on Wed 18/07/2012 22:25:41
Why don't you join the other developers on github? Alan is already there. As long as you agree that you both did good changes there really shouldn't be a problem.
I might do that for the next set of changes.
But for now I'll go with CW's plan.

Quote from: Crimson Wizard on Wed 18/07/2012 22:27:45
By the way, regarding Alan's Editor changes. How much work it would be to allow Editor users select a colour scheme? Personally I like the darker colours more (much better for my eyes) but that does not mean everyone will appreciate hard-coded scheme.
If we want to do it properly, I think it will take some work.
I'll open up an issue for the editor with my suggestion, so we can discuss it further over there.
Edit: Issue is here (http://www.adventuregamestudio.co.uk/yabb/index.php?issue=339.0).
Title: Re: New editor version for testing
Post by: Crimson Wizard on Fri 20/07/2012 14:32:54
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?
Title: Re: New editor version for testing
Post by: RickJ on Fri 20/07/2012 20:42:46
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.
Title: Re: New editor version for testing
Post by: SpeechCenter on Sat 21/07/2012 09:34:07
Quote from: tzachs on Fri 20/07/2012 14:06:30

Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
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?

Quote from: tzachs on Fri 20/07/2012 14:06:30
Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
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?

Quote from: tzachs on Fri 20/07/2012 14:06:30
Quote from: SpeechCenter on Thu 19/07/2012 03:36:48
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.
Title: Re: New editor version for testing
Post by: tzachs on Sat 21/07/2012 14:10:13
New version in first post.

Quote from: Crimson Wizard on Fri 20/07/2012 14:32:54
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.

Quote from: RickJ on Fri 20/07/2012 20:42:46
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:
(http://i.imgur.com/uRHs7.png)

Quote from: SpeechCenter on Sat 21/07/2012 09:34:07
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...

Quote from: SpeechCenter on Sat 21/07/2012 09:34:07
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.

Quote from: SpeechCenter on Sat 21/07/2012 09:34:07
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..
Title: Re: New editor version for testing
Post by: Alan v.Drake on Sat 21/07/2012 15:29:52
Nice job tzachs. I can't wait to see all of this merged on the repository.

- Alan
Title: Re: New editor version for testing
Post by: SpeechCenter on Sat 21/07/2012 16:02:31
Quote from: tzachs on Sat 21/07/2012 14:10:13
Quote from: SpeechCenter on Sat 21/07/2012 09:34:07
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.
Title: Re: New editor version for testing
Post by: keisari on Sun 22/07/2012 15:07:09
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 (AGS) Select
Error: Object reference not set to an instance of an object.
Version: AGS 3.2.2.112

System.NullReferenceException: Object reference not set to an instance of an object.
   at AGS.Editor.RoomSettingsEditor.HandleKeyPress(Keys keyData)
   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
   at AGS.Editor.TabbedDocumentManager.ProcessKeyDown(Keys key)
   at AGS.Editor.frmMain.frmMain_KeyDown(Object sender, KeyEventArgs e)
   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.PropertyGridInternal.PropertyGridView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   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.
Title: Re: New editor version for testing
Post by: tzachs on Sun 22/07/2012 19:15:06
New version in the first post with a fix to the crash described by doomantia.

Quote from: SpeechCenter on Sat 21/07/2012 16:02:31
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.
Title: Re: New editor version for testing
Post by: SpeechCenter on Thu 20/09/2012 11:02:18
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.
Title: Re: New editor version for testing
Post by: tzachs on Sat 22/09/2012 12:55:50
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 (http://www.adventuregamestudio.co.uk/forums/index.php?topic=45990.msg617718#msg617718) 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.
Title: Re: New editor version for testing
Post by: SpeechCenter on Sat 22/09/2012 18:53:04
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.
Title: Re: New editor version for testing
Post by: dbuske on Tue 05/03/2013 17:04:21
Why was custom resolutions not included? 
Title: Re: New editor version for testing
Post by: Crimson Wizard on Tue 05/03/2013 18:35:52
Quote from: dbuske on Tue 05/03/2013 17:04:21
Why was custom resolutions not included? 
I explained why here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47344.msg636447731#msg636447731
Title: Re: New editor version for testing
Post by: Crimson Wizard on Tue 02/04/2013 22:23:57
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.SaveLayout()
   ÃÂ² AGS.Editor.frmMain.frmMain_FormClosing(Object sender, FormClosingEventArgs e)
   ÃÂ² System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   ÃÂ² System.Windows.Forms.Form.RaiseFormClosingOnAppExit()
   ÃÂ² System.Windows.Forms.Application.ExitInternal()
   ÃÂ² System.Windows.Forms.Application.Exit(CancelEventArgs e)
   ÃÂ² System.Windows.Forms.Application.Exit()
   ÃÂ² AGS.Editor.GUIController.ShowWelcomeScreen()
   ÃÂ² AGS.Editor.frmMain.frmMain_Shown(Object sender, EventArgs e)
   ÃÂ² System.Windows.Forms.Form.OnShown(EventArgs e)
   ÃÂ² System.Windows.Forms.Form.CallShownEvent()
   ÃÂ² System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   ÃÂ² System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   ÃÂ² System.Threading.ExecutionContext.runTryCode(Object userData)
   ÃÂ² System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   ÃÂ² System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   ÃÂ² System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   ÃÂ² System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   ÃÂ² System.Windows.Forms.Control.InvokeMarshaledCallbacks()

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.
Title: Re: New editor version for testing
Post by: tzachs on Wed 03/04/2013 12:25:11
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...
Title: Re: New editor version for testing
Post by: Crimson Wizard on Wed 03/04/2013 13:09:06
Quote from: tzachs on Wed 03/04/2013 12:25:11
Thanks, fixed this in Git.
Umm... have you pushed it to remote repository?
Title: Re: New editor version for testing
Post by: SpeechCenter on Wed 03/04/2013 18:51:46
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.
Title: Re: New editor version for testing
Post by: tzachs on Thu 04/04/2013 07:33:35
@Crimson Wizard: Yes..
@SpeechCenter: What exception?
Title: Re: New editor version for testing
Post by: SpeechCenter on Thu 04/04/2013 08:57:22
Quote from: Crimson Wizard on Tue 02/04/2013 22:23: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.
Title: Re: New editor version for testing
Post by: tzachs on Thu 04/04/2013 18:41:02
I haven't looked at it.. Just made a fix to the critical issue so that CW could release the beta.
Title: Re: New editor version for testing
Post by: Crimson Wizard on Thu 04/04/2013 19:17:16
Quote from: tzachs on Thu 04/04/2013 18:41:02
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.