Simplify map: remove filter dropdown, only show DeepDesert/HaggaBasin data, placeholder when no image

This commit is contained in:
Reditus committed 2026-05-15 03:48:18 +01:00
1 parent d769c3ef86
commit ca1f2e1966
2 files changed
+12 -40

No files matched your search

+4 -4
View File
@@ -470,21 +470,21 @@ def register_routes(app, services, settings):
ORDER BY a.map, ps.character_name ORDER BY a.map, ps.character_name
""") or [] """) or []
# Get vehicles with coordinates # Get vehicles with coordinates (only DeepDesert and HaggaBasin)
vehicles = db.query(""" vehicles = db.query("""
SELECT v.id, a.map, a.transform, a.class SELECT v.id, a.map, a.transform, a.class
FROM dune.vehicles v FROM dune.vehicles v
JOIN dune.actors a ON v.id = a.id JOIN dune.actors a ON v.id = a.id
WHERE a.transform IS NOT NULL WHERE a.transform IS NOT NULL AND a.map IN ('DeepDesert', 'HaggaBasin')
ORDER BY a.map, a.class ORDER BY a.map, a.class
""") or [] """) or []
# Get buildings with coordinates # Get buildings with coordinates (only DeepDesert and HaggaBasin)
buildings = db.query(""" buildings = db.query("""
SELECT b.id, a.map, a.transform, a.class SELECT b.id, a.map, a.transform, a.class
FROM dune.buildings b FROM dune.buildings b
JOIN dune.actors a ON b.id = a.id JOIN dune.actors a ON b.id = a.id
WHERE a.transform IS NOT NULL WHERE a.transform IS NOT NULL AND a.map IN ('DeepDesert', 'HaggaBasin')
ORDER BY a.map ORDER BY a.map
LIMIT 200 LIMIT 200
""") or [] """) or []
+8 -36
View File
@@ -269,14 +269,6 @@
Buildings ({{ buildings|length }}) Buildings ({{ buildings|length }})
</label> </label>
<h3>Filter by Map</h3>
<select class="map-select" id="map-filter" onchange="filterMap()">
<option value="">All Maps</option>
{% for map in maps %}
<option value="{{ map }}">{{ map }}</option>
{% endfor %}
</select>
<h3>Players</h3> <h3>Players</h3>
<div class="location-list" id="player-list"> <div class="location-list" id="player-list">
{% for p in players %} {% for p in players %}
@@ -329,9 +321,7 @@
<div class="map-image-container"> <div class="map-image-container">
<img src="{{ url_for('static', filename=map_image) }}" class="map-image" alt="Map"> <img src="{{ url_for('static', filename=map_image) }}" class="map-image" alt="Map">
{# Players #} {# Players - only show if they have pixel coords #}
{% if show_players is not defined %}{% set show_players = true %}{% endif %}
{% if show_players %}
{% for p in players %} {% for p in players %}
{% if p.px is not none and p.py is not none %} {% if p.px is not none and p.py is not none %}
<div class="map-marker player" style="left:{{ p.px }}px;top:{{ p.py }}px;" title="{{ p.name }}"> <div class="map-marker player" style="left:{{ p.px }}px;top:{{ p.py }}px;" title="{{ p.name }}">
@@ -339,11 +329,8 @@
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %}
{# Vehicles #} {# Vehicles #}
{% if show_vehicles is not defined %}{% set show_vehicles = true %}{% endif %}
{% if show_vehicles %}
{% for v in vehicles %} {% for v in vehicles %}
{% if v.px is not none and v.py is not none %} {% if v.px is not none and v.py is not none %}
<div class="map-marker vehicle" style="left:{{ v.px }}px;top:{{ v.py }}px;" title="{{ v.class }}"> <div class="map-marker vehicle" style="left:{{ v.px }}px;top:{{ v.py }}px;" title="{{ v.class }}">
@@ -351,11 +338,8 @@
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %}
{# Buildings #} {# Buildings #}
{% if show_buildings is not defined %}{% set show_buildings = true %}{% endif %}
{% if show_buildings %}
{% for b in buildings[:30] %} {% for b in buildings[:30] %}
{% if b.px is not none and b.py is not none %} {% if b.px is not none and b.py is not none %}
<div class="map-marker building" style="left:{{ b.px }}px;top:{{ b.py }}px;" title="{{ b.class }}"> <div class="map-marker building" style="left:{{ b.px }}px;top:{{ b.py }}px;" title="{{ b.class }}">
@@ -363,34 +347,27 @@
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %}
</div> </div>
</div> </div>
{% else %} {% else %}
<div class="map-placeholder"> <div class="map-placeholder">
<div class="map-placeholder-icon">🗺️</div> <div class="map-placeholder-icon">🗺️</div>
<h3>No Map Configured</h3> <h3>No Map Available</h3>
<p>Configure a map in settings to display coordinates.</p> <p>Map image not configured. Showing coordinate data in list view.</p>
<div class="no-map-note"> <div class="no-map-note">
<strong>Data available:</strong><br> <strong>Available Data:</strong><br>
DeepDesert & HaggaBasin locations:<br>
Players: {{ players|length }}<br> Players: {{ players|length }}<br>
Vehicles: {{ vehicles|length }}<br> Vehicles: {{ vehicles|length }}<br>
Buildings: {{ buildings|length }} Buildings: {{ buildings|length }}
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div id="selected-coords" style="display:none;margin-top:16px;">
<strong>Selected:</strong>
<div class="coord-display" id="coord-display"></div>
</div>
</div> </div>
</div> </div>
<script> <script>
let currentFilter = '';
function showCoords(el) { function showCoords(el) {
const type = el.dataset.type;
const name = el.dataset.name; const name = el.dataset.name;
const map = el.dataset.map; const map = el.dataset.map;
const x = parseFloat(el.dataset.x); const x = parseFloat(el.dataset.x);
@@ -404,11 +381,6 @@ function showCoords(el) {
`X: ${x.toFixed(2)} | Y: ${y.toFixed(2)} | Z: ${z.toFixed(2)}`; `X: ${x.toFixed(2)} | Y: ${y.toFixed(2)} | Z: ${z.toFixed(2)}`;
} }
function filterMap() {
currentFilter = document.getElementById('map-filter').value;
updateMap();
}
function updateMap() { function updateMap() {
const showPlayers = document.getElementById('show-players').checked; const showPlayers = document.getElementById('show-players').checked;
const showVehicles = document.getElementById('show-vehicles').checked; const showVehicles = document.getElementById('show-vehicles').checked;
@@ -416,13 +388,13 @@ function updateMap() {
// Filter lists // Filter lists
document.querySelectorAll('#player-list .location-item').forEach(el => { document.querySelectorAll('#player-list .location-item').forEach(el => {
el.style.display = (showPlayers && (!currentFilter || el.dataset.map === currentFilter)) ? 'flex' : 'none'; el.style.display = showPlayers ? 'flex' : 'none';
}); });
document.querySelectorAll('#vehicle-list .location-item').forEach(el => { document.querySelectorAll('#vehicle-list .location-item').forEach(el => {
el.style.display = (showVehicles && (!currentFilter || el.dataset.map === currentFilter)) ? 'flex' : 'none'; el.style.display = showVehicles ? 'flex' : 'none';
}); });
document.querySelectorAll('#building-list .location-item').forEach(el => { document.querySelectorAll('#building-list .location-item').forEach(el => {
el.style.display = (showBuildings && (!currentFilter || el.dataset.map === currentFilter)) ? 'flex' : 'none'; el.style.display = showBuildings ? 'flex' : 'none';
}); });
} }
</script> </script>