mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 13:33:26 +02:00
make laser pointers work even while content is loading
This commit is contained in:
parent
4a318e5498
commit
ddce0ef74a
2 changed files with 14 additions and 3 deletions
scripts/system/controllers
|
@ -2770,7 +2770,13 @@ var handleHandMessages = function(channel, message, sender) {
|
|||
|
||||
Messages.messageReceived.connect(handleHandMessages);
|
||||
|
||||
var BASIC_TIMER_INTERVAL = 20; // 20ms = 50hz good enough
|
||||
var updateIntervalTimer = Script.setInterval(function(){
|
||||
update();
|
||||
}, BASIC_TIMER_INTERVAL);
|
||||
|
||||
function cleanup() {
|
||||
Script.clearInterval(updateIntervalTimer);
|
||||
rightController.cleanup();
|
||||
leftController.cleanup();
|
||||
Controller.disableMapping(MAPPING_NAME);
|
||||
|
@ -2778,6 +2784,5 @@ function cleanup() {
|
|||
}
|
||||
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
Script.update.connect(update);
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
|
@ -507,10 +507,15 @@ function update() {
|
|||
clearSystemLaser();
|
||||
Reticle.visible = false;
|
||||
}
|
||||
setupHandler(Script.update, update);
|
||||
|
||||
var BASIC_TIMER_INTERVAL = 20; // 20ms = 50hz good enough
|
||||
var updateIntervalTimer = Script.setInterval(function(){
|
||||
update();
|
||||
}, BASIC_TIMER_INTERVAL);
|
||||
|
||||
|
||||
// Check periodically for changes to setup.
|
||||
var SETTINGS_CHANGE_RECHECK_INTERVAL = 10 * 1000; // milliseconds
|
||||
var SETTINGS_CHANGE_RECHECK_INTERVAL = 10 * 1000; // 10 seconds
|
||||
function checkSettings() {
|
||||
updateFieldOfView();
|
||||
updateRecommendedArea();
|
||||
|
@ -520,6 +525,7 @@ checkSettings();
|
|||
var settingsChecker = Script.setInterval(checkSettings, SETTINGS_CHANGE_RECHECK_INTERVAL);
|
||||
Script.scriptEnding.connect(function () {
|
||||
Script.clearInterval(settingsChecker);
|
||||
Script.clearInterval(updateIntervalTimer);
|
||||
OffscreenFlags.navigationFocusDisabled = false;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue