mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
From @rextimmy was missing the stateblock handling for the Transparency mode Sub
Added Open Recent functionality to File menubar item Added new editor setting for Startup Mode to dictate if it'll open the most recent level edited or the blank level, instead of utilizing a game UI control for level selection. Properly re-enabled the handling for the forceSidebarToSide setting to track to the setting value
This commit is contained in:
parent
c1e99364b7
commit
62fabf6894
9 changed files with 314 additions and 227 deletions
|
|
@ -1439,21 +1439,21 @@ function EWorldEditorAlignPopup::onSelect(%this, %id, %text)
|
|||
|
||||
function EWorldEditor::onResize(%this, %newPosition, %newExtent)
|
||||
{
|
||||
//if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1)
|
||||
//{
|
||||
if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1)
|
||||
{
|
||||
%treePos = %this.extent.x - (%this.extent.x * 0.2) SPC EditorGuiToolbar.extent.y;
|
||||
%treeExt = %this.extent.x * 0.2 SPC (%this.extent.y * 0.5) - EditorGuiToolbar.extent.y - EditorGuiStatusBar.extent.y - 25;
|
||||
|
||||
EWTreeWindow.resize(%treePos.x, %treePos.y, %treeExt.x, %treeExt.y);
|
||||
//}
|
||||
}
|
||||
|
||||
//if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1)
|
||||
//{
|
||||
if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1)
|
||||
{
|
||||
%inspPos = EWTreeWindow.position.x SPC EWTreeWindow.position.y + EWTreeWindow.extent.y;
|
||||
%inspExt = EWTreeWindow.extent.x SPC %this.extent.y - EWTreeWindow.extent.y - (EditorGuiStatusBar.extent.y * 2);
|
||||
|
||||
EWInspectorWindow.resize(%inspPos.x, %inspPos.y, %inspExt.x, %inspExt.y);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ function EditorNewLevel( %file )
|
|||
if( !$missionRunning )
|
||||
{
|
||||
activatePackage( "BootEditor" );
|
||||
StartLevel( %file );
|
||||
StartGame( %file );
|
||||
}
|
||||
else
|
||||
EditorOpenMission(%file);
|
||||
|
|
@ -356,16 +356,47 @@ function EditorOpenMission(%levelAsset)
|
|||
else
|
||||
{
|
||||
//If we got the actual assetdef, just roll with it
|
||||
%levelAssetId = "";
|
||||
if(isObject(%levelAsset))
|
||||
{
|
||||
%assetDef = %levelAsset;
|
||||
%levelAssetId = %assetDef.getAssetId();
|
||||
}
|
||||
else
|
||||
{
|
||||
//parse it out if its
|
||||
%assetDef = AssetDatabase.acquireAsset(%levelAsset);
|
||||
%levelAssetId = %levelAsset;
|
||||
}
|
||||
|
||||
EditorSettings.setValue("WorldEditor/lastEditedLevel", %levelAssetId);
|
||||
|
||||
//update the recent levels list
|
||||
%recentLevels = EditorSettings.value("WorldEditor/recentLevelsList");
|
||||
%recentCount = getTokenCount(%recentLevels, ",");
|
||||
|
||||
%updatedRecentList = %levelAssetId;
|
||||
|
||||
%updatedRecentCount = 1;
|
||||
for(%i=0; %i < %recentCount; %i++)
|
||||
{
|
||||
%recentEntry = getToken(%recentLevels, ",", %i);
|
||||
|
||||
if(%levelAssetId $= %recentEntry)
|
||||
continue;
|
||||
|
||||
%updatedRecentList = %updatedRecentList @ "," @ %recentEntry;
|
||||
|
||||
%updatedRecentCount++;
|
||||
|
||||
if(%updatedRecentCount == 10)
|
||||
break;
|
||||
}
|
||||
|
||||
EditorSettings.setValue("WorldEditor/recentLevelsList", %updatedRecentList);
|
||||
|
||||
updateRecentLevelsListing();
|
||||
|
||||
%filename = %assetDef.levelFile;
|
||||
|
||||
if(%filename $= "")
|
||||
|
|
@ -387,7 +418,7 @@ function EditorOpenMission(%levelAsset)
|
|||
if( !$missionRunning )
|
||||
{
|
||||
activatePackage( "BootEditor" );
|
||||
StartLevel( %filename );
|
||||
StartGame( %filename );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -571,6 +602,22 @@ function EditorUnmount()
|
|||
%obj.unmount();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
function updateRecentLevelsListing()
|
||||
{
|
||||
RecentLevelsPopupMenu.clearItems();
|
||||
|
||||
%recentLevels = EditorSettings.value("WorldEditor/recentLevelsList");
|
||||
%recentCount = getTokenCount(%recentLevels, ",");
|
||||
|
||||
for(%i=0; %i < %recentCount; %i++)
|
||||
{
|
||||
%recentEntry = getToken(%recentLevels, ",", %i);
|
||||
|
||||
RecentLevelsPopupMenu.insertItem(%i, %recentEntry, "", "schedule(1,0, \"EditorOpenMission\", " @ %recentEntry @ ");");
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// View Menu Handlers
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -632,8 +679,6 @@ function EditorMenuEditPaste()
|
|||
EditorGui.currentEditor.handlePaste();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Window Menu Handler
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -119,6 +119,12 @@ function EditorGui::buildMenus(%this)
|
|||
profile = "ToolsGuiMenuBarProfile";
|
||||
};
|
||||
|
||||
%recentLevelsMenu = new PopupMenu(RecentLevelsPopupMenu)
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
class = "EditorFileMenu";
|
||||
};
|
||||
|
||||
// File Menu
|
||||
%fileMenu = new PopupMenu()
|
||||
{
|
||||
|
|
@ -127,10 +133,11 @@ function EditorGui::buildMenus(%this)
|
|||
|
||||
barTitle = "File";
|
||||
};
|
||||
|
||||
|
||||
%fileMenu.appendItem("New Level" TAB "" TAB "schedule( 1, 0, \"EditorNewLevel\" );");
|
||||
%fileMenu.appendItem("Open Level..." TAB %cmdCtrl SPC "O" TAB "schedule( 1, 0, \"EditorOpenMission\" );");
|
||||
%fileMenu.appendItem("Open Recent" TAB RecentLevelsPopupMenu);
|
||||
%fileMenu.appendItem("-");
|
||||
%fileMenu.appendItem("Save Level" TAB %cmdCtrl SPC "S" TAB "EditorSaveMissionMenu();");
|
||||
%fileMenu.appendItem("Save Level As..." TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule, \"EditorSaveMissionAs\");");
|
||||
%fileMenu.appendItem("-");
|
||||
|
|
@ -164,6 +171,9 @@ function EditorGui::buildMenus(%this)
|
|||
|
||||
%this.menuBar.insert(%fileMenu);
|
||||
|
||||
//Update the recent levels listing
|
||||
updateRecentLevelsListing();
|
||||
|
||||
// Edit Menu
|
||||
%editMenu = new PopupMenu()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue