mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge remote-tracking branch 'upstream/development' into imageAsset_refactor_rev3
This commit is contained in:
commit
e1c01cd49a
152 changed files with 7312 additions and 4132 deletions
|
|
@ -164,40 +164,3 @@ function toggleEditor(%make)
|
|||
//------------------------------------------------------------------------------
|
||||
// The editor action maps are defined in editor.bind.tscript
|
||||
GlobalActionMap.bind(keyboard, "f11", fastLoadWorldEdit);
|
||||
|
||||
|
||||
// The scenario:
|
||||
// The editor is open and the user closes the level by any way other than
|
||||
// the file menu ( exit level ), eg. typing disconnect() in the console.
|
||||
//
|
||||
// The problem:
|
||||
// Editor::close() is not called in this scenario which means onEditorDisable
|
||||
// is not called on objects which hook into it and also gEditingMission will no
|
||||
// longer be valid.
|
||||
//
|
||||
// The solution:
|
||||
// Override the stock disconnect() function which is in game scripts from here
|
||||
// in tools so we avoid putting our code in there.
|
||||
//
|
||||
// Disclaimer:
|
||||
// If you think of a better way to do this feel free. The thing which could
|
||||
// be dangerous about this is that no one will ever realize this code overriding
|
||||
// a fairly standard and core game script from a somewhat random location.
|
||||
// If it 'did' have unforscene sideeffects who would ever find it?
|
||||
|
||||
package EditorDisconnectOverride
|
||||
{
|
||||
function disconnect()
|
||||
{
|
||||
if ( isObject( Editor ) && Editor.isEditorEnabled() )
|
||||
{
|
||||
EditorGui.saveAs = false; //whatever edits we were doing are irrelevent now
|
||||
%mainMenuGUI = ProjectSettings.value("UI/mainMenuName");
|
||||
if (isObject( %mainMenuGUI ))
|
||||
Editor.close( %mainMenuGUI );
|
||||
}
|
||||
|
||||
Parent::disconnect();
|
||||
}
|
||||
};
|
||||
activatePackage( EditorDisconnectOverride );
|
||||
|
|
|
|||
|
|
@ -721,32 +721,7 @@ function EditorExplodePrefab()
|
|||
}
|
||||
|
||||
function makeSelectedAMesh(%assetId)
|
||||
{
|
||||
|
||||
/*%dlg = new SaveFileDialog()
|
||||
{
|
||||
Filters = "Collada file (*.dae)|*.dae|";
|
||||
DefaultPath = $Pref::WorldEditor::LastPath;
|
||||
DefaultFile = "";
|
||||
ChangePath = false;
|
||||
OverwritePrompt = true;
|
||||
};
|
||||
|
||||
%ret = %dlg.Execute();
|
||||
if ( %ret )
|
||||
{
|
||||
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
|
||||
%saveFile = %dlg.FileName;
|
||||
}
|
||||
|
||||
if( fileExt( %saveFile ) !$= ".dae" )
|
||||
%saveFile = %saveFile @ ".dae";
|
||||
|
||||
%dlg.delete();
|
||||
|
||||
if ( !%ret )
|
||||
return;*/
|
||||
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||
|
||||
%assetPath = AssetDatabase.getAssetPath(%assetId);
|
||||
|
|
@ -762,16 +737,12 @@ function makeSelectedAMesh(%assetId)
|
|||
AssetDatabase.refreshAsset(%assetId);
|
||||
|
||||
if(%success)
|
||||
{
|
||||
//ok, cool it worked, so clear out the old
|
||||
//First, get our center of the currently selected objects
|
||||
%selectionCenter = EWorldEditor.getSelectionCentroid();
|
||||
|
||||
{
|
||||
//Next, for safety purposes(and convenience!) we'll make them a prefab aping off the filepath/name provided
|
||||
//TODO: Make this an editor option
|
||||
%prefabPath = %assetPath @ "/" @ %assetDef.AssetName @ ".prefab";
|
||||
EWorldEditor.makeSelectionPrefab(%prefabPath, true);
|
||||
|
||||
EWorldEditor.makeSelectionPrefab(%prefabPath, false);
|
||||
%selectionPos = EWorldEditor.getSelectedObject(0).getPosition();
|
||||
//Next, nuke 'em
|
||||
EditorMenuEditDelete();
|
||||
|
||||
|
|
@ -779,7 +750,7 @@ function makeSelectedAMesh(%assetId)
|
|||
%newStatic = new TSStatic()
|
||||
{
|
||||
shapeAsset = %assetId;
|
||||
position = %selectionCenter;
|
||||
position = %selectionPos;
|
||||
};
|
||||
|
||||
getRootScene().add(%newStatic);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue