mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:19:05 +02:00
Code review
This commit is contained in:
parent
24dcc8788c
commit
7898aa2c4b
1 changed files with 11 additions and 10 deletions
|
@ -163,15 +163,13 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateDoesHover = function(handLaser) {
|
this.updateDoesHover = function(handLaser, doesHover) {
|
||||||
if (handLaser.doesHover !== undefined) {
|
if (handLaser.doesHover !== undefined) {
|
||||||
if (handLaser.hand === LEFT_HAND
|
if (handLaser.hand === LEFT_HAND && _this.leftPointerDoesHover !== doesHover) {
|
||||||
&& _this.leftPointerDoesHover !== handLaser.doesHover) {
|
_this.leftPointerDoesHover = doesHover;
|
||||||
_this.leftPointerDoesHover = handLaser.doesHover;
|
|
||||||
_this.leftPointerDoesHoverChanged = true;
|
_this.leftPointerDoesHoverChanged = true;
|
||||||
} else if (handLaser.hand === RIGHT_HAND
|
} else if (handLaser.hand === RIGHT_HAND && _this.rightPointerDoesHover !== doesHover) {
|
||||||
&& _this.rightPointerDoesHover !== handLaser.doesHover) {
|
_this.rightPointerDoesHover = doesHover;
|
||||||
_this.rightPointerDoesHover = handLaser.doesHover;
|
|
||||||
_this.rightPointerDoesHoverChanged = true;
|
_this.rightPointerDoesHoverChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -359,7 +357,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
_this.runningPluginNames[orderedPluginName] = true;
|
_this.runningPluginNames[orderedPluginName] = true;
|
||||||
_this.markSlots(candidatePlugin, orderedPluginName);
|
_this.markSlots(candidatePlugin, orderedPluginName);
|
||||||
_this.pointerManager.makePointerVisible(candidatePlugin.parameters.handLaser);
|
_this.pointerManager.makePointerVisible(candidatePlugin.parameters.handLaser);
|
||||||
_this.updateDoesHover(candidatePlugin.parameters.handLaser);
|
_this.updateDoesHover(candidatePlugin.parameters.handLaser,
|
||||||
|
candidatePlugin.parameters.handLaser.doesHover);
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
print("controllerDispatcher running " + orderedPluginName);
|
print("controllerDispatcher running " + orderedPluginName);
|
||||||
}
|
}
|
||||||
|
@ -389,14 +388,16 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
if (PROFILE) {
|
if (PROFILE) {
|
||||||
Script.beginProfileRange("dispatch.run." + runningPluginName);
|
Script.beginProfileRange("dispatch.run." + runningPluginName);
|
||||||
}
|
}
|
||||||
_this.updateDoesHover(plugin.parameters.handLaser);
|
|
||||||
var runningness = plugin.run(controllerData, deltaTime);
|
var runningness = plugin.run(controllerData, deltaTime);
|
||||||
if (!runningness.active) {
|
if (runningness.active) {
|
||||||
|
_this.updateDoesHover(plugin.parameters.handLaser, plugin.parameters.handLaser.doesHover);
|
||||||
|
} else {
|
||||||
// plugin is finished running, for now. remove it from the list
|
// plugin is finished running, for now. remove it from the list
|
||||||
// of running plugins and mark its activity-slots as "not in use"
|
// of running plugins and mark its activity-slots as "not in use"
|
||||||
delete _this.runningPluginNames[runningPluginName];
|
delete _this.runningPluginNames[runningPluginName];
|
||||||
_this.markSlots(plugin, false);
|
_this.markSlots(plugin, false);
|
||||||
_this.pointerManager.makePointerInvisible(plugin.parameters.handLaser);
|
_this.pointerManager.makePointerInvisible(plugin.parameters.handLaser);
|
||||||
|
_this.updateDoesHover(plugin.parameters.handLaser, true);
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
print("controllerDispatcher stopping " + runningPluginName);
|
print("controllerDispatcher stopping " + runningPluginName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue