mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +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();
|
||||
print("starting tablet in landscape mode")
|
||||
tablet.landscape = true;
|
||||
entityIconOverlayManager.setIconsSelectable(null,false);
|
||||
// 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
|
||||
// Window.setFocus();
|
||||
}
|
||||
var activeLightParticle = (isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
||||
entityIconOverlayManager.setVisible(activeLightParticle);
|
||||
entityIconOverlayManager.setIconsSelectable(activeLightParticle);
|
||||
|
||||
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
||||
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
||||
};
|
||||
|
||||
|
@ -944,6 +942,9 @@ function mouseClickEvent(event) {
|
|||
} else {
|
||||
selectionManager.addEntity(foundEntity, true);
|
||||
}
|
||||
|
||||
entityIconOverlayManager.setIconsSelectable(selectionManager.selections,true);
|
||||
|
||||
if (wantDebug) {
|
||||
print("Model selected: " + foundEntity);
|
||||
}
|
||||
|
@ -1467,10 +1468,7 @@ function handeMenuEvent(menuItem) {
|
|||
} else if (menuItem === "Select All Entities Touching Box") {
|
||||
selectAllEtitiesInCurrentSelectionBox(true);
|
||||
} 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(activeLightParticle);
|
||||
entityIconOverlayManager.setIconsSelectable(activeLightParticle);
|
||||
|
||||
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE));
|
||||
} else if (menuItem === MENU_SHOW_ZONES_IN_EDIT_MODE) {
|
||||
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* globals EntityIconOverlayManager:true */
|
||||
|
||||
EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||
|
||||
var visible = false;
|
||||
var iconsSelectable = false;
|
||||
|
||||
// List of all created overlays
|
||||
var allOverlays = [];
|
||||
|
@ -71,14 +71,25 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
|||
};
|
||||
|
||||
|
||||
this.setIconsSelectable = function(isIconsSelectable) {
|
||||
if (iconsSelectable !== isIconsSelectable) {
|
||||
iconsSelectable = isIconsSelectable;
|
||||
this.setIconsSelectable = function(arrayOfSelectedEntityIDs, isIconsSelectable) {
|
||||
if (arrayOfSelectedEntityIDs === null) {
|
||||
for (var id in entityOverlays) {
|
||||
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