From 25a79c4be5b50546147d61184e60bc63292a074c Mon Sep 17 00:00:00 2001
From: Catalin Mititiuc
Date: Sat, 27 Apr 2024 11:47:25 -0700
Subject: Remove 'reveal pattern' from game, as it's not necessary
---
src/index.js | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
(limited to 'src/index.js')
diff --git a/src/index.js b/src/index.js
index bc4f138..b16e00b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,5 +1,5 @@
-import PanZoom from './modules/panzoom.js';
-import Game from './modules/game.js';
+import * as panzoom from './modules/panzoom.js';
+import * as game from './modules/game.js';
const RecordSheet = {
unSelect: function () {
@@ -40,19 +40,18 @@ document.querySelector('object').addEventListener('load', function () {
});
window.addEventListener('load', () => {
- const svg = document.querySelector('object').contentDocument.querySelector('svg'),
- game = Game(svg);
+ const svg = document.querySelector('object').contentDocument.querySelector('svg');
- window.game = game;
+ game.start(svg);
+ panzoom.start(svg);
const svgns = "http://www.w3.org/2000/svg",
recordSheetVisibility = document.querySelector('#content input[type="checkbox"].visible');
- PanZoom(svg);
const distanceOutput = document.getElementById('status');
- game.distanceCallback = count => {
+ game.setDistanceCallback(count => {
const output = {
count: '-',
display: 'none'
@@ -65,12 +64,12 @@ window.addEventListener('load', () => {
distanceOutput.querySelector('#hex-count').textContent = output.count;
distanceOutput.style.display = output.display;
- };
+ });
const proneToggle = document.getElementById('toggle-prone-counter');
- game.proneFlagCallback = checked => proneToggle.checked = checked;
- game.selectCallback = data => RecordSheet.select(data);
+ game.setProneFlagCallback(checked => proneToggle.checked = checked);
+ game.setSelectCallback(data => RecordSheet.select(data));
// Object.values(settingsPanel.querySelectorAll('fieldset')).forEach(fieldset => {
// const identityMtx = [1, 0, 0, 1, 0, 0];
--
cgit v1.2.3