Charakterverwalter: Fertigkeiten-Attribut für eigene Einträge, Stufe ohne Vorzeichen
- eigenedefinierte Fertigkeiten bekommen ein Bezugsattribut (STR…CHA) im Selektor und lassen es im Bearbeiten-Abschnitt korrigieren - neue Spalte character_skills.attribute (Migration 2, schema.sql angepasst); character_skills() nutzt COALESCE aus Zeilen- und Katalogattribut - Fertigkeitsstufe startet bei max(0, Attributsbonus) und wird in Formular, Update und Anzeige (Web-Bogen, PDF) nie negativ bzw. nie mit Vorzeichen gezeigt - MOD- und Stufe-Spalte im Bogen auf gemeinsame Grundlinie gezogen
This commit is contained in:
parent
b4d4c53dd4
commit
929aa52c73
10 changed files with 86 additions and 30 deletions
|
|
@ -142,7 +142,8 @@ function page_handle(string $method, string $path): void
|
|||
$skillId > 0 ? $skillId : null,
|
||||
post_string('name'),
|
||||
post_int('bonus', 0),
|
||||
post_string('note')
|
||||
post_string('note'),
|
||||
post_string('attribute')
|
||||
);
|
||||
flash('success', 'Fertigkeit eingetragen.');
|
||||
} else {
|
||||
|
|
@ -161,7 +162,13 @@ function page_handle(string $method, string $path): void
|
|||
if (preg_match('#^/characters/(\d+)/skills/(\d+)$#', $path, $m) === 1) {
|
||||
require_post();
|
||||
$character = character_require((int) $m[1], $user);
|
||||
character_skill_update((int) $character['id'], (int) $m[2], post_int('bonus', 0), post_string('note'));
|
||||
character_skill_update(
|
||||
(int) $character['id'],
|
||||
(int) $m[2],
|
||||
post_int('bonus', 0),
|
||||
post_string('note'),
|
||||
array_key_exists('attribute', $_POST) ? post_string('attribute') : null
|
||||
);
|
||||
flash('success', 'Fertigkeit gespeichert.');
|
||||
redirect('/characters/' . $character['id'] . '/edit#fertigkeiten');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue