From 48c6287c7a4251b9043877265cca98970e8f88be Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 12 Oct 2024 16:51:29 +0100 Subject: Removed name unique from actions --- play.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index f8d5cf5..f90e207 100644 --- a/play.js +++ b/play.js @@ -71,7 +71,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi spaceArea.style.width = width + 'px'; spaceArea.style.height = height + 'px'; spaceArea.style.zIndex = 2; - spaceArea.my_space = space.name_unique; + spaceArea.my_space = space.space_id; spaceArea.addEventListener('mousedown', on_click_space); //CREATE DEMOCRATIC INFLUENCE MARKERS FOR EACH SPACE @@ -80,7 +80,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi dem_img.style.display = 'none' dem_img.id=`${space.name_unique}_demInfl` dem_img.style.zIndex = 1 - dem_img.my_space = space.name_unique; + dem_img.my_space = space.space_id; dem_img.addEventListener('mousedown', on_click_space); spaceArea.appendChild(dem_img) @@ -91,7 +91,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi demInflValue.id=`${space.name_unique}_demInflValue` demInflValue.innerText=space.demInfl demInflValue.style.zIndex = 1 - demInflValue.my_space = space.name_unique; + demInflValue.my_space = space.space_id; demInflValue.addEventListener('mousedown', on_click_space); spaceArea.appendChild(demInflValue) @@ -101,7 +101,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi com_img.style.display='none' com_img.id=`${space.name_unique}_comInfl` com_img.style.zIndex = 1 - com_img.my_space = space.name_unique; + com_img.my_space = space.space_id; com_img.addEventListener('mousedown', on_click_space); spaceArea.appendChild(com_img) @@ -112,7 +112,7 @@ const spaceCharacteristicsElement = document.getElementById('space-characteristi comInflValue.id=`${space.name_unique}_comInflValue` comInflValue.innerText=space.comInfl comInflValue.style.zIndex = 1 - comInflValue.my_space = space.name_unique; + comInflValue.my_space = space.space_id; comInflValue.addEventListener('mousedown', on_click_space); spaceArea.appendChild(comInflValue) //} @@ -182,11 +182,12 @@ function is_card_enabled(card) { function on_click_space(evt) { if (evt.button === 0) { const space = evt.target.my_space; - //console.log('on_click_space_called with space:', space); + console.log('on_click_space_called with space:', space); if (send_action('infl', space)) { + console.log('send_action with infl:', space); evt.stopPropagation(); } else if (send_action('sc', space)) { - //console.log('send_action with sc:', space); + console.log('send_action with sc:', space); evt.stopPropagation(); } else { // console.log('send_action failed for space:', space); @@ -554,6 +555,8 @@ if (view.ceausescu_cards && view.ceausescu_cards.length > 0 && view.is_pwr_strug for (let c of view.ceausescu_cards) { let power_card = ui.power_cards[c] document.getElementById("ceausescu_hand").appendChild(power_card); + power_card.classList.remove('discard_card') + } } else { document.getElementById("ceausescu_panel").classList.add("hide") -- cgit v1.2.3