Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- **Where a type sits on the sheet.** Each item type on the builder's TYPES tab now has ON THE SHEET: EQUIPPED (worn or wielded), USABLE (used up or used often: potions, ammo, kits) or PACK. WEAPON and ARMOR presets start EQUIPPED, CONSUMABLE and SPELL start USABLE, and GEAR and every type you already have start in PACK. The sheet's GEAR tab sorts lines into these bands next.
- **GEAR in bands.** The sheet's GEAR tab now sorts what you carry into EQUIPPED, USABLE and PACK, by each item type's ON THE SHEET, with a count on each band and what's in hand first. A fourth band, STASH, holds everything left in the stash whatever its type, and says each one's type; it starts closed. Click a band's head to close or open it, and the sheet remembers. The + buttons for adding a thing by hand sit in one row at the top, and the band it lands in opens. SHEET.EXE and the sheet's own tab are the same.
- **Where a type sits on the sheet.** Each item type on the builder's TYPES tab now has ON THE SHEET: EQUIPPED (worn or wielded), USABLE (used up or used often: potions, ammo, kits) or PACK. WEAPON and ARMOR presets start EQUIPPED, CONSUMABLE and SPELL start USABLE, and GEAR and every type you already have start in PACK.
- **EDIT CURRENT in SHOP_CATALOGUES.** A new button beside DOWNLOAD CURRENT puts what your shops sell now straight into the box, ready to change, PREVIEW and SAVE, with no file to download and upload again. If the box already has text in it, it asks before replacing it.
- **Publishing tidies the shop catalogue.** When you publish a system, any catalogue line that is now exactly one of your items, same name, price and columns, is taken out of the file, since the item sells itself. That includes lines that ADD NEW LINES TO ITEMS turned into items. The builder's publish message says how many. Lines naming an item kept out of the shops stay, so they sell again if you switch it back on.
- **Catalogue lines can become items.** In SHOP_CATALOGUES, PREVIEW now offers ADD NEW LINES TO ITEMS, off to start. Switched on, it lists what it will add and how many items your system will hold. SAVE then makes each line that isn't one of your items yet into an item: of its section's type (a shelf's lines go to your DEFAULT type), with its columns, price and words, in the shops. They go into the builder's draft and are kept once you publish; until then the catalogue line sells them. If the builder is open, it takes them in, so its next save keeps them.
Expand Down
14 changes: 8 additions & 6 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ panel), so a control that looks fine but does nothing is caught for all of them.
| Shop catalogues by item type | a section per item type (8a7a1), its columns checked, blanks kept | `shop_catalogue_types`, `catalogueTypes` | `catalogue-types`, `shop-typed-lines` (bought at the General Store and given, landing typed, 8a7a2) | **AT THE TABLE** |
| The shops under load | 1000+ lines on a shelf, 200 items, a full cart, a long gear list (8n3); a long shelf drawn 200 rows at a time | `shop_stress`, `ShopWindow` | `shop-stress` | **AT THE TABLE** |
| An item type's SOLD AT | the kinds of shop that sell its lines (8a7a2), the General Store where unsaid; set in the builder in 8a7b | `shop_typed_lines`, `typedShelves` | `shop-typed-lines` (unsaid: the General Store) | **AT THE TABLE** unsaid; a kind of shop picked waits for 8a7b's box |
| An item type's ON THE SHEET band | EQUIPPED, USABLE or PACK (G1), PACK where unsaid; the sheet's GEAR bands come in G2 | `system_builder_item_types`, `itemTypes`, `ItemsPage` | `builder-item-types` (the WEAPON preset EQUIPPED) | **SET IN THE BUILDER**; at the table with G2 |
| An item type's ON THE SHEET band | EQUIPPED, USABLE or PACK (G1), PACK where unsaid; the sheet's GEAR tab in those bands plus STASH, closed to start, a band's head closing it, remembered (G2) | `system_builder_item_types`, `itemTypes`, `ItemsPage`, `gearBands`, `GearTypeTables` | `builder-item-types` (the WEAPON preset EQUIPPED), `sheet-gear-bands` (a Sword, a Draught and a Rope in EQUIPPED, USABLE and PACK; the Sword stashed into STASH; USABLE kept closed) | **AT THE TABLE** |
| An item's PRICE and IN SHOPS | priced and IN SHOPS, it sells itself at its type's shops (8a7a3a); off, never sold, not even from a file, but bought back at its price by a shop of its type (8a7a3c2); a type's PRICE column read as its price; set on ITEMS under TYPE, NOT SOLD in the list, a new item's price asked for (8a7a3b1); in the ITEMS import and downloads, price and in shops columns (8a7a3b2) | `shop_items_on_sale`, `itemPrice`, `ItemsPage`, `system_builder_items_import`, `itemsImport` | `shop-items-on-sale` (a type's PRICE column; a ring turned off; sold back from the window at 50%), `builder-item-price` (set by clicks), `builder-items-import` (imported priced and IN SHOPS) | **AT THE TABLE** |
| A catalogue file held against the game's items | an exact copy of an item left out, an item kept out of the shops left out, one of an item's name overruling it, ALSO ON SALE FROM ITEMS (8a7a3c1) | `shop_items_on_sale`, `CatalogueWindow` | `catalogue-and-items` | **AT THE TABLE** |
| ADD NEW LINES TO ITEMS | a catalogue's new lines made items in the draft (8a7a4a), off to start; on PUBLISH the lines now exactly an item leave the file (8a7a4b) | `catalogue_into_items`, `CatalogueWindow`, `catalogueItems`, `BuilderScreen` | `catalogue-and-items` (the Hand Cannon into the draft, then out of the file once published) | **AT THE TABLE** |
Expand Down
5 changes: 3 additions & 2 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ kept; the job itself stops at 30 (`timeout-minutes`), for a hang outside the tes
| `tests/sheet-ranks.spec.ts` | A rank on the sheet (7f1c1): a player with Level 3 sees Athletics as a picker of UNTRAINED, TRAINED and EXPERT, picks EXPERT, its worth = 7 shows beside it, the formula Climb reading it shows 8, and the server keeps the step 2 with Athletics 7 and Climb 8 |
| `tests/sheet-ranks-start.spec.ts` | Ranks making a character (7f1c2): a player in NEW CHARACTER types Grit, finds Lore under RANKS with UP TO TRAINED TO START and EXPERT off, picks TRAINED, and the server keeps the step 1 with Lore worth 2 |
| `tests/sheet-worn-items.spec.ts` | Items at the table (7e3b): two GEAR lines named like items get WEAR and ATTUNE; the ring worn does nothing yet, attuned it is WORKING, ATTUNED 1 OF 1, CON 14 → 16; the cloak worn with no slot free says so and can't attune; the GM, on the player's sheet, ATTUNES it ANYWAY (2 OF 1) and gives them 2 of their own; END frees the ring's slot and its +2 goes; the cloak taken off stays attuned and does nothing. A second test: the GM's GIVE.EXE lists the ring under ITEMS with NEEDS ATTUNED and its words, gives it to the player as a stowed gear line, the player is told and WEARS it; TERMINATE_SESSION closes GIVE.EXE while the session is still ending |
| `tests/sheet-item-types.spec.ts` | The GEAR tab as a table per item type (8a3a): a player's sheet with WEAPONS and GEAR tables, each empty with its +; + WEAPON made A stick with DAMAGE 1d4 and GRADE HEAVY; a second line named Pistol showing 2d6 + @might faint, its RANGE typed over to 50 m; + GEAR made Rope at 10 lb; saved as made, each in its table after a reload; since 8a3b the stick's DAMAGE rolled with ROLL, "rolled A stick DAMAGE 1d4" in the dice tray's history; and (8a3c1) as compact lines: a line made by hand opened under ✎, DONE showing its words with ROLL, the Pistol's RANGE read as words after the reload, and no box on the GEAR tab scrolling sideways in SHEET.EXE; and (8a3c2) the Pistol's DAMAGE under ✎ said ON THIS CHARACTER: 2d6 + Might (12): 14 to 24, @strength flagged as not the system's, eˣ INSERT putting in @might |
| `tests/sheet-item-types.spec.ts` | The GEAR tab as a table per item type (8a3a): a player's sheet with WEAPONS and GEAR tables, each empty with its +; + WEAPON made A stick with DAMAGE 1d4 and GRADE HEAVY; a second line named Pistol showing 2d6 + @might faint, its RANGE typed over to 50 m; + GEAR made Rope at 10 lb; saved as made, each in its table after a reload; since 8a3b the stick's DAMAGE rolled with ROLL, "rolled A stick DAMAGE 1d4" in the dice tray's history; and (8a3c1) as compact lines: a line made by hand opened under ✎, DONE showing its words with ROLL, the Pistol's RANGE read as words after the reload, and no box on the GEAR tab scrolling sideways in SHEET.EXE; and (8a3c2) the Pistol's DAMAGE under ✎ said ON THIS CHARACTER: 2d6 + Might (12): 14 to 24, @strength flagged as not the system's, eˣ INSERT putting in @might; and (G2) in bands: PACK says "Nothing here." with no WEAPONS group before anything is carried, and things are added from the row of + at the top |
| `tests/sheet-gear-bands.spec.ts` | The GEAR tab in bands (G2): a game with WEAPONS EQUIPPED, POTIONS USABLE and GEAR unsaid; a player adds a Sword, a Draught and a Rope from the row of + at the top, each in its band and counted (EQUIPPED · 1, USABLE · 1, PACK · 1, STASH · 0 closed), saved as made; the Sword moved to the stash goes to STASH, which opens and says WEAPONS, EQUIPPED left at 0; USABLE closed by its head, and on the next visit USABLE is still closed and PACK open |
| `tests/sheet-gear-counts.spec.ts` | A gear line's COUNT at the table (8a4): a player's Pistol at AMMO 2 / 6 spends one with FIRE; RELOAD, with Pistol Rounds and AP Rounds both carried, asks which and takes all 3 AP Rounds, their line gone; RELOAD again takes 2 of the Pistol Rounds alone, full, RELOAD held; the Wand's CHARGES, with no RELOAD, filled by a SHORT REST from the sheet |
| `tests/sheet-standalone-tab.spec.ts` | The sheet in a new tab is the window (8s1a): a player makes two gear lines in SHEET.EXE, opens the tab with ⧉ (a `.crt-container`, so in the theme), WEARs the boots there and SHEET.EXE says WORKING too, and rolls the club's DAMAGE from the tab, said on it once the dice land; since 8s1b the roll from the tab opens DICE_TRAY.EXE in the main app's window; and (8s1c) a character being made: the flow left, SHEET.EXE says CREATING · CONTINUE, the tab says it too and opens NEW_CHARACTER.EXE on itself; and (8s1d) Cash on the tab opens BANK.EXE in the main window and the tab says so, then with the main window closed the tab says to open it |
| `tests/sheet-standalone-tab.spec.ts` | The sheet in a new tab is the window (8s1a): a player makes two gear lines in SHEET.EXE, opens the tab with ⧉ (a `.crt-container`, so in the theme), WEARs the boots there and SHEET.EXE says WORKING too, and rolls the club's DAMAGE from the tab, said on it once the dice land; since 8s1b the roll from the tab opens DICE_TRAY.EXE in the main app's window; and (8s1c) a character being made: the flow left, SHEET.EXE says CREATING · CONTINUE, the tab says it too and opens NEW_CHARACTER.EXE on itself; and (8s1d) Cash on the tab opens BANK.EXE in the main window and the tab says so, then with the main window closed the tab says to open it; and (G2) gear added from the row of + at the top of GEAR |
| `tests/sheet-vitals.spec.ts` | The vitals strip (8s3b): a player with a token takes 5 with DAMAGE in SHEET.EXE (the token and the bar at 15/20), opens the ⧉ tab and HEALs 3 there (18/20 on the token, the tab and SHEET.EXE), then clicks the tab's HP bar and HEALTH's own panel opens in place; and (8s3c) PRONE put on under the box in SHEET.EXE, shown on the tab as a chip and taken off there, then REST ▾ on the tab taking a LONG REST, asked first, the stat it refills set; the box's HIT POINTS ▾ wholly under the numbers with the slash centered over it, and the conditions list as wide as the box; and CWN in SHEET.EXE: MELEE AC and RANGED AC shown, no two of HEAL, DAMAGE, STIM, HIT POINTS, + CONDITION, the AC and REST overlapping, and every button's words inside it; the AC centered between + CONDITION and REST; and (8s3d1) a two-track system: STUN MAX set on the sheet, STUN picked above the box, 6 damage filling it with 2 spilling into PHYSICAL (18/20 on the token), STUN FULL · 2 SPILLED INTO PHYSICAL said; and (8s3d2) the GM opens a player's sheet (GLOBAL_CHAT, VIEW_PLAYER_INFO, OPEN_SHEET) and takes 5 with the box there: the token at 15, the GM's box and the player's own SHEET.EXE saying 15. Since 8a6c the chip is clicked open, as wide as the box, and taken off with TAKE OFF |
| `tests/sheet-installed-items.spec.ts` | Items installed (7e4c): a player with Might 2 installs a Cranial Jack (cost 1): WORKING, CYBERWARE · STRAIN 1 OF 2, its line's × and WHERE locked, Strain's badge 0 → 1 (Cranial Jack +1); Dermal Plating (cost 2) can't be installed by the player and says why; the GM, on their sheet, INSTALLS it ANYWAY (3 OF 2); REMOVE gives the jack's cost back and unlocks its line |
| `tests/sheet-spend-xp.spec.ts` | SPEND XP at the table (7f2c1): with purchases waiting for the GM, a player on CHARACTER sees XP 40 UNSPENT, BUYs Body 2 to 3 for 15 and a feat for 10, each PENDING with its XP held and Body still 2; the GM, on the player's sheet, APPROVES Body (3 on the server), DECLINES the feat, then UNDOES Body (2 again, all 40 back). And AWARD XP in a game that only spends it (7f2c2): KARMA.EXE with no level buttons gives a player 30, and their SPEND KARMA has it to spend |
Expand Down
72 changes: 72 additions & 0 deletions e2e/tests/sheet-gear-bands.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { test, expect } from '@playwright/test';
import { signInAsPlayer, gmToken, asGm, runningSystem, approvedPlayer, sheetTab } from './helpers';

// The GEAR tab in bands (G2; approved mockup docs/mockups/sheet-gear-layout.html, layout A): a game whose WEAPONS are
// EQUIPPED, POTIONS USABLE and GEAR unsaid (PACK). Things made by hand land in their bands, counted; a sword moved to the
// stash goes to the STASH band, which opens to show it; USABLE closed by its head stays closed on the next visit.

test('GEAR in bands: EQUIPPED, USABLE, PACK by type, a sword stashed into the STASH, a band closed and kept closed (G2)', async ({ browser, request }, info) => {
test.setTimeout(120_000);
const again = info.retry ? `_${info.retry + 1}` : '';
const gm = await gmToken(request);
await runningSystem(request, gm, {
format: 1, name: `Bandhold${again}`, core: { health: { model: 'pool' } },
stats: [{ id: 'abilities', label: 'ABILITIES', stats: [{ id: 'might', label: 'Might' }] }],
items: {
types: [
{ id: 'gear', label: 'GEAR', one: 'Gear', columns: [{ id: 'weight', label: 'WEIGHT', kind: 'number', unit: 'LB' }] },
{ id: 'weapons', label: 'WEAPONS', one: 'Weapon', on_sheet: 'equipped', columns: [{ id: 'damage', label: 'DAMAGE', kind: 'damage' }] },
{ id: 'potions', label: 'POTIONS', one: 'Potion', on_sheet: 'usable', columns: [{ id: 'heals', label: 'HEALS', kind: 'dice' }] },
],
list: [],
},
});
const player = { username: `e2e_bandhold${again}`, password: 'e2e-player-password' };
await approvedPlayer(request, gm, player);
const sheetOf = async () => (await asGm(request, gm, 'get', `/api/sheets/user/${player.username}`)).data;

const context = await browser.newContext({ baseURL: info.project.use.baseURL, viewport: { width: 1280, height: 800 } });
const mine = await context.newPage();
await signInAsPlayer(mine, player);
await mine.getByRole('button', { name: 'CHARACTER_CONTROLS', exact: true }).click();
await mine.getByRole('button', { name: 'CHARACTER_SHEET', exact: true }).click();
await sheetTab(mine, 'GEAR');

// One of each, made by hand: each in its type's band.
const add = mine.getByRole('group', { name: 'Add by hand' });
const band = (label: string) => mine.getByRole('region', { name: `${label} band` });
const head = (label: string) => band(label).getByRole('button', { name: new RegExp(`^[▸▾] ${label} · \\d+$`) });
await add.getByRole('button', { name: 'Add a Weapon by hand' }).click();
await mine.getByLabel('Item 1 name', { exact: true }).fill('Sword');
await add.getByRole('button', { name: 'Add a Potion by hand' }).click();
await mine.getByLabel('Item 2 name', { exact: true }).fill('Draught');
await add.getByRole('button', { name: 'Add a Gear by hand' }).click();
await mine.getByLabel('Item 3 name', { exact: true }).fill('Rope');
await expect(head('EQUIPPED')).toHaveText('▾ EQUIPPED · 1');
await expect(head('USABLE')).toHaveText('▾ USABLE · 1');
await expect(head('PACK')).toHaveText('▾ PACK · 1');
await expect(head('STASH')).toHaveText('▸ STASH · 0');
await expect(band('USABLE').getByRole('region', { name: 'POTIONS gear' })).toBeVisible();
await expect.poll(async () => JSON.parse(String((await sheetOf()).inventory ?? '[]')).map((l: { name: string }) => l.name), { timeout: 15_000 }).toEqual(['Sword', 'Draught', 'Rope']);

// The sword to the stash: into the STASH band, opened to show it, its type said.
await band('EQUIPPED').getByLabel('Item 1 carried', { exact: true }).selectOption('stash');
await expect(head('STASH')).toHaveText('▾ STASH · 1');
await expect(band('STASH').getByLabel('Item 1 name', { exact: true })).toHaveValue('Sword');
await expect(band('STASH').getByText('WEAPONS', { exact: true })).toBeVisible();
await expect(head('EQUIPPED')).toHaveText('▾ EQUIPPED · 0');

// USABLE closed by its head; still closed after a reload.
await head('USABLE').click();
await expect(head('USABLE')).toHaveAttribute('aria-expanded', 'false');
await expect(band('USABLE').getByLabel('Item 2 name', { exact: true })).toHaveCount(0);
await expect.poll(async () => JSON.parse(String((await sheetOf()).inventory ?? '[]'))[0]?.carry, { timeout: 15_000 }).toBe('stash');
// A fresh visit, signed in again: which bands are closed is kept in this browser.
await signInAsPlayer(mine, player);
await mine.getByRole('button', { name: 'CHARACTER_CONTROLS', exact: true }).click();
await mine.getByRole('button', { name: 'CHARACTER_SHEET', exact: true }).click();
await sheetTab(mine, 'GEAR');
await expect(head('USABLE')).toHaveAttribute('aria-expanded', 'false');
await expect(head('PACK')).toHaveAttribute('aria-expanded', 'true');
await context.close();
});
13 changes: 7 additions & 6 deletions e2e/tests/sheet-item-types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ test('GEAR as a table per type: a stick made by hand and its DAMAGE rolled, the
await mine.getByLabel('Might', { exact: true }).fill('12');
await expect.poll(async () => (await sheetOf()).might, { timeout: 15_000 }).toBe(12);

// A table per type, each empty with its own +.
// In bands (G2): nothing carried yet, a + for each type in the row at the top.
await sheetTab(mine, 'GEAR');
const weapons = mine.getByRole('region', { name: 'WEAPONS gear' });
const gear = mine.getByRole('region', { name: 'GEAR gear' });
await expect(weapons.getByText('WEAPONS · 0')).toBeVisible();
await expect(gear.getByText('GEAR · 0')).toBeVisible();
const add = mine.getByRole('group', { name: 'Add by hand' });
await expect(mine.getByRole('region', { name: 'PACK band' }).getByText('Nothing here.')).toBeVisible();
await expect(weapons).toHaveCount(0);

// A stick, made by hand: its own DAMAGE and GRADE.
await weapons.getByRole('button', { name: 'Add a Weapon by hand' }).click();
await add.getByRole('button', { name: 'Add a Weapon by hand' }).click();
await weapons.getByLabel('Item 1 name', { exact: true }).fill('A stick');
await weapons.getByLabel('Item 1 DAMAGE', { exact: true }).fill('1d4');
await weapons.getByLabel('Item 1 GRADE', { exact: true }).selectOption('HEAVY');
Expand All @@ -61,13 +62,13 @@ test('GEAR as a table per type: a stick made by hand and its DAMAGE rolled, the
await expect(tray).toBeHidden();

// A line named like the Pistol: its values faint, until RANGE is typed over.
await weapons.getByRole('button', { name: 'Add a Weapon by hand' }).click();
await add.getByRole('button', { name: 'Add a Weapon by hand' }).click();
await weapons.getByLabel('Item 2 name', { exact: true }).fill('Pistol');
await expect(weapons.getByLabel('Item 2 DAMAGE', { exact: true })).toHaveAttribute('placeholder', '2d6 + @might');
await weapons.getByLabel('Item 2 RANGE', { exact: true }).fill('50 m');

// A rope, in GEAR.
await gear.getByRole('button', { name: 'Add a Gear by hand' }).click();
await add.getByRole('button', { name: 'Add a Gear by hand' }).click();
await gear.getByLabel('Item 3 name', { exact: true }).fill('Rope');
await gear.getByLabel('Item 3 WEIGHT', { exact: true }).fill('10');

Expand Down
Loading
Loading