Skip to content

Commit cd99fc9

Browse files
committed
CSS anpassung für Mobil, Autoplaner Exclude Bench
1 parent a2c84a8 commit cd99fc9

3 files changed

Lines changed: 54 additions & 16 deletions

File tree

static/css/styles.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,13 @@
473473
align-items: center;
474474
z-index: 1000;
475475
}
476+
/* Wichtig: `.hidden` muss auch ohne Tailwind funktionieren.
477+
Tailwind-CDN lädt asynchron, und auf Mobile kann das Modal sonst
478+
kurzzeitig (oder dauerhaft, falls Tailwind nicht lädt) sichtbar sein. */
479+
.login-modal-overlay.hidden,
480+
.modal-overlay.hidden {
481+
display: none !important;
482+
}
476483
.login-modal-content {
477484
background-color: var(--color-dark-green-bg);
478485
border: 1px solid var(--color-gold-border);
@@ -1203,4 +1210,4 @@ html[data-theme="soo"] #toggle-video-btn {
12031210
[data-theme="soo"] #raid-selector {
12041211
border-color: var(--color-gold-border) !important;
12051212
color: var(--color-parchment) !important;
1206-
}
1213+
}

static/js/auth-presence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ window.showModal = function(message, isConfirm = false) {
3535
const allOverlays = document.querySelectorAll('.modal-overlay');
3636
allOverlays.forEach(el => {
3737
// Wir prüfen anhand der ID, ob es ein "wichtiges" statisches Fenster ist
38-
const isStatic = (el.id === 'player-edit-modal' || el.id === 'login-modal-overlay' || el.id === 'image-window.lightbox');
38+
const isStatic = (el.id === 'player-edit-modal' || el.id === 'login-modal-overlay' || el.id === 'image-lightbox');
3939

4040
// Nur löschen, wenn es KEIN statisches Fenster ist
4141
if (!isStatic) {

static/js/roster-comp.js

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,43 @@ window.RosterPatches = (function() {
6262
return out;
6363
}
6464

65-
function buildEffectiveRoster(globalRoster, bossId) {
65+
function buildEffectiveRoster(globalRoster, bossId, options) {
6666
if (!Array.isArray(globalRoster)) return [];
67+
const opts = options || {};
6768
const bossPatches = bossPatchesById[bossId] || {};
68-
if (Object.keys(bossPatches).length === 0) return globalRoster;
69-
return globalRoster.map(p => {
70-
const name = p.name || p;
71-
if (bossPatches[name]) {
72-
return applyPatchObject({ ...p, name: name }, bossPatches[name]);
73-
}
74-
return p;
75-
});
69+
70+
// 1. Patches anwenden (Klasse/Spec/Rolle pro Boss überschreiben)
71+
let roster = (Object.keys(bossPatches).length === 0)
72+
? globalRoster
73+
: globalRoster.map(p => {
74+
const name = p.name || p;
75+
if (bossPatches[name]) {
76+
return applyPatchObject({ ...p, name: name }, bossPatches[name]);
77+
}
78+
return p;
79+
});
80+
81+
// 2. Bench-Spieler optional rausfiltern.
82+
// Regel: Bench-Spieler sind alle ab Index 25 in globalRoster.
83+
// Ausnahme: hat der Spieler für diesen Boss einen Patch → bleibt drin
84+
// (Patch = User hat ihn bewusst für diesen Boss konfiguriert).
85+
if (opts.excludeBench) {
86+
const RAID_SLOT_COUNT = 25;
87+
// Map name → original global index (Bench-Erkennung über globalRoster, nicht über roster
88+
// — der könnte schon umsortiert sein, aber Indizes in globalRoster sind die Wahrheitsquelle)
89+
const benchNames = new Set(
90+
globalRoster.slice(RAID_SLOT_COUNT).map(p => p.name || p)
91+
);
92+
roster = roster.filter(p => {
93+
const name = p.name || p;
94+
const isOnBench = benchNames.has(name);
95+
const hasPatch = !!bossPatches[name];
96+
// Drin lassen wenn NICHT Bench, ODER Bench-mit-Patch
97+
return !isOnBench || hasPatch;
98+
});
99+
}
100+
101+
return roster;
76102
}
77103

78104
/**
@@ -927,8 +953,12 @@ window.setupBossListener = function(bossId) {
927953

928954
// Effektiver Roster = globalRoster + bossPatches
929955
const effectiveRoster = window.RosterPatches.buildEffectiveRoster(window.rosterData || [], bossId);
930-
// Kompatibilität: window.effectiveRoster für Module die später nachladen wollen
931-
window.effectiveRoster = effectiveRoster;
956+
// window.effectiveRoster wird vom Autoplaner gelesen → ohne Bench-Spieler (außer mit Boss-Patch),
957+
// damit der Autoplaner sie nicht versehentlich für Zuweisungen nutzt.
958+
// Die lokale 'effectiveRoster' bleibt komplett (mit Bench) für die Dropdowns auf der Boss-Seite.
959+
window.effectiveRoster = window.RosterPatches.buildEffectiveRoster(
960+
window.rosterData || [], bossId, { excludeBench: true }
961+
);
932962
window.currentBossIdForPatches = bossId;
933963

934964
// Banner aktualisieren (falls bereits gerendert)
@@ -1048,7 +1078,10 @@ window.setupBossListener = function(bossId) {
10481078
delete assignments._rosterPatches;
10491079

10501080
const effectiveRoster = window.RosterPatches.buildEffectiveRoster(window.rosterData || [], bossId);
1051-
window.effectiveRoster = effectiveRoster;
1081+
// Autoplaner-Variante: ohne Bench (außer Bench-mit-Patch)
1082+
window.effectiveRoster = window.RosterPatches.buildEffectiveRoster(
1083+
window.rosterData || [], bossId, { excludeBench: true }
1084+
);
10521085
window.currentBossIdForPatches = bossId;
10531086

10541087
if (typeof window.updateRosterPatchBanner === 'function') {
@@ -1888,14 +1921,12 @@ function openPlayerEditModal(player) {
18881921
};
18891922

18901923
modal.classList.remove('hidden');
1891-
modal.style.display = 'flex';
18921924
nameInput.focus();
18931925
}
18941926

18951927
function closePlayerEditModal() {
18961928
const modal = document.getElementById('player-edit-modal');
18971929
modal.classList.add('hidden');
1898-
modal.style.display = 'none';
18991930
currentPlayerIdToEdit = null;
19001931
isAddingNewPlayer = false;
19011932
}

0 commit comments

Comments
 (0)