mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Fixes issue #1277
Adds the file path to the saveDataFile call (missionpath\missionname.forest as the format) This correctly utilizes the forest object's datafile field if it's set. If not, it will create a new forest item with the missionPath\missionName.forest convention. This also removes the checks for the hardcoded "theForest" forest object name, so that if it is renamed for some reason, it doesn't break. Lastly, this corrects a minor semi-related bug, where if you are in the forest editor and have a brush selected, and then click to paint, but no forest object currently exists, it prompts to create one. Once the forest object is created, it would trigger the editor to inspect the newly made forest object. If you attempted to paint the currently selected brush, there was a mis-match in the inspector information, and it would trigger a crash. This has been corrected by re-initializing the forest editor's selected tool mode so it can be utilized immediately after the forest object is created.
This commit is contained in:
parent
f8d41a2b96
commit
2f69ffd2d4
8 changed files with 148 additions and 15 deletions
|
|
@ -97,7 +97,6 @@ void ForestEditorCtrl::onSleep()
|
|||
|
||||
bool ForestEditorCtrl::updateActiveForest( bool createNew )
|
||||
{
|
||||
mForest = dynamic_cast<Forest*>( Sim::findObject( "theForest" ) );
|
||||
Con::executef( this, "onActiveForestUpdated", mForest ? mForest->getIdString() : "", createNew ? "1" : "0" );
|
||||
|
||||
if ( mTool )
|
||||
|
|
@ -400,4 +399,13 @@ DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj
|
|||
DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" )
|
||||
{
|
||||
return object->isDirty();
|
||||
}
|
||||
|
||||
DefineConsoleMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )")
|
||||
{
|
||||
Forest *forestObject;
|
||||
if (!Sim::findObject(obj, forestObject))
|
||||
return;
|
||||
|
||||
object->setActiveForest(forestObject);
|
||||
}
|
||||
|
|
@ -86,6 +86,9 @@ class ForestEditorCtrl : public EditTSCtrl
|
|||
/// Causes the editor to reselect the active forest.
|
||||
bool updateActiveForest( bool createNew );
|
||||
|
||||
/// Sets the active Forest
|
||||
void setActiveForest(Forest* forestObject) { mForest = forestObject; }
|
||||
|
||||
/// Returns the active Forest.
|
||||
Forest *getActiveForest() const { return mForest; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue