mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Reworks the open/close functions of the gui and world editors so they will properly toggle between and clean up when closed.
This commit is contained in:
parent
0aea1d5c33
commit
f8b650f7a1
16 changed files with 238 additions and 142 deletions
|
|
@ -75,11 +75,26 @@ function toggleGuiEditor( %make )
|
|||
if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui )
|
||||
toggleEditor( true );
|
||||
|
||||
GuiEdit();
|
||||
if( !isObject( GuiEditCanvas ) )
|
||||
new GuiControl( GuiEditCanvas, EditorGuiGroup );
|
||||
|
||||
// Cancel the scheduled event to prevent
|
||||
// the level from cycling after it's duration
|
||||
// has elapsed.
|
||||
if( GuiEditorIsActive() )
|
||||
{
|
||||
GuiEditor.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
GuiEditor.open();
|
||||
|
||||
// Cancel the scheduled event to prevent
|
||||
// the level from cycling after it's duration
|
||||
// has elapsed.
|
||||
cancel($Game::Schedule);
|
||||
}
|
||||
|
||||
// Cancel the scheduled event to prevent
|
||||
// the level from cycling after it's duration
|
||||
// has elapsed.
|
||||
cancel($Game::Schedule);
|
||||
}
|
||||
}
|
||||
|
|
@ -98,6 +113,26 @@ package GuiEditor_BlockDialogs
|
|||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
function GuiEditor::open(%this)
|
||||
{
|
||||
GuiEditCanvas.onCreateMenu();
|
||||
|
||||
GuiEditContent(Canvas.getContent());
|
||||
}
|
||||
|
||||
function GuiEditor::close(%this)
|
||||
{
|
||||
// prevent the mission editor from opening while the GuiEditor is open.
|
||||
if(Canvas.getContent() != GuiEditorGui.getId())
|
||||
return;
|
||||
|
||||
GuiGroup.add(GuiEditorGui);
|
||||
|
||||
Canvas.setContent(GuiEditor.lastContent);
|
||||
|
||||
GuiEditCanvas.onDestroyMenu();
|
||||
}
|
||||
|
||||
function GuiEditor::openForEditing( %this, %content )
|
||||
{
|
||||
Canvas.setContent( GuiEditorGui );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue