Update README.md, check_dependencies.sh, colors.txt, and 3 more files for new alpha, get rid of IMagick for vips

This commit is contained in:
Rainer 2025-06-28 20:14:08 +02:00
parent 33f64cc57d
commit a3556c44e1
6 changed files with 1317 additions and 1048 deletions

View file

@ -89,9 +89,8 @@ document.addEventListener('DOMContentLoaded', function() {
const extent = [0, -mapData.mapHeight, mapData.mapWidth, 0];
const sourceResolutions = %%RESOLUTIONS_JS_ARRAY%%;
// HINZUGEFÜGT: Logik für digitalen Zoom wiederhergestellt
const maxNativeZoom = sourceResolutions.length -1;
const viewResolutions = [...sourceResolutions];
const digitalZoomLevels = 3;
let lastResolution = viewResolutions[viewResolutions.length - 1];
@ -124,11 +123,14 @@ document.addEventListener('DOMContentLoaded', function() {
const parentAreaStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(0, 100, 255, 0.8)', width: 2 }), fill: new ol.style.Fill({ color: 'rgba(0, 100, 255, 0.2)' }) });
const subAreaStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(0, 100, 255, 0.8)', width: 1.5, lineDash: [6, 6] }), fill: new ol.style.Fill({ color: 'transparent' }) });
const playerLayer = new ol.layer.Vector({ source: window.playerMarkerSource_%%current_world_key%%, style: f => f.get('style'), title: 'Spieler' });
const parentAreaLayer = new ol.layer.Vector({ source: window.parentAreaLayerSource_%%current_world_key%%, style: parentAreaStyle, title: 'Grundstücke' });
const subAreaLayer = new ol.layer.Vector({ source: window.subAreaLayerSource_%%current_world_key%%, style: subAreaStyle, title: 'Parzellen', visible: false });
const playerLayer = new ol.layer.Vector({ source: window.playerMarkerSource_%%current_world_key%%, style: f => f.get('style'), title: 'Spielerpositionen' });
// KORREKTUR: Die 'title'-Eigenschaft wurde von diesem Layer entfernt
const subAreaLayer = new ol.layer.Vector({ source: window.subAreaLayerSource_%%current_world_key%%, style: subAreaStyle, visible: false });
const overlayLayers = new ol.layer.Group({ title: 'Overlays', layers: [subAreaLayer, parentAreaLayer, playerLayer] });
const view = new ol.View({ projection: projection, center: ol.extent.getCenter(extent), resolutions: viewResolutions });
const popupContainer = document.getElementById('popup-%%current_world_key%%');
@ -159,18 +161,14 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
// KORREKTUR: Klick-Handler mit korrekter Priorisierung
map.on('click', function(evt) {
// Reset
overlay.setPosition(undefined);
popupCloser.blur();
// Priorität 1: Spieler-Marker
const playerFeature = map.forEachFeatureAtPixel(evt.pixel, (f, l) => l === playerLayer ? f : undefined);
if (playerFeature) {
window.subAreaLayerSource_%%current_world_key%%.clear(); // Sub-Areas ausblenden, wenn ein Spieler geklickt wird
window.subAreaLayerSource_%%current_world_key%%.clear();
subAreaLayer.setVisible(false);
const playerData = playerFeature.get('playerData');
if (playerData) {
const statusDotClass = playerFeature.get('statusDotClass');
@ -196,11 +194,10 @@ document.addEventListener('DOMContentLoaded', function() {
popupContent.innerHTML = popupHTML;
overlay.setPosition(playerFeature.getGeometry().getCoordinates());
}
return; // Verarbeitung hier beenden
return;
}
// Priorität 2: Hauptgrundstück (nur wenn kein Spieler geklickt wurde)
window.subAreaLayerSource_%%current_world_key%%.clear(); // Alte Sub-Areas immer entfernen
window.subAreaLayerSource_%%current_world_key%%.clear();
const areaFeature = map.forEachFeatureAtPixel(evt.pixel, (f, l) => l === parentAreaLayer ? f : undefined);
if (areaFeature) {
const areaData = areaFeature.get('areaData');
@ -215,7 +212,6 @@ document.addEventListener('DOMContentLoaded', function() {
} else {
subAreaLayer.setVisible(false);
}
let popupHTML = `<strong>${areaData.name}</strong><br>Besitzer: ${areaData.owner}`;
if (areaData.sub_areas && areaData.sub_areas.length > 0) {
popupHTML += `<hr class="privilege-separator"><p><strong>Parzellen:</strong></p><ul>`;
@ -225,7 +221,6 @@ document.addEventListener('DOMContentLoaded', function() {
popupContent.innerHTML = popupHTML;
overlay.setPosition(evt.coordinate);
} else {
// Wenn nichts geklickt wurde, auch die sub-areas ausblenden
subAreaLayer.setVisible(false);
}
});
@ -239,14 +234,33 @@ document.addEventListener('DOMContentLoaded', function() {
console.error("Fehler beim Initialisieren der Karte oder der Grundstücksdaten:", error);
mapContainer.innerHTML = "<p><em>Karte konnte nicht initialisiert werden: " + error.message + "</em></p>";
});
const liveBtn = document.getElementById('toggle-live-btn-%%current_world_key%%');
const archiveBtn = document.getElementById('toggle-archive-btn-%%current_world_key%%');
const liveContainer = document.getElementById('live-map-container-%%current_world_key%%');
const archiveContainer = document.getElementById('archive-view-container-%%current_world_key%%');
if (liveBtn && archiveBtn && liveContainer && archiveContainer) {
liveBtn.addEventListener('click', () => { liveContainer.style.display = 'block'; archiveContainer.style.display = 'none'; if (window.olMap_%%current_world_key%%) { setTimeout(() => window.olMap_%%current_world_key%%.updateSize(), 10); } });
archiveBtn.addEventListener('click', () => { archiveContainer.style.display = 'block'; liveContainer.style.display = 'none'; });
const setActiveButton = (activeBtn) => {
liveBtn.classList.remove('active');
archiveBtn.classList.remove('active');
activeBtn.classList.add('active');
};
liveBtn.addEventListener('click', () => {
setActiveButton(liveBtn);
liveContainer.style.display = 'block';
archiveContainer.style.display = 'none';
if (window.olMap_%%current_world_key%%) {
setTimeout(() => window.olMap_%%current_world_key%%.updateSize(), 10);
}
});
archiveBtn.addEventListener('click', () => {
setActiveButton(archiveBtn);
archiveContainer.style.display = 'block';
liveContainer.style.display = 'none';
});
}
});
</script>