mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 08:17:35 +02:00
move function out of global scope
This commit is contained in:
parent
2a055429cd
commit
e795af03dd
1 changed files with 19 additions and 21 deletions
|
@ -452,6 +452,25 @@ var toolBar = (function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handles any edit mode updates required when domains have switched
|
||||||
|
function checkEditPermissionsAndUpdate() {
|
||||||
|
if ((createButton === null) || (createButton === undefined)) {
|
||||||
|
//--EARLY EXIT--( nothing to safely update )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hasRezPermissions = (Entities.canRez() || Entities.canRezTmp() || Entities.canRezCertified() || Entities.canRezTmpCertified());
|
||||||
|
createButton.editProperties({
|
||||||
|
icon: (hasRezPermissions ? CREATE_ENABLED_ICON : CREATE_DISABLED_ICON),
|
||||||
|
captionColor: (hasRezPermissions ? "#ffffff" : "#888888"),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!hasRezPermissions && isActive) {
|
||||||
|
that.setActive(false);
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
Window.domainChanged.connect(function () {
|
Window.domainChanged.connect(function () {
|
||||||
|
@ -857,27 +876,6 @@ function handleOverlaySelectionToolUpdates(channel, message, sender) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handles any edit mode updates required when domains have switched
|
|
||||||
function checkEditPermissionsAndUpdate() {
|
|
||||||
if ( (createButton === null) || (createButton === undefined) ){
|
|
||||||
//--EARLY EXIT--( nothing to safely update )
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hasRezPermissions = (Entities.canRez() || Entities.canRezTmp() || Entities.canRezCertified() || Entities.canRezTmpCertified());
|
|
||||||
createButton.editProperties({
|
|
||||||
icon: (hasRezPermissions ? CREATE_ENABLED_ICON : CREATE_DISABLED_ICON),
|
|
||||||
captionColor: (hasRezPermissions ? "#ffffff" : "#888888"),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!hasRezPermissions) {
|
|
||||||
if (isActive) {
|
|
||||||
that.setActive(false);
|
|
||||||
}
|
|
||||||
tablet.gotoHomeScreen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleMessagesReceived(channel, message, sender) {
|
function handleMessagesReceived(channel, message, sender) {
|
||||||
switch( channel ){
|
switch( channel ){
|
||||||
case 'entityToolUpdates': {
|
case 'entityToolUpdates': {
|
||||||
|
|
Loading…
Reference in a new issue