index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-02 15:52:38 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-02 15:52:38 -0700 |
commit | 3c0e59f68ee061abc98dafa07301bd54005e94dc (patch) | |
tree | 8b8cd84b9ec75b728949cc32948b3a062ea8f309 /src/modules/record_sheet.js | |
parent | 71724cc97967a876224d1a4b711843b17256cb0d (diff) |
Create counters with assigned weapons
Diffstat (limited to 'src/modules/record_sheet.js')
-rw-r--r-- | src/modules/record_sheet.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js index 0f279d5..5f14852 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -152,6 +152,18 @@ function endMove() { deselect(); } +export function extractWeaponFromRecord(recordEl) { + return recordEl + .querySelector('[slot="primary-weapon-type"] use') + .getAttributeNS(null, 'href') + .split('#') + .pop(); +} + +export function isRecord(el) { + return el.classList && el.classList.contains('soldier-record'); +} + export function getSelected() { return document.querySelector('.soldier-record.selected'); } |