Urho3D/bin/Data/Scripts/Editor/EditorToolBar.as
Lasse Öörni 337056b657 Squashed commit of the following:
commit 53b7204fded9ce69fa69e96b0531a12161c1036d
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Tue Feb 7 13:52:27 2017 -0300

    Restore windows positions when viewportmode switch

    Now the hierarchy and inspector windows will be restored to original state if you switch between viewport_compact and others.

commit 8a15c06ea468fd42268fa3d937433ff624b03a42
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 15:04:43 2017 -0300

    Replaced tabs by spaces.

commit 9663fef07f5dcebc3a78d2e82c875736cb6d1a70
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 14:56:06 2017 -0300

    Replaced tabs by spaces.

commit 6fbea29b26491675d9783769cc9f01e8f925dabe
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 14:49:15 2017 -0300

    Replaced tabs by spaces.

commit 6dbe8b451e444391f82c642374f1bcba506035ce
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 14:48:30 2017 -0300

    Replaced tabs by spaces.

commit 1d3c98689183abcc99271a65fe9ec3d9be5b6ca0
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 14:19:00 2017 -0300

    Fixed stats text position.

commit 9632876aee4470d722872223f62a072cef1e8137
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 13:54:20 2017 -0300

    Prevent inspector hide if viewport_compact

commit 46775b205bb340dddcb2f1950d9c1912845d36aa
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 13:52:25 2017 -0300

    Prevent hierarchy hide if viewport_compact

commit b301b244a47c4f374ca7b97f6c06029f95531c5e
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 13:47:10 2017 -0300

    Replaced .visible by functions.

commit a30879d68d2145c6521a9ed9f7d282e9f63b4404
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 13:42:51 2017 -0300

    Enable hierarchy/inspector on compact viewport mode.

commit d6f9d2748e96d8f7b76ea875e5079385f4d9af60
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Mon Feb 6 13:30:18 2017 -0300

    Clean version of code

    Now the content of SetCompactMode is inside of SetViewportMode.
    Code commented.
    Now the code match the engine code convention.

commit 9777750d41f6f45701438b65fae20ea008db3f71
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Sat Feb 4 17:21:57 2017 -0300

    Update EditorView.as

commit e00dbbac2a528a535dab2e1bbc24fe91933caf3b
Author: Liichi <lisandrobruzzo@gmail.com>
Date:   Sat Feb 4 17:18:11 2017 -0300

    Added compact option to viewport mode list.
2017-02-09 15:34:36 +02:00

536 lines
19 KiB
ActionScript

