Gear-Planer Guide: Stats-Prioritaet - allgemein als Reihenfolge und je Waffen, Ruestung, Schmuck und Manasteine, mit Hinweisen; Vorschlaege aus den Seelenpraegungen der Gegenstaende
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3d31df9adf
commit
e05f303719
4 changed files with 198 additions and 1 deletions
|
|
@ -6703,6 +6703,22 @@ button.gear-guide-skill:hover { border-color: var(--gold); transform: translateY
|
|||
.gear-guide-skill-chip img { width: 1.35em; height: 1.35em; border-radius: 50%; object-fit: cover; }
|
||||
.gear-guide-skill-chip.is-stigma { border-color: rgba(160, 120, 230, 0.55); background: rgba(160, 120, 230, 0.12); }
|
||||
.gear-guide-chip-hint code { padding: 0.05rem 0.3rem; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
|
||||
.gear-guide-stats { margin-bottom: 1rem; }
|
||||
.gear-guide-stat-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
|
||||
.gear-guide-stat-chain li { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.75rem 0.35rem 0.35rem; border: 1px solid rgba(201, 162, 39, 0.45); border-radius: 999px; background: rgba(201, 162, 39, 0.08); font-weight: 600; font-size: 0.9rem; }
|
||||
.gear-guide-stat-chain li small { font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }
|
||||
.gear-guide-stat-chain li + li::before { content: '›'; margin: 0 0.35rem 0 -0.2rem; color: var(--gold); font-size: 1.1rem; order: -1; }
|
||||
.gear-guide-stat-no { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--gold); color: #1a1a1a; font-size: 0.75rem; font-weight: 700; }
|
||||
.gear-guide-stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 0.75rem; align-items: stretch; }
|
||||
.gear-guide-stat-group { padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.2); }
|
||||
.gear-guide-stat-group h4 { display: flex; align-items: center; gap: 0.5rem; min-height: 28px; margin: 0 0 0.7rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; cursor: help; }
|
||||
.gear-guide-stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid rgba(201, 162, 39, 0.4); border-radius: 6px; background: rgba(0, 0, 0, 0.3); color: var(--gold); }
|
||||
.gear-guide-stat-icon .gear-doll-silhouette { width: 18px; height: 18px; }
|
||||
.gear-guide-stat-gem { width: 10px; height: 10px; transform: rotate(45deg); border: 2px solid currentColor; border-radius: 2px; }
|
||||
.gear-guide-stat-group ol { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.88rem; }
|
||||
.gear-guide-stat-group ol li::marker { color: var(--gold); font-weight: 700; }
|
||||
.gear-guide-stat-note { display: block; color: var(--text-muted); font-size: 0.78rem; line-height: 1.3; }
|
||||
.gear-guide-stat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
|
||||
.gear-guide-daevanion { margin-bottom: 1rem; }
|
||||
.gear-guide-dv-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
|
||||
.gear-guide-dv-board { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.2); opacity: 0.55; }
|
||||
|
|
@ -6748,6 +6764,8 @@ button.gear-guide-skill:hover { border-color: var(--gold); transform: translateY
|
|||
.gear-guide-hotbar-note { grid-column: 1 / -1; }
|
||||
.gear-guide-key-row { grid-template-columns: auto minmax(0, 1fr); }
|
||||
.gear-guide-key-row textarea { grid-column: 1 / -1; }
|
||||
.gear-guide-stat-row { grid-template-columns: auto minmax(0, 1fr); }
|
||||
.gear-guide-stat-row input:last-child { grid-column: 2; }
|
||||
}
|
||||
.gear-set-card-description { font-size: 0.85rem; color: var(--text-muted); line-height: 1.45; }
|
||||
|
||||
|
|
|
|||
|
|
@ -603,6 +603,7 @@ switch ($action) {
|
|||
'skills' => gear_guide($set)['skills'],
|
||||
'preset' => gear_guide($set)['preset'],
|
||||
'keys' => gear_guide($set)['keys'],
|
||||
'stats' => gear_guide($set)['stats'],
|
||||
'difficulty' => $_POST['difficulty'] ?? '',
|
||||
'tags' => (string) ($_POST['tags'] ?? ''),
|
||||
'strengths' => (string) ($_POST['strengths'] ?? ''),
|
||||
|
|
@ -628,6 +629,16 @@ switch ($action) {
|
|||
$pdo->prepare('UPDATE gear_sets SET guide = ?, updated_at = NOW() WHERE id = ?')->execute([gear_guide_json($guide), $set['id']]);
|
||||
set_flash('success', 'Erklärungen gespeichert.');
|
||||
redirect('/gear.php?set=' . (int) $set['id'] . '&tab=guide');
|
||||
|
||||
case 'save_guide_stats':
|
||||
// Guide: Stats-Prioritaet allgemein und je Waffe, Ruestung, Schmuck und Manastein
|
||||
$set = $ownSet();
|
||||
$guide = gear_guide_normalize(array_merge(gear_guide($set), [
|
||||
'stats' => is_array($_POST['stats'] ?? null) ? $_POST['stats'] : [],
|
||||
]));
|
||||
$pdo->prepare('UPDATE gear_sets SET guide = ?, updated_at = NOW() WHERE id = ?')->execute([gear_guide_json($guide), $set['id']]);
|
||||
set_flash('success', 'Stats-Priorität gespeichert.');
|
||||
redirect('/gear.php?set=' . (int) $set['id'] . '&tab=guide');
|
||||
}
|
||||
|
||||
set_flash('error', 'Unbekannte Aktion.');
|
||||
|
|
|
|||
|
|
@ -21,6 +21,19 @@ const GEAR_GUIDE_ORDER_MAX = 99; // Reihenfolge beim Steigern je Skill (0 =
|
|||
const GEAR_GUIDE_WHY_LENGTH = 600; // Begruendung je Skill
|
||||
const GEAR_GUIDE_KEY_LENGTH = 300; // Erklaerung je Taste der Skill-Leiste
|
||||
const GEAR_GUIDE_DAEVANION_LENGTH = 600; // Erklaerung zu den Daevanion-Brettern
|
||||
// Stats-Prioritaet: Gruppen (Slot-Gruppen aus GEAR_SLOTS plus allgemein und Manasteine) => [Name, Slot fuer das Symbol]
|
||||
const GEAR_GUIDE_STAT_GROUPS = [
|
||||
'all' => ['Allgemein', null],
|
||||
'weapon' => ['Waffen', 'main_hand'],
|
||||
'armor' => ['Rüstung', 'torso'],
|
||||
'jewelry' => ['Schmuck', 'necklace'],
|
||||
'manastone' => ['Manasteine', null],
|
||||
];
|
||||
// Slot-Gruppe in GEAR_SLOTS => Gruppe der Stats-Prioritaet
|
||||
const GEAR_GUIDE_SLOT_GROUPS = ['Waffen' => 'weapon', 'Rüstung' => 'armor', 'Schmuck' => 'jewelry'];
|
||||
const GEAR_GUIDE_STATS_MAX = 6; // Werte je Gruppe
|
||||
const GEAR_GUIDE_STAT_LENGTH = 40;
|
||||
const GEAR_GUIDE_STAT_NOTE_LENGTH = 80;
|
||||
|
||||
/** Einzeiliger Text: Leerraum zusammengefasst und gekuerzt. */
|
||||
function gear_guide_line(mixed $value, int $max): string
|
||||
|
|
@ -74,6 +87,20 @@ function gear_guide_normalize(array $raw): array
|
|||
$keys[$key] = $text;
|
||||
}
|
||||
}
|
||||
// Stats-Prioritaet je Gruppe: [['stat' => Wert, 'note' => Hinweis], …] in Reihenfolge
|
||||
$stats = [];
|
||||
foreach (GEAR_GUIDE_STAT_GROUPS as $group => $unused) {
|
||||
$entries = [];
|
||||
foreach (is_array($raw['stats'][$group] ?? null) ? $raw['stats'][$group] : [] as $entry) {
|
||||
$stat = gear_guide_line(is_array($entry) ? ($entry['stat'] ?? '') : '', GEAR_GUIDE_STAT_LENGTH);
|
||||
if ($stat !== '') {
|
||||
$entries[] = ['stat' => $stat, 'note' => gear_guide_line($entry['note'] ?? '', GEAR_GUIDE_STAT_NOTE_LENGTH)];
|
||||
}
|
||||
}
|
||||
if ($entries) {
|
||||
$stats[$group] = array_slice($entries, 0, GEAR_GUIDE_STATS_MAX);
|
||||
}
|
||||
}
|
||||
return [
|
||||
'difficulty' => isset(GEAR_GUIDE_DIFFICULTIES[$raw['difficulty'] ?? '']) ? (string) $raw['difficulty'] : '',
|
||||
'tags' => $list(is_array($tags) ? $tags : explode(',', (string) $tags), GEAR_GUIDE_TAGS_MAX, GEAR_GUIDE_TAG_LENGTH),
|
||||
|
|
@ -84,9 +111,57 @@ function gear_guide_normalize(array $raw): array
|
|||
'preset' => in_array((int) ($raw['preset'] ?? 1), GEAR_MACRO_PRESETS, true) ? (int) ($raw['preset'] ?? 1) : 1,
|
||||
'keys' => $keys,
|
||||
'daevanion' => gear_guide_text($raw['daevanion'] ?? '', GEAR_GUIDE_DAEVANION_LENGTH),
|
||||
'stats' => $stats,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Werte, die bei Gegenstaenden einer Gruppe als Seelenpraegung vorkommen (Vorschlaege im Dialog "Stats-Prioritaet"),
|
||||
* Manasteine wie im Slot-Editor, "Allgemein" alle zusammen.
|
||||
*
|
||||
* @return array<string, string[]> [Gruppe => Wertnamen]
|
||||
*/
|
||||
function gear_guide_stat_options(): array
|
||||
{
|
||||
$groups = array_fill_keys(array_keys(GEAR_GUIDE_STAT_GROUPS), []);
|
||||
foreach (db()->query('SELECT slot, data FROM gear_items')->fetchAll() as $row) {
|
||||
$group = GEAR_GUIDE_SLOT_GROUPS[GEAR_SLOTS[$row['slot']][1] ?? ''] ?? null;
|
||||
if ($group === null) {
|
||||
continue;
|
||||
}
|
||||
foreach ((json_decode((string) $row['data'], true)['soul_imprint'] ?? []) as $entry) {
|
||||
$name = (string) ($entry[0] ?? '');
|
||||
if ($name !== '' && !str_contains($name, '[')) {
|
||||
$groups[$group][$name] = true;
|
||||
$groups['all'][$name] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
$groups['manastone'] = array_fill_keys(gear_manastone_stats(), true);
|
||||
$sort = static function (string $a, string $b): int {
|
||||
$ia = array_search($a, GEAR_STAT_ORDER, true);
|
||||
$ib = array_search($b, GEAR_STAT_ORDER, true);
|
||||
return [$ia === false ? 99 : $ia, $a] <=> [$ib === false ? 99 : $ib, $b];
|
||||
};
|
||||
return array_map(static function (array $names) use ($sort): array {
|
||||
$names = array_map('strval', array_keys($names));
|
||||
usort($names, $sort);
|
||||
return $names;
|
||||
}, $groups);
|
||||
}
|
||||
|
||||
/** Slots einer Gruppe der Stats-Prioritaet als Text: "Kopf, Schultern, Brust, …" (Ring 1/2 nur einmal) */
|
||||
function gear_guide_stat_group_slots(string $group): string
|
||||
{
|
||||
$names = [];
|
||||
foreach (GEAR_SLOTS as [$label, $slotGroup]) {
|
||||
if ((GEAR_GUIDE_SLOT_GROUPS[$slotGroup] ?? '') === $group) {
|
||||
$names[(string) preg_replace('/ \d$/', '', $label)] = true;
|
||||
}
|
||||
}
|
||||
return implode(', ', array_keys($names));
|
||||
}
|
||||
|
||||
/**
|
||||
* Skills einer Klasse fuer die Skill-Chips: [kleingeschriebener Name (deutsch und englisch) => Skill].
|
||||
*
|
||||
|
|
@ -200,7 +275,7 @@ function gear_guide(array $set): array
|
|||
function gear_guide_json(array $guide): ?string
|
||||
{
|
||||
$empty = $guide['difficulty'] === '' && !$guide['tags'] && !$guide['strengths'] && !$guide['weaknesses'] && !$guide['tips']
|
||||
&& !$guide['skills'] && !$guide['keys'] && $guide['daevanion'] === '';
|
||||
&& !$guide['skills'] && !$guide['keys'] && $guide['daevanion'] === '' && !$guide['stats'];
|
||||
return $empty ? null : json_encode($guide, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
|
|
@ -539,6 +614,53 @@ function gear_render_guide_tab(array $set, bool $isOwn, array $slots, array $pla
|
|||
</section>
|
||||
</div>
|
||||
|
||||
<?php if ($guide['stats'] || $isOwn): ?>
|
||||
<?php // Stats-Prioritaet: worauf man bei Seelenpraegung und Manasteinen achten soll, allgemein und je Gruppe ?>
|
||||
<section class="panel gear-guide-section gear-guide-stats">
|
||||
<div class="gear-guide-section-head">
|
||||
<h3>Stats-Priorität</h3>
|
||||
<span class="text-muted gear-guide-legend">Worauf du bei Seelenprägung und Manasteinen achten solltest</span>
|
||||
<?php if ($isOwn): ?>
|
||||
<button type="button" class="button button-secondary button-small" data-modal-open="gear-guide-stats-edit"><?= icon('edit') ?> Priorität festlegen</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!$guide['stats']): ?>
|
||||
<p class="text-muted">Noch keine Priorität festgelegt – lege fest, welche Werte für diesen Build am wichtigsten sind, allgemein oder je Waffe, Rüstung, Schmuck und Manastein.</p>
|
||||
<?php else: ?>
|
||||
<?php if (!empty($guide['stats']['all'])): ?>
|
||||
<ol class="gear-guide-stat-chain">
|
||||
<?php foreach ($guide['stats']['all'] as $i => $entry): ?>
|
||||
<li<?= $entry['note'] !== '' ? ' title="' . e($entry['note']) . '"' : '' ?>>
|
||||
<span class="gear-guide-stat-no"><?= $i + 1 ?></span><?= e($entry['stat']) ?>
|
||||
<?php if ($entry['note'] !== ''): ?><small><?= e($entry['note']) ?></small><?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
<?php $statGroups = array_diff_key($guide['stats'], ['all' => true]); ?>
|
||||
<?php if ($statGroups): ?>
|
||||
<div class="gear-guide-stat-groups">
|
||||
<?php foreach (GEAR_GUIDE_STAT_GROUPS as $group => [$groupLabel, $groupSlot]): ?>
|
||||
<?php if (empty($statGroups[$group])) { continue; } ?>
|
||||
<div class="gear-guide-stat-group">
|
||||
<?php // Welche Slots dazugehoeren, steht im Tooltip - so beginnen die Listen aller Karten auf einer Hoehe ?>
|
||||
<h4 title="<?= e($groupSlot !== null ? gear_guide_stat_group_slots($group) : 'Manasteine in allen Sockeln') ?>">
|
||||
<span class="gear-guide-stat-icon" aria-hidden="true"><?= $groupSlot !== null ? gear_slot_silhouette($groupSlot) : '<span class="gear-guide-stat-gem"></span>' ?></span>
|
||||
<?= e($groupLabel) ?>
|
||||
</h4>
|
||||
<ol>
|
||||
<?php foreach ($statGroups[$group] as $entry): ?>
|
||||
<li><strong><?= e($entry['stat']) ?></strong><?php if ($entry['note'] !== ''): ?><small class="gear-guide-stat-note"><?= e($entry['note']) ?></small><?php endif; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// Daevanion: Bretter mit aktivierten Feldern, Kristalle, Skill-Boni und Werte (wie auf der Planer-Seite)
|
||||
$class = (string) ($set['class_name'] ?? '');
|
||||
|
|
@ -648,6 +770,42 @@ function gear_render_guide_tab(array $set, bool $isOwn, array $slots, array $pla
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($isOwn): ?>
|
||||
<?php // Stats-Prioritaet festlegen (#stats-prioritaet); Vorschlaege = Werte, die es bei der Gruppe gibt ?>
|
||||
<?php $statOptions = gear_guide_stat_options(); ?>
|
||||
<div class="modal-overlay" id="gear-guide-stats-edit" data-hash="stats-prioritaet" hidden>
|
||||
<div class="modal modal-wide">
|
||||
<button type="button" class="modal-close icon-button" title="Schließen"><?= icon('x') ?></button>
|
||||
<h2>Stats-Priorität</h2>
|
||||
<p class="text-muted">Wichtigster Wert zuerst. Die Vorschläge sind die Werte, die bei Gegenständen der Gruppe als Seelenprägung (bzw. als Manastein) vorkommen – du kannst aber auch etwas anderes eintragen. Leere Zeilen fallen weg.</p>
|
||||
<form method="post" action="/gear_action.php" class="gear-guide-form">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="save_guide_stats">
|
||||
<input type="hidden" name="set_id" value="<?= (int) $set['id'] ?>">
|
||||
<?php foreach (GEAR_GUIDE_STAT_GROUPS as $group => [$groupLabel]): ?>
|
||||
<fieldset class="gear-fieldset">
|
||||
<legend><?= e($groupLabel) ?><?= $group === 'all' ? ' <span class="text-muted">(gilt für die ganze Ausrüstung)</span>' : '' ?></legend>
|
||||
<datalist id="gear-guide-stat-options-<?= e($group) ?>">
|
||||
<?php foreach ($statOptions[$group] ?? [] as $option): ?><option value="<?= e($option) ?>"><?php endforeach; ?>
|
||||
</datalist>
|
||||
<?php for ($i = 0; $i < GEAR_GUIDE_STATS_MAX; $i++): ?>
|
||||
<?php $entry = $guide['stats'][$group][$i] ?? ['stat' => '', 'note' => '']; ?>
|
||||
<div class="gear-guide-stat-row">
|
||||
<span class="gear-guide-stat-no"><?= $i + 1 ?></span>
|
||||
<input type="text" name="stats[<?= e($group) ?>][<?= $i ?>][stat]" list="gear-guide-stat-options-<?= e($group) ?>" maxlength="<?= GEAR_GUIDE_STAT_LENGTH ?>" value="<?= e($entry['stat']) ?>" placeholder="Wert" aria-label="<?= e($groupLabel) ?>: Wert <?= $i + 1 ?>">
|
||||
<input type="text" name="stats[<?= e($group) ?>][<?= $i ?>][note]" maxlength="<?= GEAR_GUIDE_STAT_NOTE_LENGTH ?>" value="<?= e($entry['note']) ?>" placeholder="Hinweis (optional), z.B. bis 50 %" aria-label="<?= e($groupLabel) ?>: Hinweis <?= $i + 1 ?>">
|
||||
</div>
|
||||
<?php endfor; ?>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
<div class="actions">
|
||||
<button type="submit" class="button">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($isOwn): ?>
|
||||
<?php // Guide bearbeiten - nach einem Fehler geht der Dialog wieder auf (#guide) ?>
|
||||
<div class="modal-overlay" id="gear-guide-edit" data-hash="guide" hidden>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@ const PATCHNOTE_TYPES = [
|
|||
];
|
||||
|
||||
const PATCHNOTES = [
|
||||
[
|
||||
'id' => '2026-10-17-b',
|
||||
'date' => '2026-10-17',
|
||||
'title' => 'Stats-Priorität im Build-Guide',
|
||||
'summary' => 'Im Guide eines Builds steht jetzt, auf welche Werte du bei Seelenprägung und Manasteinen achten solltest – allgemein und je Waffe, Rüstung, Schmuck und Manastein.',
|
||||
'changes' => [
|
||||
['type' => 'neu', 'area' => 'Gear-Planer', 'text' => 'Neuer Abschnitt „Stats-Priorität“ im Reiter Guide: oben die allgemeine Reihenfolge (1 › 2 › 3), darunter je Gruppe die wichtigsten Werte mit Hinweisen wie „bis 50 %“. Bei deinen eigenen Sets legst du sie über „Priorität festlegen“ fest; vorgeschlagen werden die Werte, die es bei Gegenständen der Gruppe als Seelenprägung bzw. Manastein gibt.'],
|
||||
['type' => 'verbessert', 'area' => 'Gear-Planer', 'text' => 'Das Skill-Setup im Guide zeigt die erreichte Stufe samt Boni aus Daevanion und Arcana, und Tasten lassen sich über „Tasten erklären“ auch ohne geplante Skills beschreiben.'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'id' => '2026-10-17-a',
|
||||
'date' => '2026-10-17',
|
||||
|
|
|
|||
Loading…
Reference in a new issue