mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fix-another-highlighting-issue
This commit is contained in:
parent
ef997e647a
commit
6414fcaae5
2 changed files with 11 additions and 1 deletions
|
@ -56,6 +56,12 @@
|
|||
return canGrabEntity;
|
||||
};
|
||||
|
||||
this.clearAll = function() {
|
||||
this.highlightedEntities.forEach(function(entity) {
|
||||
dispatcherUtils.unhighlightTargetEntity(entity);
|
||||
});
|
||||
};
|
||||
|
||||
this.hasHyperLink = function(props) {
|
||||
return (props.href !== "" && props.href !== undefined);
|
||||
};
|
||||
|
@ -121,7 +127,6 @@
|
|||
if (channel === 'Hifi-unhighlight-entity') {
|
||||
try {
|
||||
data = JSON.parse(message);
|
||||
|
||||
var hand = data.hand;
|
||||
if (hand === dispatcherUtils.LEFT_HAND) {
|
||||
leftHighlightNearbyEntities.removeEntityFromHighlightList(data.entityID);
|
||||
|
@ -131,6 +136,9 @@
|
|||
} catch (e) {
|
||||
print("Failed to parse message");
|
||||
}
|
||||
} else if (channel === 'Hifi-unhighlight-all') {
|
||||
leftHighlightNearbyEntities.clearAll();
|
||||
rightHighlightNearbyEntities.clearAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -145,6 +153,7 @@
|
|||
dispatcherUtils.disableDispatcherModule("RightHighlightNearbyEntities");
|
||||
}
|
||||
Messages.subscribe('Hifi-unhighlight-entity');
|
||||
Messages.subscribe('Hifi-unhighlight-all');
|
||||
Messages.messageReceived.connect(handleMessage);
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
}());
|
||||
|
|
|
@ -78,6 +78,7 @@ Script.include("/~/system/libraries/utils.js");
|
|||
if (controllerData.triggerValues[this.hand] < TRIGGER_ON_VALUE) {
|
||||
this.triggerClicked = false;
|
||||
}
|
||||
Messages.sendLocalMessage('Hifi-unhighlight-all', '');
|
||||
return makeRunningValues(true, [], []);
|
||||
}
|
||||
this.triggerClicked = false;
|
||||
|
|
Loading…
Reference in a new issue