Merge pull request #698 from Areloch/RemoveLibraryTabsFromEditors

Removes the Library tabs from the World and GUI editors to avoid confusion
This commit is contained in:
Brian Roberts 2021-12-05 02:33:10 -06:00 committed by GitHub
commit ce1fbe5f2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 83 additions and 480 deletions

View file

@ -136,7 +136,7 @@ function VPathTreeView::DeleteSelectedPaths( %this )
function VPathTreeView::CreatePath( %this )
{
// Create Path Object.
EWCreatorWindow.createObject( "ObjectBuilderGui.buildObject( \"VPath\" );" );
ObjectCreator.createObject( "ObjectBuilderGui.buildObject( \"VPath\" );" );
}
//-----------------------------------------------------------------------------

View file

@ -105,7 +105,7 @@ function VPathEditorPlugin::onWorldEditorStartup( %this )
//
//----------------------------------------------------------------------
EWCreatorWindow.registerMissionObject( "VPath", "VPath", "", "Level" );
ObjectCreator.registerMissionObject( "VPath", "VPath", "", "Level" );
}
//EditorGui.setEditor(\"VPathEditorPlugin\");

View file

@ -35,6 +35,9 @@ function AssetBrowser::initialize(%this)
if(!isObject(AssetPreviewArray))
new ArrayObject(AssetPreviewArray);
if(!isObject(ObjectCreator))
new ScriptObject(ObjectCreator);
if(!isObject(%this.dirHandler))
{
%this.dirHandler = makedirectoryHandler(AssetBrowser-->filterTree, "cache,shaderCache", "");
@ -2301,7 +2304,7 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
%assetType = %payload.assetType;
%pos = EWCreatorWindow.getCreateObjectPosition(); //LocalClientConnection.camera.position;
%pos = ObjectCreator.getCreateObjectPosition(); //LocalClientConnection.camera.position;
%module = %payload.moduleName;
%asset = %payload.assetName;

View file

@ -37,7 +37,7 @@ function AssetBrowser::onCreatorEditorDropped(%this, %assetDef, %position)
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = EWCreatorWindow.getCreateObjectPosition();
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{

View file

@ -88,7 +88,7 @@ function spawnDatablockObject(%datablock)
%cmd = %class @ "::create(" @ %name @ ");";
%shapePath = ( %datablock.shapeAsset !$= "" ) ? %datablock.shapeFile : %datablock.shapeName;
%createCmd = "EWCreatorWindow.createObject( \"" @ %cmd @ "\" );";
%createCmd = "ObjectCreator.createObject( \"" @ %cmd @ "\" );";
return eval(%createCmd);//eval("showImportDialog( \"" @ %shapePath @ "\", \"" @ %createCmd @ "\" );");
}
@ -171,7 +171,7 @@ function AssetBrowser::onDatablockEditorDropped(%this, %assetDef, %position)
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = EWCreatorWindow.getCreateObjectPosition();
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{

View file

@ -109,7 +109,7 @@ function AssetBrowser::dragAndDropGameObjectAsset(%this, %assetDef, %dropTarget)
getScene(0).add(%gameObject);
%pos = EWCreatorWindow.getCreateObjectPosition(); //LocalClientConnection.camera.position;
%pos = ObjectCreator.getCreateObjectPosition(); //LocalClientConnection.camera.position;
%gameObject.position = %pos;
@ -131,7 +131,7 @@ function AssetBrowser::onGameObjectAssetEditorDropped(%this, %assetDef, %positio
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = EWCreatorWindow.getCreateObjectPosition();
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{

View file

@ -38,7 +38,7 @@ function AssetBrowser::onPrefabEditorDropped(%this, %assetDef, %position)
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = EWCreatorWindow.getCreateObjectPosition();
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{

View file

@ -45,7 +45,7 @@ function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position)
%camPos = LocalClientConnection.camera.getPosition();
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
%pos = EWCreatorWindow.getCreateObjectPosition();
%pos = ObjectCreator.getCreateObjectPosition();
if(%rayResult != 0)
{

View file

@ -178,7 +178,7 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc)
else
%cmd = "ObjectBuilderGui." @ %method @ "();";
%buildfunc = "ObjectBuilderGui.newObjectCallback = \"AssetBrowser.onFinishCreateObject\"; EWCreatorWindow.createObject( \"" @ %cmd @ "\" );";
%buildfunc = "ObjectBuilderGui.newObjectCallback = \"AssetBrowser.onFinishCreateObject\"; ObjectCreator.createObject( \"" @ %cmd @ "\" );";
}
%args = new ScriptObject();

View file

@ -1251,7 +1251,7 @@ function ColladaImportDlg::showDialog(%this, %shapePath, %cmd)
%this.cmd = %cmd;
// Only allow loading lights if creating a new scene object
%canLoadLights = (strstr(%this.cmd, "EWCreatorWindow.create") != -1);
%canLoadLights = (strstr(%this.cmd, "ObjectCreator.create") != -1);
// Check for an existing TSShapeConstructor object. Need to exec the script
// manually as the DAE resource may not have been loaded yet

View file

@ -1010,76 +1010,6 @@ $guiContent = new GuiControl(GuiEditorGui, EditorGuiGroup) {
};
};
new GuiTabPageCtrl() {
fitBook = "1";
text = "Library";
maxLength = "1024";
docking = "client";
Margin = "-1 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "1";
Profile = "ToolsGuiTabPageProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 20";
Extent = "223 734";
MinExtent = "8 2";
canSave = "1";
Visible = "0";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
internalName = "toolboxPage";
new GuiScrollCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiScrollProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "true";
lockVertScroll = "false";
constantThumbHeight = "0";
childMargin = "0 0";
docking = "client";
new GuiStackControl(GuiEditorToolbox) {
StackingType = "Vertical";
HorizStacking = "Left to Right";
VertStacking = "Top to Bottom";
Padding = "2";
DynamicSize = "1";
ChangeChildSizeToFit = "1";
ChangeChildPosition = "1";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "3 3";
Extent = "419 10008";
MinExtent = "16 16";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
};
};
new GuiTabPageCtrl() {
fitBook = "1";
text = "Profiles";

View file

@ -1023,11 +1023,6 @@ function GuiEditorGui::onWake( %this )
%this.initSettings();
%this.readSettings();
// Initialize toolbox.
if( !GuiEditorToolbox.isInitialized )
GuiEditorToolbox.initialize();
// Set up initial menu toggle states.

View file

@ -91,13 +91,13 @@ function NavEditorPlugin::onWorldEditorStartup(%this)
ENavEditorSettingsPage.init();
// Add items to World Editor Creator
EWCreatorWindow.beginGroup("Navigation");
ObjectCreator.beginGroup("Navigation");
EWCreatorWindow.registerMissionObject("CoverPoint", "Cover point");
EWCreatorWindow.registerMissionObject("NavPath", "Nav Path");
EWCreatorWindow.registerMissionObject("NavMesh", "Navigation mesh");
ObjectCreator.registerMissionObject("CoverPoint", "Cover point");
ObjectCreator.registerMissionObject("NavPath", "Nav Path");
ObjectCreator.registerMissionObject("NavMesh", "Navigation mesh");
EWCreatorWindow.endGroup();
ObjectCreator.endGroup();
}
function ENavEditorSettingsPage::init(%this)

View file

@ -176,331 +176,6 @@ $guiContent = new GuiControl() {
};
};
};
new GuiTabPageCtrl(EWCreatorWindow) {
canSaveDynamicFields = "0";
internalName = "CreatorWindow";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiEditorTabPage";
HorizSizing = "width";
VertSizing = "height";
position = "0 19";
Extent = "208 274";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Library";
maxLength = "1024";
new GuiControl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "0 0";
Extent = "198 271";
MinExtent = "8 2";
canSave = "0";
Visible = "1";
};
new GuiBitmapBorderCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTabBorderProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "5 5";
Extent = "198 271";
MinExtent = "8 2";
canSave = "0";
Visible = "1";
hovertime = "1000";
};
new GuiBitmapBorderCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTabBorderProfile";
HorizSizing = "width";
VertSizing = "bottom";
position = "0 25";
Extent = "198 246";
MinExtent = "8 2";
canSave = "0";
Visible = "1";
hovertime = "1000";
};
new GuiContainer() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTransparentProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "-4 47";
Extent = "206 228";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
new GuiScrollCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "EditorLightScrollProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "4 4";
Extent = "198 220";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
profile = "ToolsGuiScrollProfile";
hovertime = "1000";
Docking = "Client";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
willFirstRespond = "1";
hScrollBar = "dynamic";
vScrollBar = "alwaysOff";
lockHorizScroll = "false";
lockVertScroll = "true";
constantThumbHeight = "0";
childMargin = "0 6";
new GuiDynamicCtrlArrayControl(CreatorIconArray) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTransparentProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "1 1";
Extent = "197 218";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
colCount = "20";
colSize = "64";
rowCount = "0";
RowSize = "32";
rowSpacing = "4";
colSpacing = "4";
frozen = "0";
autoCellSize = "1";
fillRowFirst = "0";
dynamicSize = "1";
};
};
};
new GuiControl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "-3 2";
Extent = "202 55";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
new GuiBitmapButtonCtrl(CreatorNavUpButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "9 28";
Extent = "20 19";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "EWCreatorWindow.navigateUp();";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
groupNum = "0";
buttonType = "PushButton";
Bitmap = "ToolsModule:folderUp_image";
autoSize = "0";
};
new GuiPopUpMenuCtrl(CreatorPopupMenu) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiPopUpMenuProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "32 28";
Extent = "163 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Objects";
maxLength = "1024";
maxPopupHeight = "200";
sbUsesNAColor = "0";
reverseTextList = "0";
bitmapBounds = "16 16";
};
new GuiTabBookCtrl(CreatorTabBook) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTabBookProfile";
HorizSizing = "width";
VertSizing = "bottom";
Position = "0 4";
Extent = "201 25";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Docking = "None";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
TabPosition = "Top";
TabMargin = "0";
MinTabWidth = "49";
new GuiTabPageCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTabPageProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "0 0";
MinExtent = "0 0";
canSave = "1";
Visible = "0";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Scripted";
maxLength = "1024";
};
new GuiTabPageCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTabPageProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "0 0";
MinExtent = "0 0";
canSave = "1";
Visible = "0";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Meshes";
maxLength = "1024";
};
new GuiTabPageCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTabPageProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "0 0";
MinExtent = "0 0";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Level";
maxLength = "1024";
};
new GuiTabPageCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiTabPageProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "0 0";
MinExtent = "0 0";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Prefabs";
maxLength = "1024";
};
};
};
};
};
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";

View file

@ -973,7 +973,7 @@ function ObjectBuilderGui::processNewObject(%this, %obj)
if( %this.objectGroup !$= "" )
%this.objectGroup.add( %obj );
else
EWCreatorWindow.objectGroup.add( %obj );
ObjectCreator.objectGroup.add( %obj );
// If we were given a callback to call after the
// object has been created, do so now. Also clear
@ -1148,9 +1148,9 @@ function ObjectBuilderGui::buildBasicClouds(%this)
function ObjectBuilderGui::checkExists( %this, %classname )
{
for ( %i = 0; %i < EWCreatorWindow.objectGroup.getCount(); %i++ )
for ( %i = 0; %i < ObjectCreator.objectGroup.getCount(); %i++ )
{
%obj = EWCreatorWindow.objectGroup.getObject( %i );
%obj = ObjectCreator.objectGroup.getObject( %i );
if ( %obj.getClassName() $= %classname )
return true;
}
@ -1425,7 +1425,7 @@ function ObjectBuilderGui::buildPlayerDropPoint(%this)
%this.addField("spawnClass", "TypeString", "Spawn Class", "Player");
%this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "PlayerData DefaultPlayerData");
if( EWCreatorWindow.objectGroup.getID() == getScene(0).getID() )
if( ObjectCreator.objectGroup.getID() == getScene(0).getID() )
{
if( !isObject("PlayerDropPoints") )
getScene(0).add( new SimGroup("PlayerDropPoints") );
@ -1445,7 +1445,7 @@ function ObjectBuilderGui::buildObserverDropPoint(%this)
%this.addField("spawnClass", "TypeString", "Spawn Class", "Camera");
%this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "CameraData Observer");
if( EWCreatorWindow.objectGroup.getID() == getScene(0).getID() )
if( ObjectCreator.objectGroup.getID() == getScene(0).getID() )
{
if( !isObject("ObserverDropPoints") )
getScene(0).add( new SimGroup("ObserverDropPoints") );
@ -1508,7 +1508,7 @@ function PhysicsEntityData::create(%data)
{
%obj = new PhysicsEntity() {
dataBlock = %data;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1517,7 +1517,7 @@ function StaticShapeData::create(%data)
{
%obj = new StaticShape() {
dataBlock = %data;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1529,13 +1529,13 @@ function MissionMarkerData::create(%block)
case "WayPointMarker":
%obj = new WayPoint() {
dataBlock = %block;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return(%obj);
case "SpawnSphereMarker":
%obj = new SpawnSphere() {
datablock = %block;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return(%obj);
}
@ -1548,7 +1548,7 @@ function ItemData::create(%data)
%obj = new Item()
{
dataBlock = %data;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
static = true;
rotate = true;
};
@ -1561,7 +1561,7 @@ function TurretShapeData::create(%block)
dataBlock = %block;
static = true;
respawn = true;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1572,7 +1572,7 @@ function AITurretShapeData::create(%block)
dataBlock = %block;
static = true;
respawn = true;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1581,7 +1581,7 @@ function WheeledVehicleData::create(%block)
{
%obj = new WheeledVehicle() {
dataBlock = %block;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1591,7 +1591,7 @@ function FlyingVehicleData::create(%block)
%obj = new FlyingVehicle()
{
dataBlock = %block;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return(%obj);
}
@ -1601,7 +1601,7 @@ function HoverVehicleData::create(%block)
%obj = new HoverVehicle()
{
dataBlock = %block;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return(%obj);
}
@ -1610,7 +1610,7 @@ function RigidShapeData::create(%data)
{
%obj = new RigidShape() {
dataBlock = %data;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1620,7 +1620,7 @@ function PhysicsShapeData::create( %datablock )
%obj = new PhysicsShape()
{
dataBlock = %datablock;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
invulnerable = false;
damageRadius = 0;
@ -1637,7 +1637,7 @@ function ProximityMineData::create( %datablock )
%obj = new ProximityMine()
{
dataBlock = %dataBlock;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
static = true; // mines created by the editor are static, and armed immediately
};
@ -1660,7 +1660,7 @@ function ParticleEmitterData::create( %datablock )
%obj = new ParticleEmitter()
{
dataBlock = %datablock;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1670,7 +1670,7 @@ function PrecipitationData::create(%datablock)
%obj = new Precipitation()
{
dataBlock = %datablock;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
};
return %obj;
}
@ -1680,7 +1680,7 @@ function TriggerData::create(%datablock)
%obj = new Trigger()
{
dataBlock = %datablock;
parentGroup = EWCreatorWindow.objectGroup;
parentGroup = ObjectCreator.objectGroup;
polyhedron = "-0.5 0.5 0.0 1.0 0.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0";
};
return %obj;

View file

@ -216,7 +216,7 @@ function EditorGui::init(%this)
ETerrainEditor.init();
//Creator.init();
EWCreatorWindow.init();
ObjectCreator.init();
ObjectBuilderGui.init();
%this.setMenuDefaultState();
@ -873,7 +873,7 @@ function WorldEditorPlugin::onActivated( %this )
EditorGui.menuBar.insert( EditorGui.worldMenu, EditorGui.menuBar.dynamicItemInsertPos );
EWorldEditor.makeFirstResponder(true);
EditorTree.open($scenesRootGroup,true);
EWCreatorWindow.setNewObjectGroup(getScene(0));
ObjectCreator.setNewObjectGroup(getScene(0));
EditorTree.expandItem(1);
EditorTree.buildVisibleTree(true);
@ -1521,8 +1521,8 @@ function EditorTree::onDeleteObject( %this, %object )
if( %object.locked )
return true;
if( %object == EWCreatorWindow.objectGroup )
EWCreatorWindow.setNewObjectGroup( getScene(0) );
if( %object == ObjectCreator.objectGroup )
ObjectCreator.setNewObjectGroup( getScene(0) );
// Append it to our list.
%this.undoDeleteList = %this.undoDeleteList TAB %object;
@ -1620,7 +1620,7 @@ function EditorTree::onDragDropped(%this)
function EditorTree::onAddGroupSelected(%this, %group)
{
EWCreatorWindow.setNewObjectGroup(%group);
ObjectCreator.setNewObjectGroup(%group);
}
function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
@ -1706,7 +1706,7 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
%popup.item[ 5 ] = "Toggle Hide Children" TAB "" TAB "EWorldEditor.toggleHideChildren( " @ %popup.object @ " );";
%popup.item[ 8 ] = "-";
%popup.item[ 9 ] = "Add New Objects Here" TAB "" TAB "EWCreatorWindow.setNewObjectGroup( " @ %popup.object @ " );";
%popup.item[ 9 ] = "Add New Objects Here" TAB "" TAB "ObjectCreator.setNewObjectGroup( " @ %popup.object @ " );";
%popup.item[ 10 ] = "Add Children to Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( " @ %popup.object @ ", false );";
%popup.item[ 11 ] = "Remove Children from Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( " @ %popup.object @ ", true );";
@ -2276,7 +2276,7 @@ function EWorldEditor::convertSelectionToConvexShape( %this )
function EWorldEditor::getNewObjectGroup( %this )
{
return EWCreatorWindow.getNewObjectGroup();
return ObjectCreator.getNewObjectGroup();
}
function EWorldEditor::deleteMissionObject( %this, %object )

View file

@ -21,7 +21,7 @@
//-----------------------------------------------------------------------------
function EWCreatorWindow::init( %this )
function ObjectCreator::init( %this )
{
// Just so we can recall this method for testing changes
// without restarting.
@ -113,23 +113,23 @@ function EWCreatorWindow::init( %this )
%this.endGroup();
}
function EWCreatorWindow::onWake( %this )
function ObjectCreator::onWake( %this )
{
CreatorTabBook.selectPage( 0 );
CreatorTabBook.onTabSelected( "Scripted" );
}
function EWCreatorWindow::beginGroup( %this, %group )
function ObjectCreator::beginGroup( %this, %group )
{
%this.currentGroup = %group;
}
function EWCreatorWindow::endGroup( %this, %group )
function ObjectCreator::endGroup( %this, %group )
{
%this.currentGroup = "";
}
function EWCreatorWindow::getCreateObjectPosition()
function ObjectCreator::getCreateObjectPosition()
{
%focusPoint = LocalClientConnection.getControlObject().getLookAtPoint();
if( %focusPoint $= "" )
@ -138,7 +138,7 @@ function EWCreatorWindow::getCreateObjectPosition()
return getWord( %focusPoint, 1 ) SPC getWord( %focusPoint, 2 ) SPC getWord( %focusPoint, 3 );
}
function EWCreatorWindow::registerMissionObject( %this, %class, %name, %buildfunc, %group )
function ObjectCreator::registerMissionObject( %this, %class, %name, %buildfunc, %group )
{
if( !isClass(%class) )
return;
@ -150,7 +150,7 @@ function EWCreatorWindow::registerMissionObject( %this, %class, %name, %buildfun
if ( %class $= "" || %group $= "" )
{
warn( "EWCreatorWindow::registerMissionObject, invalid parameters!" );
warn( "ObjectCreator::registerMissionObject, invalid parameters!" );
return;
}
@ -162,12 +162,12 @@ function EWCreatorWindow::registerMissionObject( %this, %class, %name, %buildfun
%this.array.push_back( %group, %args );
}
function EWCreatorWindow::getNewObjectGroup( %this )
function ObjectCreator::getNewObjectGroup( %this )
{
return %this.objectGroup;
}
function EWCreatorWindow::setNewObjectGroup( %this, %group )
function ObjectCreator::setNewObjectGroup( %this, %group )
{
if( %this.objectGroup )
{
@ -182,7 +182,7 @@ function EWCreatorWindow::setNewObjectGroup( %this, %group )
EditorTree.markItem( %itemId );
}
function EWCreatorWindow::createStatic( %this, %file )
function ObjectCreator::createStatic( %this, %file )
{
if ( !$missionRunning )
return;
@ -200,7 +200,7 @@ function EWCreatorWindow::createStatic( %this, %file )
%this.onObjectCreated( %objId );
}
function EWCreatorWindow::createPrefab( %this, %file )
function ObjectCreator::createPrefab( %this, %file )
{
if ( !$missionRunning )
return;
@ -218,7 +218,7 @@ function EWCreatorWindow::createPrefab( %this, %file )
%this.onObjectCreated( %objId );
}
function EWCreatorWindow::createObject( %this, %cmd )
function ObjectCreator::createObject( %this, %cmd )
{
if ( !$missionRunning )
return;
@ -236,7 +236,7 @@ function EWCreatorWindow::createObject( %this, %cmd )
return %objId;
}
function EWCreatorWindow::onFinishCreateObject( %this, %objId )
function ObjectCreator::onFinishCreateObject( %this, %objId )
{
%this.objectGroup.add( %objId );
@ -251,7 +251,7 @@ function EWCreatorWindow::onFinishCreateObject( %this, %objId )
%this.onObjectCreated( %objId );
}
function EWCreatorWindow::onObjectCreated( %this, %objId )
function ObjectCreator::onObjectCreated( %this, %objId )
{
// Can we submit an undo action?
if ( isObject( %objId ) )
@ -270,12 +270,12 @@ function CreatorTabBook::onTabSelected( %this, %text, %idx )
{
if ( %this.isAwake() )
{
EWCreatorWindow.tab = %text;
EWCreatorWindow.navigate( "" );
ObjectCreator.tab = %text;
ObjectCreator.navigate( "" );
}
}
function EWCreatorWindow::navigate( %this, %address )
function ObjectCreator::navigate( %this, %address )
{
CreatorIconArray.frozen = true;
CreatorIconArray.clear();
@ -535,7 +535,7 @@ function EWCreatorWindow::navigate( %this, %address )
CreatorPopupMenu.tooltip = %str;
}
function EWCreatorWindow::navigateDown( %this, %folder )
function ObjectCreator::navigateDown( %this, %folder )
{
if ( %this.address $= "" )
%address = %folder;
@ -548,7 +548,7 @@ function EWCreatorWindow::navigateDown( %this, %folder )
%this.schedule( 1, "navigate", %address );
}
function EWCreatorWindow::navigateUp( %this )
function ObjectCreator::navigateUp( %this )
{
%count = getWordCount( %this.address );
@ -563,7 +563,7 @@ function EWCreatorWindow::navigateUp( %this )
%this.navigate( %address );
}
function EWCreatorWindow::setListView( %this, %noupdate )
function ObjectCreator::setListView( %this, %noupdate )
{
//CreatorIconArray.clear();
//CreatorIconArray.setVisible( false );
@ -576,7 +576,7 @@ function EWCreatorWindow::setListView( %this, %noupdate )
%this.navigate( %this.address );
}
//function EWCreatorWindow::setIconView( %this )
//function ObjectCreator::setIconView( %this )
//{
//echo( "setIconView" );
//
@ -590,7 +590,7 @@ function EWCreatorWindow::setListView( %this, %noupdate )
//%this.navigate( %this.address );
//}
function EWCreatorWindow::findIconCtrl( %this, %name )
function ObjectCreator::findIconCtrl( %this, %name )
{
for ( %i = 0; %i < %this.contentCtrl.getCount(); %i++ )
{
@ -602,7 +602,7 @@ function EWCreatorWindow::findIconCtrl( %this, %name )
return -1;
}
function EWCreatorWindow::createIcon( %this )
function ObjectCreator::createIcon( %this )
{
%ctrl = new GuiIconButtonCtrl()
{
@ -630,11 +630,11 @@ function EWCreatorWindow::createIcon( %this )
return %ctrl;
}
function EWCreatorWindow::addFolderIcon( %this, %text )
function ObjectCreator::addFolderIcon( %this, %text )
{
%ctrl = %this.createIcon();
%ctrl.altCommand = "EWCreatorWindow.navigateDown(\"" @ %text @ "\");";
%ctrl.altCommand = "ObjectCreator.navigateDown(\"" @ %text @ "\");";
%ctrl.iconBitmap = "tools/gui/images/folder.png";
%ctrl.text = %text;
%ctrl.tooltip = %text;
@ -646,7 +646,7 @@ function EWCreatorWindow::addFolderIcon( %this, %text )
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addMissionObjectIcon( %this, %class, %name, %buildfunc )
function ObjectCreator::addMissionObjectIcon( %this, %class, %name, %buildfunc )
{
%ctrl = %this.createIcon();
@ -661,7 +661,7 @@ function EWCreatorWindow::addMissionObjectIcon( %this, %class, %name, %buildfunc
else
%cmd = "ObjectBuilderGui." @ %method @ "();";
%ctrl.altCommand = "ObjectBuilderGui.newObjectCallback = \"EWCreatorWindow.onFinishCreateObject\"; EWCreatorWindow.createObject( \"" @ %cmd @ "\" );";
%ctrl.altCommand = "ObjectBuilderGui.newObjectCallback = \"ObjectCreator.onFinishCreateObject\"; ObjectCreator.createObject( \"" @ %cmd @ "\" );";
%ctrl.iconBitmap = EditorIconRegistry::findIconByClassName( %class );
%ctrl.text = %name;
%ctrl.class = "CreatorMissionObjectIconBtn";
@ -673,7 +673,7 @@ function EWCreatorWindow::addMissionObjectIcon( %this, %class, %name, %buildfunc
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addShapeIcon( %this, %datablock )
function ObjectCreator::addShapeIcon( %this, %datablock )
{
%ctrl = %this.createIcon();
@ -683,7 +683,7 @@ function EWCreatorWindow::addShapeIcon( %this, %datablock )
%shapePath = ( %datablock.shapeFile !$= "" ) ? %datablock.shapeFile : %datablock.shapeName;
%createCmd = "EWCreatorWindow.createObject( \\\"" @ %cmd @ "\\\" );";
%createCmd = "ObjectCreator.createObject( \\\"" @ %cmd @ "\\\" );";
%ctrl.altCommand = "showImportDialog( \"" @ %shapePath @ "\", \"" @ %createCmd @ "\" );";
%ctrl.iconBitmap = EditorIconRegistry::findIconByClassName( %class );
@ -697,7 +697,7 @@ function EWCreatorWindow::addShapeIcon( %this, %datablock )
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addStaticIcon( %this, %fullPath )
function ObjectCreator::addStaticIcon( %this, %fullPath )
{
%ctrl = %this.createIcon();
@ -709,7 +709,7 @@ function EWCreatorWindow::addStaticIcon( %this, %fullPath )
"Date Created: " @ fileCreatedTime( %fullPath ) NL
"Last Modified: " @ fileModifiedTime( %fullPath );
%createCmd = "EWCreatorWindow.createStatic( \\\"" @ %fullPath @ "\\\" );";
%createCmd = "ObjectCreator.createStatic( \\\"" @ %fullPath @ "\\\" );";
%ctrl.altCommand = "showImportDialog( \"" @ %fullPath @ "\", \"" @ %createCmd @ "\" );";
%ctrl.iconBitmap = ( ( %ext $= ".dts" ) ? EditorIconRegistry::findIconByClassName( "TSStatic" ) : "tools/gui/images/iconCollada" );
@ -723,7 +723,7 @@ function EWCreatorWindow::addStaticIcon( %this, %fullPath )
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addPrefabIcon( %this, %fullPath )
function ObjectCreator::addPrefabIcon( %this, %fullPath )
{
%ctrl = %this.createIcon();
@ -735,7 +735,7 @@ function EWCreatorWindow::addPrefabIcon( %this, %fullPath )
"Date Created: " @ fileCreatedTime( %fullPath ) NL
"Last Modified: " @ fileModifiedTime( %fullPath );
%ctrl.altCommand = "EWCreatorWindow.createPrefab( \"" @ %fullPath @ "\" );";
%ctrl.altCommand = "ObjectCreator.createPrefab( \"" @ %fullPath @ "\" );";
%ctrl.iconBitmap = EditorIconRegistry::findIconByClassName( "Prefab" );
%ctrl.text = %file;
%ctrl.class = "CreatorPrefabIconBtn";
@ -750,7 +750,7 @@ function EWCreatorWindow::addPrefabIcon( %this, %fullPath )
function CreatorPopupMenu::onSelect( %this, %id, %text )
{
%split = strreplace( %text, "/", " " );
EWCreatorWindow.navigate( %split );
ObjectCreator.navigate( %split );
}
function alphaIconCompare( %a, %b )
@ -779,7 +779,7 @@ function genericCreateObject( %class )
%cmd = "return new " @ %class @ "();";
%obj = EWCreatorWindow.createObject( %cmd );
%obj = ObjectCreator.createObject( %cmd );
// In case the caller wants it.
return %obj;