Game Development Community

[Beta 4 Bug w/ Fix] Gui Editor Scroll Control

by Ryan Mounts · in Torque 3D Professional · 07/25/2009 (2:17 pm) · 1 replies

I have a GuiWindowCtrl that is docked to the right side of the Canvas. When going into the Gui Editor to work on it, I'd have to scroll all the way over to the right, because my GuiWindowCtrl was hidden under the gui inspector tree. Then I'd hit F10 to check out my changes ingame. When I hit F10 again to bring up the editor, the GuiEditorScroll control would still be scrolled horizontally completely to the right, like I had left it. The only problem is that the editor content region had been reset to the upper left corner of my gui. Since the GuiEditorScroll control was as far as it could go to the right, I had no way of getting to my window control docked on the right side. So I'd have to scroll all the way to the left, exit and then enter the Gui Editor again, and then I could get to it.

Well, to fix that problem (assuming you understood any of that!) is to add a line in tools/guiEditor/gui/guiEditor.ed.cs around line 201:

GuiEditorContentList.setText(%name);

   GuiEditorScroll.scrollToObject(GuiEditor.lastContent);	// Add this line here
   GuiEditor.setRoot(%content);
   GuiEditorRegion.resize(0,0,getWord(%ext,0), getWord(%ext, 1));
   GuiEditorContent.getObject(0).resize(0,0,getWord(%ext,0), getWord(%ext, 1));

That will reset the GuiEditorScroll control to the upper left corner before adding the current content to the GuiEditor.

#1
07/27/2009 (6:09 pm)

GUI Editor has received a pretty big overhaul for the next release and this behavior had been fixed in the process for the next release.

Great find, though, and thanks for posting a fix.