Skip to content

Commit

Permalink
Merge pull request #226 from Kapim/devel
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
Kapim authored Dec 6, 2021
2 parents 56c9c64 + 205f169 commit 9e854b0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arcor2_AREditor/Assets/TABLET/Models/ActionModel.stl.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions arcor2_AREditor/Assets/TABLET/Scripts/ActionObject3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,12 @@ public override void UpdateModel() {
Model.transform.localScale = new Vector3(dimensions.Value.x, dimensions.Value.y, dimensions.Value.z);

}

public void Highlight() {
outlineOnClick.Highlight();
}

public void UnHighlight() {
outlineOnClick.UnHighlight();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public async Task UpdateMenu() {
CancelAimingButton.SetInteractivity(true);
await CheckDoneBtn();
AimingInProgress = true;
if (currentObject is ActionObject3D actionObject3D)
actionObject3D.UnHighlight();
UpdateCurrentPointLabel();
if (!automaticPointSelection && currentObject.ActionObjectMetadata.ObjectModel.Mesh.FocusPoints.Count > 1) {
NextButton.SetInteractivity(true);
Expand All @@ -207,6 +209,8 @@ public async Task UpdateMenu() {
SavePositionButton.SetInteractivity(false, "No aiming in progress");
CancelAimingButton.SetInteractivity(false, "No aiming in progress");
AimingInProgress = false;
if (currentObject is ActionObject3D actionObject3D)
actionObject3D.Highlight();
}
} else if (!currentObject.IsRobot() && !currentObject.IsCamera() && currentObject.ActionObjectMetadata.ObjectModel != null) {
UpdatePositionBlockVO.SetActive(true);
Expand Down Expand Up @@ -271,6 +275,8 @@ public async void CancelAiming() {
try {
await WebsocketManager.Instance.CancelObjectAiming();
AimingInProgress = false;
if (currentObject is ActionObject3D actionObject3D)
actionObject3D.Highlight();
if (currentFocusPoint >= 0 && currentFocusPoint < spheres.Count)
spheres[currentFocusPoint].UnHighlight();
UpdateCurrentPointLabel();
Expand Down Expand Up @@ -319,6 +325,8 @@ await WebsocketManager.Instance.ObjectAimingStart(currentObject.Data.Id,
SavePositionButton.SetInteractivity(true);
CancelAimingButton.SetInteractivity(true);
StartObjectFocusingButton.SetInteractivity(false, "Already aiming");
if (currentObject is ActionObject3D actionObject3D)
actionObject3D.UnHighlight();
if (!automaticPointSelection && currentObject.ActionObjectMetadata.ObjectModel.Mesh.FocusPoints.Count > 1) {
NextButton.SetInteractivity(true);
PreviousButton.SetInteractivity(true);
Expand All @@ -332,6 +340,8 @@ await WebsocketManager.Instance.ObjectAimingStart(currentObject.Data.Id,
CurrentPointLabel.text = "";
currentFocusPoint = -1;
AimingInProgress = false;
if (currentObject is ActionObject3D actionObject3D)
actionObject3D.Highlight();
if (ex.Message == "Focusing already started.") { //TODO HACK! find better solution
FocusObjectDone();
}
Expand Down Expand Up @@ -368,6 +378,8 @@ public async void FocusObjectDone() {
PreviousButton.SetInteractivity(false, "No aiming in progress");
SavePositionButton.SetInteractivity(false, "No aiming in progress");
StartObjectFocusingButton.SetInteractivity(true);
if (currentObject is ActionObject3D actionObject3D)
actionObject3D.Highlight();
AimingInProgress = false;
} catch (Base.RequestFailedException ex) {
Base.NotificationsModernUI.Instance.ShowNotification("Failed to focus object", ex.Message);
Expand Down Expand Up @@ -485,4 +497,13 @@ public void OpenSteppingMenu() {
EditorHelper.EnableCanvasGroup(CanvasGroup, false);
}

public void Highlight(bool enable) {
if (currentObject != null && currentObject is ActionObject3D actionObject) {
if (enable)
actionObject.Highlight();
else
actionObject.UnHighlight();
}
}

}
1 change: 1 addition & 0 deletions arcor2_AREditor/Assets/TABLET/Scripts/GUI/LeftMenuScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private async void CancelObjectAiming() {
try {
await WebsocketManager.Instance.CancelObjectAiming();
ActionObjectAimingMenu.Instance.AimingInProgress = false;
ActionObjectAimingMenu.Instance.Highlight(true);
DeactivateAllSubmenus();
ConfirmationDialog.Close();
} catch (RequestFailedException ex) {
Expand Down

0 comments on commit 9e854b0

Please sign in to comment.