mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Merge pull request #760 from Areloch/ForestBrushGroupToolingFixes
Fixes tooling of Forest Editor to be module-friendly
This commit is contained in:
commit
be3be2eb7d
11 changed files with 177 additions and 88 deletions
|
|
@ -68,6 +68,8 @@ namespace Sim
|
||||||
ImplementNamedSet(SFXAmbienceSet)
|
ImplementNamedSet(SFXAmbienceSet)
|
||||||
ImplementNamedSet(TerrainMaterialSet)
|
ImplementNamedSet(TerrainMaterialSet)
|
||||||
ImplementNamedSet(DataBlockSet);
|
ImplementNamedSet(DataBlockSet);
|
||||||
|
ImplementNamedSet(ForestBrushSet);
|
||||||
|
ImplementNamedSet(ForestItemDataSet);
|
||||||
ImplementNamedGroup(ActionMapGroup)
|
ImplementNamedGroup(ActionMapGroup)
|
||||||
ImplementNamedGroup(ClientGroup)
|
ImplementNamedGroup(ClientGroup)
|
||||||
ImplementNamedGroup(GuiGroup)
|
ImplementNamedGroup(GuiGroup)
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,8 @@ namespace Sim
|
||||||
DeclareNamedSet(SFXAmbienceSet);
|
DeclareNamedSet(SFXAmbienceSet);
|
||||||
DeclareNamedSet(TerrainMaterialSet);
|
DeclareNamedSet(TerrainMaterialSet);
|
||||||
DeclareNamedSet(DataBlockSet);
|
DeclareNamedSet(DataBlockSet);
|
||||||
|
DeclareNamedSet(ForestBrushSet);
|
||||||
|
DeclareNamedSet(ForestItemDataSet);
|
||||||
DeclareNamedGroup(ActionMapGroup)
|
DeclareNamedGroup(ActionMapGroup)
|
||||||
DeclareNamedGroup(ClientGroup)
|
DeclareNamedGroup(ClientGroup)
|
||||||
DeclareNamedGroup(GuiGroup)
|
DeclareNamedGroup(GuiGroup)
|
||||||
|
|
|
||||||
|
|
@ -565,6 +565,8 @@ void init()
|
||||||
InstantiateNamedSet(SFXAmbienceSet);
|
InstantiateNamedSet(SFXAmbienceSet);
|
||||||
InstantiateNamedSet(TerrainMaterialSet);
|
InstantiateNamedSet(TerrainMaterialSet);
|
||||||
InstantiateNamedSet(DataBlockSet);
|
InstantiateNamedSet(DataBlockSet);
|
||||||
|
InstantiateNamedSet(ForestBrushSet);
|
||||||
|
InstantiateNamedSet(ForestItemDataSet);
|
||||||
InstantiateNamedGroup(ActionMapGroup);
|
InstantiateNamedGroup(ActionMapGroup);
|
||||||
InstantiateNamedGroup(ClientGroup);
|
InstantiateNamedGroup(ClientGroup);
|
||||||
InstantiateNamedGroup(GuiGroup);
|
InstantiateNamedGroup(GuiGroup);
|
||||||
|
|
|
||||||
|
|
@ -198,3 +198,77 @@ DefineEngineMethod( ForestBrush, containsItemData, bool, ( const char * obj ), ,
|
||||||
|
|
||||||
return object->containsItemData( data );
|
return object->containsItemData( data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// ForestBrushGroupSet
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_CONOBJECT(ForestBrushGroup);
|
||||||
|
|
||||||
|
ConsoleDocClass(ForestBrushGroup,
|
||||||
|
"@brief Container class for ForestBrushes\n\n"
|
||||||
|
"Editor use only.\n\n"
|
||||||
|
"@internal"
|
||||||
|
);
|
||||||
|
|
||||||
|
ForestBrushGroup::ForestBrushGroup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ForestBrushGroup::onAdd()
|
||||||
|
{
|
||||||
|
if (!Parent::onAdd())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SimSet* forestBrushSet;
|
||||||
|
if (!Sim::findObject("ForestBrushSet", forestBrushSet))
|
||||||
|
{
|
||||||
|
Con::errorf("ForestBrushGroup::onAdd() - failed to find ForestBrushSet to add new ForestBrushGroup to!");
|
||||||
|
}
|
||||||
|
|
||||||
|
forestBrushSet->addObject(this);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForestBrushGroup::addObject(SimObject* inObj)
|
||||||
|
{
|
||||||
|
ForestBrush* ele = dynamic_cast<ForestBrush*>(inObj);
|
||||||
|
if (!ele)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//if ( containsItemData( ele->mData ) )
|
||||||
|
// return;
|
||||||
|
|
||||||
|
Parent::addObject(inObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ForestBrushGroup::containsBrushData(const ForestBrush* inData)
|
||||||
|
{
|
||||||
|
SimObjectList::iterator iter = mObjectList.begin();
|
||||||
|
for (; iter != mObjectList.end(); iter++)
|
||||||
|
{
|
||||||
|
ForestBrush* pElement = dynamic_cast<ForestBrush*>(*iter);
|
||||||
|
|
||||||
|
if (!pElement)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pElement == inData)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(ForestBrushGroup, containsBrushData, bool, (const char* obj), , "( ForestBrush obj )")
|
||||||
|
{
|
||||||
|
ForestBrush* data = NULL;
|
||||||
|
if (!Sim::findObject(obj, data))
|
||||||
|
{
|
||||||
|
Con::warnf("ForestBrush::containsBrushData - invalid object passed");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return object->containsBrushData(data);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,5 +121,28 @@ protected:
|
||||||
static SimObjectPtr<SimGroup> smGroup;
|
static SimObjectPtr<SimGroup> smGroup;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// ForestBrushGroup
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class ForestBrushGroup : public SimGroup
|
||||||
|
{
|
||||||
|
typedef SimGroup Parent;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
ForestBrushGroup();
|
||||||
|
|
||||||
|
DECLARE_CONOBJECT(ForestBrushGroup);
|
||||||
|
|
||||||
|
virtual bool onAdd();
|
||||||
|
|
||||||
|
virtual void addObject(SimObject*);
|
||||||
|
|
||||||
|
bool containsBrushData(const ForestBrush* inData);
|
||||||
|
protected:
|
||||||
|
|
||||||
|
static SimObjectPtr<SimGroup> smGroup;
|
||||||
|
};
|
||||||
|
|
||||||
#endif // _FOREST_EDITOR_BRUSHELEMENT_H_
|
#endif // _FOREST_EDITOR_BRUSHELEMENT_H_
|
||||||
|
|
@ -610,9 +610,14 @@ void ForestBrushTool::_collectElements()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find all ForestBrushElements that are directly or indirectly selected.
|
// Find all ForestBrushElements that are directly or indirectly selected.
|
||||||
|
SimSet* brushSet;
|
||||||
|
if (!Sim::findObject("ForestBrushSet", brushSet))
|
||||||
|
{
|
||||||
|
Con::errorf("ForestBrushTool::_collectElements() - could not find ForestBrushSet!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SimGroup *brushGroup = ForestBrush::getGroup();
|
brushSet->findObjectByCallback( findSelectedElements, mElements );
|
||||||
brushGroup->findObjectByCallback( findSelectedElements, mElements );
|
|
||||||
|
|
||||||
// We just needed to flag these objects as selected for the benefit of our
|
// We just needed to flag these objects as selected for the benefit of our
|
||||||
// findSelectedElements callback, we can now mark them un-selected again.
|
// findSelectedElements callback, we can now mark them un-selected again.
|
||||||
|
|
|
||||||
|
|
@ -328,10 +328,16 @@ void ForestEditorCtrl::deleteMeshSafe( ForestItemData *mesh )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find ForestBrushElement(s) referencing this datablock.
|
// Find ForestBrushElement(s) referencing this datablock.
|
||||||
SimGroup *brushGroup = ForestBrush::getGroup();
|
SimSet* brushSet;
|
||||||
|
if (!Sim::findObject("ForestBrushSet", brushSet))
|
||||||
|
{
|
||||||
|
Con::errorf("ForestBrushTool::_collectElements() - could not find ForestBrushSet!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sKey = mesh;
|
sKey = mesh;
|
||||||
Vector<SimObject*> foundElements;
|
Vector<SimObject*> foundElements;
|
||||||
brushGroup->findObjectByCallback( &findMeshReferences, foundElements );
|
brushSet->findObjectByCallback( &findMeshReferences, foundElements );
|
||||||
|
|
||||||
// Add UndoAction to delete the ForestBrushElement(s) and the ForestItemData.
|
// Add UndoAction to delete the ForestBrushElement(s) and the ForestItemData.
|
||||||
MEDeleteUndoAction *elementAction = new MEDeleteUndoAction();
|
MEDeleteUndoAction *elementAction = new MEDeleteUndoAction();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ function @@::onCreateGameServer(%this)
|
||||||
%this.registerDatablock("./scripts/managedData/managedDatablocks");
|
%this.registerDatablock("./scripts/managedData/managedDatablocks");
|
||||||
if(isFile("./scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension))
|
if(isFile("./scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension))
|
||||||
%this.registerDatablock("./scripts/managedData/managedForestItemData");
|
%this.registerDatablock("./scripts/managedData/managedForestItemData");
|
||||||
|
if(isFile("./scripts/managedData/managedForestBrushData." @ $TorqueScriptFileExtension))
|
||||||
|
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
|
||||||
if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension))
|
if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension))
|
||||||
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
|
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
|
||||||
if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
|
if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Copyright (c) 2012 GarageGames, LLC
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
// of this software and associated documentation files (the "Software"), to
|
|
||||||
// deal in the Software without restriction, including without limitation the
|
|
||||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
// sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
// furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
// IN THE SOFTWARE.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
$forestBrushesGroup = new SimGroup( ForestBrushGroup )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
//--- OBJECT WRITE END ---
|
|
||||||
|
|
@ -110,17 +110,45 @@ function ForestEditorGui::createForest( %this )
|
||||||
|
|
||||||
function ForestEditorGui::newBrush( %this )
|
function ForestEditorGui::newBrush( %this )
|
||||||
{
|
{
|
||||||
%internalName = getUniqueInternalName( "Brush", ForestBrushGroup, true );
|
AssetBrowser_SelectModule.showDialog("ForestEditorGui.pickedNewBrushTargetModule");
|
||||||
|
AssetBrowser_SelectModuleWindow.selectWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ForestEditorGui::pickedNewBrushTargetModule(%this, %module)
|
||||||
|
{
|
||||||
|
%moduleDef = ModuleDatabase.findModule(%module);
|
||||||
|
|
||||||
|
ForestEditorGui.forestBrushPath = %moduleDef.ModulePath @ "/scripts/managedData/managedForestBrushData." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath(ForestEditorGui.forestItemDataPath)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath(ForestEditorGui.forestItemDataPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
%group = ForestBrushSet.findObjectByInternalName(%module @ "ForestBrushGroup");
|
||||||
|
if(!isObject(%group))
|
||||||
|
{
|
||||||
|
%group = new ForestBrushGroup() {
|
||||||
|
internalName = %module @ "ForestBrushGroup";
|
||||||
|
};
|
||||||
|
|
||||||
|
%group.setFilename(ForestEditorGui.forestBrushPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
%internalName = getUniqueInternalName( "Brush", ForestBrushSet, true );
|
||||||
|
|
||||||
%brush = new ForestBrush()
|
%brush = new ForestBrush()
|
||||||
{
|
{
|
||||||
|
class = "ForestBrushGroup";
|
||||||
internalName = %internalName;
|
internalName = %internalName;
|
||||||
parentGroup = ForestBrushGroup;
|
parentGroup = ForestBrushSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
%group.add(%brush);
|
||||||
|
|
||||||
MECreateUndoAction::submit( %brush );
|
MECreateUndoAction::submit( %brush );
|
||||||
|
|
||||||
ForestEditBrushTree.open( ForestBrushGroup );
|
ForestEditBrushTree.open( ForestBrushSet );
|
||||||
ForestEditBrushTree.buildVisibleTree(true);
|
ForestEditBrushTree.buildVisibleTree(true);
|
||||||
%item = ForestEditBrushTree.findItemByObjectId( %brush );
|
%item = ForestEditBrushTree.findItemByObjectId( %brush );
|
||||||
ForestEditBrushTree.clearSelection();
|
ForestEditBrushTree.clearSelection();
|
||||||
|
|
@ -135,7 +163,7 @@ function ForestEditorGui::newElement( %this )
|
||||||
%sel = ForestEditBrushTree.getSelectedObject();
|
%sel = ForestEditBrushTree.getSelectedObject();
|
||||||
|
|
||||||
if ( !isObject( %sel ) )
|
if ( !isObject( %sel ) )
|
||||||
%parentGroup = ForestBrushGroup;
|
%parentGroup = ForestBrushSet;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( %sel.getClassName() $= "ForestBrushElement" )
|
if ( %sel.getClassName() $= "ForestBrushElement" )
|
||||||
|
|
@ -144,7 +172,7 @@ function ForestEditorGui::newElement( %this )
|
||||||
%parentGroup = %sel;
|
%parentGroup = %sel;
|
||||||
}
|
}
|
||||||
|
|
||||||
%internalName = getUniqueInternalName( "Element", ForestBrushGroup, true );
|
%internalName = getUniqueInternalName( "Element", ForestBrushSet, true );
|
||||||
|
|
||||||
%element = new ForestBrushElement()
|
%element = new ForestBrushElement()
|
||||||
{
|
{
|
||||||
|
|
@ -191,37 +219,11 @@ function ForestEditorGui::pickedNewMeshTargetModule(%this, %module)
|
||||||
|
|
||||||
function selectNewForestMesh(%selectedShapeAssetId)
|
function selectNewForestMesh(%selectedShapeAssetId)
|
||||||
{
|
{
|
||||||
/*%spec = "All Mesh Files|*.dts;*.dae|DTS|*.dts|DAE|*.dae";
|
|
||||||
|
|
||||||
%dlg = new OpenFileDialog()
|
|
||||||
{
|
|
||||||
Filters = %spec;
|
|
||||||
DefaultPath = $Pref::WorldEditor::LastPath;
|
|
||||||
DefaultFile = "";
|
|
||||||
ChangePath = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
%ret = %dlg.Execute();
|
|
||||||
|
|
||||||
if ( %ret )
|
|
||||||
{
|
|
||||||
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
|
|
||||||
%fullPath = makeRelativePath( %dlg.FileName, getMainDotCSDir() );
|
|
||||||
%file = fileBase( %fullPath );
|
|
||||||
}
|
|
||||||
|
|
||||||
%dlg.delete();*/
|
|
||||||
|
|
||||||
if ( %selectedShapeAssetId $= "")
|
if ( %selectedShapeAssetId $= "")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
%name = getUniqueName( AssetDatabase.getAssetName(%selectedShapeAssetId) );
|
%name = getUniqueName( AssetDatabase.getAssetName(%selectedShapeAssetId) );
|
||||||
|
|
||||||
//%str = "datablock TSForestItemData( " @ %name @ " ) { shapeFile = \"" @ %fullPath @ "\"; };";
|
|
||||||
//eval( %str );
|
|
||||||
|
|
||||||
//%fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapePath();
|
|
||||||
|
|
||||||
new TSForestItemData(%name) {
|
new TSForestItemData(%name) {
|
||||||
shapeAsset = %selectedShapeAssetId;
|
shapeAsset = %selectedShapeAssetId;
|
||||||
};
|
};
|
||||||
|
|
@ -418,7 +420,7 @@ function ForestEditBrushTree::handleRenameObject( %this, %name, %obj )
|
||||||
{
|
{
|
||||||
if ( %name !$= "" )
|
if ( %name !$= "" )
|
||||||
{
|
{
|
||||||
%found = ForestBrushGroup.findObjectByInternalName( %name );
|
%found = ForestBrushSet.findObjectByInternalName( %name );
|
||||||
if ( isObject( %found ) && %found.getId() != %obj.getId() )
|
if ( isObject( %found ) && %found.getId() != %obj.getId() )
|
||||||
{
|
{
|
||||||
toolsMessageBoxOK( "Error", "Brush or Element with that name already exists.", "" );
|
toolsMessageBoxOK( "Error", "Brush or Element with that name already exists.", "" );
|
||||||
|
|
|
||||||
|
|
@ -91,25 +91,7 @@ function ForestEditorPlugin::onWorldEditorStartup( %this )
|
||||||
{
|
{
|
||||||
new PersistenceManager( ForestDataManager );
|
new PersistenceManager( ForestDataManager );
|
||||||
|
|
||||||
%brushPath = "tools/forestEditor/brushes." @ $TorqueScriptFileExtension;
|
ForestEditBrushTree.open( ForestBrushSet );
|
||||||
|
|
||||||
if ( !isFile( %brushPath ) )
|
|
||||||
%successfulFile = createPath( %brushPath );
|
|
||||||
|
|
||||||
// This creates the ForestBrushGroup, all brushes, and elements.
|
|
||||||
exec( %brushpath );
|
|
||||||
|
|
||||||
if ( !isObject( ForestBrushGroup ) )
|
|
||||||
{
|
|
||||||
new SimGroup( ForestBrushGroup );
|
|
||||||
%this.showError = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ForestEditBrushTree.open( ForestBrushGroup );
|
|
||||||
|
|
||||||
if ( !isObject( ForestItemDataSet ) )
|
|
||||||
new SimSet( ForestItemDataSet );
|
|
||||||
|
|
||||||
ForestEditMeshTree.open( ForestItemDataSet );
|
ForestEditMeshTree.open( ForestItemDataSet );
|
||||||
|
|
||||||
// Add ourselves to the window menu.
|
// Add ourselves to the window menu.
|
||||||
|
|
@ -126,8 +108,8 @@ function ForestEditorPlugin::onWorldEditorStartup( %this )
|
||||||
|
|
||||||
function ForestEditorPlugin::onWorldEditorShutdown( %this )
|
function ForestEditorPlugin::onWorldEditorShutdown( %this )
|
||||||
{
|
{
|
||||||
if ( isObject( ForestBrushGroup ) )
|
if ( isObject( ForestBrushSet ) )
|
||||||
ForestBrushGroup.delete();
|
ForestBrushSet.delete();
|
||||||
if ( isObject( ForestDataManager ) )
|
if ( isObject( ForestDataManager ) )
|
||||||
ForestDataManager.delete();
|
ForestDataManager.delete();
|
||||||
}
|
}
|
||||||
|
|
@ -153,7 +135,7 @@ function ForestEditorPlugin::onActivated( %this )
|
||||||
%this.map.push();
|
%this.map.push();
|
||||||
Parent::onActivated(%this);
|
Parent::onActivated(%this);
|
||||||
|
|
||||||
ForestEditBrushTree.open( ForestBrushGroup );
|
ForestEditBrushTree.open( ForestBrushSet );
|
||||||
ForestEditMeshTree.open( ForestItemDataSet );
|
ForestEditMeshTree.open( ForestItemDataSet );
|
||||||
|
|
||||||
// Open the Brush tab.
|
// Open the Brush tab.
|
||||||
|
|
@ -224,12 +206,26 @@ function ForestEditorPlugin::onDeactivated( %this )
|
||||||
|
|
||||||
// Also take this opportunity to save.
|
// Also take this opportunity to save.
|
||||||
ForestDataManager.saveDirty();
|
ForestDataManager.saveDirty();
|
||||||
|
%this.saveBrushSet();
|
||||||
|
|
||||||
%this.map.pop();
|
%this.map.pop();
|
||||||
|
|
||||||
Parent::onDeactivated(%this);
|
Parent::onDeactivated(%this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ForestEditorPlugin::saveBrushSet(%this)
|
||||||
|
{
|
||||||
|
for(%i=0; %i < ForestBrushSet.getCount(); %i++)
|
||||||
|
{
|
||||||
|
%group = ForestBrushSet.getObject(%i);
|
||||||
|
if(%group.isMemberOfClass("ForestBrushGroup"))
|
||||||
|
{
|
||||||
|
%fileName = %group.getFileName();
|
||||||
|
%group.save(%group.getFileName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function ForestEditorPlugin::isDirty( %this )
|
function ForestEditorPlugin::isDirty( %this )
|
||||||
{
|
{
|
||||||
%dirty = %this.dirty || ForestEditorGui.isDirty();
|
%dirty = %this.dirty || ForestEditorGui.isDirty();
|
||||||
|
|
@ -266,7 +262,8 @@ function ForestEditorPlugin::onSaveMission( %this, %missionFile )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ForestBrushGroup.save( "tools/forestEditor/brushes." @ $TorqueScriptFileExtension );
|
//Make sure our data is up to date too
|
||||||
|
%this.saveBrushSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
function ForestEditorPlugin::onEditorSleep( %this )
|
function ForestEditorPlugin::onEditorSleep( %this )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue