mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1933 from Areloch/SDLMenubarFixins
Fixes editor handling of menubars when opening/closing.
This commit is contained in:
commit
ca4204be14
16 changed files with 238 additions and 142 deletions
|
|
@ -106,7 +106,7 @@
|
||||||
profile = "GuiMenuButtonProfile";
|
profile = "GuiMenuButtonProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
command = "GuiEdit();";
|
command = "toggleGuiEditor(1);";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
tooltip = "The GUI Editor is accessible in-game by pressing F10";
|
tooltip = "The GUI Editor is accessible in-game by pressing F10";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ function EditorInspectorBase::onAdd( %this )
|
||||||
superClass = "MenuBuilder";
|
superClass = "MenuBuilder";
|
||||||
isPopup = true;
|
isPopup = true;
|
||||||
|
|
||||||
item[ 0 ] = "Edit Profile" TAB "" TAB "if( !$InGuiEditor ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );";
|
item[ 0 ] = "Edit Profile" TAB "" TAB "if( !GuiEditorIsActive() ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );";
|
||||||
item[ 1 ] = "Jump to Definition in Torsion" TAB "" TAB "EditorOpenDeclarationInTorsion( %this.inspectorField.getData() );";
|
item[ 1 ] = "Jump to Definition in Torsion" TAB "" TAB "EditorOpenDeclarationInTorsion( %this.inspectorField.getData() );";
|
||||||
item[ 2 ] = "Inspect Object" TAB "" TAB "inspectObject( %this.inspectorField.getData() );";
|
item[ 2 ] = "Inspect Object" TAB "" TAB "inspectObject( %this.inspectorField.getData() );";
|
||||||
item[ 3 ] = "-";
|
item[ 3 ] = "-";
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
minExtent = "8 8";
|
minExtent = "8 8";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
command = "GuiEditor.switchToWorldEditor();";
|
command = "toggleEditor(1);";
|
||||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
ToolTip = "World Editor";
|
ToolTip = "World Editor";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -75,11 +75,26 @@ function toggleGuiEditor( %make )
|
||||||
if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui )
|
if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui )
|
||||||
toggleEditor( true );
|
toggleEditor( true );
|
||||||
|
|
||||||
GuiEdit();
|
if( !isObject( GuiEditCanvas ) )
|
||||||
|
new GuiControl( GuiEditCanvas, EditorGuiGroup );
|
||||||
|
|
||||||
// Cancel the scheduled event to prevent
|
if( GuiEditorIsActive() )
|
||||||
// the level from cycling after it's duration
|
{
|
||||||
// has elapsed.
|
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);
|
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 )
|
function GuiEditor::openForEditing( %this, %content )
|
||||||
{
|
{
|
||||||
Canvas.setContent( GuiEditorGui );
|
Canvas.setContent( GuiEditorGui );
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
MinExtent = "8 8";
|
MinExtent = "8 8";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
Visible = "1";
|
Visible = "1";
|
||||||
Command = "toggleEditor( true ); GuiEdit(); $GuiEditorBtnPressed = true;";
|
Command = "toggleGuiEditor(true); $GuiEditorBtnPressed = true;";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||||
ToolTip = "Open the GuiEditor";
|
ToolTip = "Open the GuiEditor";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ function EditorGui::init(%this)
|
||||||
$NextOperationId = 1;
|
$NextOperationId = 1;
|
||||||
$HeightfieldDirtyRow = -1;
|
$HeightfieldDirtyRow = -1;
|
||||||
|
|
||||||
%this.buildMenus();
|
|
||||||
|
|
||||||
if( !isObject( %this-->ToolsPaletteWindow ) )
|
if( !isObject( %this-->ToolsPaletteWindow ) )
|
||||||
{
|
{
|
||||||
// Load Creator/Inspector GUI
|
// Load Creator/Inspector GUI
|
||||||
|
|
@ -1914,6 +1912,8 @@ function Editor::open(%this)
|
||||||
if(Canvas.getContent() == GuiEditorGui.getId())
|
if(Canvas.getContent() == GuiEditorGui.getId())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
EditorGui.buildMenus();
|
||||||
|
|
||||||
if( !EditorGui.isInitialized )
|
if( !EditorGui.isInitialized )
|
||||||
EditorGui.init();
|
EditorGui.init();
|
||||||
|
|
||||||
|
|
@ -1929,6 +1929,21 @@ function Editor::close(%this, %gui)
|
||||||
if(isObject(MessageHud))
|
if(isObject(MessageHud))
|
||||||
MessageHud.close();
|
MessageHud.close();
|
||||||
EditorGui.writeCameraSettings();
|
EditorGui.writeCameraSettings();
|
||||||
|
|
||||||
|
EditorGui.onDestroyMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
function EditorGui::onDestroyMenu(%this)
|
||||||
|
{
|
||||||
|
if( !isObject( %this.menuBar ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Destroy menus
|
||||||
|
while( %this.menuBar.getCount() != 0 )
|
||||||
|
%this.menuBar.getObject( 0 ).delete();
|
||||||
|
|
||||||
|
%this.menuBar.removeFromCanvas();
|
||||||
|
%this.menuBar.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
$RelightCallback = "";
|
$RelightCallback = "";
|
||||||
|
|
|
||||||
|
|
@ -99,18 +99,12 @@ function Editor::checkActiveLoadDone()
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
function toggleEditor(%make)
|
function toggleEditor(%make)
|
||||||
{
|
{
|
||||||
if (Canvas.isFullscreen())
|
|
||||||
{
|
|
||||||
MessageBoxOK("Windowed Mode Required", "Please switch to windowed mode to access the Mission Editor.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (%make)
|
if (%make)
|
||||||
{
|
{
|
||||||
%timerId = startPrecisionTimer();
|
%timerId = startPrecisionTimer();
|
||||||
|
|
||||||
if( $InGuiEditor )
|
if( GuiEditorIsActive() )
|
||||||
GuiEdit();
|
toggleGuiEditor(1);
|
||||||
|
|
||||||
if( !$missionRunning )
|
if( !$missionRunning )
|
||||||
{
|
{
|
||||||
|
|
@ -141,29 +135,21 @@ function toggleEditor(%make)
|
||||||
Editor.close("PlayGui");
|
Editor.close("PlayGui");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !$GuiEditorBtnPressed )
|
canvas.pushDialog( EditorLoadingGui );
|
||||||
{
|
canvas.repaint();
|
||||||
canvas.pushDialog( EditorLoadingGui );
|
|
||||||
canvas.repaint();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$GuiEditorBtnPressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Editor.open();
|
Editor.open();
|
||||||
|
|
||||||
// Cancel the scheduled event to prevent
|
// Cancel the scheduled event to prevent
|
||||||
// the level from cycling after it's duration
|
// the level from cycling after it's duration
|
||||||
// has elapsed.
|
// has elapsed.
|
||||||
cancel($Game::Schedule);
|
cancel($Game::Schedule);
|
||||||
|
|
||||||
if (theLevelInfo.type $= "DemoScene")
|
if (theLevelInfo.type $= "DemoScene")
|
||||||
commandToServer('dropCameraAtPlayer', true);
|
commandToServer('dropCameraAtPlayer', true);
|
||||||
|
|
||||||
|
|
||||||
canvas.popDialog(EditorLoadingGui);
|
canvas.popDialog(EditorLoadingGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,47 +42,59 @@ function EditorGui::buildMenus(%this)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sub menus (temporary, until MenuBuilder gets updated)
|
// Sub menus (temporary, until MenuBuilder gets updated)
|
||||||
// The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState.
|
// The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState.
|
||||||
// The new min/max for the editor camera speed range can be set in each level's levelInfo object.
|
// The new min/max for the editor camera speed range can be set in each level's levelInfo object.
|
||||||
%this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions)
|
if(!isObject(EditorCameraSpeedOptions))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions)
|
||||||
class = "EditorCameraSpeedMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5";
|
class = "EditorCameraSpeedMenu";
|
||||||
item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35";
|
|
||||||
item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70";
|
item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5";
|
||||||
item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100";
|
item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35";
|
||||||
item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130";
|
item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70";
|
||||||
item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165";
|
item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100";
|
||||||
item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200";
|
item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130";
|
||||||
};
|
item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165";
|
||||||
%this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions)
|
item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if(!isObject(EditorFreeCameraTypeOptions))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions)
|
||||||
class = "EditorFreeCameraTypeMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");";
|
class = "EditorFreeCameraTypeMenu";
|
||||||
item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");";
|
|
||||||
Item[2] = "-";
|
item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");";
|
||||||
item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");";
|
item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");";
|
||||||
item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");";
|
Item[2] = "-";
|
||||||
};
|
item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");";
|
||||||
%this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions)
|
item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if(!isObject(EditorPlayerCameraTypeOptions))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions)
|
||||||
class = "EditorPlayerCameraTypeMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");";
|
class = "EditorPlayerCameraTypeMenu";
|
||||||
Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");";
|
|
||||||
};
|
Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");";
|
||||||
%this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks)
|
Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if(!isObject(EditorCameraBookmarks))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks)
|
||||||
class = "EditorCameraBookmarksMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
//item[0] = "None";
|
class = "EditorCameraBookmarksMenu";
|
||||||
};
|
|
||||||
|
//item[0] = "None";
|
||||||
|
};
|
||||||
|
}
|
||||||
%this.viewTypeMenu = new PopupMenu()
|
%this.viewTypeMenu = new PopupMenu()
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
superClass = "MenuBuilder";
|
||||||
|
|
@ -98,7 +110,7 @@ function EditorGui::buildMenus(%this)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Menu bar
|
// Menu bar
|
||||||
%this.menuBar = new MenuBar()
|
%this.menuBar = new MenuBar(WorldEditorMenubar)
|
||||||
{
|
{
|
||||||
dynamicItemInsertPos = 3;
|
dynamicItemInsertPos = 3;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
profile = "GuiMenuButtonProfile";
|
profile = "GuiMenuButtonProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
command = "GuiEdit();";
|
command = "toggleGuiEditor(1);";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
tooltip = "The GUI Editor is accessible in-game by pressing F10";
|
tooltip = "The GUI Editor is accessible in-game by pressing F10";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ function EditorInspectorBase::onAdd( %this )
|
||||||
superClass = "MenuBuilder";
|
superClass = "MenuBuilder";
|
||||||
isPopup = true;
|
isPopup = true;
|
||||||
|
|
||||||
item[ 0 ] = "Edit Profile" TAB "" TAB "if( !$InGuiEditor ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );";
|
item[ 0 ] = "Edit Profile" TAB "" TAB "if( !GuiEditorIsActive() ) toggleGuiEditor( true ); GuiEditor.editProfile( %this.inspectorField.getData() );";
|
||||||
item[ 1 ] = "Jump to Definition in Torsion" TAB "" TAB "EditorOpenDeclarationInTorsion( %this.inspectorField.getData() );";
|
item[ 1 ] = "Jump to Definition in Torsion" TAB "" TAB "EditorOpenDeclarationInTorsion( %this.inspectorField.getData() );";
|
||||||
item[ 2 ] = "Inspect Object" TAB "" TAB "inspectObject( %this.inspectorField.getData() );";
|
item[ 2 ] = "Inspect Object" TAB "" TAB "inspectObject( %this.inspectorField.getData() );";
|
||||||
item[ 3 ] = "-";
|
item[ 3 ] = "-";
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
minExtent = "8 8";
|
minExtent = "8 8";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
command = "GuiEditor.switchToWorldEditor();";
|
command = "toggleEditor(1);";
|
||||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
ToolTip = "World Editor";
|
ToolTip = "World Editor";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -75,11 +75,26 @@ function toggleGuiEditor( %make )
|
||||||
if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui )
|
if( EditorIsActive() && !GuiEditor.toggleIntoEditorGui )
|
||||||
toggleEditor( true );
|
toggleEditor( true );
|
||||||
|
|
||||||
GuiEdit();
|
if( !isObject( GuiEditCanvas ) )
|
||||||
|
new GuiControl( GuiEditCanvas, EditorGuiGroup );
|
||||||
|
|
||||||
// Cancel the scheduled event to prevent
|
if( GuiEditorIsActive() )
|
||||||
// the level from cycling after it's duration
|
{
|
||||||
// has elapsed.
|
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);
|
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 )
|
function GuiEditor::openForEditing( %this, %content )
|
||||||
{
|
{
|
||||||
Canvas.setContent( GuiEditorGui );
|
Canvas.setContent( GuiEditorGui );
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
MinExtent = "8 8";
|
MinExtent = "8 8";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
Visible = "1";
|
Visible = "1";
|
||||||
Command = "toggleEditor( true ); GuiEdit(); $GuiEditorBtnPressed = true;";
|
Command = "toggleGuiEditor(true); $GuiEditorBtnPressed = true;";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||||
ToolTip = "Open the GuiEditor";
|
ToolTip = "Open the GuiEditor";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ function EditorGui::init(%this)
|
||||||
$NextOperationId = 1;
|
$NextOperationId = 1;
|
||||||
$HeightfieldDirtyRow = -1;
|
$HeightfieldDirtyRow = -1;
|
||||||
|
|
||||||
%this.buildMenus();
|
|
||||||
|
|
||||||
if( !isObject( %this-->ToolsPaletteWindow ) )
|
if( !isObject( %this-->ToolsPaletteWindow ) )
|
||||||
{
|
{
|
||||||
// Load Creator/Inspector GUI
|
// Load Creator/Inspector GUI
|
||||||
|
|
@ -1914,6 +1912,8 @@ function Editor::open(%this)
|
||||||
if(Canvas.getContent() == GuiEditorGui.getId())
|
if(Canvas.getContent() == GuiEditorGui.getId())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
EditorGui.buildMenus();
|
||||||
|
|
||||||
if( !EditorGui.isInitialized )
|
if( !EditorGui.isInitialized )
|
||||||
EditorGui.init();
|
EditorGui.init();
|
||||||
|
|
||||||
|
|
@ -1929,6 +1929,21 @@ function Editor::close(%this, %gui)
|
||||||
if(isObject(MessageHud))
|
if(isObject(MessageHud))
|
||||||
MessageHud.close();
|
MessageHud.close();
|
||||||
EditorGui.writeCameraSettings();
|
EditorGui.writeCameraSettings();
|
||||||
|
|
||||||
|
EditorGui.onDestroyMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
function EditorGui::onDestroyMenu(%this)
|
||||||
|
{
|
||||||
|
if( !isObject( %this.menuBar ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Destroy menus
|
||||||
|
while( %this.menuBar.getCount() != 0 )
|
||||||
|
%this.menuBar.getObject( 0 ).delete();
|
||||||
|
|
||||||
|
%this.menuBar.removeFromCanvas();
|
||||||
|
%this.menuBar.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
$RelightCallback = "";
|
$RelightCallback = "";
|
||||||
|
|
|
||||||
|
|
@ -99,18 +99,12 @@ function Editor::checkActiveLoadDone()
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
function toggleEditor(%make)
|
function toggleEditor(%make)
|
||||||
{
|
{
|
||||||
if (Canvas.isFullscreen())
|
|
||||||
{
|
|
||||||
MessageBoxOK("Windowed Mode Required", "Please switch to windowed mode to access the Mission Editor.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (%make)
|
if (%make)
|
||||||
{
|
{
|
||||||
%timerId = startPrecisionTimer();
|
%timerId = startPrecisionTimer();
|
||||||
|
|
||||||
if( $InGuiEditor )
|
if( GuiEditorIsActive() )
|
||||||
GuiEdit();
|
toggleGuiEditor(1);
|
||||||
|
|
||||||
if( !$missionRunning )
|
if( !$missionRunning )
|
||||||
{
|
{
|
||||||
|
|
@ -141,29 +135,21 @@ function toggleEditor(%make)
|
||||||
Editor.close("PlayGui");
|
Editor.close("PlayGui");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !$GuiEditorBtnPressed )
|
canvas.pushDialog( EditorLoadingGui );
|
||||||
{
|
canvas.repaint();
|
||||||
canvas.pushDialog( EditorLoadingGui );
|
|
||||||
canvas.repaint();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$GuiEditorBtnPressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Editor.open();
|
Editor.open();
|
||||||
|
|
||||||
// Cancel the scheduled event to prevent
|
// Cancel the scheduled event to prevent
|
||||||
// the level from cycling after it's duration
|
// the level from cycling after it's duration
|
||||||
// has elapsed.
|
// has elapsed.
|
||||||
cancel($Game::Schedule);
|
cancel($Game::Schedule);
|
||||||
|
|
||||||
if (theLevelInfo.type $= "DemoScene")
|
if (theLevelInfo.type $= "DemoScene")
|
||||||
commandToServer('dropCameraAtPlayer', true);
|
commandToServer('dropCameraAtPlayer', true);
|
||||||
|
|
||||||
|
|
||||||
canvas.popDialog(EditorLoadingGui);
|
canvas.popDialog(EditorLoadingGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,47 +42,59 @@ function EditorGui::buildMenus(%this)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sub menus (temporary, until MenuBuilder gets updated)
|
// Sub menus (temporary, until MenuBuilder gets updated)
|
||||||
// The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState.
|
// The speed increments located here are overwritten in EditorCameraSpeedMenu::setupDefaultState.
|
||||||
// The new min/max for the editor camera speed range can be set in each level's levelInfo object.
|
// The new min/max for the editor camera speed range can be set in each level's levelInfo object.
|
||||||
%this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions)
|
if(!isObject(EditorCameraSpeedOptions))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.cameraSpeedMenu = new PopupMenu(EditorCameraSpeedOptions)
|
||||||
class = "EditorCameraSpeedMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5";
|
class = "EditorCameraSpeedMenu";
|
||||||
item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35";
|
|
||||||
item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70";
|
item[0] = "Slowest" TAB %cmdCtrl @ "-Shift 1" TAB "5";
|
||||||
item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100";
|
item[1] = "Slow" TAB %cmdCtrl @ "-Shift 2" TAB "35";
|
||||||
item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130";
|
item[2] = "Slower" TAB %cmdCtrl @ "-Shift 3" TAB "70";
|
||||||
item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165";
|
item[3] = "Normal" TAB %cmdCtrl @ "-Shift 4" TAB "100";
|
||||||
item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200";
|
item[4] = "Faster" TAB %cmdCtrl @ "-Shift 5" TAB "130";
|
||||||
};
|
item[5] = "Fast" TAB %cmdCtrl @ "-Shift 6" TAB "165";
|
||||||
%this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions)
|
item[6] = "Fastest" TAB %cmdCtrl @ "-Shift 7" TAB "200";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if(!isObject(EditorFreeCameraTypeOptions))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.freeCameraTypeMenu = new PopupMenu(EditorFreeCameraTypeOptions)
|
||||||
class = "EditorFreeCameraTypeMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");";
|
class = "EditorFreeCameraTypeMenu";
|
||||||
item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");";
|
|
||||||
Item[2] = "-";
|
item[0] = "Standard" TAB "Ctrl 1" TAB "EditorGuiStatusBar.setCamera(\"Standard Camera\");";
|
||||||
item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");";
|
item[1] = "Orbit Camera" TAB "Ctrl 2" TAB "EditorGuiStatusBar.setCamera(\"Orbit Camera\");";
|
||||||
item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");";
|
Item[2] = "-";
|
||||||
};
|
item[3] = "Smoothed" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Camera\");";
|
||||||
%this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions)
|
item[4] = "Smoothed Rotate" TAB "" TAB "EditorGuiStatusBar.setCamera(\"Smooth Rot Camera\");";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if(!isObject(EditorPlayerCameraTypeOptions))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.playerCameraTypeMenu = new PopupMenu(EditorPlayerCameraTypeOptions)
|
||||||
class = "EditorPlayerCameraTypeMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");";
|
class = "EditorPlayerCameraTypeMenu";
|
||||||
Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");";
|
|
||||||
};
|
Item[0] = "First Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"1st Person Camera\");";
|
||||||
%this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks)
|
Item[1] = "Third Person" TAB "" TAB "EditorGuiStatusBar.setCamera(\"3rd Person Camera\");";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if(!isObject(EditorCameraBookmarks))
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
%this.cameraBookmarksMenu = new PopupMenu(EditorCameraBookmarks)
|
||||||
class = "EditorCameraBookmarksMenu";
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
//item[0] = "None";
|
class = "EditorCameraBookmarksMenu";
|
||||||
};
|
|
||||||
|
//item[0] = "None";
|
||||||
|
};
|
||||||
|
}
|
||||||
%this.viewTypeMenu = new PopupMenu()
|
%this.viewTypeMenu = new PopupMenu()
|
||||||
{
|
{
|
||||||
superClass = "MenuBuilder";
|
superClass = "MenuBuilder";
|
||||||
|
|
@ -98,7 +110,7 @@ function EditorGui::buildMenus(%this)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Menu bar
|
// Menu bar
|
||||||
%this.menuBar = new MenuBar()
|
%this.menuBar = new MenuBar(WorldEditorMenubar)
|
||||||
{
|
{
|
||||||
dynamicItemInsertPos = 3;
|
dynamicItemInsertPos = 3;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue