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:
Areloch 2019-11-19 01:25:24 -06:00
parent c1e99364b7
commit 62fabf6894
9 changed files with 314 additions and 227 deletions

View file

@ -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);
//}
}
}
//-----------------------------------------------------------------------------

View file

@ -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
//////////////////////////////////////////////////////////////////////////

View file

@ -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()
{