mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
snap syncing
for world and convex shape editors
This commit is contained in:
parent
e9638d285f
commit
7664b63071
|
|
@ -3043,16 +3043,23 @@ DefineEngineMethod(GuiConvexEditorCtrl, getSelectedFaceZRot, float, (), ,
|
|||
}
|
||||
|
||||
DefineEngineMethod(GuiConvexEditorCtrl, toggleGridSnapping, void, (),,
|
||||
"@brief Mount objB to this object at the desired slot with optional transform.\n\n"
|
||||
|
||||
"@param objB Object to mount onto us\n"
|
||||
"@param slot Mount slot ID\n"
|
||||
"@param txfm (optional) mount offset transform\n"
|
||||
"@return true if successful, false if failed (objB is not valid)")
|
||||
"@brief toggle grid snapping state.\n\n")
|
||||
{
|
||||
object->toggleGridSnapping();
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiConvexEditorCtrl, setGridSnap, void, (bool snap), ,
|
||||
"@brief set grid snapping state.\n\n")
|
||||
{
|
||||
object->setGridSnap(snap);
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiConvexEditorCtrl, getGridSnap, bool, (), ,
|
||||
"@brief set grid snapping state.\n\n")
|
||||
{
|
||||
return object->getGridSnap();
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiConvexEditorCtrl, setGridSnapSize, void, (float gridSize), (1.0),
|
||||
"@brief Mount objB to this object at the desired slot with optional transform.\n\n"
|
||||
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ public:
|
|||
void setSelectedFaceVertFlip(bool flipped);
|
||||
void setSelectedFaceZRot(float degrees);
|
||||
void toggleGridSnapping();
|
||||
bool getGridSnap() { return mGridSnap; };
|
||||
void setGridSnap(bool snap) { mGridSnap = snap; };
|
||||
void setGridSnapSize(float gridSize);
|
||||
|
||||
void updateShape();
|
||||
|
|
|
|||
|
|
@ -59,6 +59,11 @@ function ConvexEditorGui::onWake( %this )
|
|||
%this.resizing = false;
|
||||
%this.releaseSidePanel();
|
||||
}
|
||||
|
||||
EWorldEditor.UseGridSnap = EditorSettings.value("WorldEditor/Tools/UseGridSnap");
|
||||
CESnapOptions-->objectGridSnapBtn.setStateOn( EWorldEditor.UseGridSnap );
|
||||
%this.setGridSnap( EWorldEditor.UseGridSnap );
|
||||
EWorldEditor.setGridSnap( EWorldEditor.UseGridSnap );
|
||||
}
|
||||
|
||||
function ConvexEditorGui::onSleep( %this )
|
||||
|
|
@ -212,9 +217,14 @@ function ConvexEditorMaterialResetBtn::onClick(%this)
|
|||
|
||||
function ConvexEditorGui::toggleGridSnap(%this)
|
||||
{
|
||||
%this.toggleGridSnapping();
|
||||
EWorldEditor.UseGridSnap = !EWorldEditor.UseGridSnap;
|
||||
EditorSettings.setValue("WorldEditor/Tools/UseGridSnap", EWorldEditor.UseGridSnap );
|
||||
CESnapOptions-->objectGridSnapBtn.setStateOn( EWorldEditor.UseGridSnap );
|
||||
%this.setGridSnap( EWorldEditor.UseGridSnap );
|
||||
EWorldEditor.setGridSnap( EWorldEditor.UseGridSnap );
|
||||
}
|
||||
|
||||
|
||||
function ConvexEditorGridSnapSizeFld::onReturn(%this)
|
||||
{
|
||||
ConvexEditorGui.setGridSnapSize(%this.getText());
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ $guiContent = new GuiControl(convexEditorToolbar, EditorGuiGroup) {
|
|||
MinExtent = "1 1";
|
||||
bitmapAsset = "ToolsModule:separator_h_image";
|
||||
};
|
||||
new GuiContainer() {
|
||||
new GuiContainer(CESnapOptions) {
|
||||
canSaveDynamicFields = "0";
|
||||
Enabled = "1";
|
||||
isContainer = "1";
|
||||
|
|
|
|||
|
|
@ -130,6 +130,10 @@ function ConvexEditorPlugin::onActivated( %this )
|
|||
ConvexEditorScaleModeBtn.performClick();
|
||||
}
|
||||
|
||||
EWorldEditor.UseGridSnap = EditorSettings.value("WorldEditor/Tools/UseGridSnap");
|
||||
CESnapOptions-->objectGridSnapBtn.setStateOn( EWorldEditor.UseGridSnap );
|
||||
%this.setGridSnap( EWorldEditor.UseGridSnap );
|
||||
|
||||
Parent::onActivated( %this );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1019,6 +1019,10 @@ function WorldEditorPlugin::onActivated( %this )
|
|||
ETransformSelection.setVisible(true);
|
||||
}
|
||||
|
||||
EWorldEditor.UseGridSnap = EditorSettings.value("WorldEditor/Tools/UseGridSnap");
|
||||
ESnapOptions-->GridSnapButton.setStateOn( EWorldEditor.UseGridSnap );
|
||||
SnapToBar-->objectGridSnapBtn.setStateOn( EWorldEditor.UseGridSnap );
|
||||
|
||||
Parent::onActivated(%this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue