diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-19 11:38:25 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:12:42 +0100 |
commit | d70b3cdf98919c89f1ba481a700d79d84fe3c43d (patch) | |
tree | 783d76368575a15791f23b8a8f101101da5fb030 /ui.js | |
parent | 2c807d4ce8a075f588b3b054b0652d42a99a096f (diff) | |
download | shores-of-tripoli-d70b3cdf98919c89f1ba481a700d79d84fe3c43d.tar.gz |
tripoli: Show disabled card popup menu items too.
Stable menu items should prevent some mis-clicks.
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -212,7 +212,6 @@ function on_update() { function update_year_marker(year) { let e = document.getElementById("year"); - console.log("year", e); e.style.left = Math.round(YEAR_X[year] - 27) + "px"; e.style.top = Math.round(YEAR_Y - 27) + "px"; } @@ -388,33 +387,33 @@ function hide_popup_menu() { } function on_card_event() { - send_action('card_event', current_popup_card); - hide_popup_menu(); + if (send_action('card_event', current_popup_card)) + hide_popup_menu(); } function on_card_take() { - send_action('card_take', current_popup_card); - hide_popup_menu(); + if (send_action('card_take', current_popup_card)) + hide_popup_menu(); } function on_card_move_frigates() { - send_action('card_move_frigates', current_popup_card); - hide_popup_menu(); + if (send_action('card_move_frigates', current_popup_card)) + hide_popup_menu(); } function on_card_pirate_raid() { - send_action('card_pirate_raid', current_popup_card); - hide_popup_menu(); + if (send_action('card_pirate_raid', current_popup_card)) + hide_popup_menu(); } function on_card_build_gunboat() { - send_action('card_build_gunboat', current_popup_card); - hide_popup_menu(); + if (send_action('card_build_gunboat', current_popup_card)) + hide_popup_menu(); } function on_card_build_corsair() { - send_action('card_build_corsair', current_popup_card); - hide_popup_menu(); + if (send_action('card_build_corsair', current_popup_card)) + hide_popup_menu(); } function is_card_action(action, card) { |