diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-12 16:51:29 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-12 16:51:29 +0100 |
commit | 48c6287c7a4251b9043877265cca98970e8f88be (patch) | |
tree | 456cb1d1ea91c8a899ae49b065e0c5d49f90ee30 /play.js | |
parent | 6e7a3c69a79ecca8e45df60b59a22de504e1a2f5 (diff) | |
download | 1989-dawn-of-freedom-48c6287c7a4251b9043877265cca98970e8f88be.tar.gz |
Removed name unique from actions
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -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")
|