Skip to content

Commit

Permalink
Update @planarally/dice
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruptein committed Jan 11, 2025
1 parent 4de6803 commit 7924cc7
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 57 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ tech changes will usually be stripped from release notes for the public
- Added a reroll button to history entries
- Add an option to roll 3D dice inside a dice box rather than over the playfield
- Input field now scrolls to the end after populating via the on screen buttons
- @planarally/dice:
- (this is the standalone dice library that handles most of the dice logic and rendering)
- Upgraded to v0.7
- Dice will now stop sliding smoother
- Clear state can be configured
- D100 dice now properly work in 3D for the full range (1-100 / 0-99)
- Currently hardcoded to 1-100 in the client, but the library can be told otherwise
- I18n:
- Added 95% i18n for zh (except diceTool)
- [server] Assets:
Expand Down
109 changes: 57 additions & 52 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"coverage": "vitest run --coverage"
},
"dependencies": {
"@babylonjs/core": "^7.20.1",
"@babylonjs/materials": "^7.20.1",
"@babylonjs/core": "^7.43.0",
"@babylonjs/materials": "^7.43.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/vue-fontawesome": "^3.0.8",
"@planarally/dice": "^0.6.0",
"@planarally/dice": "^0.7.0",
"mathjs": "^13.2.0",
"path-data-polyfill": "^1.0.6",
"socket.io-client": "^4.8.0",
Expand Down
8 changes: 6 additions & 2 deletions client/src/game/tools/variants/dice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ class DiceTool extends Tool implements ITool {
if (use3d) {
const dieDefaults = await generate3dOptions();
const { diceThrower } = await getDiceEnvironment();
roll = await rollString(input, diceState.raw.systems!["3d"], { thrower: diceThrower!, dieDefaults });
roll = await rollString(input, diceState.raw.systems!["3d"], {
thrower: diceThrower!,
dieDefaults,
d100Mode: 100 as const,
});
} else {
roll = await rollString(input, diceState.raw.systems!["2d"]);
roll = await rollString(input, diceState.raw.systems!["2d"], { d100Mode: 100 as const });
}

if (shareWith !== "none") {
Expand Down

0 comments on commit 7924cc7

Please sign in to comment.