Complete player stats inventory and Control content editors
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import './progression.css';
|
||||
import type { Character, TitleAward } from './generated';
|
||||
import { modifiersView } from './character-stats';
|
||||
|
||||
function element<K extends keyof HTMLElementTagNameMap>(tag: K, text = '', className = '') {
|
||||
const node = document.createElement(tag); node.textContent = text; node.className = className; return node;
|
||||
@@ -22,7 +23,7 @@ export function progressionSummary(character: Character) {
|
||||
const line = element('div', '', 'progression-line');
|
||||
line.append(element('strong', `Level ${character.level || 1}`), element('span', experienceText(character)));
|
||||
const meter = element('progress', '', 'experience-meter'); meter.setAttribute('aria-label', 'Level experience'); updateExperienceMeter(meter, character);
|
||||
parent.append(line, meter, element('p', statPointsText(character), 'progression-note'), element('p', 'Stat allocation is coming later.', 'progression-note'));
|
||||
parent.append(line, meter, element('p', statPointsText(character), 'progression-note'), element('p', `${character.pendingVitalChoices ?? 0} health / mana choices available. Allocate points in the character panel.`, 'progression-note'));
|
||||
return parent;
|
||||
}
|
||||
export function permanentTitles(titles: TitleAward[] = []) {
|
||||
@@ -38,6 +39,7 @@ export function permanentTitles(titles: TitleAward[] = []) {
|
||||
for (const [value, label] of [[title.effects.damage, 'damage'], [title.effects.moveSpeed, 'movement speed']] as const) {
|
||||
if (value) effects.append(element('span', `${value > 0 ? '+' : ''}${value} ${label}`, value > 0 ? 'effect-positive' : 'effect-negative'));
|
||||
}
|
||||
effects.append(...modifiersView(title.effects.modifiers ?? []).childNodes);
|
||||
if (!effects.children.length) effects.append(element('span', 'No attribute effects.', 'progression-note'));
|
||||
card.append(effects); parent.append(card);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user