draw resonator lines below resonators when selecting a portal. Also reduce code duplication
This commit is contained in:
parent
146c061a3b
commit
e69ba16a23
@ -412,33 +412,26 @@ window.portalResetColor = function(portal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.resonatorsResetStyle = function(portalGuid) {
|
window.resonatorsResetStyle = function(portalGuid) {
|
||||||
for(var i = 0; i < 8; i++) {
|
window.resonatorsSetStyle(portalGuid, OPTIONS_RESONATOR_NON_SELECTED, OPTIONS_RESONATOR_LINE_NON_SELECTED);
|
||||||
resonatorLayerGroup = resonators[portalResonatorGuid(portalGuid, i)];
|
|
||||||
if(!resonatorLayerGroup) continue;
|
|
||||||
resonatorLayerGroup.eachLayer(function(layer) {
|
|
||||||
if (layer.options.guid) {
|
|
||||||
// Resonator
|
|
||||||
layer.setStyle(OPTIONS_RESONATOR_NON_SELECTED);
|
|
||||||
} else {
|
|
||||||
// Resonator line
|
|
||||||
layer.setStyle(OPTIONS_RESONATOR_LINE_NON_SELECTED);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.resonatorsSetSelectStyle = function(portalGuid) {
|
window.resonatorsSetSelectStyle = function(portalGuid) {
|
||||||
|
window.resonatorsSetStyle(portalGuid, OPTIONS_RESONATOR_SELECTED, OPTIONS_RESONATOR_LINE_SELECTED);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.resonatorsSetStyle = function(portalGuid, resoStyle, lineStyle) {
|
||||||
for(var i = 0; i < 8; i++) {
|
for(var i = 0; i < 8; i++) {
|
||||||
resonatorLayerGroup = resonators[portalResonatorGuid(portalGuid, i)];
|
resonatorLayerGroup = resonators[portalResonatorGuid(portalGuid, i)];
|
||||||
if(!resonatorLayerGroup) continue;
|
if(!resonatorLayerGroup) continue;
|
||||||
|
// bring resonators and their connection lines to front separately.
|
||||||
|
// this way the resonators are drawn on top of the lines.
|
||||||
resonatorLayerGroup.eachLayer(function(layer) {
|
resonatorLayerGroup.eachLayer(function(layer) {
|
||||||
if (layer.options.guid) {
|
if (!layer.options.guid) // Resonator line
|
||||||
// Resonator
|
layer.bringToFront().setStyle(lineStyle);
|
||||||
layer.bringToFront().setStyle(OPTIONS_RESONATOR_SELECTED);
|
});
|
||||||
} else {
|
resonatorLayerGroup.eachLayer(function(layer) {
|
||||||
// Resonator line
|
if (layer.options.guid) // Resonator
|
||||||
layer.bringToFront().setStyle(OPTIONS_RESONATOR_LINE_SELECTED);
|
layer.bringToFront().setStyle(resoStyle);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user