refactor(features): extract dice system to standalone module

Extract dice rolling functionality from modals.js into dedicated
feature module at src/systems/features/dice.js. This includes:
- rollDice() - core rolling logic with animation
- executeRollCommand() - dice notation parser
- updateDiceDisplay() - sidebar display updates
- clearDiceRoll() - clear last roll
- addDiceQuickReply() - quick reply integration

Also fixes ES6 module binding issue with pendingDiceRoll by adding
getPendingDiceRoll() getter function in state.js to ensure correct
value retrieval across module boundaries.

Reduces modals.js from 568 to 499 lines (-69 lines).
Creates dice.js with 113 lines of focused dice functionality.
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-17 13:25:38 +11:00
parent bb952aecec
commit f4dfd368e1
3 changed files with 139 additions and 90 deletions
+4
View File
@@ -151,6 +151,10 @@ export function setPendingDiceRoll(roll) {
pendingDiceRoll = roll;
}
export function getPendingDiceRoll() {
return pendingDiceRoll;
}
export function setPanelContainer($element) {
$panelContainer = $element;
}