diff --git a/app/css/modals.css b/app/css/modals.css index 59b2941..aeaf053 100644 --- a/app/css/modals.css +++ b/app/css/modals.css @@ -53,7 +53,7 @@ left: 0px; background: rgba(0, 0, 0, 0.75); z-index: 3; - overflow: scroll; + overflow: auto; } .modal .token_search_input { diff --git a/app/mappingTool/map.admin.js b/app/mappingTool/map.admin.js index 693ceaa..7e4a36f 100644 --- a/app/mappingTool/map.admin.js +++ b/app/mappingTool/map.admin.js @@ -110,9 +110,9 @@ function notifySelectedPawnsChanged() { } -function notifyTokenAdded(tokenIndex, name) { - window.api.messageWindow('mainWindow', 'notify-token-added-in-maptool', [tokenIndex, name]); -} +// function notifyTokenAdded(tokenIndex, name) { +// window.api.messageWindow('mainWindow', 'notify-token-added-in-maptool', [tokenIndex, name]); +// } function requestNotifyUpdateFromMain() { window.api.messageWindow('mainWindow', 'update-all-pawns'); @@ -819,7 +819,7 @@ function startAddingFromQueue() { var offset = (radiusOfPawn * cellSize) / 2; var popped = pawns.addQueue[0]; pawns.addQueue.splice(0, 1); - popped.index_in_main_window = lastIndexInsertedMonsters++; + popped.spawnPoint = { x: e.clientX - offset, y: e.clientY - offset }; await generatePawns([popped], true); diff --git a/app/mappingTool/mapscript.ipc.js b/app/mappingTool/mapscript.ipc.js index abccc75..0e006c5 100644 --- a/app/mappingTool/mapscript.ipc.js +++ b/app/mappingTool/mapscript.ipc.js @@ -93,9 +93,9 @@ ipcRenderer.on('settings-changed', function (evt, arg) { ipcRenderer.on('monster-list-cleared', function (evt, arg) { pawns.monsters.forEach(function (element) { + element = element[0]; if (element.getAttribute("data-mob_size") != null) return; - element = element[0]; element.index_in_main_window = ""; element.classList.remove("pawn_numbered"); }); diff --git a/app/mappingTool/tokenDialog.js b/app/mappingTool/tokenDialog.js index 68d0b79..1e7a80c 100644 --- a/app/mappingTool/tokenDialog.js +++ b/app/mappingTool/tokenDialog.js @@ -157,8 +157,7 @@ class TokenDialog { spawnPoint: { x: e.clientX - (dndSize * cellSize) / 2, y: e.clientY - (dndSize * cellSize) / 2 } }], true ) - - notifyTokenAdded(lastIndexInsertedMonsters, pawnName) + } populateSizeDropdown() { diff --git a/docs/client/map.js b/docs/client/map.js index 63a05f3..7476366 100644 --- a/docs/client/map.js +++ b/docs/client/map.js @@ -1169,10 +1169,9 @@ function refreshMeasurementTooltip() { function removeDuplicatePawnNumbers(index, newEleId) { var pawns = [...document.getElementsByClassName("pawn_numbered")]; - console.log(`Remove duplicates ${index}`, newEleId) + index = `${index}`; pawns.forEach(function (pawn) { - if (pawn.index_in_main_window === index && pawn.id != newEleId) { - + if (`${pawn.index_in_main_window}` === index && pawn.id != newEleId) { pawn.classList.remove("pawn_numbered"); pawn.index_in_main_window = ""; } @@ -1777,8 +1776,6 @@ async function setPawnMobBackgroundImages(pawn, path, tokens) { } - -var lastIndexInsertedMonsters = 1; var lastColorIndex = 0; async function generatePawns(pawnArray, monsters) { var newPawn, lastPoint, rotate, sightRadiusBright, sightRadiusDim, sightMode;