mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
added ability to drag ParticleEffects and Light Entities around via Overlay Icon.
This commit is contained in:
parent
e384f6d1b7
commit
be68d99bed
2 changed files with 25 additions and 2 deletions
|
@ -648,7 +648,10 @@ var toolBar = (function () {
|
||||||
// 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();
|
||||||
}
|
}
|
||||||
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(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);
|
||||||
|
|
||||||
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1464,7 +1467,10 @@ 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) {
|
||||||
entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(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);
|
||||||
|
|
||||||
} 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));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
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 = [];
|
||||||
|
@ -69,6 +70,18 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this.setIconsSelectable = function(isIconsSelectable) {
|
||||||
|
if (iconsSelectable !== isIconsSelectable) {
|
||||||
|
iconsSelectable = isIconsSelectable;
|
||||||
|
for (var id in entityOverlays) {
|
||||||
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
|
ignoreRayIntersection: iconsSelectable
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Allocate or get an unused overlay
|
// Allocate or get an unused overlay
|
||||||
function getOverlay() {
|
function getOverlay() {
|
||||||
var overlay;
|
var overlay;
|
||||||
|
@ -114,6 +127,10 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
overlayProperties[key] = customProperties[key];
|
overlayProperties[key] = customProperties[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(properties.type === 'ParticleEffect' || properties.type === 'Light'){
|
||||||
|
overlayProperties.ignoreRayIntersection = true;
|
||||||
|
}
|
||||||
Overlays.editOverlay(overlay, overlayProperties);
|
Overlays.editOverlay(overlay, overlayProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue