adds a useGroupCenter var/button to allow folks to use non-itterative snapping, and defaults it to do so (maintains prior functionality envelope)

This commit is contained in:
Azaezel 2017-02-22 14:31:26 -06:00
parent 7d2315c781
commit ebdd441833
4 changed files with 33 additions and 5 deletions

View file

@ -28,7 +28,7 @@
canMinimize = "0";
canMaximize = "0";
position = "400 31";
extent =" 175 257";
extent =" 175 267";
MinExtent = "175 130";
text = "Snap Options";
closeCommand = "ESnapOptions.hideDialog();";
@ -51,7 +51,7 @@
Visible = "1";
hovertime = "1000";
Docking = "Client";
Margin = "3 22 3 3";
Margin = "3 32 3 3";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
@ -793,6 +793,25 @@
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl() {
text = "Use Group Center";
groupNum = "1";
useMouseEvents = "0";
isContainer = "0";
horizSizing = "right";
vertSizing = "top";
position = "4 246";
extent = "105 24";
minExtent = "8 8";
visible = "1";
active = "1";
command = "toggleSnappingOptions(\"byGroup\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
internalName = "GroupSnapButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Size";
maxLength = "1024";

View file

@ -2056,6 +2056,7 @@ function EWorldEditor::syncGui( %this )
ESnapOptions-->GridSize.setText( EWorldEditor.getGridSize() );
ESnapOptions-->GridSnapButton.setStateOn( %this.getGridSnap() );
ESnapOptions-->GroupSnapButton.setStateOn( %this.UseGroupCenter );
SnapToBar-->objectGridSnapBtn.setStateOn( %this.getGridSnap() );
ESnapOptions-->NoSnapButton.setStateOn( !%this.stickToGround && !%this.getSoftSnap() && !%this.getGridSnap() );
}
@ -2458,6 +2459,12 @@ function toggleSnappingOptions( %var )
{
EWorldEditor.setGridSnap( !EWorldEditor.getGridSnap() );
}
else if( %var $= "byGroup" )
{
EWorldEditor.UseGroupCenter = !EWorldEditor.UseGroupCenter;
ESnapOptions->GroupSnapButton.setStateOn(EWorldEditor.UseGroupCenter);
error(EWorldEditor.UseGroupCenter);
}
else
{
// No snapping.