Merge pull request #310 from thecelloman/goodbyeDIF

Remove Interior Object format (DIF)
This commit is contained in:
David Wyand 2013-04-20 13:44:11 -07:00
commit 2dcc7f0247
99 changed files with 76 additions and 17318 deletions

View file

@ -300,7 +300,7 @@ function MaterialEditorGui::prepareActiveObject( %this, %override )
if( MaterialEditorGui.currentObject == %obj && !%override)
return;
// TSStatics, ShapeBase, and Interiors should have getModelFile methods
// TSStatics and ShapeBase objects should have getModelFile methods
if( %obj.isMethod( "getModelFile" ) )
{
MaterialEditorGui.currentObject = %obj;
@ -310,30 +310,11 @@ function MaterialEditorGui::prepareActiveObject( %this, %override )
MaterialEditorGui.setMode();
if( MaterialEditorGui.currentObject.isMethod( "getNumDetailLevels" ) ) // Interiors
for(%j = 0; %j < MaterialEditorGui.currentObject.getTargetCount(); %j++)
{
for(%j = 0; %j < MaterialEditorGui.currentObject.getNumDetailLevels(); %j++)
{
%target = "Detail Level " @ %j;
%count = SubMaterialSelector.getCount();
SubMaterialSelector.addCategory(%target);
for(%k = 0; %k < MaterialEditorGui.currentObject.getTargetCount(%j); %k++)
{
%target = MaterialEditorGui.currentObject.getTargetName(%j, %k);
%count = SubMaterialSelector.getCount();
SubMaterialSelector.add(%target);
}
}
}
else // TSStatic and ShapeBase
{
for(%j = 0; %j < MaterialEditorGui.currentObject.getTargetCount(); %j++)
{
%target = MaterialEditorGui.currentObject.getTargetName(%j);
%count = SubMaterialSelector.getCount();
SubMaterialSelector.add(%target);
}
%target = MaterialEditorGui.currentObject.getTargetName(%j);
%count = SubMaterialSelector.getCount();
SubMaterialSelector.add(%target);
}
}
else // Other classes that support materials if possible
@ -523,9 +504,7 @@ function MaterialEditorGui::setMaterialDirty(%this)
{
%obj = MaterialEditorGui.currentObject;
if( %obj.interiorFile !$= "" )
%shapePath = %obj.interiorFile;
else if( %obj.shapeName !$= "" )
if( %obj.shapeName !$= "" )
%shapePath = %obj.shapeName;
else if( %obj.isMethod("getDatablock") )
{

View file

@ -373,7 +373,7 @@
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Interiors";
text = "Objects";
maxLength = "1024";
maxPopupHeight = "200";
sbUsesNAColor = "0";

View file

@ -1,240 +0,0 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(InteriorExportGui, EditorGuiGroup) {
canSaveDynamicFields = "0";
Profile = "ToolsGuiOverlayProfile";
Enabled = "1";
isContainer = "1";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 0";
Extent = "1024 768";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiWindowCtrl(InteriorExportWindow) {
profile = "ToolsGuiWindowProfile";
canSaveDynamicFields = "0";
internalName = "InteriorExport";
Enabled = "1";
isContainer = "1";
HorizSizing = "center";
VertSizing = "center";
Position = "248 248";
Extent = "290 235";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "1";
AnchorLeft = "1";
AnchorRight = "1";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "InteriorExportGui.close();";
EdgeSnap = "0";
canCollapse = "0";
text = "Export Interiors to COLLADA";
new GuiScrollCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
HorizSizing = "right";
VertSizing = "bottom";
Position = "9 43";
Extent = "272 112";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "true";
lockVertScroll = "false";
constantThumbHeight = "0";
childMargin = "0 0";
new GuiListBoxCtrl(InteriorSelectListBox) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
HorizSizing = "right";
VertSizing = "bottom";
Position = "2 2";
Extent = "248 104";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
AllowMultipleSelections = "1";
fitParentWidth = "1";
};
};
new GuiTextCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
HorizSizing = "right";
VertSizing = "bottom";
Position = "9 25";
Extent = "88 16";
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 = "Select Interior(s):";
maxLength = "1024";
};
new GuiCheckBoxCtrl(InteriorSelectAllToggle) {
profile = "ToolsGuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "9 158";
extent = "248 23";
minExtent = "8 8";
visible = "1";
text = " Select / deselect all";
groupNum = "-1";
buttonType = "ToggleButton";
helpTag = "0";
maxLength = "255";
};
new GuiCheckBoxCtrl(InteriorExportTransToggle) {
profile = "ToolsGuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "9 176";
extent = "248 23";
minExtent = "8 8";
visible = "1";
text = " Export Interiors with transforms baked in";
groupNum = "-1";
buttonType = "ToggleButton";
helpTag = "0";
maxLength = "255";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
HorizSizing = "right";
VertSizing = "bottom";
Position = "9 202";
Extent = "107 24";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "InteriorExportGui.export();";
hovertime = "1000";
text = "Export";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
HorizSizing = "right";
VertSizing = "bottom";
Position = "174 202";
Extent = "107 24";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "InteriorExportGui.close();";
hovertime = "1000";
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};
};
//--- OBJECT WRITE END ---
function InteriorExportGui::findAllInteriors( %this )
{
InteriorSelectListBox.clearItems();
// Find all of the Interior files
initContainerTypeSearch( $TypeMasks::InteriorObjectType );
while ( (%interiorObject = containerSearchNext()) != 0 )
{
%interiorName = %interiorObject.getName();
if ( %interiorName $= "" )
%interiorName = fileBase(%interiorObject.interiorFile);
%text = %interiorName SPC "(" @ %interiorObject.getId() @ ")";
InteriorSelectListBox.addItem( %text, %interiorObject );
}
}
function InteriorExportGui::export( %this )
{
%selected = InteriorSelectListBox.getSelectedItems();
%numSel = getWordCount(%selected);
if ( %numSel == 0 )
MessageBoxOk("Select Interior(s)", "You must select at least one Interior to export");
for (%i = 0; %i < %numSel; %i++)
{
%index = getWord(%selected, %i);
%interiorObj = InteriorSelectListBox.getItemObject( %index );
if (!isObject(%interiorObj))
continue;
%interiorObj.exportToCollada(InteriorExportTransToggle.getValue());
}
%this.close();
}
function InteriorExportGui::onWake( %this )
{
%this.findAllInteriors();
InteriorSelectAllToggle.setValue(false);
InteriorExportTransToggle.setValue(true);
}
function InteriorExportGui::close( %this )
{
Canvas.popDialog( %this );
}
function InteriorSelectAllToggle::onClick( %this )
{
if (InteriorSelectAllToggle.getValue())
{
%numItems = InteriorSelectListBox.getItemCount();
for (%i = 0; %i < %numItems; %i++)
InteriorSelectListBox.setSelected(%i);
}
else
InteriorSelectListBox.clearSelection();
}

