diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-20 14:36:20 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | db5183be29b35d777fed31753c8a14bb3c29ba06 (patch) | |
tree | 59cbd8b6c7ffeef2c8c3ab2bcad2a096f725131e | |
parent | 8a5916ce20fc16e9655463d3d142056401a04031 (diff) | |
download | time-of-crisis-db5183be29b35d777fed31753c8a14bb3c29ba06.tar.gz |
Better layout.
-rw-r--r-- | play.js | 454 | ||||
-rw-r--r-- | tools/boxes.svg | 108 | ||||
-rw-r--r-- | tools/genboxes.py | 2 |
3 files changed, 424 insertions, 140 deletions
@@ -68,26 +68,66 @@ const REGION_NAME = [ "Unavailable", ] -function is_no_place_governor(province) { return province >= view.support.length } -function get_support(province) { return view.support[province] } -function get_barbarian_location(id) { return view.barbarians[id] & 63 } -function is_barbarian_inactive(id) { return view.barbarians[id] & 64 } -function get_legion_location(ix) { return view.legions[ix] & 63 } -function is_legion_reduced(ix) { return view.legions[ix] & 64 } -function is_legion_unused(ix) { return view.legions[ix] === AVAILABLE } -function get_governor_location(id, loc) { return view.governors[id] & 63 } -function get_general_location(id) { return view.generals[id] & 63 } -function is_general_inside_capital(id) { return view.generals[id] & 64 } -function has_general_castra(id) { return view.castra & (1 << id) } -function has_militia_castra(province) { return view.mcastra & (1 << province) } -function has_quaestor(province) { return view.quaestor & (1 << province) } -function has_militia(province) { return view.militia & (1 << province) } -function get_mobs(province) { return view.mobs[province] } -function has_amphitheater(province) { return view.amphitheater & (1 << province) } -function has_basilica(province) { return view.basilica & (1 << province) } -function has_limes(province) { return view.limes & (1 << province) } -function is_breakaway(province) { return view.breakaway & (1 << province) } -function is_seat_of_power(province) { return view.seat_of_power & (1 << province) } +function is_no_place_governor(province) { + return province >= view.support.length +} +function get_support(province) { + return view.support[province] +} +function get_barbarian_location(id) { + return view.barbarians[id] & 63 +} +function is_barbarian_inactive(id) { + return view.barbarians[id] & 64 +} +function get_legion_location(ix) { + return view.legions[ix] & 63 +} +function is_legion_reduced(ix) { + return view.legions[ix] & 64 +} +function is_legion_unused(ix) { + return view.legions[ix] === AVAILABLE +} +function get_governor_location(id, loc) { + return view.governors[id] & 63 +} +function get_general_location(id) { + return view.generals[id] & 63 +} +function is_general_inside_capital(id) { + return view.generals[id] & 64 +} +function has_general_castra(id) { + return view.castra & (1 << id) +} +function has_militia_castra(province) { + return view.mcastra & (1 << province) +} +function has_quaestor(province) { + return view.quaestor & (1 << province) +} +function has_militia(province) { + return view.militia & (1 << province) +} +function get_mobs(province) { + return view.mobs[province] +} +function has_amphitheater(province) { + return view.amphitheater & (1 << province) +} +function has_basilica(province) { + return view.basilica & (1 << province) +} +function has_limes(province) { + return view.limes & (1 << province) +} +function is_breakaway(province) { + return view.breakaway & (1 << province) +} +function is_seat_of_power(province) { + return view.seat_of_power & (1 << province) +} // === END SYNC === @@ -111,42 +151,40 @@ const PLAYER_CLASS = [ "red", "blue", "yellow", "green" ] const BARBARIAN_CLASS = [ "alamanni", "franks", "goths", "nomads", "sassanids" ] const BOXES = { - "Thracia Support": [1502,720,258,52], - "Syria Support": [2034,1280,258,52], - "Pannonia Support": [1154,626,258,53], - "Macedonia Support": [1384,936,258,53], - "Hispania Support": [154,980,258,53], - "Gallia Support": [460,507,258,53], - "Galatia Support": [1954,931,258,53], - "Britannia Support": [231,260,258,52], - "Asia Support": [1679,1000,258,52], - "Africa Support": [647,1290,258,53], - "Aegyptus Support": [1700,1468,258,53], - "Italia Support 2": [1054,887,258,52], - "Italia Support 1": [1028,835,258,52], - "Thracia Capital": [1594,631,70,70], - "Syria Capital": [2174,1193,70,70], - "Pannonia Capital": [1214,536,70,70], - "Macedonia Capital": [1477,850,70,70], - "Italia Capital": [1038,743,70,70], - "Hispania Capital": [249,892,70,70], - "Gallia Capital": [554,418,70,70], - "Galatia Capital": [2048,842,70,70], - "Britannia Capital": [325,177,70,70], - "Asia Capital": [1790,908,70,70], - "Africa Capital": [741,1204,70,70], - "Aegyptus Capital": [1793,1380,70,70], - "Pontus Euxinus XY": [1970,620,130,60], - "Mare Orientale XY": [1770,1170,100,60], - "Mare Occidentale XY": [720,890,90,60], - "Oceanus Atlanticus XY": [130,495,80,50], - "Nomads XY": [705,1495,165,25], - "Sassanids XY": [2295,980,190,25], - "Goths XY": [1840,235,130,15], - "Alamanni XY": [1370,200,195,15], - "Franks XY": [900,200,135,15], - "SCORE TRACK": [40,40,2469,80], - "CRISIS TABLE": [2195,189,262,326], + "Thracia Support": [ 1502, 720, 258, 52 ], + "Syria Support": [ 2034, 1280, 258, 52 ], + "Pannonia Support": [ 1154, 626, 258, 53 ], + "Macedonia Support": [ 1384, 936, 258, 53 ], + "Hispania Support": [ 154, 980, 258, 53 ], + "Gallia Support": [ 460, 507, 258, 53 ], + "Galatia Support": [ 1954, 931, 258, 53 ], + "Britannia Support": [ 231, 260, 258, 52 ], + "Asia Support": [ 1679, 1000, 258, 52 ], + "Africa Support": [ 647, 1290, 258, 53 ], + "Aegyptus Support": [ 1700, 1468, 258, 53 ], + "Italia Support 2": [ 1054, 887, 258, 52 ], + "Italia Support 1": [ 1028, 835, 258, 52 ], + "Thracia Capital": [ 1594, 631, 70, 70 ], + "Syria Capital": [ 2174, 1193, 70, 70 ], + "Pannonia Capital": [ 1214, 536, 70, 70 ], + "Macedonia Capital": [ 1477, 850, 70, 70 ], + "Italia Capital": [ 1038, 743, 70, 70 ], + "Hispania Capital": [ 249, 892, 70, 70 ], + "Gallia Capital": [ 554, 418, 70, 70 ], + "Galatia Capital": [ 2048, 842, 70, 70 ], + "Britannia Capital": [ 325, 177, 70, 70 ], + "Asia Capital": [ 1790, 908, 70, 70 ], + "Africa Capital": [ 741, 1204, 70, 70 ], + "Aegyptus Capital": [ 1793, 1380, 70, 70 ], + "Pontus Euxinus XY": [ 1880, 580, 60, 60 ], + "Mare Orientale XY": [ 1480, 1160, 60, 60 ], + "Mare Occidentale XY": [ 720, 900, 60, 60 ], + "Oceanus Atlanticus XY": [ 180, 500, 60, 60 ], + "Nomads XY": [ 520, 1480, 60, 60 ], + "Sassanids XY": [ 2440, 820, 60, 60 ], + "Goths XY": [ 2020, 360, 60, 60 ], + "Alamanni XY": [ 1540, 280, 60, 60 ], + "Franks XY": [ 1160, 300, 60, 60 ], } const LAYOUT_XY = [ @@ -188,6 +226,238 @@ const LAYOUT_SUPPORT = [ BOXES["Syria Support"], ] +const LAYOUT_SEA = [ [ 0, 0 ] ] + +const LAYOUT_HOMELAND = [ + [ 0, 0 ], + [ -1, 0 ], + [ -2, 0 ], + [ -3, 0 ], + [ -3, -1 ], + [ -2, -1 ], + [ -1, -1 ], + [ 0, -1 ], +] + +const LAYOUT_SASSANIDS = [ + [ 0, 0 ], + [ -1, 0 ], + [ -2, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ -2, -1 ], + [ -2, 1 ], + [ -1, 1 ], + [ 0, 1 ], + [ -2, 2 ], + [ -1, 2 ], + [ 0, 2 ], +] + +const LAYOUT_NOMADS = [ + [ 0, 0 ], + [ 1, 0 ], + [ 2, 0 ], + [ 3, 0 ], + [ 4, 0 ], + [ 5, 0 ], + [ 0, 1 ], +] + +const LAYOUT_ITALIA = [ + [ -3, -2 ], + [ -2, -2 ], + [ -1, -2 ], + [ 0, -2 ], + [ -2, -1 ], + [ -1, -1 ], + [ 0, -1 ], + [ -1, 0 ], + [ 1, 0 ], + [ 2, 0 ], + [ 0, 3 ], +] + +const LAYOUT_ASIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ 1, -1 ], + [ 1, -2 ], + [ 0, -2 ], + [ 1, -3 ], + [ -1, 3 ], +] + +const LAYOUT_GALLIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ 1, -1 ], + [ -2, 0 ], + [ 2, 0 ], + [ 2, -1 ], + [ 0, -2 ], + [ 1, -2 ], + [ -1, 3 ], +] + +const LAYOUT_MACEDONIA = [ + [ -1, 0 ], + [ -2, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ -2, -1 ], + [ -1, 3 ], +] + +const LAYOUT_PANNONIA = [ + [ 0, -1 ], + [ -1, -1 ], + [ -2, -1 ], + [ -3, -1 ], + [ -4, -1 ], + [ 1, -1 ], + [ -1, -2 ], + [ -2, -2 ], + [ -3, -2 ], + [ -4, -2 ], + [ -5, -2 ], + [ -1, 0 ], + [ 1, 0 ], +] + +const LAYOUT_THRACIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ 1, -1 ], + [ -2, -1 ], + [ -2, -2 ], + [ -3, -2 ], + [ -2, -3 ], + [ -1, -2 ], +] + +const LAYOUT_AEGYPTUS = [ + [ -1, 0 ], + [ -2, 0 ], + [ -3, 0 ], + [ -4, 0 ], + [ 1, 0 ], + [ -4, -1 ], + [ -4, 1 ], + [ -3, 1 ], + [ -4, 2 ], + [ -3, 2 ], + [ 3, 2 ], +] + +const LAYOUT_AFRICA = [ + [ -1, 0 ], + [ -2, 0 ], + [ -3, 0 ], + [ -4, 0 ], + [ 1, 0 ], + [ 2, 0 ], + [ 2, -1 ], + [ 1, -1 ], + [ -4, 1 ], + [ -3, 1 ], + [ 3, 2 ], + [ 4, 2 ], + [ 5, 2 ], + [ 6, 2 ], + [ 5, 3 ], +] + +const LAYOUT_HISPANIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ 1, -1 ], + [ -2, 0 ], + [ 2, 0 ], + [ -2, -1 ], + [ 2, -1 ], + [ 0, -2 ], + [ -1, -2 ], + [ 1, -2 ], +] + +const LAYOUT_BRITANNIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 2, 0 ], + [ -2, 0 ], + [ -3, 0 ], + [ -3, 1 ], + [ -3, 2 ], + [ -2, 1 ], + [ -2, 2 ], + [ -3, 3 ], +] + +const LAYOUT_GALATIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ 1, -1 ], + [ 1, -2 ], + [ 0, -2 ], + [ -1, -2 ], + [ -1, -3 ], +] + +const LAYOUT_SYRIA = [ + [ -1, 0 ], + [ 1, 0 ], + [ 0, -1 ], + [ -1, -1 ], + [ 1, -1 ], + [ -2, 0 ], + [ 2, 0 ], + [ -2, -1 ], + [ 2, -1 ], + [ 0, -2 ], + [ -1, -2 ], + [ 1, -2 ], +] + +const LAYOUT_PATTERN = [ + LAYOUT_ITALIA, + LAYOUT_ASIA, + LAYOUT_GALLIA, + LAYOUT_MACEDONIA, + LAYOUT_PANNONIA, + LAYOUT_THRACIA, + + LAYOUT_AEGYPTUS, + LAYOUT_AFRICA, + LAYOUT_HISPANIA, + + LAYOUT_BRITANNIA, + LAYOUT_GALATIA, + LAYOUT_SYRIA, + + LAYOUT_HOMELAND, + LAYOUT_HOMELAND, + LAYOUT_HOMELAND, + LAYOUT_NOMADS, + LAYOUT_SASSANIDS, + + LAYOUT_SEA, + LAYOUT_SEA, + LAYOUT_SEA, + LAYOUT_SEA, +] + let ui = { cards: [], militia: [], @@ -319,15 +589,17 @@ function register_action(target, action, id) { function on_click_action(evt, target) { if (evt.button === 0) { - if (typeof target.my_stack === "number") { + /* + if (typeof target.my_stack === "number") { + evt.stopPropagation() + if (focus_stack(target.my_stack)) + if (!send_action(target.my_action, target.my_id)) + blur_stack() + } else { + */ + if (send_action(target.my_action, target.my_id)) evt.stopPropagation() - if (focus_stack(target.my_stack)) - if (!send_action(target.my_action, target.my_id)) - blur_stack() - } else { - if (send_action(target.my_action, target.my_id)) - evt.stopPropagation() - } + //} } } @@ -339,7 +611,7 @@ document.getElementById("map").addEventListener("mousedown", function (evt) { function create_building(region, className, xoff, yoff) { let [ x, y, w, h ] = LAYOUT_SUPPORT[region] let e = create_thing({ className }) - e.style.left = x + (w>>1) + xoff - 46 + "px" + e.style.left = x + (w >> 1) + xoff - 46 + "px" e.style.top = y + h + yoff + "px" return e } @@ -403,7 +675,7 @@ function on_init() { if (true) { ui.amphitheater[region] = create_building(region, "amphitheater hide", -48 - 3, 6) ui.basilica[region] = create_building(region, "basilica hide", 48 + 3, 6) - ui.limes[region] = create_building(region, "limes hide", 0, 6+25) + ui.limes[region] = create_building(region, "limes hide", 0, 6 + 25) } else { ui.amphitheater[region] = create_building(region, "amphitheater hide", -96 - 5, 6) ui.basilica[region] = create_building(region, "basilica hide", 0, 6) @@ -412,7 +684,7 @@ function on_init() { register_action(ui.capital[region], "capital", region) register_action(ui.regions[region], "region", region) - + ui.neutral_governors[region] = create_thing({ className: "neutral governor hide" }) } for (let region = 12; region < 21; ++region) { @@ -420,12 +692,13 @@ function on_init() { } } -let stack_count = new Array(12 + 5).fill(0) +let stack_count = new Array(21).fill(0) let stack_focus = -1 let stack_cache = [] function focus_stack(id) { if (stack_focus !== id) { + // if (view.selected_general === undefined) send_action("general", id) stack_focus = id on_update() let stack = stack_cache[id] @@ -443,28 +716,39 @@ function blur_stack() { function layout_stack(id, list, region, in_capital) { let [ x, y, w, h ] = LAYOUT_XY[region] - let dx = 8 - let dy = 8 + let dx = 6 + let dy = 6 let z = 1 if (id >= 0) stack_cache[id] = list - if (in_capital) { - x += 5 - y += 5 - } else { - x += stack_count[region] * 80 + x += w >> 1 + y += h >> 1 + + x -= 30 + y -= 30 + + if (!in_capital) { + let sc = stack_count[region] + if (sc >= LAYOUT_PATTERN[region].length) + sc = LAYOUT_PATTERN[region].length - 1 + let xo = LAYOUT_PATTERN[region][sc][0] * 80 + let yo = LAYOUT_PATTERN[region][sc][1] * 80 + if (stack_count[region] > sc) + xo += (stack_count[region] - sc) * 80 + x += xo + y += yo stack_count[region] += 1 } - if (list.length > 5) { - dx = 5 - dy = 5 + if (list.length > 6) { + dx = 4 + dy = 4 } - if (id >= 0 && stack_focus === id) { - dx = 24 + if (id >= 0) { + dx = 16 dy = 16 } @@ -493,8 +777,8 @@ function layout_available(list, dx, x0, y0) { function layout_governor(e, color, region) { e.className = color + " governor s" + get_support(region) - e.style.left = (LAYOUT_SUPPORT[region][0] - 1) + "px" - e.style.top = (LAYOUT_SUPPORT[region][1] - 1) + "px" + e.style.left = LAYOUT_SUPPORT[region][0] - 1 + "px" + e.style.top = LAYOUT_SUPPORT[region][1] - 1 + "px" } function layout_governor_available(e, color) { @@ -557,7 +841,7 @@ function on_update() { show(ui.legacy[pi]) ui.legacy[pi].style.left = Math.round(43 + legacy * 60.2) + "px" - ui.legacy[pi].style.top = (2 + y) + "px" + ui.legacy[pi].style.top = 2 + y + "px" y = 30 for (let k = 0; k < pi; ++k) { @@ -568,7 +852,7 @@ function on_update() { show(ui.emperor_turns[pi]) ui.emperor_turns[pi].style.left = Math.round(41 + turns * 60.2) + "px" - ui.emperor_turns[pi].style.top = (0 + y) + "px" + ui.emperor_turns[pi].style.top = 0 + y + "px" } for (let pi = player_count; pi < 4; ++pi) { @@ -628,7 +912,7 @@ function on_update() { for (let id = BARBARIAN_COUNT[player_count]; id < ui.barbarians.length; ++id) hide(ui.barbarians[id]) - stack_count.fill(1) + stack_count.fill(0) for (let region = 0; region < 12 + 5; ++region) { for (let tribe = 0; tribe < TRIBE_COUNT[player_count]; ++tribe) { diff --git a/tools/boxes.svg b/tools/boxes.svg index 7e5f781..d5aa730 100644 --- a/tools/boxes.svg +++ b/tools/boxes.svg @@ -40,9 +40,9 @@ inkscape:window-height="480" id="namedview6" showgrid="true" - inkscape:zoom="1.7859922" - inkscape:cx="2122.3644" - inkscape:cy="944.53822" + inkscape:zoom="0.63591382" + inkscape:cx="1692.2778" + inkscape:cy="1133.1474" inkscape:current-layer="svg4" inkscape:document-rotation="0"> <inkscape:grid @@ -52,11 +52,11 @@ <image sodipodi:absref="/home/tor/src/rally/public/time-of-crisis/map75.png" xlink:href="../map75.png" - sodipodi:insensitive="true" - id="image2" - height="1650" + style="display:inline;image-rendering:pixelated" width="2550" - style="display:inline;image-rendering:pixelated" /> + height="1650" + id="image2" + sodipodi:insensitive="true" /> <rect style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect873" @@ -283,85 +283,85 @@ ry="0.610479" inkscape:label="Aegyptus Capital" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:1.35873;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect902" - width="130" + width="60" height="60" - x="1970" - y="620" + x="1880" + y="580" ry="0.610479" inkscape:label="Pontus Euxinus XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:1.5492;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect900" - width="100" + width="60" height="60" - x="1770" - y="1170" + x="1480" + y="1160" ry="0.610479" inkscape:label="Mare Orientale XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:1.63299;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect898" - width="90" + width="60" height="60" x="720" - y="890" + y="900" ry="0.610479" inkscape:label="Mare Occidentale XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:1.89736;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect893" - width="80" - height="50" - x="130" - y="495" - ry="0.610479" + width="60" + height="60" + x="180" + y="500" + ry="0.73257476" inkscape:label="Oceanus Atlanticus XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:1.8684;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect904" - width="165" - height="25" - x="705" - y="1495" - ry="0.610479" + width="60" + height="60" + x="520" + y="1480" + ry="1.4651496" inkscape:label="Nomads XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:1.74114;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect906" - width="190" - height="25" - x="2295" - y="980" - ry="0.610479" + width="60" + height="60" + x="2440" + y="820" + ry="1.4651496" inkscape:label="Sassanids XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2.71747;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect912" - width="130" - height="15" - x="1840" - y="235" - ry="0.610479" + width="60" + height="60" + x="2020" + y="360" + ry="2.441916" inkscape:label="Goths XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2.2188;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect910" - width="195" - height="15" - x="1370" - y="200" - ry="0.610479" + width="60" + height="60" + x="1540" + y="280" + ry="2.4419162" inkscape:label="Alamanni XY" /> <rect - style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" + style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2.66666;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" id="rect908" - width="135" - height="15" - x="900" - y="200" - ry="0.610479" + width="60" + height="60.000015" + x="1160" + y="300" + ry="2.4419165" inkscape:label="Franks XY" /> <rect style="fill:#e60000;fill-opacity:0.325203;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.581301" diff --git a/tools/genboxes.py b/tools/genboxes.py index 650f625..eeea2b9 100644 --- a/tools/genboxes.py +++ b/tools/genboxes.py @@ -40,7 +40,7 @@ for line in open("tools/boxes.svg").readlines(): flush() def print_list(): - print("const boxes = {") + print("const BOXES = {") for (x,y,w,h,c,name) in list: print(f'"{name}": [{x},{y},{w},{h}],') print("}") |