Skip to content

Commit

Permalink
Display roster custom notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rweyrauch committed Jun 3, 2023
1 parent deb188f commit f5cc7e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/prettyscribe.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/renderer40k.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export class Renderer40k implements Renderer {
footer.classList.add('footer');
footer.appendChild(document.createElement('div')).appendChild(document.createTextNode('PrettyScribe'));
footer.appendChild(document.createElement('div')).appendChild(document.createTextNode(text));

if (this._roster._customNotes) {
title.appendChild(document.createElement('p')).appendChild(document.createTextNode(this._roster._customNotes));
}
}

if (list) {
Expand Down
5 changes: 5 additions & 0 deletions src/roster40k.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ export function Create40kRoster(doc: Document, is40k: boolean = true): Roster40k
roster._name = "40k Army Roster";
}

let note = info.querySelector("customNotes");
if (note) {
roster._customNotes = <string>note.textContent;
}

ParseRosterPoints(doc, roster);
ParseForces(doc, roster, is40k);

Expand Down

0 comments on commit f5cc7e7

Please sign in to comment.