mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
Fixed Icons not being selectable while not highlighted.
This commit is contained in:
parent
d9706452ac
commit
53f581c3d4
2 changed files with 22 additions and 13 deletions
|
@ -644,14 +644,12 @@ var toolBar = (function () {
|
||||||
selectionDisplay.triggerMapping.enable();
|
selectionDisplay.triggerMapping.enable();
|
||||||
print("starting tablet in landscape mode")
|
print("starting tablet in landscape mode")
|
||||||
tablet.landscape = true;
|
tablet.landscape = true;
|
||||||
|
entityIconOverlayManager.setIconsSelectable(null,false);
|
||||||
// Not sure what the following was meant to accomplish, but it currently causes
|
// Not sure what the following was meant to accomplish, but it currently causes
|
||||||
// everybody else to think that Interface has lost focus overall. fogbugzid:558
|
// everybody else to think that Interface has lost focus overall. fogbugzid:558
|
||||||
// Window.setFocus();
|
// Window.setFocus();
|
||||||
}
|
}
|
||||||
var activeLightParticle = (isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
||||||
entityIconOverlayManager.setVisible(activeLightParticle);
|
|
||||||
entityIconOverlayManager.setIconsSelectable(activeLightParticle);
|
|
||||||
|
|
||||||
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -944,6 +942,9 @@ function mouseClickEvent(event) {
|
||||||
} else {
|
} else {
|
||||||
selectionManager.addEntity(foundEntity, true);
|
selectionManager.addEntity(foundEntity, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entityIconOverlayManager.setIconsSelectable(selectionManager.selections,true);
|
||||||
|
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("Model selected: " + foundEntity);
|
print("Model selected: " + foundEntity);
|
||||||
}
|
}
|
||||||
|
@ -1467,10 +1468,7 @@ function handeMenuEvent(menuItem) {
|
||||||
} else if (menuItem === "Select All Entities Touching Box") {
|
} else if (menuItem === "Select All Entities Touching Box") {
|
||||||
selectAllEtitiesInCurrentSelectionBox(true);
|
selectAllEtitiesInCurrentSelectionBox(true);
|
||||||
} else if (menuItem === MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) {
|
} else if (menuItem === MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) {
|
||||||
var activeLightParticle = (isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
||||||
entityIconOverlayManager.setVisible(activeLightParticle);
|
|
||||||
entityIconOverlayManager.setIconsSelectable(activeLightParticle);
|
|
||||||
|
|
||||||
} else if (menuItem === MENU_SHOW_ZONES_IN_EDIT_MODE) {
|
} else if (menuItem === MENU_SHOW_ZONES_IN_EDIT_MODE) {
|
||||||
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* globals EntityIconOverlayManager:true */
|
/* globals EntityIconOverlayManager:true */
|
||||||
|
|
||||||
EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
|
|
||||||
var visible = false;
|
var visible = false;
|
||||||
var iconsSelectable = false;
|
|
||||||
|
|
||||||
// List of all created overlays
|
// List of all created overlays
|
||||||
var allOverlays = [];
|
var allOverlays = [];
|
||||||
|
@ -71,14 +71,25 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
this.setIconsSelectable = function(isIconsSelectable) {
|
this.setIconsSelectable = function(arrayOfSelectedEntityIDs, isIconsSelectable) {
|
||||||
if (iconsSelectable !== isIconsSelectable) {
|
if (arrayOfSelectedEntityIDs === null) {
|
||||||
iconsSelectable = isIconsSelectable;
|
|
||||||
for (var id in entityOverlays) {
|
for (var id in entityOverlays) {
|
||||||
Overlays.editOverlay(entityOverlays[id], {
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
ignoreRayIntersection: iconsSelectable
|
ignoreRayIntersection: isIconsSelectable
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (var id in entityOverlays) {
|
||||||
|
if (arrayOfSelectedEntityIDs.indexOf(id) !== -1) { // in the entityOverlays array and selectable
|
||||||
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
|
ignoreRayIntersection: isIconsSelectable
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
|
ignoreRayIntersection: !isIconsSelectable
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue