Skip to content

Commit 652ff51

Browse files
authored
Merge pull request #1811 from Areloch/guiObjViewFix
guiObjectView fix
2 parents 640bca0 + 3616647 commit 652ff51

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

Engine/source/T3D/guiObjectView.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ void GuiObjectView::initPersistFields()
136136
docsURL;
137137
addGroup( "Shape" );
138138
ADD_FIELD("shapeAsset", TypeShapeAssetRef, Offset(mShapeAssetRef, GuiObjectView))
139-
.doc("The source shape asset.");
139+
.doc("The source shape asset.")
140+
.onSet(&GuiObjectView::setShapeAsset);
140141
ADD_FIELD("modelAsset", TypeShapeAssetRef, Offset(mShapeAssetRef, GuiObjectView))
141142
.doc("The source shape asset.")
142143
.withFlags(AbstractClassRep::FieldFlags::FIELD_HideInInspectors | AbstractClassRep::FieldFlags::FIELD_DontWriteToFile);
@@ -154,7 +155,8 @@ void GuiObjectView::initPersistFields()
154155

155156
addGroup( "Mounting" );
156157
ADD_FIELD("mountedShapeAsset", TypeShapeAssetRef, Offset(mMountedShapeAssetRef, GuiObjectView))
157-
.doc("The mounted shape asset.");
158+
.doc("The mounted shape asset.")
159+
.onSet(&GuiObjectView::setMountedShapeAsset);
158160
ADD_FIELD("mountedModelAsset", TypeShapeAssetRef, Offset(mMountedShapeAssetRef, GuiObjectView))
159161
.doc("The source shape asset.")
160162
.withFlags(AbstractClassRep::FieldFlags::FIELD_HideInInspectors | AbstractClassRep::FieldFlags::FIELD_DontWriteToFile);
@@ -195,6 +197,26 @@ void GuiObjectView::initPersistFields()
195197

196198
//------------------------------------------------------------------------------
197199

200+
bool GuiObjectView::setShapeAsset(void* object, const char* index, const char* data)
201+
{
202+
GuiObjectView* ctrl = static_cast<GuiObjectView*>(object);
203+
if (ctrl)
204+
return ctrl->setObjectShape(data);;
205+
206+
return false;
207+
}
208+
209+
bool GuiObjectView::setMountedShapeAsset(void* object, const char* index, const char* data)
210+
{
211+
GuiObjectView* ctrl = static_cast<GuiObjectView*>(object);
212+
if (ctrl)
213+
return ctrl->setMountedShape(data);
214+
215+
return false;
216+
}
217+
218+
//------------------------------------------------------------------------------
219+
198220
void GuiObjectView::onStaticModified( StringTableEntry slotName, const char* newValue )
199221
{
200222
Parent::onStaticModified( slotName, newValue );

Engine/source/T3D/guiObjectView.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ class GuiObjectView : public GuiTSCtrl, protected AssetPtrCallback
163163
///
164164
void onStaticModified( StringTableEntry slotName, const char* newValue ) override;
165165

166+
static bool setShapeAsset(void* object, const char* index, const char* data);
167+
static bool setMountedShapeAsset(void* object, const char* index, const char* data);
168+
166169
public:
167170

168171
GuiObjectView();

0 commit comments

Comments
 (0)