mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 21:03:27 +02:00
use update signal instead of timer
This commit is contained in:
parent
357b4db1db
commit
5c06841732
1 changed files with 2 additions and 7 deletions
|
@ -571,12 +571,6 @@ function update() {
|
||||||
Reticle.visible = false;
|
Reticle.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var BASIC_TIMER_INTERVAL = 20; // 20ms = 50hz good enough
|
|
||||||
var updateIntervalTimer = Script.setInterval(function(){
|
|
||||||
update();
|
|
||||||
}, BASIC_TIMER_INTERVAL);
|
|
||||||
|
|
||||||
|
|
||||||
// Check periodically for changes to setup.
|
// Check periodically for changes to setup.
|
||||||
var SETTINGS_CHANGE_RECHECK_INTERVAL = 10 * 1000; // 10 seconds
|
var SETTINGS_CHANGE_RECHECK_INTERVAL = 10 * 1000; // 10 seconds
|
||||||
function checkSettings() {
|
function checkSettings() {
|
||||||
|
@ -586,9 +580,10 @@ function checkSettings() {
|
||||||
checkSettings();
|
checkSettings();
|
||||||
|
|
||||||
var settingsChecker = Script.setInterval(checkSettings, SETTINGS_CHANGE_RECHECK_INTERVAL);
|
var settingsChecker = Script.setInterval(checkSettings, SETTINGS_CHANGE_RECHECK_INTERVAL);
|
||||||
|
Script.update.connect(update);
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
Script.clearInterval(settingsChecker);
|
Script.clearInterval(settingsChecker);
|
||||||
Script.clearInterval(updateIntervalTimer);
|
Script.update.disconnect(update);
|
||||||
OffscreenFlags.navigationFocusDisabled = false;
|
OffscreenFlags.navigationFocusDisabled = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue