Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Durtur committed Jul 25, 2022
1 parent 12f2f6b commit a5751e2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/css/modals.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
left: 0px;
background: rgba(0, 0, 0, 0.75);
z-index: 3;
overflow: scroll;
overflow: auto;
}

.modal .token_search_input {
Expand Down
8 changes: 4 additions & 4 deletions app/mappingTool/map.admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion app/mappingTool/mapscript.ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
Expand Down
3 changes: 1 addition & 2 deletions app/mappingTool/tokenDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ class TokenDialog {
spawnPoint: { x: e.clientX - (dndSize * cellSize) / 2, y: e.clientY - (dndSize * cellSize) / 2 }

}], true )

notifyTokenAdded(lastIndexInsertedMonsters, pawnName)

}

populateSizeDropdown() {
Expand Down
7 changes: 2 additions & 5 deletions docs/client/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a5751e2

Please sign in to comment.