summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js91
-rw-r--r--tools/genseat.js57
-rw-r--r--tools/markers3.sh107
-rw-r--r--tools/seats.sh8
4 files changed, 115 insertions, 148 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index 7f2d41a..71c3855 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -113,34 +113,6 @@ const boxes = {
"vassal vassal_devon": [406,1400,27,30],
"vassal vassal_bonville": [174,1377,27,30],
"vassal vassal_beaumont": [753,787,27,30],
- "seat lancaster lord_henry_vi": [834,1169,50,50],
- "seat lancaster lord_margaret": [833,1170,50,50],
- "seat lancaster lord_henry_tudor": [834,1170,50,50],
- "seat lancaster lord_clarence": [650,637,50,50],
- "seat lancaster lord_northumberland_l": [392,430,50,50],
- "seat lancaster lord_buckingham": [714,975,50,50],
- "seat lancaster lord_jasper_tudor_2": [346,921,50,50],
- "seat lancaster lord_jasper_tudor_1": [127,1104,50,50],
- "seat lancaster lord_oxford": [678,1078,50,50],
- "seat lancaster lord_warwick_l": [1150,1350,50,50],
- "seat lancaster lord_exeter_1": [300,1333,50,50],
- "seat lancaster lord_somerset_1": [453,1277,50,50],
- "seat york lord_edward_iv": [952,1148,50,50],
- "seat york lord_gloucester_2": [953,1148,50,50],
- "seat york lord_gloucester_1": [609,1074,50,50],
- "seat york lord_salisbury": [770,636,50,50],
- "seat york lord_march": [427,969,50,50],
- "seat york lord_rutland": [1125,1214,50,50],
- "seat york lord_devon": [359,1318,50,50],
- "seat york lord_pembroke": [184,1067,50,50],
- "seat york lord_norfolk": [795,1398,50,50],
- "seat york lord_northumberland_y1": [391,431,50,50],
- "seat york lord_warwick_y": [1150,1349,50,50],
- "seat york lord_york": [906,937,50,50],
- "seat york lord_northumberland_y2": [391,431,50,50],
- "seat york lord_richard_iii": [953,1149,50,50],
- "seat lancaster lord_somerset_2": [452,1276,50,50],
- "seat lancaster lord_exeter_2": [300,1333,50,50],
}
let data = []
@@ -177,20 +149,6 @@ function defloc(region, type, name) {
ways.push([])
}
-function defseat(name) {
- let [x, y, w, h] = boxes[name]
- x = Math.floor(x)
- y = Math.floor(y)
- w = Math.ceil(w)
- h = Math.ceil(h)
- locmap[name] = locales.length
- seat.push({ name, box: { x, y, w, h } })
-}
-
-function defvassal(name) {
-}
-
-
function defway(type, aname, bname) {
let aix = locmap[aname]
let bix = locmap[bname]
@@ -301,52 +259,6 @@ defloc(null, "sea", "English Channel")
defloc(null, "sea", "Irish Sea")
defloc(null, "sea", "North Sea")
-//LOCALE SEAT
-defseat("seat york lord_york")
-defseat("seat york lord_march")
-defseat("seat york lord_edward_iv")
-defseat("seat york lord_salisbury")
-defseat("seat york lord_rutland")
-defseat("seat york lord_pembroke")
-defseat("seat york lord_devon")
-defseat("seat york lord_northumberland_y1")
-defseat("seat york lord_northumberland_y2")
-defseat("seat york lord_gloucester_1")
-defseat("seat york lord_gloucester_2")
-defseat("seat york lord_richard_iii")
-defseat("seat york lord_norfolk")
-defseat("seat york lord_warwick_y")
-defseat("seat lancaster lord_henry_vi")
-defseat("seat lancaster lord_margaret")
-defseat("seat lancaster lord_somerset_1")
-defseat("seat lancaster lord_somerset_2")
-defseat("seat lancaster lord_exeter_1")
-defseat("seat lancaster lord_exeter_2")
-defseat("seat lancaster lord_buckingham")
-defseat("seat lancaster lord_northumberland_l")
-defseat("seat lancaster lord_clarence")
-defseat("seat lancaster lord_jasper_tudor_1")
-defseat("seat lancaster lord_jasper_tudor_2")
-defseat("seat lancaster lord_henry_tudor")
-defseat("seat lancaster lord_oxford")
-defseat("seat lancaster lord_warwick_l")
-
-// VASSAL SEAT
-
-defvassal("Westmoreland")
-defvassal("Stanley")
-defvassal("Dudley")
-defvassal("Shrewsbury")
-defvassal("Worcester")
-defvassal("Oxford")
-defvassal("Essex")
-defvassal("Suffolk")
-defvassal("Fauconberg")
-defvassal("Norfolk")
-defvassal("Devon")
-defvassal("Bonville")
-defvassal("Beaumont")
-
//WAYS BETWEEN LOCALES
highway("Bamburgh", "Newcastle")
@@ -1468,9 +1380,6 @@ dumplist("lords", lords)
dumplist("vassals", vassals)
dumplist("cards", cards)
-// layout client only
-dumplist("seat", seat)
-
print("}")
print("if (typeof module !== 'undefined') module.exports = data")
diff --git a/tools/genseat.js b/tools/genseat.js
new file mode 100644
index 0000000..744b2f5
--- /dev/null
+++ b/tools/genseat.js
@@ -0,0 +1,57 @@
+/*
+border radius in html/css is given on outer edge (8 * 50/50)
+black outline is box-shadow (8 * 52/50)
+inner image is 8 * 46/50)
+*/
+
+const fs = require('fs')
+
+const PREFIX1 = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="74" height="74">
+<clipPath id="a"><path d="M0,0 52,52 0,52z"/></clipPath>
+<clipPath id="b"><path d="M0,0 52,52 52,0z"/></clipPath>
+<clipPath id="c"><rect transform="translate(11 11) rotate(-45 26 26)" x="3" y="3" width="46" height="46" rx="7.36" ry="7.36"/></clipPath>
+<g transform="translate(11 11) rotate(-45 26 26)">
+<rect x="0" y="0" width="52" height="52" rx="8.32" ry="8.32" fill="#333"/>`
+
+const L_PREFIX=`
+<rect clip-path="url(#a)" x="1" y="1" width="50" height="50" rx="8" ry="8" fill="#b4181e"/>
+<rect clip-path="url(#b)" x="1" y="1" width="50" height="50" rx="8" ry="8" fill="#e74b51"/>`
+
+const PREFIX2=`
+</g>
+<image clip-path="url(#c)" x="4" y="4" width="66" height="66" xlink:href="data:image/png;base64,`
+
+const Y_PREFIX = `
+<rect clip-path="url(#a)" x="1" y="1" width="50" height="50" rx="8" ry="8" fill="#dbdbdb"/>
+<rect clip-path="url(#b)" x="1" y="1" width="50" height="50" rx="8" ry="8" fill="#ffffff"/>`
+
+const SUFFIX = `"/>
+</svg>`
+
+function print_seat(prefix, output, label) {
+ let image = fs.readFileSync(label).toString('base64')
+ fs.writeFileSync(output, PREFIX1 + prefix + PREFIX2 + image + SUFFIX)
+}
+
+print_seat(L_PREFIX, "images/seat_lancaster_buckingham.svg", "images/raw_seat_lancaster_buckingham.png")
+print_seat(L_PREFIX, "images/seat_lancaster_clarence.svg", "images/raw_seat_lancaster_clarence.png")
+print_seat(L_PREFIX, "images/seat_lancaster_exeter.svg", "images/raw_seat_lancaster_exeter.png")
+print_seat(L_PREFIX, "images/seat_lancaster_henry_tudor.svg", "images/raw_seat_lancaster_henry_tudor.png")
+print_seat(L_PREFIX, "images/seat_lancaster_henry_vi.svg", "images/raw_seat_lancaster_henry_vi.png")
+print_seat(L_PREFIX, "images/seat_lancaster_jasper_tudor.svg", "images/raw_seat_lancaster_jasper_tudor.png")
+print_seat(L_PREFIX, "images/seat_lancaster_margaret.svg", "images/raw_seat_lancaster_margaret.png")
+print_seat(L_PREFIX, "images/seat_lancaster_northumberland.svg", "images/raw_seat_lancaster_northumberland.png")
+print_seat(L_PREFIX, "images/seat_lancaster_oxford.svg", "images/raw_seat_lancaster_oxford.png")
+print_seat(L_PREFIX, "images/seat_lancaster_somerset.svg", "images/raw_seat_lancaster_somerset.png")
+print_seat(L_PREFIX, "images/seat_lancaster_warwick.svg", "images/raw_seat_lancaster_warwick.png")
+print_seat(Y_PREFIX, "images/seat_york_devon.svg", "images/raw_seat_york_devon.png")
+print_seat(Y_PREFIX, "images/seat_york_edward_iv.svg", "images/raw_seat_york_edward_iv.png")
+print_seat(Y_PREFIX, "images/seat_york_gloucester.svg", "images/raw_seat_york_gloucester.png")
+print_seat(Y_PREFIX, "images/seat_york_march.svg", "images/raw_seat_york_march.png")
+print_seat(Y_PREFIX, "images/seat_york_norfolk.svg", "images/raw_seat_york_norfolk.png")
+print_seat(Y_PREFIX, "images/seat_york_northumberland.svg", "images/raw_seat_york_northumberland.png")
+print_seat(Y_PREFIX, "images/seat_york_pembroke.svg", "images/raw_seat_york_pembroke.png")
+print_seat(Y_PREFIX, "images/seat_york_rutland.svg", "images/raw_seat_york_rutland.png")
+print_seat(Y_PREFIX, "images/seat_york_salisbury.svg", "images/raw_seat_york_salisbury.png")
+print_seat(Y_PREFIX, "images/seat_york_warwick.svg", "images/raw_seat_york_warwick.png")
+print_seat(Y_PREFIX, "images/seat_york_york.svg", "images/raw_seat_york_york.png")
diff --git a/tools/markers3.sh b/tools/markers3.sh
index 58868b4..d79b834 100644
--- a/tools/markers3.sh
+++ b/tools/markers3.sh
@@ -4,6 +4,14 @@ function single {
convert -colorspace RGB -resize 25% -colorspace sRGB HIRES/output/$1.png images/$1.png
}
+function rotate_lanc {
+ convert -background '#e02027' -rotate 315 -colorspace RGB -resize 132x132 -colorspace sRGB HIRES/output/$1.png images/raw_$1.png
+}
+
+function rotate_york {
+ convert -background white -rotate 315 -colorspace RGB -resize 132x132 -colorspace sRGB HIRES/output/$1.png images/raw_$1.png
+}
+
function multi {
BGND=$1
SIZE=$2
@@ -60,29 +68,29 @@ single source
single valour
single victory_check
-single seat_york_devon
-single seat_york_edward_iv
-single seat_york_gloucester
-single seat_york_march
-single seat_york_norfolk
-single seat_york_northumberland
-single seat_york_pembroke
-single seat_york_rutland
-single seat_york_salisbury
-single seat_york_warwick
-single seat_york_york
-
-single seat_lancaster_buckingham
-single seat_lancaster_clarence
-single seat_lancaster_exeter
-single seat_lancaster_henry_tudor
-single seat_lancaster_henry_vi
-single seat_lancaster_jasper_tudor
-single seat_lancaster_margaret
-single seat_lancaster_northumberland
-single seat_lancaster_oxford
-single seat_lancaster_somerset
-single seat_lancaster_warwick
+rotate_york seat_york_devon
+rotate_york seat_york_edward_iv
+rotate_york seat_york_gloucester
+rotate_york seat_york_march
+rotate_york seat_york_norfolk
+rotate_york seat_york_northumberland
+rotate_york seat_york_pembroke
+rotate_york seat_york_rutland
+rotate_york seat_york_salisbury
+rotate_york seat_york_warwick
+rotate_york seat_york_york
+
+rotate_lanc seat_lancaster_buckingham
+rotate_lanc seat_lancaster_clarence
+rotate_lanc seat_lancaster_exeter
+rotate_lanc seat_lancaster_henry_tudor
+rotate_lanc seat_lancaster_henry_vi
+rotate_lanc seat_lancaster_jasper_tudor
+rotate_lanc seat_lancaster_margaret
+rotate_lanc seat_lancaster_northumberland
+rotate_lanc seat_lancaster_oxford
+rotate_lanc seat_lancaster_somerset
+rotate_lanc seat_lancaster_warwick
single vassal_beaumont
single vassal_bonville
@@ -98,34 +106,19 @@ single vassal_suffolk
single vassal_westmoreland
single vassal_worcester
-single vassal_beaumont_b
-single vassal_bonville_b
-single vassal_devon_b
-single vassal_dudley_b
-single vassal_essex_b
-single vassal_fauconberg_b
-single vassal_norfolk_b
-single vassal_oxford_b
-single vassal_shrewsbury_b
-single vassal_stanley_b
-single vassal_suffolk_b
-single vassal_westmoreland_b
-single vassal_worcester_b
-
-single vassal_beaumont_b
-single vassal_bonville_b
-single vassal_devon_b
-single vassal_dudley_b
-single vassal_essex_b
-single vassal_fauconberg_b
-single vassal_norfolk_b
-single vassal_oxford_b
-single vassal_shrewsbury_b
-single vassal_stanley_b
-single vassal_suffolk_b
-single vassal_westmoreland_b
-single vassal_worcester_b
-
+# single vassal_beaumont_b
+# single vassal_bonville_b
+# single vassal_devon_b
+# single vassal_dudley_b
+# single vassal_essex_b
+# single vassal_fauconberg_b
+# single vassal_norfolk_b
+# single vassal_oxford_b
+# single vassal_shrewsbury_b
+# single vassal_stanley_b
+# single vassal_suffolk_b
+# single vassal_westmoreland_b
+# single vassal_worcester_b
single vassal_clifford
single vassal_edward
@@ -134,12 +127,12 @@ single vassal_thomas_stanley
single vassal_trollope
single vassal_montagu
-single vassal_clifford_b
-single vassal_edward_b
-single vassal_hastings_b
-single vassal_thomas_stanley_b
-single vassal_trollope_b
-single vassal_montagu_b
+# single vassal_clifford_b
+# single vassal_edward_b
+# single vassal_hastings_b
+# single vassal_thomas_stanley_b
+# single vassal_trollope_b
+# single vassal_montagu_b
multi "#ffffff" 6x1 numbers_york \
HIRES/output/number_1_york.png \
diff --git a/tools/seats.sh b/tools/seats.sh
new file mode 100644
index 0000000..0e9a066
--- /dev/null
+++ b/tools/seats.sh
@@ -0,0 +1,8 @@
+node tools/genseat.js
+
+for F in images/seat_*.svg
+do
+ B=$(basename $F .svg)
+ echo $B
+ inkscape -d 192 -o images/$B.png $F
+done