Asked for in Discord: "raidplan.io bitte einbauen für die harten Dungeons". raidplan.io has no Aion 2
(only WoW, FFXIV, Lost Ark, New World), so the map tactics got what it offers.
- Dungeon maps: the in-game map textures of 11 expeditions, 7 transcendence dungeons, the 3 sanctuaries
(Ludra, Corroded Decontamination Facility, Chalice of Muspel), the 6 awakening towers and 3
subjugations, as published by the DPS meter Waffle-ens/waffle_meter (dotnet/Assets/Maps, pinned
commit). assets/map/dungeons/dungeons.json is kept by hand: groups, slugs (= tactics.map_slug),
German names from the Global client (aion2.app), KR/TW-only dungeons marked as unavailable, boss
hints for the awakening towers. scripts/download_dungeon_maps.py fetches the images, writes
dungeons/<slug>.webp (2048 px, about 3 MB in total, in Git) and the previews, and finds the dungeon
area (bounds) by comparing each map with the shared background of all maps. Two empty arenas
(round, square) are drawn in code.
- Viewer: image maps and arenas next to the tile maps (MapView.drawImageMap/drawArena, half zoom
steps, opens fitted to the dungeon beside the tactic panel), map picker with the tabs "Welt" and
"Dungeons & Raids", each area remembers its last map, no category panel without markers. The mouse
wheel zooms to the cursor.
- New page raidplan.php ("Raidplaner" in the menu, map.view) = map.php started in the dungeon area.
Location links on dungeon maps point to /raidplan.php and are recognized in texts and by the
calendar picker.
- Tokens (shape type 'token', TokenIcons.js): classes, roles, players 1-8, markers A-D and symbols,
boss, add, danger, stack, spread, tower, orb, bomb. Colour and size come from the toolbar, numbers
and letters count up while placing, tokens are drawn above areas. Server whitelist
TACTIC_TOKEN_ICONS.
- Move tool (✥) with label/delete actions above the selected shape, double click and Del; new action
shape_update in tactics_api.php (points and label, same permissions, snapshot before). Undo also
reverts moves and labels. Rectangle and cone tools, saved as areas.
- Step transitions: tactic_shapes.ref is kept by "Kopie dieses Schritts", tactic copies and restores
(existing shapes get s<id>), so the same shape glides to its new place when stepping or playing;
play button (and space) runs through all steps. 🔗 copies a link to the tactic and step
(?taktik=&schritt=), which opens it after loading.
- Live view: the bot relay only knows the old shape types and events, so placing tokens and moving
send "changed" and the others reload - no bot deploy needed.
- Schema version 60 (tactic_shapes.icon, .ref, enum 'token'; also in sql/schema.sql), tour step on the
dashboard, patch notes and README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
151 lines
No EOL
4.7 KiB
JavaScript
151 lines
No EOL
4.7 KiB
JavaScript
/**
|
|
* MapData - Model for map information and markers
|
|
*/
|
|
|
|
class MapData {
|
|
constructor() {
|
|
this.maps = []; // List of available maps
|
|
this.currentMap = null; // Currently selected map info
|
|
this.markers = []; // Markers for current map
|
|
this.categories = {}; // Category metadata (group/name -> info)
|
|
this.visibleCategories = new Set();
|
|
this.extractedAt = ''; // Stand der Markerdaten (extracted_at_utc), fuer den Hinweis unter den Kategorien
|
|
}
|
|
|
|
/**
|
|
* Add a map to the available maps list
|
|
*/
|
|
addMap(mapInfo) {
|
|
this.maps.push({
|
|
id: mapInfo.id,
|
|
slug: mapInfo.slug,
|
|
name: mapInfo.name,
|
|
zone: mapInfo.zone || 'Unknown',
|
|
// tiles = Weltkarte mit Kacheln und Markern, image = Dungeon-Karte (ein Bild), arena = leere Arena
|
|
kind: mapInfo.kind || 'tiles',
|
|
area: mapInfo.area || 'welt',
|
|
group: mapInfo.group || '',
|
|
hint: mapInfo.hint || '',
|
|
unavailable: !!mapInfo.unavailable,
|
|
bounds: mapInfo.bounds || null,
|
|
arena: mapInfo.arena || null,
|
|
version: mapInfo.version || ''
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Set the current map and clear markers
|
|
*/
|
|
setCurrentMap(slug) {
|
|
const map = this.maps.find(m => m.slug === slug);
|
|
if (map) {
|
|
this.currentMap = map;
|
|
this.markers = [];
|
|
this.categories = {};
|
|
this.visibleCategories.clear();
|
|
this.extractedAt = '';
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* Load markers for the current map from JSON data
|
|
*/
|
|
loadMarkers(jsonData) {
|
|
if (!this.currentMap) return;
|
|
|
|
// Parse and normalize marker data
|
|
const rawMarkers = jsonData.markers || [];
|
|
this.extractedAt = jsonData.extracted_at_utc || '';
|
|
|
|
this.markers = rawMarkers.map(m => ({
|
|
id: m.id,
|
|
name: m.name,
|
|
description: m.description,
|
|
group_name: m.group_name,
|
|
category_name: m.category_name,
|
|
worldX: m.coordinates ? m.coordinates[1] : 0,
|
|
worldY: m.coordinates ? m.coordinates[0] : 0,
|
|
color: m.properties?.primary_color || '#FFFFFF',
|
|
iconText: m.properties?.icon_text || '',
|
|
nt: m.properties?.nt || '',
|
|
iconName: m.properties?.icon_name || '',
|
|
iconImage: this.iconPath(m.properties?.icon_image)
|
|
}));
|
|
|
|
// Build category metadata
|
|
this.markers.forEach(m => {
|
|
const key = `${m.group_name}/${m.category_name}`;
|
|
if (!this.categories[key]) {
|
|
this.categories[key] = {
|
|
group: m.group_name,
|
|
name: m.category_name,
|
|
count: 0,
|
|
color: CONFIG.CATEGORY_COLORS[m.group_name] || '#FFFFFF',
|
|
iconImage: m.iconImage || ''
|
|
};
|
|
}
|
|
this.categories[key].count++;
|
|
});
|
|
|
|
// Anfangs sind alle Kategorien versteckt - man blendet gezielt ein, was man sucht
|
|
// (einzeln, per Gruppe oder mit "Alle anzeigen").
|
|
}
|
|
|
|
/**
|
|
* Icon-Pfad aus den Markerdaten ohne ?... - ueber CONFIG.ICON_ALIASES auf die passende Datei
|
|
* in data/icons umgebogen. Karte und Kategorienliste lesen beide iconImage.
|
|
*/
|
|
iconPath(raw) {
|
|
if (!raw) return '';
|
|
const path = String(raw).split('?')[0];
|
|
return CONFIG.ICON_ALIASES[path] || path;
|
|
}
|
|
|
|
/**
|
|
* Toggle visibility of a category
|
|
*/
|
|
toggleCategory(key, visible) {
|
|
if (visible) {
|
|
this.visibleCategories.add(key);
|
|
} else {
|
|
this.visibleCategories.delete(key);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Toggle all categories in a group
|
|
*/
|
|
toggleGroup(groupName, visible) {
|
|
Object.entries(this.categories).forEach(([key, cat]) => {
|
|
if (cat.group === groupName) {
|
|
this.toggleCategory(key, visible);
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Check if all categories in a group are visible
|
|
*/
|
|
isGroupFullyVisible(groupName) {
|
|
return Object.entries(this.categories)
|
|
.filter(([key, cat]) => cat.group === groupName)
|
|
.every(([key]) => this.visibleCategories.has(key));
|
|
}
|
|
|
|
/**
|
|
* Check if any category in a group is visible
|
|
*/
|
|
isGroupPartiallyVisible(groupName) {
|
|
return Object.entries(this.categories)
|
|
.filter(([key, cat]) => cat.group === groupName)
|
|
.some(([key]) => this.visibleCategories.has(key));
|
|
}
|
|
|
|
/**
|
|
* Get marker count for a category
|
|
*/
|
|
getCategoryCount(key) {
|
|
return this.categories[key]?.count || 0;
|
|
}
|
|
} |