bool subscribedToEditorToolBar = false;
bool toolBarDirty = true;
UIElement@ toolBar;
const StringHash VIEW_MODE("VIEW_MODE");
void CreateToolBar()
{
toolBar = BorderImage("ToolBar");
toolBar.style = "EditorToolBar";
toolBar.SetLayout(LM_HORIZONTAL);
toolBar.layoutSpacing = 4;
toolBar.layoutBorder = IntRect(8, 4, 4, 8);
toolBar.opacity = uiMaxOpacity;
toolBar.SetFixedSize(graphics.width, 42);
toolBar.SetPosition(0, uiMenuBar.height);
ui.root.AddChild(toolBar);
UIElement@ runUpdateGroup = CreateGroup("RunUpdateGroup", LM_HORIZONTAL);
runUpdateGroup.AddChild(CreateToolBarToggle("RunUpdatePlay"));
runUpdateGroup.AddChild(CreateToolBarToggle("RunUpdatePause"));
runUpdateGroup.AddChild(CreateToolBarToggle("RevertOnPause"));
FinalizeGroupHorizontal(runUpdateGroup, "ToolBarToggle");
toolBar.AddChild(runUpdateGroup);
toolBar.AddChild(CreateToolBarSpacer(4));
UIElement@ editModeGroup = CreateGroup("EditModeGroup", LM_HORIZONTAL);
editModeGroup.AddChild(CreateToolBarToggle("EditMove"));
editModeGroup.AddChild(CreateToolBarToggle("EditRotate"));
editModeGroup.AddChild(CreateToolBarToggle("EditScale"));
editModeGroup.AddChild(CreateToolBarToggle("EditSelect"));
FinalizeGroupHorizontal(editModeGroup, "ToolBarToggle");
toolBar.AddChild(editModeGroup);
UIElement@ axisModeGroup = CreateGroup("AxisModeGroup", LM_HORIZONTAL);
axisModeGroup.AddChild(CreateToolBarToggle("AxisWorld"));
axisModeGroup.AddChild(CreateToolBarToggle("AxisLocal"));
FinalizeGroupHorizontal(axisModeGroup, "ToolBarToggle");
toolBar.AddChild(axisModeGroup);
toolBar.AddChild(CreateToolBarSpacer(4));
toolBar.AddChild(CreateToolBarToggle("MoveSnap"));
toolBar.AddChild(CreateToolBarToggle("RotateSnap"));
toolBar.AddChild(CreateToolBarToggle("ScaleSnap"));
UIElement@ snapScaleModeGroup = CreateGroup("SnapScaleModeGroup", LM_HORIZONTAL);
snapScaleModeGroup.AddChild(CreateToolBarToggle("SnapScaleHalf"));
snapScaleModeGroup.AddChild(CreateToolBarToggle("SnapScaleQuarter"));
FinalizeGroupHorizontal(snapScaleModeGroup, "ToolBarToggle");
toolBar.AddChild(snapScaleModeGroup);
toolBar.AddChild(CreateToolBarSpacer(4));
UIElement@ pickModeGroup = CreateGroup("PickModeGroup", LM_HORIZONTAL);
pickModeGroup.AddChild(CreateToolBarToggle("PickGeometries"));
pickModeGroup.AddChild(CreateToolBarToggle("PickLights"));
pickModeGroup.AddChild(CreateToolBarToggle("PickZones"));
pickModeGroup.AddChild(CreateToolBarToggle("PickRigidBodies"));
pickModeGroup.AddChild(CreateToolBarToggle("PickUIElements"));
FinalizeGroupHorizontal(pickModeGroup, "ToolBarToggle");
toolBar.AddChild(pickModeGroup);
toolBar.AddChild(CreateToolBarSpacer(4));
UIElement@ fillModeGroup = CreateGroup("FillModeGroup", LM_HORIZONTAL);
fillModeGroup.AddChild(CreateToolBarToggle("FillPoint"));
fillModeGroup.AddChild(CreateToolBarToggle("FillWireFrame"));
fillModeGroup.AddChild(CreateToolBarToggle("FillSolid"));
FinalizeGroupHorizontal(fillModeGroup, "ToolBarToggle");
toolBar.AddChild(fillModeGroup);
toolBar.AddChild(CreateToolBarSpacer(4));
UIElement@ originGroup = CreateGroup("OriginGroup", LM_HORIZONTAL);
originGroup.AddChild(CreateToolBarToggle("ShowOrigin"));
FinalizeGroupHorizontal(originGroup, "ToolBarToggle");
toolBar.AddChild(originGroup);
toolBar.AddChild(CreateToolBarSpacer(4));
DropDownList@ viewportModeList = DropDownList();
viewportModeList.style = AUTO_STYLE;
viewportModeList.SetMaxSize(100, 18);
viewportModeList.SetAlignment(HA_LEFT, VA_CENTER);
toolBar.AddChild(viewportModeList);
viewportModeList.AddItem(CreateViewPortModeText("Single", VIEWPORT_SINGLE));
viewportModeList.AddItem(CreateViewPortModeText("Compact", VIEWPORT_COMPACT));
viewportModeList.AddItem(CreateViewPortModeText("Vertical Split", VIEWPORT_LEFT|VIEWPORT_RIGHT));
viewportModeList.AddItem(CreateViewPortModeText("Horizontal Split", VIEWPORT_TOP|VIEWPORT_BOTTOM));
viewportModeList.AddItem(CreateViewPortModeText("Quad", VIEWPORT_TOP_LEFT|VIEWPORT_TOP_RIGHT|VIEWPORT_BOTTOM_LEFT|VIEWPORT_BOTTOM_RIGHT));
viewportModeList.AddItem(CreateViewPortModeText("1 Top / 2 Bottom", VIEWPORT_TOP|VIEWPORT_BOTTOM_LEFT|VIEWPORT_BOTTOM_RIGHT));
viewportModeList.AddItem(CreateViewPortModeText("2 Top / 1 Bottom", VIEWPORT_TOP_LEFT|VIEWPORT_TOP_RIGHT|VIEWPORT_BOTTOM));
viewportModeList.AddItem(CreateViewPortModeText("1 Left / 2 Right", VIEWPORT_LEFT|VIEWPORT_TOP_RIGHT|VIEWPORT_BOTTOM_RIGHT));
viewportModeList.AddItem(CreateViewPortModeText("2 Left / 1 Right", VIEWPORT_TOP_LEFT|VIEWPORT_BOTTOM_LEFT|VIEWPORT_RIGHT));
for (uint i = 0; i < viewportModeList.numItems; ++i)
{
if (viewportModeList.items[i].vars[VIEW_MODE].GetUInt() == viewportMode)
{
viewportModeList.selection = i;
break;
}
}
SubscribeToEvent(viewportModeList, "ItemSelected", "ToolBarSetViewportMode");
}
Button@ CreateToolBarButton(const String&in title)
{
Button@ button = Button(title);
button.defaultStyle = uiStyle;
button.style = "ToolBarButton";
CreateToolBarIcon(button);
CreateToolTip(button, title, IntVector2(button.width + 10, button.height - 10));
return button;
}
CheckBox@ CreateToolBarToggle(const String&in title)
{
CheckBox@ toggle = CheckBox(title);
toggle.defaultStyle = uiStyle;
toggle.style = "ToolBarToggle";
CreateToolBarIcon(toggle);
CreateToolTip(toggle, title, IntVector2(toggle.width + 10, toggle.height - 10));
return toggle;
}
void CreateToolBarIcon(UIElement@ element)
{
BorderImage@ icon = BorderImage("Icon");
icon.defaultStyle = iconStyle;
icon.style = element.name;
icon.SetFixedSize(30, 30);
icon.blendMode = BLEND_ALPHA;
element.AddChild(icon);
}
UIElement@ CreateGroup(const String&in title, LayoutMode layoutMode)
{
UIElement@ group = UIElement(title);
group.defaultStyle = uiStyle;
group.layoutMode = layoutMode;
return group;
}
void FinalizeGroupHorizontal(UIElement@ group, const String&in baseStyle)
{
for (uint i = 0; i < group.numChildren; ++i)
{
UIElement@ child = group.children[i];
if (i == 0 && i < group.numChildren - 1)
child.style = baseStyle + "GroupLeft";
else if (i < group.numChildren - 1)
child.style = baseStyle + "GroupMiddle";
else
child.style = baseStyle + "GroupRight";
}
group.maxSize = group.size;
}
UIElement@ CreateToolBarSpacer(uint width)
{
UIElement@ spacer = UIElement();
spacer.SetFixedWidth(width);
return spacer;
}
UIElement@ CreateToolTip(UIElement@ parent, const String&in title, const IntVector2&in offset)
{
ToolTip@ toolTip = parent.CreateChild("ToolTip");
toolTip.position = offset;
BorderImage@ textHolder = toolTip.CreateChild("BorderImage");
textHolder.SetStyle("ToolTipBorderImage");
Text@ toolTipText = textHolder.CreateChild("Text");
toolTipText.SetStyle("ToolTipText");
toolTipText.autoLocalizable = true;
toolTipText.text = title;
return toolTip;
}
void ToolBarRunUpdatePlay(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
StartSceneUpdate();
toolBarDirty = true;
}
void ToolBarRunUpdatePause(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
StopSceneUpdate();
toolBarDirty = true;
}
void ToolBarRevertOnPause(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
revertOnPause = edit.checked;
toolBarDirty = true;
}
void ToolBarEditModeMove(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
editMode = EDIT_MOVE;
toolBarDirty = true;
}
void ToolBarEditModeRotate(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
editMode = EDIT_ROTATE;
toolBarDirty = true;
}
void ToolBarEditModeScale(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
editMode = EDIT_SCALE;
toolBarDirty = true;
}
void ToolBarEditModeSelect(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
editMode = EDIT_SELECT;
toolBarDirty = true;
}
void ToolBarAxisModeWorld(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
axisMode = AXIS_WORLD;
toolBarDirty = true;
}
void ToolBarAxisModeLocal(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
axisMode = AXIS_LOCAL;
toolBarDirty = true;
}
void ToolBarMoveSnap(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
moveSnap = edit.checked;
toolBarDirty = true;
}
void ToolBarRotateSnap(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
rotateSnap = edit.checked;
toolBarDirty = true;
}
void ToolBarScaleSnap(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
scaleSnap = edit.checked;
toolBarDirty = true;
}
void ToolBarSnapScaleModeHalf(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
{
snapScaleMode = SNAP_SCALE_HALF;
snapScale = 0.5;
}
else if (snapScaleMode == SNAP_SCALE_HALF)
{
snapScaleMode = SNAP_SCALE_FULL;
snapScale = 1.0;
}
toolBarDirty = true;
}
void ToolBarSnapScaleModeQuarter(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
{
snapScaleMode = SNAP_SCALE_QUARTER;
snapScale = 0.25;
}
else if (snapScaleMode == SNAP_SCALE_QUARTER)
{
snapScaleMode = SNAP_SCALE_FULL;
snapScale = 1.0;
}
toolBarDirty = true;
}
void ToolBarPickModeGeometries(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
pickMode = PICK_GEOMETRIES;
toolBarDirty = true;
}
void ToolBarPickModeLights(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
pickMode = PICK_LIGHTS;
toolBarDirty = true;
}
void ToolBarPickModeZones(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
pickMode = PICK_ZONES;
toolBarDirty = true;
}
void ToolBarPickModeRigidBodies(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
pickMode = PICK_RIGIDBODIES;
toolBarDirty = true;
}
void ToolBarPickModeUIElements(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
pickMode = PICK_UI_ELEMENTS;
toolBarDirty = true;
}
void ToolBarFillModePoint(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
{
fillMode = FILL_POINT;
SetFillMode(fillMode);
}
toolBarDirty = true;
}
void ToolBarFillModeWireFrame(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
{
fillMode = FILL_WIREFRAME;
SetFillMode(fillMode);
}
toolBarDirty = true;
}
void ToolBarFillModeSolid(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
if (edit.checked)
{
fillMode = FILL_SOLID;
SetFillMode(fillMode);
}
toolBarDirty = true;
}
void ToolBarSetViewportMode(StringHash eventType, VariantMap& eventData)
{
DropDownList@ dropDown = eventData["Element"].GetPtr();
UIElement@ selected = dropDown.selectedItem;
dropDown.focus = false; // Lose the focus so the RMB dragging, immediately followed after changing viewport setup, behaves as expected
uint mode = selected.vars[VIEW_MODE].GetUInt();
SetViewportMode(mode);
}
void ToolBarShowOrigin(StringHash eventType, VariantMap& eventData)
{
CheckBox@ edit = eventData["Element"].GetPtr();
ShowOrigins (edit.checked);
toolBarDirty = true;
}
void UpdateDirtyToolBar()
{
if (toolBar is null || !toolBarDirty)
return;
CheckBox@ runUpdatePlayToggle = toolBar.GetChild("RunUpdatePlay", true);
if (runUpdatePlayToggle.checked != runUpdate)
runUpdatePlayToggle.checked = runUpdate;
CheckBox@ runUpdatePauseToggle = toolBar.GetChild("RunUpdatePause", true);
if (runUpdatePauseToggle.checked != (runUpdate == false))
runUpdatePauseToggle.checked = runUpdate == false;
CheckBox@ revertOnPauseToggle = toolBar.GetChild("RevertOnPause", true);
if (revertOnPauseToggle.checked != revertOnPause)
revertOnPauseToggle.checked = revertOnPause;
CheckBox@ editMoveToggle = toolBar.GetChild("EditMove", true);
if (editMoveToggle.checked != (editMode == EDIT_MOVE))
editMoveToggle.checked = editMode == EDIT_MOVE;
CheckBox@ editRotateToggle = toolBar.GetChild("EditRotate", true);
if (editRotateToggle.checked != (editMode == EDIT_ROTATE))
editRotateToggle.checked = editMode == EDIT_ROTATE;
CheckBox@ editScaleToggle = toolBar.GetChild("EditScale", true);
if (editScaleToggle.checked != (editMode == EDIT_SCALE))
editScaleToggle.checked = editMode == EDIT_SCALE;
CheckBox@ editSelectToggle = toolBar.GetChild("EditSelect", true);
if (editSelectToggle.checked != (editMode == EDIT_SELECT))
editSelectToggle.checked = editMode == EDIT_SELECT;
CheckBox@ axisWorldToggle = toolBar.GetChild("AxisWorld", true);
if (axisWorldToggle.checked != (axisMode == AXIS_WORLD))
axisWorldToggle.checked = axisMode == AXIS_WORLD;
CheckBox@ axisLocalToggle = toolBar.GetChild("AxisLocal", true);
if (axisLocalToggle.checked != (axisMode == AXIS_LOCAL))
axisLocalToggle.checked = axisMode == AXIS_LOCAL;
CheckBox@ moveSnapToggle = toolBar.GetChild("MoveSnap", true);
if (moveSnapToggle.checked != moveSnap)
moveSnapToggle.checked = moveSnap;
CheckBox@ rotateSnapToggle = toolBar.GetChild("RotateSnap", true);
if (rotateSnapToggle.checked != rotateSnap)
rotateSnapToggle.checked = rotateSnap;
CheckBox@ scaleSnapToggle = toolBar.GetChild("ScaleSnap", true);
if (scaleSnapToggle.checked != scaleSnap)
scaleSnapToggle.checked = scaleSnap;
CheckBox@ snapStepHalfToggle = toolBar.GetChild("SnapScaleHalf", true);
if (snapStepHalfToggle.checked != (snapScaleMode == SNAP_SCALE_HALF))
snapStepHalfToggle.checked = snapScaleMode == SNAP_SCALE_HALF;
CheckBox@ snapStepQuarterToggle = toolBar.GetChild("SnapScaleQuarter", true);
if (snapStepQuarterToggle.checked != (snapScaleMode == SNAP_SCALE_QUARTER))
snapStepQuarterToggle.checked = snapScaleMode == SNAP_SCALE_QUARTER;
CheckBox@ pickGeometriesToggle = toolBar.GetChild("PickGeometries", true);
if (pickGeometriesToggle.checked != (pickMode == PICK_GEOMETRIES))
pickGeometriesToggle.checked = pickMode == PICK_GEOMETRIES;
CheckBox@ pickLightsToggle = toolBar.GetChild("PickLights", true);
if (pickLightsToggle.checked != (pickMode == PICK_LIGHTS))
pickLightsToggle.checked = pickMode == PICK_LIGHTS;
CheckBox@ pickZonesToggle = toolBar.GetChild("PickZones", true);
if (pickZonesToggle.checked != (pickMode == PICK_ZONES))
pickZonesToggle.checked = pickMode == PICK_ZONES;
CheckBox@ pickRigidBodiesToggle = toolBar.GetChild("PickRigidBodies", true);
if (pickRigidBodiesToggle.checked != (pickMode == PICK_RIGIDBODIES))
pickRigidBodiesToggle.checked = pickMode == PICK_RIGIDBODIES;
CheckBox@ pickUIElementsToggle = toolBar.GetChild("PickUIElements", true);
if (pickUIElementsToggle.checked != (pickMode == PICK_UI_ELEMENTS))
pickUIElementsToggle.checked = pickMode == PICK_UI_ELEMENTS;
CheckBox@ fillPointToggle = toolBar.GetChild("FillPoint", true);
if (fillPointToggle.checked != (fillMode == FILL_POINT))
fillPointToggle.checked = fillMode == FILL_POINT;
CheckBox@ fillWireFrameToggle = toolBar.GetChild("FillWireFrame", true);
if (fillWireFrameToggle.checked != (fillMode == FILL_WIREFRAME))
fillWireFrameToggle.checked = fillMode == FILL_WIREFRAME;
CheckBox@ fillSolidToggle = toolBar.GetChild("FillSolid", true);
if (fillSolidToggle.checked != (fillMode == FILL_SOLID))
fillSolidToggle.checked = fillMode == FILL_SOLID;
CheckBox@ showOriginToggle = toolBar.GetChild("ShowOrigin", true);
if (showOriginToggle.checked != (EditorOriginShow == true))
showOriginToggle.checked = EditorOriginShow == true;
if (!subscribedToEditorToolBar)
{
SubscribeToEvent(runUpdatePlayToggle, "Toggled", "ToolBarRunUpdatePlay");
SubscribeToEvent(runUpdatePauseToggle, "Toggled", "ToolBarRunUpdatePause");
SubscribeToEvent(revertOnPauseToggle, "Toggled", "ToolBarRevertOnPause");
SubscribeToEvent(editMoveToggle, "Toggled", "ToolBarEditModeMove");
SubscribeToEvent(editRotateToggle, "Toggled", "ToolBarEditModeRotate");
SubscribeToEvent(editScaleToggle, "Toggled", "ToolBarEditModeScale");
SubscribeToEvent(editSelectToggle, "Toggled", "ToolBarEditModeSelect");
SubscribeToEvent(axisWorldToggle, "Toggled", "ToolBarAxisModeWorld");
SubscribeToEvent(axisLocalToggle, "Toggled", "ToolBarAxisModeLocal");
SubscribeToEvent(moveSnapToggle, "Toggled", "ToolBarMoveSnap");
SubscribeToEvent(rotateSnapToggle, "Toggled", "ToolBarRotateSnap");
SubscribeToEvent(scaleSnapToggle, "Toggled", "ToolBarScaleSnap");
SubscribeToEvent(snapStepHalfToggle, "Toggled", "ToolBarSnapScaleModeHalf");
SubscribeToEvent(snapStepQuarterToggle, "Toggled", "ToolBarSnapScaleModeQuarter");
SubscribeToEvent(pickGeometriesToggle, "Toggled", "ToolBarPickModeGeometries");
SubscribeToEvent(pickLightsToggle, "Toggled", "ToolBarPickModeLights");
SubscribeToEvent(pickZonesToggle, "Toggled", "ToolBarPickModeZones");
SubscribeToEvent(pickRigidBodiesToggle, "Toggled", "ToolBarPickModeRigidBodies");
SubscribeToEvent(pickUIElementsToggle, "Toggled", "ToolBarPickModeUIElements");
SubscribeToEvent(fillPointToggle, "Toggled", "ToolBarFillModePoint");
SubscribeToEvent(fillWireFrameToggle, "Toggled", "ToolBarFillModeWireFrame");
SubscribeToEvent(fillSolidToggle, "Toggled", "ToolBarFillModeSolid");
SubscribeToEvent(showOriginToggle, "Toggled", "ToolBarShowOrigin");
subscribedToEditorToolBar = true;
}
toolBarDirty = false;
}
Text@ CreateViewPortModeText(String text_, uint mode)
{
Text@ text = Text();
text.text = text_;
text.vars[VIEW_MODE] = mode;
text.style = "EditorEnumAttributeText";
return text;
}