Merge remote-tracking branch 'devhead/Preview4_0' into tsneo

# Conflicts:
#	Templates/BaseGame/game/data/ui/guis/loadingGui.gui
#	Templates/BaseGame/game/data/ui/guis/mainMenu.gui
#	Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui
#	Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
#	Templates/BaseGame/game/tools/forestEditor/brushes.tscript
This commit is contained in:
Jeff Hutchinson 2021-08-13 20:14:39 -04:00
commit 717c7acca9
2266 changed files with 48780 additions and 26034 deletions

View file

@ -84,7 +84,7 @@ GuiConvexEditorCtrl::GuiConvexEditorCtrl()
mCtrlDown( false ),
mGridSnap(false)
{
mMaterialName = StringTable->insert("Grid512_OrangeLines_Mat");
mMaterialName = StringTable->insert("Prototyping:WallOrange");
}
GuiConvexEditorCtrl::~GuiConvexEditorCtrl()
@ -115,7 +115,7 @@ void GuiConvexEditorCtrl::onRemove()
void GuiConvexEditorCtrl::initPersistFields()
{
addField( "isDirty", TypeBool, Offset( mIsDirty, GuiConvexEditorCtrl ) );
addField( "materialName", TypeString, Offset(mMaterialName, GuiConvexEditorCtrl) );
addField( "materialName", TypeMaterialAssetId, Offset(mMaterialName, GuiConvexEditorCtrl) );
Parent::initPersistFields();
}
@ -249,13 +249,13 @@ void GuiConvexEditorCtrl::setVisible( bool val )
//Set the texture to a representatory one so we know what's what
if (isTrigger)
proxyShape->mMaterialName = "TriggerProxyMaterial";
proxyShape->mMaterialName = "ToolsModule:TriggerProxyMaterial";
else if (isPortal)
proxyShape->mMaterialName = "PortalProxyMaterial";
proxyShape->mMaterialName = "ToolsModule:PortalProxyMaterial";
else if (isZone)
proxyShape->mMaterialName = "ZoneProxyMaterial";
proxyShape->mMaterialName = "ToolsModule:ZoneProxyMaterial";
else if (isOccluder)
proxyShape->mMaterialName = "OccluderProxyMaterial";
proxyShape->mMaterialName = "ToolsModule:OccluderProxyMaterial";
proxyShape->_updateMaterial();
@ -529,7 +529,7 @@ void GuiConvexEditorCtrl::on3DMouseDragged(const Gui3DMouseEvent & event)
setupShape( newShape );
newShape->setField("material", mConvexSEL->getMaterialName());
newShape->_setMaterial(mConvexSEL->getMaterial());
submitUndo( CreateShape, newShape );
@ -1459,8 +1459,8 @@ bool GuiConvexEditorCtrl::isShapeValid( ConvexShape *shape )
void GuiConvexEditorCtrl::setupShape( ConvexShape *shape )
{
shape->setField( "material", mMaterialName );
shape->registerObject();
shape->_setMaterial(mMaterialName);
updateShape( shape );
Scene* scene = Scene::getRootScene();
@ -1910,11 +1910,11 @@ const char* GuiConvexEditorCtrl::getSelectedFaceMaterial()
if (mConvexSEL->mSurfaceUVs[mFaceSEL].matID == 0)
{
return mConvexSEL->mMaterialName;
return mConvexSEL->getMaterial();
}
else
{
return mConvexSEL->mSurfaceTextures[mConvexSEL->mSurfaceUVs[mFaceSEL].matID - 1].materialName;
return mConvexSEL->mSurfaceTextures[mConvexSEL->mSurfaceUVs[mFaceSEL].matID - 1].getMaterial();
}
}
@ -1978,7 +1978,7 @@ void GuiConvexEditorCtrl::setSelectedFaceMaterial(const char* materialName)
{
for (U32 i = 0; i < mConvexSEL->mSurfaceTextures.size(); i++)
{
if (!String::compare(mConvexSEL->mSurfaceTextures[i].materialName, materialName))
if (!String::compare(mConvexSEL->mSurfaceTextures[i].getMaterial(), materialName))
{
//found a match
mConvexSEL->mSurfaceUVs[mFaceSEL].matID = i + 1;
@ -1990,7 +1990,7 @@ void GuiConvexEditorCtrl::setSelectedFaceMaterial(const char* materialName)
{
//add a new one
ConvexShape::surfaceMaterial newMat;
newMat.materialName = materialName;
newMat._setMaterial(materialName);
mConvexSEL->mSurfaceTextures.push_back(newMat);
@ -2284,9 +2284,10 @@ ConvexEditorTool::EventResult ConvexEditorCreateTool::on3DMouseDown( const Gui3D
mNewConvex->setTransform( objMat );
mNewConvex->setField( "material", Parent::mEditor->mMaterialName );
mNewConvex->registerObject();
mNewConvex->_setMaterial(Parent::mEditor->mMaterialName);
mPlaneSizes.set( 0.1f, 0.1f, 0.1f );
mNewConvex->resizePlanes( mPlaneSizes );
mEditor->updateShape( mNewConvex );
@ -2509,7 +2510,7 @@ ConvexShape* ConvexEditorCreateTool::extrudeShapeFromFace( ConvexShape *inShape,
}
//newShape->setField( "material", Parent::mEditor->mMaterialName );
newShape->setField("material", inShape->getMaterialName());
newShape->_setMaterial(inShape->getMaterial());
newShape->registerObject();
mEditor->updateShape( newShape );

View file

@ -59,8 +59,8 @@ ConsoleDocClass( GuiMissionAreaCtrl,
GuiMissionAreaCtrl::GuiMissionAreaCtrl()
{
mHandleBitmap = StringTable->EmptyString();
mHandleTexture = NULL;
INIT_IMAGEASSET(HandleBitmap);
mHandleTextureSize = Point2I::Zero;
mHandleTextureHalfSize = Point2F::Zero;
@ -89,8 +89,7 @@ void GuiMissionAreaCtrl::initPersistFields()
{
addField( "squareBitmap", TypeBool, Offset(mSquareBitmap, GuiMissionAreaCtrl));
addField( "handleBitmap", TypeFilename, Offset( mHandleBitmap, GuiMissionAreaCtrl ),
"Bitmap file for the mission area handles.\n");
INITPERSISTFIELD_IMAGEASSET(HandleBitmap, GuiMissionAreaCtrl, "Bitmap for the mission area handles.\n");
addField( "missionBoundsColor", TypeColorI, Offset(mMissionBoundsColor, GuiMissionAreaCtrl));
addField( "cameraColor", TypeColorI, Offset(mCameraColor, GuiMissionAreaCtrl));
@ -114,15 +113,13 @@ bool GuiMissionAreaCtrl::onAdd()
desc.setBlend(true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha);
mBlendStateBlock = GFX->createStateBlock( desc );
if (*mHandleBitmap)
if (!mHandleBitmap.isNull())
{
mHandleTexture = GFXTexHandle( mHandleBitmap, &GFXTexturePersistentSRGBProfile, avar("%s() - mHandleTexture (line %d)", __FUNCTION__, __LINE__) );
mHandleTextureSize = Point2I( mHandleTexture->getWidth(), mHandleTexture->getHeight() );
mHandleTextureSize = Point2I(mHandleBitmap->getWidth(), mHandleBitmap->getHeight() );
mHandleTextureHalfSize = Point2F(mHandleTextureSize.x, mHandleTextureSize.y) * 0.5f;
}
else
{
mHandleTexture = NULL;
mHandleTextureSize = Point2I::Zero;
mHandleTextureHalfSize = Point2F::Zero;
}
@ -159,7 +156,7 @@ bool GuiMissionAreaCtrl::onWake()
void GuiMissionAreaCtrl::onSleep()
{
mTextureObject = NULL;
mBitmap = NULL;
mMissionArea = 0;
mTerrainBlock = 0;
@ -420,7 +417,7 @@ void GuiMissionAreaCtrl::setArea(const RectI & area)
void GuiMissionAreaCtrl::drawHandle(const Point2F & pos)
{
Point2F pnt(pos.x-mHandleTextureHalfSize.x, pos.y-mHandleTextureHalfSize.y);
GFX->getDrawUtil()->drawBitmap(mHandleTexture, pnt);
GFX->getDrawUtil()->drawBitmap(mHandleBitmap, pnt);
}
void GuiMissionAreaCtrl::drawHandles(RectI & box)
@ -604,7 +601,7 @@ void GuiMissionAreaCtrl::onRender(Point2I offset, const RectI & updateRect)
GFXDrawUtil *drawer = GFX->getDrawUtil();
drawer->clearBitmapModulation();
drawer->drawBitmapStretch(mTextureObject, rect, GFXBitmapFlip_Y, GFXTextureFilterLinear, false);
drawer->drawBitmapStretch(mBitmap, rect, GFXBitmapFlip_Y, GFXTextureFilterLinear, false);
GFX->setStateBlock(mSolidStateBlock);
drawer->clearBitmapModulation();

View file

@ -63,8 +63,9 @@ protected:
GFXStateBlockRef mBlendStateBlock;
GFXStateBlockRef mSolidStateBlock;
StringTableEntry mHandleBitmap;
GFXTexHandle mHandleTexture;
DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, onHandleBitmapChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap);
Point2I mHandleTextureSize;
Point2F mHandleTextureHalfSize;
@ -109,6 +110,8 @@ protected:
bool testWithinHandle(const Point2I & testPoint, S32 handleX, S32 handleY);
S32 getHitHandles(const Point2I & mousePnt, const RectI & box);
void onHandleBitmapChanged() {}
public:
GuiMissionAreaCtrl();
virtual ~GuiMissionAreaCtrl();

View file

@ -1807,9 +1807,11 @@ WorldEditor::WorldEditor()
mRenderPopupBackground = true;
mPopupBackgroundColor.set(100,100,100);
mPopupTextColor.set(255,255,0);
mSelectHandle = StringTable->insert("tools/worldEditor/images/SelectHandle");
mDefaultHandle = StringTable->insert("tools/worldEditor/images/DefaultHandle");
mLockedHandle = StringTable->insert("tools/worldEditor/images/LockedHandle");
mSelectHandleAssetId = StringTable->insert("ToolsModule:SelectHandle");
mDefaultHandleAssetId = StringTable->insert("ToolsModule:DefaultHandle");
mLockedHandleAssetId = StringTable->insert("ToolsModule:LockedHandle");
mObjectTextColor.set(255,255,255);
mObjectsUseBoxCenter = true;
@ -1894,9 +1896,9 @@ bool WorldEditor::onAdd()
// create the default class entry
mDefaultClassEntry.mName = 0;
mDefaultClassEntry.mIgnoreCollision = false;
mDefaultClassEntry.mDefaultHandle = GFXTexHandle(mDefaultHandle, &GFXStaticTextureSRGBProfile, avar("%s() - mDefaultClassEntry.mDefaultHandle (line %d)", __FUNCTION__, __LINE__));
mDefaultClassEntry.mSelectHandle = GFXTexHandle(mSelectHandle, &GFXStaticTextureSRGBProfile, avar("%s() - mDefaultClassEntry.mSelectHandle (line %d)", __FUNCTION__, __LINE__));
mDefaultClassEntry.mLockedHandle = GFXTexHandle(mLockedHandle, &GFXStaticTextureSRGBProfile, avar("%s() - mDefaultClassEntry.mLockedHandle (line %d)", __FUNCTION__, __LINE__));
mDefaultClassEntry.mDefaultHandle = mDefaultHandle;
mDefaultClassEntry.mSelectHandle = mSelectHandle;
mDefaultClassEntry.mLockedHandle = mLockedHandle;
if(!(mDefaultClassEntry.mDefaultHandle && mDefaultClassEntry.mSelectHandle && mDefaultClassEntry.mLockedHandle))
return false;
@ -2826,9 +2828,10 @@ void WorldEditor::initPersistFields()
addField( "renderObjText", TypeBool, Offset(mRenderObjText, WorldEditor) );
addField( "renderObjHandle", TypeBool, Offset(mRenderObjHandle, WorldEditor) );
addField( "renderSelectionBox", TypeBool, Offset(mRenderSelectionBox, WorldEditor) );
addField( "selectHandle", TypeFilename, Offset(mSelectHandle, WorldEditor) );
addField( "defaultHandle", TypeFilename, Offset(mDefaultHandle, WorldEditor) );
addField( "lockedHandle", TypeFilename, Offset(mLockedHandle, WorldEditor) );
INITPERSISTFIELD_IMAGEASSET(SelectHandle, WorldEditor, "");
INITPERSISTFIELD_IMAGEASSET(DefaultHandle, WorldEditor, "");
INITPERSISTFIELD_IMAGEASSET(LockedHandle, WorldEditor, "");
endGroup( "Rendering" );

View file

@ -327,9 +327,14 @@ class WorldEditor : public EditTSCtrl
bool mRenderPopupBackground;
ColorI mPopupBackgroundColor;
ColorI mPopupTextColor;
StringTableEntry mSelectHandle;
StringTableEntry mDefaultHandle;
StringTableEntry mLockedHandle;
DECLARE_IMAGEASSET(WorldEditor, SelectHandle, onSelectHandleChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(WorldEditor, SelectHandle);
DECLARE_IMAGEASSET(WorldEditor, DefaultHandle, onDefaultHandleChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(WorldEditor, DefaultHandle);
DECLARE_IMAGEASSET(WorldEditor, LockedHandle, onLockedHandleChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(WorldEditor, LockedHandle);
ColorI mObjectTextColor;
bool mObjectsUseBoxCenter;
ColorI mObjSelectColor;
@ -420,6 +425,10 @@ class WorldEditor : public EditTSCtrl
void setEditorTool(EditorTool*);
EditorTool* getActiveEditorTool() { return mActiveEditorTool; }
void onSelectHandleChanged() {}
void onDefaultHandleChanged() {}
void onLockedHandleChanged() {}
};
typedef WorldEditor::DropType WorldEditorDropType;