diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-11-26 15:10:34 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:37 +0100 |
commit | 7746a800c6d0402923b4dda3c9939b706716196d (patch) | |
tree | f3b9d9e5cc25b7f3b5daf4c8c442645b709b8b1f | |
parent | 1eb2d8cd1c5ea7615dde76e7352df1f0a14b71ab (diff) | |
download | nevsky-7746a800c6d0402923b4dda3c9939b706716196d.tar.gz |
Legate location.
-rw-r--r-- | play.html | 19 | ||||
-rw-r--r-- | play.js | 19 | ||||
-rw-r--r-- | rules.js | 3 |
3 files changed, 23 insertions, 18 deletions
@@ -79,13 +79,6 @@ header.your_turn { background-color: orange; } /* PLAN */ #plan { - //background-color: white; - //border: 1px solid black; - //position: fixed; - top: 84px; - left: 36px; - //box-shadow: 0px 5px 10px 0px rgba(0,0,0,0.5); - //z-index: 51; user-select: none; max-width: 1275px; margin: 36px auto; @@ -93,9 +86,7 @@ header.your_turn { background-color: orange; } #plan_header { font-weight: bold; - cursor: move; text-align: center; - //border-bottom: 1px solid black; background-color: #444; color: white; padding: 3px 1em; @@ -721,8 +712,6 @@ body.shift .mustered_vassals { width: 32px; height: 64px; background-image: url(images/legate.svg); - top: 1580px; - left: 170px; filter: drop-shadow(0px 2px 4px #0004); } @@ -1099,10 +1088,10 @@ body.shift .mustered_vassals { <div id="boxes"></div> <div id="pieces"> - <div id="turn" class="marker circle turn levy t1"></div> - <div id="vp2" class="marker circle victory russian v0 stack"></div> - <div id="vp1" class="marker circle victory teutonic v0 stack"></div> - <div id="legate"></div> + <div id="turn" class="hide marker circle turn levy t1"></div> + <div id="vp2" class="hide marker circle victory russian v0 stack"></div> + <div id="vp1" class="hide marker circle victory teutonic v0 stack"></div> + <div id="legate" class="hide"></div> </div> </div> @@ -332,6 +332,7 @@ const ui = { lord_capabilities: [], cards: [], boxes: {}, + legate: document.getElementById("legate"), veche: document.getElementById("veche"), plan_dialog: document.getElementById("plan"), plan_list: document.getElementById("plan_list"), @@ -592,7 +593,7 @@ function on_log(text) { return p } -function layout_locale_item(loc, e, is_upper) { +function layout_locale_item(loc, e, is_upper, yofs = 0) { let [x, y] = locale_xy[loc] let z = 0 if (is_upper) { @@ -600,6 +601,7 @@ function layout_locale_item(loc, e, is_upper) { z = 1 } x += locale_layout[loc] * 44 + y += yofs e.classList.toggle("lieutenant", is_upper) e.style.top = (y - 23) + "px" e.style.left = (x - 23) + "px" @@ -782,6 +784,20 @@ function update_lord(ix) { ui.lord_mat[ix].classList.toggle("selected", ix === view.who) } +function update_legate() { + if (view.legate < 0) { + ui.legate.classList.add("hide") + } else { + ui.legate.classList.remove("hide") + if (view.legate === 100) { + ui.legate.style.top = "1580px" + ui.legate.style.left = "170px" + } else { + layout_locale_item(view.legate, ui.legate, 0, -16) + } + } +} + function update_veche() { ui.veche.replaceChildren() @@ -986,6 +1002,7 @@ function on_update() { layout_calendar() + update_legate() update_veche() update_current_card_display() @@ -799,8 +799,7 @@ function setup_peipus() { setup_lord_on_calendar(LORD_GAVRILO, 13) setup_lord_on_calendar(LORD_VLADISLAV, 15) - // XXX - goto_campaign_plan() + // XXX goto_campaign_plan() } function setup_return_of_the_prince() { |