Selektor auch für Waffen und Rüstung, fest auf die jeweilige Art vorgefiltert
This commit is contained in:
parent
a121b8c202
commit
c0756971cf
5 changed files with 247 additions and 40 deletions
|
|
@ -91,6 +91,12 @@ zauberturm.de: Nachtblau/Schwarz/Gold, Pergament, Animationen.
|
|||
per Admin-Knopf (`/admin/equipment`) oder `item_catalog_sync()` in die DB
|
||||
spiegeln. Der Selektor filtert serverseitig über `?item_kind=&item_avail=&item_q=`
|
||||
und schreibt die Auswahl als Inventarzeile (`POST …/items/from-catalog`).
|
||||
Derselbe Selektor sitzt – über `item_selector_config()` in `app/character.php`
|
||||
parametrisiert – auch in der Bewaffnung (`…/weapons/from-catalog`, fest auf Art
|
||||
„Waffe“) und in der Rüstung (`…/armors/from-catalog`, fest auf „Rüstung“ +
|
||||
„Schild“, Filterparameter `weapon_*` bzw. `armor_*`). Schaden (erster
|
||||
Würfelwurf aus `note`) und RK-Bonus (`[12]` bzw. „+1 RK“) werden dabei
|
||||
abgeleitet und bleiben im Bogen korrigierbar.
|
||||
- **Fertigkeitengruppen:** `WS_SKILL_CATALOG` in `app/rules.php` bildet den
|
||||
Charakterbogen (`RPG/6-Dokumente/Charakterbogen.pdf`) 1:1 ab: 33 Fertigkeiten
|
||||
in den Gruppen **Körper, Wildnis, Sozial, Wissen** (Reihenfolge =
|
||||
|
|
|
|||
|
|
@ -504,7 +504,9 @@ function item_catalog_sync(bool $force = false): int
|
|||
/**
|
||||
* Katalog durchsuchen.
|
||||
*
|
||||
* @param array{kind?:string,availability?:string,needle?:string,limit?:int} $filter
|
||||
* `kinds` schränkt auf mehrere Arten zugleich ein (z. B. Rüstung + Schild).
|
||||
*
|
||||
* @param array{kind?:string,kinds?:list<string>,availability?:string,needle?:string,limit?:int} $filter
|
||||
* @return list<array<string,mixed>>
|
||||
*/
|
||||
function item_catalog_search(array $filter = []): array
|
||||
|
|
@ -518,6 +520,12 @@ function item_catalog_search(array $filter = []): array
|
|||
$args[] = $kind;
|
||||
}
|
||||
|
||||
$kinds = item_catalog_filter_kinds($filter);
|
||||
if ($kinds !== []) {
|
||||
$where[] = 'kind IN (' . implode(', ', array_fill(0, count($kinds), '?')) . ')';
|
||||
$args = array_merge($args, $kinds);
|
||||
}
|
||||
|
||||
$availability = (string) ($filter['availability'] ?? '');
|
||||
if ($availability === 'methaven') {
|
||||
$where[] = "availability = 'methaven'";
|
||||
|
|
@ -533,11 +541,13 @@ function item_catalog_search(array $filter = []): array
|
|||
}
|
||||
|
||||
$limit = max(1, min(400, (int) ($filter['limit'] ?? 150)));
|
||||
// Gruppen in Katalogreihenfolge (WS_ITEM_CATEGORIES), innerhalb einer Gruppe alphabetisch.
|
||||
$kindOrder = implode(', ', array_fill(0, count(WS_ITEM_CATEGORIES), '?'));
|
||||
$sql = 'SELECT * FROM item_catalog'
|
||||
. ($where === [] ? '' : ' WHERE ' . implode(' AND ', $where))
|
||||
. ' ORDER BY sort_order, name LIMIT ' . $limit;
|
||||
. ' ORDER BY FIELD(kind, ' . $kindOrder . '), name, id LIMIT ' . $limit;
|
||||
$stmt = db()->prepare($sql);
|
||||
$stmt->execute($args);
|
||||
$stmt->execute(array_merge($args, WS_ITEM_CATEGORIES));
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
|
||||
|
|
@ -551,6 +561,11 @@ function item_catalog_count(array $filter = []): int
|
|||
$where[] = 'kind = ?';
|
||||
$args[] = $kind;
|
||||
}
|
||||
$kinds = item_catalog_filter_kinds($filter);
|
||||
if ($kinds !== []) {
|
||||
$where[] = 'kind IN (' . implode(', ', array_fill(0, count($kinds), '?')) . ')';
|
||||
$args = array_merge($args, $kinds);
|
||||
}
|
||||
$availability = (string) ($filter['availability'] ?? '');
|
||||
if ($availability === 'methaven') {
|
||||
$where[] = "availability = 'methaven'";
|
||||
|
|
@ -577,6 +592,104 @@ function item_catalog_find(int $id): ?array
|
|||
return $stmt->fetch() ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Feste Artenliste eines Katalogfilters (nur gültige Kategorien, ohne Dubletten).
|
||||
*
|
||||
* @param array<string,mixed> $filter
|
||||
* @return list<string>
|
||||
*/
|
||||
function item_catalog_filter_kinds(array $filter): array
|
||||
{
|
||||
$kinds = [];
|
||||
foreach ((array) ($filter['kinds'] ?? []) as $kind) {
|
||||
$kind = (string) $kind;
|
||||
if (in_array($kind, WS_ITEM_CATEGORIES, true) && !in_array($kind, $kinds, true)) {
|
||||
$kinds[] = $kind;
|
||||
}
|
||||
}
|
||||
return $kinds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Waffenprofil eines Katalogeintrags (Schaden, Kategorie).
|
||||
*
|
||||
* Die OSE-Werte stehen im Katalog nur als Notiz („OSE: 1W6, Nachladen“), deshalb
|
||||
* wird der erste Schadenswürfel gelesen und die Kategorie aus Name und Notiz
|
||||
* abgeleitet. Beides lässt sich im Bogen anschließend korrigieren.
|
||||
*
|
||||
* @param array<string,mixed> $entry
|
||||
* @return array{damage:string,category:string}
|
||||
*/
|
||||
function item_catalog_weapon_profile(array $entry): array
|
||||
{
|
||||
$note = (string) ($entry['note'] ?? '');
|
||||
$name = (string) ($entry['name'] ?? '');
|
||||
$damage = '';
|
||||
if (preg_match('/(\d+)\s*W\s*(\d+)(?:\s*([+-])\s*(\d+))?/u', $note, $m) === 1) {
|
||||
$damage = $m[1] . 'W' . $m[2];
|
||||
if (($m[3] ?? '') !== '' && ($m[4] ?? '') !== '') {
|
||||
$damage .= $m[3] . $m[4];
|
||||
}
|
||||
}
|
||||
$ranged = preg_match('/(bogen|armbrust|schleuder|blasrohr|wurf|lasso|netz|bolas)/iu', $name) === 1
|
||||
|| preg_match('/fernkampf/iu', $note) === 1;
|
||||
return ['damage' => $damage, 'category' => $ranged ? 'Fernkampf' : 'Nahkampf'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Rüstungsbonus eines Katalogeintrags.
|
||||
*
|
||||
* OSE nennt in den Notizen die aufsteigende RK in eckigen Klammern („RK 7 [12]“);
|
||||
* daraus wird der Bonus gegenüber der ungerüsteten RK 10. Schilde tragen ihren
|
||||
* Bonus als „+1 RK“. Alles andere (Helm, Kleidung) zählt 0.
|
||||
*
|
||||
* @param array<string,mixed> $entry
|
||||
*/
|
||||
function item_catalog_armor_bonus(array $entry): int
|
||||
{
|
||||
$note = (string) ($entry['note'] ?? '');
|
||||
if (preg_match('/\[\s*(\d+)\s*\]/u', $note, $m) === 1) {
|
||||
return max(-5, min(15, (int) $m[1] - 10));
|
||||
}
|
||||
if (preg_match('/\+\s*(\d+)\s*(?:RK|Rüstung)/iu', $note, $m) === 1) {
|
||||
return max(-5, min(15, (int) $m[1]));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Konfiguration für einen Ausrüstungs-Selektor im Charakterbogen.
|
||||
*
|
||||
* `$key` ist zugleich Präfix der Dialog-ID und der GET-Parameter
|
||||
* (`<key>_kind`, `<key>_avail`, `<key>_q`), damit sich mehrere Selektor-Schirme
|
||||
* auf derselben Seite nicht gegenseitig die Filter überschreiben.
|
||||
*
|
||||
* @param list<string>|null $kinds Feste Arten (z. B. ['Waffe']); null = freie Wahl
|
||||
* @return array{key:string,title:string,action:string,anchor:string,kinds:list<string>|null,filters:array<string,mixed>,catalog:list<array<string,mixed>>,count:int,open:bool}
|
||||
*/
|
||||
function item_selector_config(string $key, string $title, string $action, string $anchor, ?array $kinds = null): array
|
||||
{
|
||||
$filters = [
|
||||
'kind' => $kinds === null ? query_string($key . '_kind') : '',
|
||||
'availability' => query_string($key . '_avail'),
|
||||
'needle' => query_string($key . '_q'),
|
||||
];
|
||||
if ($kinds !== null) {
|
||||
$filters['kinds'] = $kinds;
|
||||
}
|
||||
return [
|
||||
'key' => $key,
|
||||
'title' => $title,
|
||||
'action' => $action,
|
||||
'anchor' => $anchor,
|
||||
'kinds' => $kinds,
|
||||
'filters' => $filters,
|
||||
'catalog' => item_catalog_search($filters),
|
||||
'count' => item_catalog_count($filters),
|
||||
'open' => $filters['kind'] !== '' || $filters['availability'] !== '' || $filters['needle'] !== '',
|
||||
];
|
||||
}
|
||||
|
||||
/** Preis eines Katalogeintrags als Text (Silbertaler, ohne Nachkommastellen wenn glatt). */
|
||||
function item_cost_label(mixed $cost): string
|
||||
{
|
||||
|
|
@ -615,6 +728,48 @@ function character_item_add_from_catalog(int $characterId, int $catalogId): bool
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Waffe aus dem Ausrüstungskatalog in die Bewaffnung übernehmen.
|
||||
*/
|
||||
function character_weapon_add_from_catalog(int $characterId, int $catalogId): bool
|
||||
{
|
||||
$entry = item_catalog_find($catalogId);
|
||||
if ($entry === null || (string) $entry['kind'] !== 'Waffe') {
|
||||
return false;
|
||||
}
|
||||
$profile = item_catalog_weapon_profile($entry);
|
||||
db()->prepare(
|
||||
'INSERT INTO character_weapons (character_id, weapon_id, name, damage, attack_bonus, category, note, equipped)
|
||||
VALUES (?, NULL, ?, ?, 0, ?, ?, 0)'
|
||||
)->execute([
|
||||
$characterId,
|
||||
shorten((string) $entry['name'], 80),
|
||||
shorten($profile['damage'], 20),
|
||||
$profile['category'],
|
||||
shorten((string) $entry['note'], 255),
|
||||
]);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rüstung oder Schild aus dem Ausrüstungskatalog übernehmen.
|
||||
*/
|
||||
function character_armor_add_from_catalog(int $characterId, int $catalogId): bool
|
||||
{
|
||||
$entry = item_catalog_find($catalogId);
|
||||
$kind = (string) ($entry['kind'] ?? '');
|
||||
if ($entry === null || !in_array($kind, ['Rüstung', 'Schild'], true)) {
|
||||
return false;
|
||||
}
|
||||
character_armor_add($characterId, 0, [
|
||||
'name' => (string) $entry['name'],
|
||||
'ac_bonus' => item_catalog_armor_bonus($entry),
|
||||
'kind' => $kind,
|
||||
'note' => (string) $entry['note'],
|
||||
]);
|
||||
return true;
|
||||
}
|
||||
|
||||
function character_item_delete(int $characterId, int $id): void
|
||||
{
|
||||
db()->prepare('DELETE FROM character_items WHERE id = ? AND character_id = ?')->execute([$id, $characterId]);
|
||||
|
|
|
|||
|
|
@ -299,6 +299,32 @@ function page_handle(string $method, string $path): void
|
|||
}
|
||||
redirect('/characters/' . $character['id'] . '/edit#inventar');
|
||||
}
|
||||
if (preg_match('#^/characters/(\d+)/weapons/from-catalog$#', $path, $m) === 1) {
|
||||
require_post();
|
||||
$character = character_require((int) $m[1], $user);
|
||||
$entry = item_catalog_find(post_int('catalog_id', 0));
|
||||
if ($entry === null) {
|
||||
flash('error', 'Diesen Eintrag kennt der Katalog nicht.');
|
||||
} elseif (character_weapon_add_from_catalog((int) $character['id'], (int) $entry['id'])) {
|
||||
flash('success', '„' . (string) $entry['name'] . '“ in die Bewaffnung übernommen.');
|
||||
} else {
|
||||
flash('error', 'Der Eintrag ist keine Waffe.');
|
||||
}
|
||||
redirect('/characters/' . $character['id'] . '/edit#bewaffnung');
|
||||
}
|
||||
if (preg_match('#^/characters/(\d+)/armors/from-catalog$#', $path, $m) === 1) {
|
||||
require_post();
|
||||
$character = character_require((int) $m[1], $user);
|
||||
$entry = item_catalog_find(post_int('catalog_id', 0));
|
||||
if ($entry === null) {
|
||||
flash('error', 'Diesen Eintrag kennt der Katalog nicht.');
|
||||
} elseif (character_armor_add_from_catalog((int) $character['id'], (int) $entry['id'])) {
|
||||
flash('success', '„' . (string) $entry['name'] . '“ in die Rüstung übernommen.');
|
||||
} else {
|
||||
flash('error', 'Der Eintrag ist weder Rüstung noch Schild.');
|
||||
}
|
||||
redirect('/characters/' . $character['id'] . '/edit#ruestung');
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ Admin */
|
||||
if ($path === '/admin/users') {
|
||||
|
|
@ -598,17 +624,15 @@ function page_character_edit(string $method, int $id, array $user): void
|
|||
$character = character_require($id, $user);
|
||||
$armors = character_armors((int) $character['id']);
|
||||
item_catalog_sync();
|
||||
$itemFilters = [
|
||||
'kind' => query_string('item_kind'),
|
||||
'availability' => query_string('item_avail'),
|
||||
'needle' => query_string('item_q'),
|
||||
$charPath = '/characters/' . (int) $character['id'];
|
||||
$selectors = [
|
||||
'item' => item_selector_config('item', 'Ausrüstung aus dem Katalog', $charPath . '/items/from-catalog', 'inventar'),
|
||||
'weapon' => item_selector_config('weapon', 'Waffe aus dem Katalog', $charPath . '/weapons/from-catalog', 'bewaffnung', ['Waffe']),
|
||||
'armor' => item_selector_config('armor', 'Rüstung aus dem Katalog', $charPath . '/armors/from-catalog', 'ruestung', ['Rüstung', 'Schild']),
|
||||
];
|
||||
render_page('character_edit', [
|
||||
'character' => $character,
|
||||
'itemFilters' => $itemFilters,
|
||||
'itemCatalog' => item_catalog_search($itemFilters),
|
||||
'itemCatalogCount' => item_catalog_count($itemFilters),
|
||||
'itemSelectorOpen' => $itemFilters['kind'] !== '' || $itemFilters['availability'] !== '' || $itemFilters['needle'] !== '',
|
||||
'selectors' => $selectors,
|
||||
'weapons' => character_weapons((int) $character['id']),
|
||||
'armors' => $armors,
|
||||
'weaponCatalog' => weapons_catalog(),
|
||||
|
|
|
|||
|
|
@ -1,62 +1,71 @@
|
|||
<?php
|
||||
/**
|
||||
* Selektor-Schirm: Ausrüstung aus dem Katalog ins Inventar übernehmen.
|
||||
* Selektor-Schirm: Ausrüstung aus dem Katalog übernehmen.
|
||||
*
|
||||
* Wird aus views/character_edit.php eingebunden; erwartet $base, $character,
|
||||
* $itemCatalog, $itemCatalogCount, $itemFilters und $itemSelectorOpen.
|
||||
* Wird aus views/character_edit.php eingebunden; erwartet $base, $character und
|
||||
* $selector (Konfiguration aus item_selector_config()). Derselbe Schirm dient
|
||||
* dem Inventar sowie – fest auf eine Art vorgefiltert – der Bewaffnung und der
|
||||
* Rüstung.
|
||||
*
|
||||
* Gefiltert wird serverseitig über GET-Parameter (item_kind/item_avail/item_q),
|
||||
* Gefiltert wird serverseitig über GET-Parameter (<key>_kind/<key>_avail/<key>_q),
|
||||
* damit der Katalog auch mit hunderten Einträgen ohne JavaScript bedienbar
|
||||
* bleibt. Die Auswahl selbst ist ein POST auf /characters/{id}/items/from-catalog.
|
||||
* bleibt. Die Auswahl selbst ist ein POST auf $selector['action'].
|
||||
*
|
||||
* @var string $base
|
||||
* @var array $character
|
||||
* @var list<array<string,mixed>> $itemCatalog
|
||||
* @var int $itemCatalogCount
|
||||
* @var array{kind:string,availability:string,needle:string} $itemFilters
|
||||
* @var bool $itemSelectorOpen
|
||||
* @var array{key:string,title:string,action:string,anchor:string,kinds:list<string>|null,filters:array<string,mixed>,catalog:list<array<string,mixed>>,count:int,open:bool} $selector
|
||||
*/
|
||||
$availabilityShort = ['methaven' => 'Methaven', 'garana' => 'Garana', 'selten' => 'selten'];
|
||||
$filterUrl = $base . '/edit';
|
||||
$selKey = (string) $selector['key'];
|
||||
$selKinds = $selector['kinds'];
|
||||
$selFilters = $selector['filters'];
|
||||
$selCatalog = $selector['catalog'];
|
||||
$selCount = (int) $selector['count'];
|
||||
$selAnchor = (string) $selector['anchor'];
|
||||
?>
|
||||
<dialog class="selector" id="item-selector" aria-labelledby="item-selector-title"<?= $itemSelectorOpen ? ' data-autopen' : '' ?>>
|
||||
<dialog class="selector" id="<?= e($selKey) ?>-selector" aria-labelledby="<?= e($selKey) ?>-selector-title"<?= $selector['open'] ? ' data-autopen' : '' ?>>
|
||||
<div class="selector-head">
|
||||
<h2 id="item-selector-title">Ausrüstung aus dem Katalog</h2>
|
||||
<h2 id="<?= e($selKey) ?>-selector-title"><?= e((string) $selector['title']) ?></h2>
|
||||
<button class="btn btn-small" type="button" data-dialog-close>Schließen</button>
|
||||
</div>
|
||||
<div class="selector-body">
|
||||
<form method="get" action="<?= e($filterUrl) ?>" class="selector-filters">
|
||||
<label class="field">
|
||||
<span>Suche</span>
|
||||
<input type="search" name="item_q" value="<?= e($itemFilters['needle']) ?>" placeholder="Name oder Notiz …" autocomplete="off">
|
||||
<input type="search" name="<?= e($selKey) ?>_q" value="<?= e($selFilters['needle']) ?>" placeholder="Name oder Notiz …" autocomplete="off">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Art</span>
|
||||
<select name="item_kind">
|
||||
<option value="">Alle Arten</option>
|
||||
<?php foreach (WS_ITEM_CATEGORIES as $category): ?>
|
||||
<option value="<?= e($category) ?>"<?= $itemFilters['kind'] === $category ? ' selected' : '' ?>><?= e($category) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php if ($selKinds === null): ?>
|
||||
<select name="<?= e($selKey) ?>_kind">
|
||||
<option value="">Alle Arten</option>
|
||||
<?php foreach (WS_ITEM_CATEGORIES as $category): ?>
|
||||
<option value="<?= e($category) ?>"<?= $selFilters['kind'] === $category ? ' selected' : '' ?>><?= e($category) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php else: ?>
|
||||
<input type="text" value="<?= e(implode(' + ', $selKinds)) ?>" readonly>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Verfügbarkeit</span>
|
||||
<select name="item_avail">
|
||||
<select name="<?= e($selKey) ?>_avail">
|
||||
<option value="">Alle (auch Seltenes)</option>
|
||||
<?php foreach (WS_ITEM_AVAILABILITY as $key => $label): ?>
|
||||
<option value="<?= e($key) ?>"<?= $itemFilters['availability'] === $key ? ' selected' : '' ?>><?= e($label) ?></option>
|
||||
<option value="<?= e($key) ?>"<?= $selFilters['availability'] === $key ? ' selected' : '' ?>><?= e($label) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<div class="selector-filter-actions">
|
||||
<button class="btn btn-small" type="submit">Filtern</button>
|
||||
<a class="btn btn-small" href="<?= e($filterUrl . '#inventar') ?>">Zurücksetzen</a>
|
||||
<a class="btn btn-small" href="<?= e($filterUrl . '#' . $selAnchor) ?>">Zurücksetzen</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p class="selector-hint muted">
|
||||
<?= count($itemCatalog) ?> von <?= (int) $itemCatalogCount ?> Gegenständen
|
||||
<?php if ((int) $itemCatalogCount > count($itemCatalog)): ?>
|
||||
<?= count($selCatalog) ?> von <?= $selCount ?> Gegenständen
|
||||
<?php if ($selCount > count($selCatalog)): ?>
|
||||
– Suche oder Filter eingrenzen, um mehr zu sehen.
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
|
@ -66,13 +75,13 @@ $filterUrl = $base . '/edit';
|
|||
(10 Münzen ≈ 1 Pfund).
|
||||
</p>
|
||||
|
||||
<form method="post" action="<?= e($base . '/items/from-catalog') ?>">
|
||||
<form method="post" action="<?= e(url($selector['action'])) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="selector-groups">
|
||||
<?php $lastKind = ''; ?>
|
||||
<?php foreach ($itemCatalog as $entry): ?>
|
||||
<?php foreach ($selCatalog as $entry): ?>
|
||||
<?php $kind = (string) $entry['kind']; ?>
|
||||
<?php if ($kind !== $lastKind): ?>
|
||||
<?php if ($kind !== $lastKind && $selKinds === null): ?>
|
||||
<?php $lastKind = $kind; ?>
|
||||
<p class="selector-group"><?= e($kind) ?></p>
|
||||
<?php endif; ?>
|
||||
|
|
@ -90,7 +99,7 @@ $filterUrl = $base . '/edit';
|
|||
</span>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($itemCatalog === []): ?>
|
||||
<?php if ($selCatalog === []): ?>
|
||||
<p class="selector-empty">Kein Gegenstand passt zu Suche und Filtern.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -281,6 +281,11 @@ $base = url('/characters/' . $cid);
|
|||
<?php endif; ?>
|
||||
|
||||
<hr class="divider">
|
||||
<div class="selector-actions" style="margin-bottom:.8rem">
|
||||
<button class="btn btn-primary" type="button" data-dialog-open="#weapon-selector">Waffe aus dem Katalog</button>
|
||||
<span class="muted"><?= (int) $selectors['weapon']['count'] ?> Waffen, fest vorgefiltert auf Art „Waffe“.</span>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= e($base . '/weapons/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
|
|
@ -371,6 +376,11 @@ $base = url('/characters/' . $cid);
|
|||
<?php endif; ?>
|
||||
|
||||
<hr class="divider">
|
||||
<div class="selector-actions" style="margin-bottom:.8rem">
|
||||
<button class="btn btn-primary" type="button" data-dialog-open="#armor-selector">Rüstung aus dem Katalog</button>
|
||||
<span class="muted"><?= (int) $selectors['armor']['count'] ?> Rüstungen und Schilde, fest vorgefiltert.</span>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= e($base . '/armors/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
|
|
@ -438,9 +448,8 @@ $base = url('/characters/' . $cid);
|
|||
<hr class="divider">
|
||||
<div class="selector-actions" style="margin-bottom:.8rem">
|
||||
<button class="btn btn-primary" type="button" data-dialog-open="#item-selector">Gegenstand aus dem Katalog</button>
|
||||
<span class="muted"><?= (int) ($itemCatalogCount ?? 0) ?> Gegenstände, filterbar nach Art und Verfügbarkeit (Methaven/Garana/Alle).</span>
|
||||
<span class="muted"><?= (int) $selectors['item']['count'] ?> Gegenstände, filterbar nach Art und Verfügbarkeit (Methaven/Garana/Alle).</span>
|
||||
</div>
|
||||
<?php require WS_ROOT . '/views/_selector_items.php'; ?>
|
||||
|
||||
<form method="post" action="<?= e($base . '/items/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
|
|
@ -486,3 +495,7 @@ $base = url('/characters/' . $cid);
|
|||
</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<?php foreach ($selectors as $selector): ?>
|
||||
<?php require WS_ROOT . '/views/_selector_items.php'; ?>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue