diff --git a/Engine/source/forest/forest.cpp b/Engine/source/forest/forest.cpp index 41da38500..6a1d8c2fc 100644 --- a/Engine/source/forest/forest.cpp +++ b/Engine/source/forest/forest.cpp @@ -330,7 +330,12 @@ void Forest::createNewFile() // We need to construct a default file name String missionName( Con::getVariable( "$Client::MissionFile" ) ); - missionName.replace( "tools/levels", "levels" ); + String levelDirectory( Con::getVariable( "$pref::Directories::Level" ) ); + if ( levelDirectory.isEmpty() ) + { + levelDirectory = "levels"; + } + missionName.replace( "tools/levels", levelDirectory ); missionName = Platform::makeRelativePathName(missionName, Platform::getMainDotCsDir()); Torque::Path basePath( missionName ); diff --git a/Engine/source/gui/buttons/guiSwatchButtonCtrl.cpp b/Engine/source/gui/buttons/guiSwatchButtonCtrl.cpp index 8067cd95a..09723a4c5 100644 --- a/Engine/source/gui/buttons/guiSwatchButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiSwatchButtonCtrl.cpp @@ -39,9 +39,9 @@ ConsoleDocClass( GuiSwatchButtonCtrl, "A swatch button is a push button that uses its color field to designate the color drawn over an image, on top of a button.\n\n" "The color itself is a float value stored inside the GuiSwatchButtonCtrl::color field. The texture path that represents\n" - "the image underlying the color is stored inside the GuiSwatchButtonCtrl::bitmap field.\n" + "the image underlying the color is stored inside the GuiSwatchButtonCtrl::gridBitmap field.\n" "The default value assigned toGuiSwatchButtonCtrl::color is \"1 1 1 1\"( White ). The default/fallback image assigned to \n" - "GuiSwatchButtonCtrl::bitmap is \"core/art/gui/images/transp_grid\".\n\n" + "GuiSwatchButtonCtrl::gridBitmap is \"tools/gui/images/transp_grid\".\n\n" "@tsexample\n" "// Create a GuiSwatchButtonCtrl that calls randomFunction with its current color when clicked\n" @@ -65,11 +65,15 @@ GuiSwatchButtonCtrl::GuiSwatchButtonCtrl() static StringTableEntry sProfile = StringTable->insert( "profile" ); setDataField( sProfile, NULL, "GuiInspectorSwatchButtonProfile" ); + + mGridBitmap = "tools/gui/images/transp_grid"; } void GuiSwatchButtonCtrl::initPersistFields() { addField( "color", TypeColorF, Offset( mSwatchColor, GuiSwatchButtonCtrl ), "The foreground color of GuiSwatchButtonCtrl" ); + + addField( "gridBitmap", TypeString, Offset( mGridBitmap, GuiSwatchButtonCtrl ), "The bitmap used for the transparent grid" ); Parent::initPersistFields(); } @@ -80,7 +84,7 @@ bool GuiSwatchButtonCtrl::onWake() return false; if ( mGrid.isNull() ) - mGrid.set( "core/art/gui/images/transp_grid", &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) ); + mGrid.set( mGridBitmap, &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) ); return true; } diff --git a/Engine/source/gui/buttons/guiSwatchButtonCtrl.h b/Engine/source/gui/buttons/guiSwatchButtonCtrl.h index 38b26c2fe..56bd1279d 100644 --- a/Engine/source/gui/buttons/guiSwatchButtonCtrl.h +++ b/Engine/source/gui/buttons/guiSwatchButtonCtrl.h @@ -41,6 +41,9 @@ class GuiSwatchButtonCtrl : public GuiButtonBaseCtrl /// The color to display on the button. ColorF mSwatchColor; + /// Bitmap used for mGrid + String mGridBitmap; + /// Background texture that will show through with transparent colors. GFXTexHandle mGrid; diff --git a/Engine/source/gui/controls/guiGradientCtrl.cpp b/Engine/source/gui/controls/guiGradientCtrl.cpp index 164a602b1..30d94c969 100644 --- a/Engine/source/gui/controls/guiGradientCtrl.cpp +++ b/Engine/source/gui/controls/guiGradientCtrl.cpp @@ -89,9 +89,6 @@ bool GuiGradientSwatchCtrl::onWake() if ( !Parent::onWake() ) return false; - if ( mPointer.isNull() ) - mPointer.set( "core/art/gui/images/arrowbtn_d", &GFXDefaultGUIProfile, avar("%s() - mGrid (line %d)", __FUNCTION__, __LINE__) ); - char* altCommand = Con::getReturnBuffer(512); dSprintf( altCommand, 512, "%s(%i.color, \"%i.setColor\");", mColorFunction, getId(), getId() ); setField( "altCommand", altCommand ); diff --git a/Engine/source/gui/controls/guiGradientCtrl.h b/Engine/source/gui/controls/guiGradientCtrl.h index 8cbcd6a8b..fbbebdd0f 100644 --- a/Engine/source/gui/controls/guiGradientCtrl.h +++ b/Engine/source/gui/controls/guiGradientCtrl.h @@ -48,7 +48,6 @@ public: void onRender(Point2I offset, const RectI &updateRect); bool onWake(); protected: - GFXTexHandle mPointer; StringTableEntry mColorFunction; }; //---------------------------- diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index e1533134f..979028c7c 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -1538,7 +1538,7 @@ GuiControl* GuiInspectorTypeBitMask32Helper::constructEditControl() mButton->setField( "Command", szBuffer ); mButton->setField( "buttonType", "ToggleButton" ); mButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorButtonProfile" ); - mButton->setBitmap( "core/art/gui/images/arrowBtn" ); + mButton->setBitmap( "tools/gui/images/arrowBtn" ); mButton->setStateOn( true ); mButton->setExtent( 16, 16 ); mButton->registerObject(); diff --git a/Engine/source/postFx/postEffectVis.cpp b/Engine/source/postFx/postEffectVis.cpp index bf4e40057..d8ff98bf6 100644 --- a/Engine/source/postFx/postEffectVis.cpp +++ b/Engine/source/postFx/postEffectVis.cpp @@ -127,7 +127,7 @@ void PostEffectVis::open( PostEffect *pfx ) bmpCtrl->setSizing( GuiControl::horizResizeWidth, GuiControl::vertResizeHeight ); bmpCtrl->setExtent( 341, 181 ); bmpCtrl->setDataField( StringTable->insert( "wrap" ), NULL, "1" ); - bmpCtrl->setBitmap( "core/art/gui/images/transp_grid" ); + bmpCtrl->setBitmap( "tools/gui/images/transp_grid" ); bmpCtrl->registerObject(); winCtrl->addObject( bmpCtrl ); diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index e22a8e776..bb77fcf4f 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -864,8 +864,13 @@ bool TerrainBlock::onAdd() if ( mTerrFileName.isEmpty() ) { mTerrFileName = Con::getVariable( "$Client::MissionFile" ); - mTerrFileName.replace("tools/levels/", "art/terrains/"); - mTerrFileName.replace("levels/", "art/terrains/"); + String terrainDirectory( Con::getVariable( "$pref::Directories::Terrain" ) ); + if ( terrainDirectory.isEmpty() ) + { + terrainDirectory = "art/terrains/"; + } + mTerrFileName.replace("tools/levels/", terrainDirectory); + mTerrFileName.replace("levels/", terrainDirectory); Vector materials; materials.push_back( "warning_material" ); diff --git a/Engine/source/terrain/terrFile.cpp b/Engine/source/terrain/terrFile.cpp index 8f7168291..ccb49f10d 100644 --- a/Engine/source/terrain/terrFile.cpp +++ b/Engine/source/terrain/terrFile.cpp @@ -744,7 +744,12 @@ void TerrainFile::create( String *inOutFilename, if ( !basePath.getExtension().equal("mis") ) { // Use the default path and filename - basePath.setPath( "art/terrains" ); + String terrainDirectory( Con::getVariable( "$pref::Directories::Terrain" ) ); + if ( terrainDirectory.isEmpty() ) + { + terrainDirectory = "art/terrains"; + } + basePath.setPath( terrainDirectory ); basePath.setFileName( "terrain" ); } diff --git a/Engine/source/terrain/terrImport.cpp b/Engine/source/terrain/terrImport.cpp index bbc36a5d6..28c384e5f 100644 --- a/Engine/source/terrain/terrImport.cpp +++ b/Engine/source/terrain/terrImport.cpp @@ -50,8 +50,13 @@ ConsoleStaticMethod( TerrainBlock, createNew, S32, 5, 5, // rename it themselves in their file browser. The main reason for this is so we can easily increment for ourselves; // and because its too easy to rename the terrain object and forget to take care of the terrain filename afterwards. FileName terrFileName( Con::getVariable("$Client::MissionFile") ); - terrFileName.replace("tools/levels/", "art/terrains/"); - terrFileName.replace("levels/", "art/terrains/"); + String terrainDirectory( Con::getVariable( "$pref::Directories::Terrain" ) ); + if ( terrainDirectory.isEmpty() ) + { + terrainDirectory = "art/terrains/"; + } + terrFileName.replace("tools/levels/", terrainDirectory); + terrFileName.replace("levels/", terrainDirectory); TerrainFile::create( &terrFileName, resolution, materials ); diff --git a/Engine/source/ts/tsMeshFit.cpp b/Engine/source/ts/tsMeshFit.cpp index 469b74d01..f82b079f4 100644 --- a/Engine/source/ts/tsMeshFit.cpp +++ b/Engine/source/ts/tsMeshFit.cpp @@ -402,7 +402,7 @@ F32 MeshFit::maxDot( const VectorF& v ) const // Best-fit oriented bounding box void MeshFit::addBox( const Point3F& sides, const MatrixF& mat ) { - TSMesh* mesh = initMeshFromFile( "core/art/shapes/unit_cube.dts" ); + TSMesh* mesh = initMeshFromFile( TSShapeConstructor::getCubeShapePath() ); if ( !mesh ) return; @@ -431,7 +431,7 @@ void MeshFit::fitOBB() // Best-fit sphere void MeshFit::addSphere( F32 radius, const Point3F& center ) { - TSMesh* mesh = initMeshFromFile( "core/art/shapes/unit_sphere.dts" ); + TSMesh* mesh = initMeshFromFile( TSShapeConstructor::getSphereShapePath() ); if ( !mesh ) return; @@ -460,7 +460,7 @@ void MeshFit::fitSphere() // Best-fit capsule void MeshFit::addCapsule( F32 radius, F32 height, const MatrixF& mat ) { - TSMesh* mesh = initMeshFromFile( "core/art/shapes/unit_capsule.dts" ); + TSMesh* mesh = initMeshFromFile( TSShapeConstructor::getCapsuleShapePath() ); if ( !mesh ) return; diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index b4036c9ce..de987704f 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -74,6 +74,10 @@ EndImplementEnumType; //----------------------------------------------------------------------------- +String TSShapeConstructor::smCapsuleShapePath("core/art/shapes/unit_capsule.dts"); +String TSShapeConstructor::smCubeShapePath("core/art/shapes/unit_cube.dts"); +String TSShapeConstructor::smSphereShapePath("core/art/shapes/unit_sphere.dts"); + ResourceRegisterPostLoadSignal< TSShape > TSShapeConstructor::_smAutoLoad( &TSShapeConstructor::_onTSShapeLoaded ); ResourceRegisterUnloadSignal< TSShape > TSShapeConstructor::_smAutoUnload( &TSShapeConstructor::_onTSShapeUnloaded ); @@ -280,6 +284,23 @@ void TSShapeConstructor::initPersistFields() Parent::initPersistFields(); } +void TSShapeConstructor::consoleInit() +{ + Parent::consoleInit(); + + Con::addVariable( "$pref::TSShapeConstructor::CapsuleShapePath", TypeString, &TSShapeConstructor::smCapsuleShapePath, + "The file path to the capsule shape used by tsMeshFit.\n\n" + "@ingroup MeshFit\n" ); + + Con::addVariable( "$pref::TSShapeConstructor::CubeShapePath", TypeString, &TSShapeConstructor::smCubeShapePath, + "The file path to the cube shape used by tsMeshFit.\n\n" + "@ingroup MeshFit\n" ); + + Con::addVariable( "$pref::TSShapeConstructor::SphereShapePath", TypeString, &TSShapeConstructor::smSphereShapePath, + "The file path to the sphere shape used by tsMeshFit.\n\n" + "@ingroup MeshFit\n" ); +} + TSShapeConstructor* TSShapeConstructor::findShapeConstructor(const FileName& path) { SimGroup *group; diff --git a/Engine/source/ts/tsShapeConstruct.h b/Engine/source/ts/tsShapeConstruct.h index 79947450d..52d129837 100644 --- a/Engine/source/ts/tsShapeConstruct.h +++ b/Engine/source/ts/tsShapeConstruct.h @@ -220,6 +220,11 @@ protected: Vector mSequences; ChangeSet mChangeSet; + // Paths to shapes used by MeshFit + static String smCapsuleShapePath; + static String smCubeShapePath; + static String smSphereShapePath; + static bool addSequenceFromField( void *obj, const char *index, const char *data ); static void _onTSShapeLoaded( Resource< TSShape >& shape ); @@ -250,6 +255,7 @@ public: DECLARE_CONOBJECT(TSShapeConstructor); static void initPersistFields(); + static void consoleInit(); static TSShapeConstructor* findShapeConstructor(const FileName& path); bool onAdd(); @@ -261,6 +267,13 @@ public: void notifyShapeChanged(); + /// @name Shape paths for MeshFit + ///@{ + static const String& getCapsuleShapePath() { return smCapsuleShapePath; } + static const String& getCubeShapePath() { return smCubeShapePath; } + static const String& getSphereShapePath() { return smSphereShapePath; } + ///@} + TSShape* getShape() const { return mShape; } const String& getShapePath() const { return mShapePath; } diff --git a/Templates/Empty PhysX/game/tools/gui/images/arrowbtn_d.png b/Templates/Empty PhysX/game/tools/gui/images/arrowbtn_d.png new file mode 100644 index 000000000..be39b42bd Binary files /dev/null and b/Templates/Empty PhysX/game/tools/gui/images/arrowbtn_d.png differ diff --git a/Templates/Empty PhysX/game/tools/gui/images/arrowbtn_n.png b/Templates/Empty PhysX/game/tools/gui/images/arrowbtn_n.png new file mode 100644 index 000000000..0c0fd526d Binary files /dev/null and b/Templates/Empty PhysX/game/tools/gui/images/arrowbtn_n.png differ diff --git a/Templates/Empty PhysX/game/tools/gui/images/transp_grid.png b/Templates/Empty PhysX/game/tools/gui/images/transp_grid.png new file mode 100644 index 000000000..e6b9db4cc Binary files /dev/null and b/Templates/Empty PhysX/game/tools/gui/images/transp_grid.png differ diff --git a/Templates/Empty/game/tools/gui/images/arrowbtn_d.png b/Templates/Empty/game/tools/gui/images/arrowbtn_d.png new file mode 100644 index 000000000..be39b42bd Binary files /dev/null and b/Templates/Empty/game/tools/gui/images/arrowbtn_d.png differ diff --git a/Templates/Empty/game/tools/gui/images/arrowbtn_n.png b/Templates/Empty/game/tools/gui/images/arrowbtn_n.png new file mode 100644 index 000000000..0c0fd526d Binary files /dev/null and b/Templates/Empty/game/tools/gui/images/arrowbtn_n.png differ diff --git a/Templates/Empty/game/tools/gui/images/transp_grid.png b/Templates/Empty/game/tools/gui/images/transp_grid.png new file mode 100644 index 000000000..e6b9db4cc Binary files /dev/null and b/Templates/Empty/game/tools/gui/images/transp_grid.png differ diff --git a/Templates/Full PhysX/game/tools/gui/images/arrowbtn_d.png b/Templates/Full PhysX/game/tools/gui/images/arrowbtn_d.png new file mode 100644 index 000000000..be39b42bd Binary files /dev/null and b/Templates/Full PhysX/game/tools/gui/images/arrowbtn_d.png differ diff --git a/Templates/Full PhysX/game/tools/gui/images/arrowbtn_n.png b/Templates/Full PhysX/game/tools/gui/images/arrowbtn_n.png new file mode 100644 index 000000000..0c0fd526d Binary files /dev/null and b/Templates/Full PhysX/game/tools/gui/images/arrowbtn_n.png differ diff --git a/Templates/Full PhysX/game/tools/gui/images/transp_grid.png b/Templates/Full PhysX/game/tools/gui/images/transp_grid.png new file mode 100644 index 000000000..e6b9db4cc Binary files /dev/null and b/Templates/Full PhysX/game/tools/gui/images/transp_grid.png differ diff --git a/Templates/Full/game/tools/gui/images/arrowbtn_d.png b/Templates/Full/game/tools/gui/images/arrowbtn_d.png new file mode 100644 index 000000000..be39b42bd Binary files /dev/null and b/Templates/Full/game/tools/gui/images/arrowbtn_d.png differ diff --git a/Templates/Full/game/tools/gui/images/arrowbtn_n.png b/Templates/Full/game/tools/gui/images/arrowbtn_n.png new file mode 100644 index 000000000..0c0fd526d Binary files /dev/null and b/Templates/Full/game/tools/gui/images/arrowbtn_n.png differ diff --git a/Templates/Full/game/tools/gui/images/transp_grid.png b/Templates/Full/game/tools/gui/images/transp_grid.png new file mode 100644 index 000000000..e6b9db4cc Binary files /dev/null and b/Templates/Full/game/tools/gui/images/transp_grid.png differ