diff --git a/api/fight.php b/api/fight.php index 1dd068a..8076e83 100644 --- a/api/fight.php +++ b/api/fight.php @@ -75,8 +75,9 @@ function localized_graphql_uri(string $language): string { return preg_replace('#https://[^/]+#', 'https://' . $host, GRAPHQL_URI); } -$acceptLanguage = $language === 'jp' ? 'ja' : $language; -$ch = curl_init(localized_graphql_uri($language)); +// Fight names must be stable regardless of language — always use the English endpoint. +// Localization only matters for ability/player names in analysis.php. +$ch = curl_init(GRAPHQL_URI); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, @@ -84,7 +85,6 @@ curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ' . $_SESSION['access_token'], - 'Accept-Language: ' . $acceptLanguage, ], CURLOPT_SSL_VERIFYPEER => !DEV_MODE, ]); diff --git a/css/planner.css b/css/planner.css index 267260b..a21f166 100644 --- a/css/planner.css +++ b/css/planner.css @@ -451,6 +451,60 @@ font-style: italic; } +/* ── Info Panel ──────────────────────────────────────────────────────────────── */ +.planner-info-panel { + margin-top: 14px; + padding-top: 14px; + border-top: 1px solid var(--border); +} + +.info-section { margin-bottom: 12px; } +.info-section:last-child { margin-bottom: 0; } + +.info-section-title { + font-size: 11px; + color: var(--t3); + text-transform: uppercase; + letter-spacing: 0.06em; + margin-bottom: 8px; +} + +.info-legend-items { + display: flex; + flex-direction: column; + gap: 5px; +} + +.info-legend-row { + display: flex; + align-items: center; + gap: 8px; +} + +.info-legend-dot { + width: 10px; + height: 10px; + border-radius: 2px; + flex-shrink: 0; +} +.info-legend-dot--buff { background: rgba(200,168,75,.8); } +.info-legend-dot--debuff { background: var(--red); } +.info-legend-dot--shield { background: var(--blue); } + +.info-legend-label { + font-size: 12px; + color: var(--t2); +} + +.info-section--warnings { margin-top: 12px; } + +.info-warning { + font-size: 12px; + padding: 3px 0; +} +.info-warning--job { color: var(--t2); } +.info-warning--missing { color: var(--red); } + /* ── Folder Sidebar ──────────────────────────────────────────────────────────── */ .folder-section { margin-bottom: 2px; } diff --git a/js/planner.js b/js/planner.js index dbeb301..e8b1561 100644 --- a/js/planner.js +++ b/js/planner.js @@ -286,6 +286,7 @@ function renderPlanDetail(plan) { if (!plan) { noplan.style.display = ''; content.style.display = 'none'; + renderInfoPanel(null); return; } @@ -325,6 +326,7 @@ function renderPlanDetail(plan) { }); initJobSlots(plan.id); initMechanicClicks(plan.id); + renderInfoPanel(plan); } function renderMechanicListHtml(plan) { @@ -438,6 +440,52 @@ function refreshMechanicList(planId) { if (!plan) return; const el = document.getElementById('mechanic-list'); if (el) el.innerHTML = renderMechanicListHtml(plan); + renderInfoPanel(plan); +} + +function renderInfoPanel(plan) { + const el = document.getElementById('planner-info-panel'); + if (!el) return; + + const legendHtml = ` +
+
Farbschema
+
+
Mitigation
+
Debuff
+
Schild
+
+
`; + + if (!plan) { el.innerHTML = legendHtml; return; } + + const activeJobSet = new Set(plan.jobComposition.filter(j => j)); + const noJobAbilities = new Set(); + const missingJobPairs = new Set(); + + for (const m of plan.mechanics) { + for (const a of m.assignments) { + if (!a.job) { + noJobAbilities.add(a.ability); + } else if (!activeJobSet.has(a.job)) { + missingJobPairs.add(`${a.job} · ${a.ability}`); + } + } + } + + let warningsHtml = ''; + if (noJobAbilities.size > 0 || missingJobPairs.size > 0) { + warningsHtml = `
Hinweise
`; + if (noJobAbilities.size > 0) { + warningsHtml += `
Fähigkeiten ohne Job-Zuordnung
`; + } + if (missingJobPairs.size > 0) { + warningsHtml += `
Fähigkeiten mit fehlendem Job
`; + } + warningsHtml += '
'; + } + + el.innerHTML = legendHtml + warningsHtml; } function removeAssignment(planId, mechanicId, abilityName) { diff --git a/templates/tab-planner.php b/templates/tab-planner.php index c657927..170b073 100644 --- a/templates/tab-planner.php +++ b/templates/tab-planner.php @@ -25,6 +25,8 @@
+ +