View file

@ -178,7 +178,7 @@
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Interiors";
text = "Objects";
maxLength = "1024";
maxPopupHeight = "200";
sbUsesNAColor = "0";

View file

@ -32,7 +32,6 @@ function initializeWorldEditor()
exec("./gui/genericPromptDialog.ed.gui" );
exec("./gui/guiTerrainImportGui.gui" );
exec("./gui/guiTerrainExportGui.gui" );
exec("./gui/guiInteriorExportGui.gui" );
exec("./gui/EditorGui.ed.gui");
exec("./gui/objectBuilderGui.ed.gui");
exec("./gui/TerrainEditorVSettingsGui.ed.gui");

View file

@ -1863,12 +1863,6 @@ function EditorTree::GetTooltipParticleEmitterNode( %this, %obj )
return %text;
}
// Tooltip for InteriorInstance
function EditorTree::GetTooltipInteriorInstance( %this, %obj )
{
return "File: " @ %obj.interiorFile;
}
// Tooltip for WorldEditorSelection
function EditorTree::GetTooltipWorldEditorSelection( %this, %obj )
{

View file

@ -169,31 +169,6 @@ function EWCreatorWindow::setNewObjectGroup( %this, %group )
EditorTree.markItem( %itemId );
}
function EWCreatorWindow::createInterior( %this, %file )
{
if ( !$missionRunning )
return;
if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
{
MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
return;
}
if( !isObject(%this.objectGroup) )
%this.setNewObjectGroup( MissionGroup );
%objId = new InteriorInstance()
{
position = %this.getCreateObjectPosition();
rotation = "0 0 0";
interiorFile = %file;
parentGroup = %this.objectGroup;
};
%this.onObjectCreated( %objId );
}
function EWCreatorWindow::createStatic( %this, %file )
{
if ( !$missionRunning )
@ -381,10 +356,7 @@ function EWCreatorWindow::navigate( %this, %address )
// Is this file in the current folder?
if ( stricmp( %pathFolders, %address ) == 0 )
{
if ( fileExt( %fullPath ) $= ".dif" )
%this.addInteriorIcon( %fullPath );
else
%this.addStaticIcon( %fullPath );
%this.addStaticIcon( %fullPath );
}
// Then is this file in a subfolder we need to add
// a folder icon for?
@ -752,30 +724,6 @@ function EWCreatorWindow::addStaticIcon( %this, %fullPath )
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addInteriorIcon( %this, %fullPath )
{
%ctrl = EWCreatorWindow.createIcon();
%file = fileBase( %fullPath );
%fileLong = %file @ fileExt( %fullPath );
%tip = %fileLong NL
"Size: " @ fileSize( %fullPath ) / 1000.0 SPC "KB" NL
"Date Created: " @ fileCreatedTime( %fullPath ) NL
"Last Modified: " @ fileModifiedTime( %fullPath );
%ctrl.altCommand = "EWCreatorWindow.createInterior( \"" @ %fullPath @ "\" );";
%ctrl.iconBitmap = EditorIconRegistry::findIconByClassName( "InteriorInstance" );
%ctrl.text = %file;
%ctrl.class = "CreatorInteriorIconBtn";
%ctrl.tooltip = %tip;
%ctrl.buttonType = "radioButton";
%ctrl.groupNum = "-1";
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addPrefabIcon( %this, %fullPath )
{
%ctrl = %this.createIcon();

View file

@ -135,7 +135,6 @@ function EditorGui::buildMenus(%this)
{
%fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
%fileMenu.appendItem("-");
%fileMenu.appendItem("Export Interiors To COLLADA..." TAB "" TAB "Canvas.pushDialog( InteriorExportGui );");
%fileMenu.appendItem("Export To COLLADA..." TAB "" TAB "EditorExportToCollada();");
//item[5] = "Import Terraform Data..." TAB "" TAB "Heightfield::import();";
//item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();";