Rename to Table Tarot in the UI: spreads, threads, deck mode, branch, repeat

User-facing text only; code names, JSON keys and the project's internal
name (and so the user:// folder) are unchanged. The Collection card kind
keeps its name until a new one is chosen. The window title says Table
Tarot; the top bar shows the theme's logo (the fortune teller, drawn from a
copy of the art without its background square); the app icon is the
mascot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
RobinFiredrake 2026-11-10 18:24:23 -06:00
parent f9aa66d74d
commit ea1e7a6492
70 changed files with 1107 additions and 417 deletions

View file

@ -1,4 +1,4 @@
# TableTower
# Table Tarot
Random roll tables for tabletop games, built as a board of table cards joined by pipes.
Click the die on any table and the result flows down its pipes into the next table.

View file

@ -0,0 +1,624 @@
<svg xmlns="http://www.w3.org/2000/svg" width="2048" height="2048" viewBox="0 0 2048 2048">
<!-- Traced from fortune_teller.png with potrace, one layer per palette colour. -->
<path id="outline" fill="#1c0329" transform="translate(0.000000,2048.000000) scale(0.100000,-0.100000)" d="M11542 20143 c-113 -359 -208 -671 -248 -813 -25 -91 -58 -205 -72
-254 l-27 -90 -85 -22 c-47 -12 -111 -32 -142 -43 -32 -12 -74 -21 -95 -21
-21 0 -56 -5 -78 -10 -104 -24 -254 -31 -308 -15 -96 28 -863 108 -1202 125
-115 5 -200 14 -235 25 -184 55 -795 -66 -1095 -218 -143 -72 -382 -273 -706
-597 -124 -124 -304 -299 -399 -390 -861 -820 -1579 -2044 -1880 -3205 -107
-412 -161 -852 -121 -983 22 -71 45 -112 64 -112 12 0 63 -78 56 -84 -2 -1
-20 -12 -39 -24 -183 -110 -182 -371 2 -480 45 -27 37 -52 -12 -39 -63 17 -65
1 -11 -83 l48 -75 6 -183 6 -182 -38 -28 c-51 -35 -144 -87 -153 -84 -11 3
-10 -6 2 -29 14 -25 75 -25 146 -1 l51 18 6 -80 c7 -89 7 -92 -21 -77 -30 16
-98 13 -116 -5 -23 -22 2 -78 54 -124 50 -44 50 -42 -10 -69 -27 -12 -50 -27
-50 -31 0 -17 41 -31 72 -25 l30 7 -29 -43 c-50 -74 -54 -85 -42 -113 25 -54
44 -44 136 68 36 44 34 46 49 -59 7 -54 17 -45 29 27 l6 37 36 -25 c20 -13 41
-23 47 -21 16 6 9 104 -10 156 l-17 44 32 26 c36 30 39 41 11 41 -18 0 -17 4
10 63 52 109 29 115 -72 18 l-38 -35 0 29 c0 45 -11 75 -26 75 -11 0 -14 19
-14 81 0 80 0 81 40 126 58 66 83 141 77 225 -7 81 -55 203 -97 243 -43 41
-41 77 2 64 41 -11 109 -12 127 0 24 16 -4 48 -49 55 -22 3 -59 14 -81 23
l-41 16 7 136 c4 85 3 166 -4 216 -10 69 -9 80 4 88 9 5 20 19 25 31 11 30
147 122 233 159 97 40 197 56 357 57 l135 0 48 -89 c97 -182 186 -445 224
-666 28 -163 25 -598 -5 -769 -30 -167 -73 -309 -127 -421 -53 -111 -67 -124
-157 -147 -215 -55 -525 -278 -542 -391 -4 -26 -3 -54 3 -65 8 -16 4 -21 -27
-36 -203 -97 -548 -475 -714 -782 -23 -43 -90 -146 -147 -229 -247 -353 -342
-508 -591 -965 -762 -1396 -1201 -2048 -1753 -2604 -182 -183 -380 -356 -408
-356 -47 0 -687 -62 -783 -75 -143 -21 -180 -37 -211 -90 -27 -45 -33 -100
-13 -108 7 -2 54 4 103 14 82 16 920 83 2075 164 1186 83 2309 132 3595 154
562 10 3034 10 3870 0 352 -4 1205 -15 1895 -23 4425 -56 6175 -59 7112 -11
l276 14 128 63 c112 55 162 88 164 109 0 3 -73 32 -162 64 -185 66 -172 64
-671 85 l-258 10 -102 79 c-56 43 -145 108 -196 145 -103 72 -113 84 -559 581
-152 170 -365 402 -472 515 -626 657 -1251 1471 -1453 1892 -128 268 -223 421
-438 709 -349 467 -616 760 -816 892 -60 40 -89 65 -83 71 33 33 -24 107 -130
170 -153 91 -744 357 -859 387 -109 28 -261 148 -434 343 l-61 68 64 -7 c345
-37 665 -85 1275 -189 225 -39 408 -59 734 -81 343 -23 361 -21 492 46 36 18
52 39 29 39 -6 0 -9 82 -9 218 0 461 -58 696 -280 1139 -347 693 -847 1301
-1403 1706 -70 51 -108 85 -110 99 -2 17 -40 41 -178 109 -406 203 -624 279
-985 343 l-180 33 -32 144 c-31 136 -62 327 -98 592 l-16 117 129 128 c156
155 228 258 272 389 47 144 23 210 -68 184 -16 -5 -96 -5 -178 0 -82 4 -158 8
-170 8 -20 1 -21 8 -28 169 -3 92 -12 204 -19 250 l-13 83 60 49 c105 84 214
202 232 251 53 146 62 203 53 325 -19 253 -95 534 -224 827 -48 109 -108 197
-120 177 -5 -8 -11 -8 -19 -1 -12 10 -86 -65 -86 -87 0 -10 -224 -255 -298
-326 l-40 -38 45 133 c103 310 128 496 97 746 -5 48 -11 57 -62 104 -114 104
-248 178 -324 179 -27 0 -38 4 -38 15 0 8 -8 15 -18 15 -15 0 -25 -21 -50 -97z
m79 -1560 c-10 -16 -40 -48 -65 -73 -59 -56 -59 -70 -2 -70 59 0 61 -7 24 -80
-29 -56 -31 -63 -15 -71 20 -12 5 -49 -33 -84 -12 -11 -36 -40 -53 -64 -27
-40 -31 -42 -43 -27 -15 22 -9 42 23 78 16 17 23 33 19 45 -4 12 5 37 24 66
40 63 39 77 -5 77 -25 0 -37 6 -46 21 -10 20 -4 28 56 85 42 40 65 69 62 78
-4 9 6 20 26 30 45 22 51 20 28 -11z m83 -1626 c3 -18 1 -48 -5 -65 -8 -24 -8
-36 1 -47 14 -16 4 -39 -33 -73 -25 -24 -25 -24 -36 -4 -16 30 -14 52 11 99
20 37 21 44 9 67 -11 21 -12 28 -1 41 22 27 47 18 54 -18z m-1056 -48 c88 -40
231 -93 307 -114 117 -32 191 -58 289 -102 277 -124 459 -165 738 -167 205 -2
186 -14 -54 -33 -137 -12 -139 -13 -131 -116 5 -70 12 -94 49 -167 25 -49 50
-119 59 -165 20 -94 41 -140 69 -154 16 -8 -2 -9 -64 -5 -47 4 -86 8 -88 9 -1
1 3 35 9 76 20 140 -56 328 -206 504 -43 51 -44 51 -139 69 -77 14 -100 23
-115 42 -13 17 -39 28 -87 39 -286 66 -551 173 -707 286 -55 40 -19 39 71 -2z
m-2208 -149 c349 -30 783 -217 972 -419 70 -75 229 -324 215 -337 -9 -9 -414
245 -617 386 -252 176 -532 270 -800 270 -126 0 -173 10 -164 34 9 25 103 57
188 65 44 5 83 9 86 10 3 0 57 -4 120 -9z m-686 -192 c-4 -7 -20 -32 -36 -56
-46 -68 -95 -179 -127 -290 -16 -57 -37 -115 -47 -129 -37 -58 -2 -378 78
-698 134 -538 324 -976 836 -1920 232 -427 344 -653 411 -830 47 -125 51 -130
80 -133 27 -3 32 -10 60 -80 l29 -77 74 0 c134 0 681 25 783 36 55 6 187 26
294 45 107 19 220 34 251 34 32 0 111 9 177 21 65 12 172 22 238 24 66 1 171
8 233 15 88 11 126 11 176 2 35 -7 81 -12 102 -12 22 0 50 -7 64 -15 14 -8 33
-17 42 -21 16 -6 20 -35 7 -48 -13 -14 -141 -26 -160 -16 -15 8 -63 8 -175 -1
-140 -11 -156 -14 -166 -33 -6 -12 -30 -43 -53 -71 -110 -131 -173 -263 -225
-462 -14 -56 -53 -123 -66 -115 -74 48 -18 329 114 574 20 37 33 71 29 75 -12
11 -839 -50 -1037 -77 -236 -32 -543 -41 -671 -20 -95 15 -89 7 -263 370 -70
146 -185 375 -256 510 -71 135 -154 298 -184 362 -38 80 -62 118 -76 123 -43
14 -264 501 -393 870 -19 55 -58 147 -85 205 -64 133 -125 310 -163 468 -16
68 -36 134 -44 146 -19 28 -51 166 -70 297 -9 57 -23 133 -32 169 -25 102 -24
293 3 350 11 25 29 79 39 120 38 160 68 207 176 277 41 26 42 26 33 11z m3276
-628 c431 -23 593 -39 697 -70 169 -50 243 -78 322 -121 42 -23 102 -55 134
-71 85 -42 139 -77 132 -88 -3 -5 7 -16 22 -24 37 -20 40 -20 -159 14 -240 42
-612 93 -933 130 -614 70 -675 81 -729 131 -20 18 -20 19 0 40 64 71 131 79
514 59z m1265 -90 l20 -9 -20 1 c-11 0 -31 4 -45 8 l-25 8 25 0 c14 0 34 -3
45 -8z m-2385 -260 c-30 -42 -123 -154 -214 -256 -95 -107 -187 -229 -229
-303 -42 -74 -47 -47 -6 29 84 158 271 396 389 496 86 73 89 75 60 34z m3731
-416 c24 -20 63 -49 87 -66 29 -20 40 -34 34 -40 -16 -16 -137 -45 -307 -73
-220 -36 -207 -32 -200 -66 12 -54 -102 -131 -235 -159 l-61 -13 3 -36 c3 -38
-3 -34 106 -61 33 -9 62 -29 117 -81 67 -64 73 -73 78 -120 8 -66 5 -73 -67
-123 -328 -233 -1154 -426 -1891 -443 -860 -19 -1596 135 -1983 417 -46 33
-89 60 -96 60 -16 0 -54 -122 -66 -213 -16 -108 -23 -115 -64 -66 -32 38 -33
74 -6 187 24 100 36 124 100 201 49 59 51 60 69 42 29 -29 276 -147 377 -180
609 -199 1963 -179 2794 41 100 27 119 51 48 62 -69 11 -88 29 -88 81 0 61 62
181 107 208 24 13 33 26 34 45 0 15 15 54 32 87 42 77 70 91 223 111 151 19
156 21 186 86 42 87 58 96 173 103 55 3 142 10 193 16 70 8 97 8 107 -1 19
-16 112 -3 119 16 9 23 31 16 77 -22z m-5279 -841 c153 -184 256 -265 463
-368 514 -253 1396 -412 3025 -545 1121 -92 1502 -147 2020 -292 482 -134 729
-262 1210 -627 222 -167 225 -178 40 -116 -72 24 -130 41 -130 37 0 -3 -5 -1
-11 5 -6 6 -18 9 -25 6 -8 -3 -14 0 -14 6 0 6 -7 8 -17 4 -11 -4 -14 -3 -9 5
5 8 2 10 -8 6 -10 -4 -16 -1 -16 8 0 10 -75 38 -242 92 -134 42 -364 117 -513
166 -746 246 -1060 302 -2190 395 -1137 93 -1856 205 -2501 390 -537 155 -868
336 -1065 585 -81 102 -151 217 -151 246 0 24 37 84 52 84 5 0 42 -39 82 -87z
m-3392 -1179 c-6 -71 -13 -130 -14 -132 -10 -9 -46 90 -46 127 0 49 47 158 62
143 5 -5 5 -58 -2 -138z m4211 -96 c209 -325 348 -470 539 -562 54 -26 78 -42
66 -44 -10 -2 -21 0 -25 5 -3 5 -40 25 -81 44 -187 89 -402 303 -510 511 -38
73 -73 158 -66 158 2 0 37 -51 77 -112z m2846 -644 l32 -6 -31 -61 c-18 -34
-39 -86 -49 -116 l-16 -55 -109 -22 c-60 -12 -134 -31 -164 -43 l-55 -22 -63
68 c-34 37 -92 108 -127 158 l-64 90 77 5 c118 9 533 11 569 4z m-1311 -2785
c3 -5 -8 -9 -24 -9 -21 0 -31 6 -35 19 -4 17 -2 18 24 9 16 -5 32 -14 35 -19z
M13398 5081 c-27 -11 -77 -46 -114 -80 -167 -152 -527 -353 -891 -496 l-122
-48 69 -48 c37 -26 78 -62 89 -78 23 -32 223 -183 476 -358 752 -522 2320
-1426 2737 -1578 57 -21 119 -46 139 -56 l36 -18 75 37 c41 21 81 43 89 50 8
7 102 65 209 128 728 430 1528 1071 1868 1497 31 40 60 74 63 77 18 16 80 143
73 150 -5 4 -101 31 -214 58 -881 218 -3660 693 -4315 738 -71 5 -103 12 -111
22 -7 10 -21 13 -38 10 -14 -3 -29 -1 -32 3 -8 13 -34 10 -86 -10z M7465 5023
c-22 -2 -166 -12 -320 -24 -368 -26 -810 -67 -1460 -135 -734 -76 -1342 -137
-1794 -179 -389 -36 -530 -53 -858 -103 -101 -16 -186 -25 -191 -20 -4 4 -27
-2 -50 -14 l-43 -21 24 -26 c13 -14 32 -38 42 -53 9 -16 25 -28 34 -28 10 0
42 -30 72 -66 65 -81 259 -260 428 -398 69 -55 204 -177 300 -270 581 -558
1105 -941 1781 -1301 91 -48 210 -112 264 -142 156 -84 166 -85 231 -24 30 28
59 51 65 51 7 0 37 19 68 43 32 23 100 69 152 102 128 79 169 108 825 575 861
614 1110 786 1410 975 77 49 169 112 205 141 36 28 119 88 185 133 66 44 141
100 168 124 l47 43 -97 33 c-159 53 -317 118 -495 202 -92 44 -263 119 -380
168 -117 48 -258 109 -312 135 -54 25 -105 46 -112 46 -7 0 -18 9 -24 20 -11
20 -46 23 -165 13z M11910 4349 c-302 -82 -570 -128 -973 -164 l-68 -7 6 -96
c4 -54 13 -117 21 -142 8 -25 28 -164 44 -310 37 -324 73 -596 151 -1150 88
-627 141 -1041 136 -1055 -4 -10 4 -53 38 -203 l6 -24 202 7 c1052 32 2304
274 3263 630 126 47 209 80 579 232 61 25 113 48 117 51 4 4 -38 34 -94 67
-55 33 -117 74 -137 92 -21 18 -285 187 -587 376 -302 189 -643 404 -759 479
-541 348 -1633 1072 -1651 1094 -24 30 -169 154 -179 153 -5 -1 -57 -14 -115
-30z M9267 4215 c-60 -57 -133 -120 -163 -142 -156 -110 -2134 -1686 -2349
-1872 -109 -93 -275 -270 -275 -291 0 -9 71 -42 110 -51 19 -4 134 -42 255
-83 1050 -358 2250 -557 3570 -592 148 -4 263 -11 266 -16 4 -7 14 -6 27 1 11
6 52 14 90 17 l70 7 7 51 c32 234 -55 2150 -116 2566 -6 41 -12 86 -14 100 -1
14 -10 79 -20 145 l-18 120 -54 -3 c-255 -17 -974 65 -1263 143 -9 2 -60 -39
-123 -100z"/>
<path id="cloth" fill="#5d0e75" transform="translate(0.000000,2048.000000) scale(0.100000,-0.100000)" d="M9025 18829 c-22 -4 -126 -8 -231 -8 -213 -1 -364 -13 -502 -41 l-92
-18 -109 -104 c-60 -57 -146 -131 -191 -164 -547 -398 -661 -497 -910 -794
-421 -501 -416 -493 -692 -1164 -310 -755 -374 -1368 -209 -2016 62 -241 18
-221 -63 30 -181 559 -156 1207 70 1865 97 280 84 286 -83 38 -479 -711 -811
-1451 -977 -2178 -93 -408 -97 -601 -13 -692 29 -32 44 -29 117 28 181 139
447 209 626 165 102 -26 236 -87 249 -113 7 -12 34 -46 61 -75 37 -39 54 -67
63 -103 7 -27 25 -75 41 -105 220 -428 161 -1323 -116 -1762 -33 -52 -31 -58
20 -58 193 0 432 -44 586 -107 117 -48 250 -66 620 -83 169 -8 210 -13 310
-40 136 -36 146 -43 94 -65 -280 -121 -505 -114 -1042 29 -74 20 -151 36 -172
36 -22 0 -141 20 -266 45 -255 51 -280 53 -333 25 -31 -15 -259 -90 -277 -90
-2 0 -4 -6 -4 -14 0 -8 25 -26 56 -40 78 -36 175 -117 247 -206 47 -59 75 -83
130 -113 38 -20 89 -51 113 -68 74 -51 244 -134 339 -165 89 -29 92 -29 325
-29 359 0 590 64 880 244 155 97 430 337 430 376 0 6 20 49 44 96 118 226 141
350 132 722 -7 277 -7 278 -41 396 -43 150 -101 282 -197 446 -41 72 -87 154
-102 183 -15 29 -62 108 -104 175 -328 522 -608 1355 -671 1997 -25 252 -21
654 8 707 5 10 21 54 36 98 66 195 194 407 324 534 128 126 135 136 332 527
100 198 212 413 250 479 40 71 98 198 143 312 72 185 191 469 236 563 l21 45
-6 -55 c-10 -86 -71 -339 -109 -453 -33 -101 -59 -160 -205 -475 -92 -200 -92
-199 3 -157 144 64 367 96 538 77 224 -25 367 -82 541 -219 142 -111 259 -185
345 -217 69 -26 319 -96 344 -96 22 0 94 80 122 135 52 106 58 182 26 325 -22
94 -24 128 -24 320 1 334 44 493 186 680 40 53 108 163 108 175 0 8 -28 15
-86 19 -47 4 -194 30 -327 57 -634 130 -850 162 -962 138z m635 -807 c64 -149
89 -213 77 -202 -5 5 -175 384 -184 410 -20 60 52 -80 107 -208z m-4402 -3878
c68 -37 172 -103 172 -109 0 -10 -113 30 -175 60 -79 39 -85 41 -85 20 0 -19
89 -208 128 -270 37 -59 34 -65 -26 -65 -111 0 -265 71 -230 106 13 13 19 13
49 0 60 -27 165 -66 177 -66 17 0 15 18 -7 48 -36 52 -73 135 -92 209 -18 72
-18 77 -1 89 22 17 13 19 90 -22z m2038 -1890 c59 -20 135 -42 168 -49 34 -7
51 -14 38 -14 -78 -3 -362 83 -494 149 -68 34 -218 127 -218 135 0 2 90 -39
200 -91 109 -52 247 -110 306 -130z m287 -71 c-7 -2 -21 -2 -30 0 -10 3 -4 5
12 5 17 0 24 -2 18 -5z m-388 -584 c33 -5 -3 -7 -110 -4 -88 3 -178 9 -200 13
-53 12 243 3 310 -9z M10523 18603 c-122 -130 -233 -288 -233 -332 0 -10 -13
-86 -29 -168 -54 -271 -65 -500 -35 -715 26 -182 2 -271 -98 -371 -26 -26 -48
-52 -48 -57 0 -15 -13 -19 -114 -35 -199 -32 -405 29 -582 173 -94 77 -435
246 -559 278 -183 48 -453 45 -611 -7 -113 -37 -145 -64 -208 -182 -81 -151
-82 -150 77 -72 220 107 338 124 519 76 106 -29 312 -137 510 -268 184 -122
255 -155 452 -213 72 -21 150 -46 174 -54 53 -19 207 -56 233 -56 10 0 38 10
62 21 41 20 48 31 115 163 40 77 94 181 121 230 101 183 120 282 131 701 5
182 13 355 19 385 37 185 117 384 208 513 41 58 41 67 1 67 -27 0 -44 -12
-105 -77z M10935 18548 c-146 -87 -306 -285 -325 -404 -15 -93 -13 -214 4
-214 43 0 246 282 360 501 92 176 87 192 -39 117z M11845 17614 c-162 -78
-432 -176 -647 -235 -59 -16 -88 -28 -88 -38 0 -12 38 -13 258 -8 260 7 644
26 651 33 2 2 -8 50 -23 106 -15 57 -32 120 -37 141 -12 46 -22 46 -114 1z
M12100 16511 c-14 -4 -76 -11 -139 -15 -164 -10 -167 -11 -162 -116 3 -77 7
-93 46 -170 26 -50 51 -118 60 -165 25 -115 41 -142 95 -161 25 -9 63 -25 86
-35 50 -23 83 -24 128 -2 29 13 42 14 70 6 43 -13 58 12 32 52 -9 13 -20 64
-26 112 -16 146 -89 457 -112 478 -19 18 -49 24 -78 16z M7352 16218 c-60
-122 -95 -225 -111 -328 -7 -41 -16 -93 -22 -115 -11 -45 58 -627 106 -890
112 -618 417 -1417 641 -1680 182 -215 294 -447 350 -724 14 -69 34 -160 44
-201 61 -243 44 -502 -50 -737 -201 -503 -841 -959 -1400 -999 -199 -14 -548
75 -733 186 -90 54 -102 53 -93 -7 4 -27 10 -75 13 -108 6 -59 7 -61 73 -119
184 -163 382 -231 675 -230 329 0 636 92 952 285 308 189 614 521 779 844 l37
75 10 227 c23 535 -34 751 -399 1506 -402 830 -576 1275 -709 1812 -117 471
-155 926 -100 1195 30 147 7 150 -63 8z M7838 16148 c-4 -91 19 -362 38 -458
35 -176 61 -235 122 -282 71 -53 83 -63 145 -117 57 -49 128 -96 204 -134 64
-33 250 -97 280 -97 13 0 40 -7 62 -16 40 -16 40 -16 88 17 140 97 296 264
416 446 36 56 71 104 77 108 30 19 3 19 -47 1 -50 -18 -80 -21 -218 -20 -241
1 -404 38 -610 140 -114 56 -330 208 -320 225 4 5 0 9 -8 9 -16 0 -207 195
-207 211 0 5 -4 9 -10 9 -5 0 -11 -19 -12 -42z M4981 13442 c-199 -103 -252
-317 -114 -455 87 -88 278 -156 332 -119 27 19 -4 47 -67 60 -128 26 -222 121
-222 223 0 49 55 166 117 251 52 71 38 83 -46 40z M4866 12892 c-3 -5 28 -58
68 -119 82 -125 100 -176 94 -262 -7 -96 -51 -149 -190 -225 -29 -17 -56 -29
-60 -28 -12 3 -9 -12 6 -33 11 -15 22 -17 69 -12 184 19 327 178 314 349 -8
92 -55 202 -110 256 -57 56 -174 101 -191 74z M12300 12375 c0 -32 -13 -67
-50 -138 l-50 -95 0 -144 c0 -326 59 -529 211 -731 93 -124 267 -257 359 -276
592 -121 958 -31 1278 316 51 56 109 112 127 125 19 12 35 28 35 35 0 10 -175
73 -203 73 -5 0 -39 -28 -76 -62 -156 -148 -352 -239 -552 -259 -360 -35 -556
-16 -730 72 -125 63 -226 232 -286 478 -51 213 -35 334 63 477 39 57 82 151
72 159 -2 1 -47 5 -100 7 l-98 5 0 -42z M12554 12358 c0 -44 -50 -188 -66
-188 -15 0 3 -359 24 -465 22 -115 65 -225 107 -276 110 -133 497 -202 806
-144 139 26 309 106 422 197 98 80 96 82 -111 152 -177 59 -231 86 -402 200
-57 38 -92 55 -100 50 -7 -5 -56 -42 -111 -83 -139 -105 -140 -105 -24 7 57
55 102 105 100 110 -5 14 -147 132 -158 132 -6 0 -40 -58 -77 -130 -126 -245
-152 -247 -55 -3 82 206 79 183 25 250 -51 63 -69 98 -85 171 l-10 49 -97 6
c-53 4 -118 7 -143 7 l-46 0 1 -42z M5047 12123 c-4 -3 -7 -27 -7 -52 l0 -45
-27 26 c-40 37 -66 48 -112 48 -84 0 -84 -67 -1 -140 50 -44 50 -42 -10 -69
-27 -12 -50 -27 -50 -31 0 -17 41 -31 72 -25 l30 7 -29 -43 c-50 -74 -54 -85
-42 -113 25 -54 44 -44 136 68 36 44 34 46 49 -59 7 -54 17 -45 29 27 l6 37
36 -25 c20 -13 41 -23 47 -21 16 6 9 104 -10 156 l-17 44 32 26 c36 30 39 41
11 41 -18 0 -17 4 10 63 52 109 29 115 -72 18 l-38 -35 0 29 c0 61 -20 92 -43
68z M11670 11939 c0 -6 -21 -42 -46 -80 -43 -65 -108 -122 -260 -227 -41 -28
-204 -109 -238 -118 -34 -8 -33 -29 2 -42 164 -63 249 -92 266 -92 51 0 238
136 406 297 63 60 130 118 148 128 31 19 33 23 27 60 -8 50 4 44 -122 66 -124
21 -183 24 -183 8z M9032 11760 l3 -72 115 -35 c474 -143 821 -399 880 -653
23 -98 67 -215 82 -218 14 -3 135 254 145 309 4 24 -9 36 -169 150 -95 67
-218 157 -273 200 -264 202 -551 350 -748 384 l-38 6 3 -71z M11980 11692 c0
-54 -288 -267 -431 -318 -59 -21 -61 -34 -12 -58 44 -21 158 -95 195 -128 l27
-23 -13 -110 c-25 -206 -74 -349 -223 -645 -90 -180 -90 -178 -68 -241 9 -23
25 -124 36 -223 11 -100 31 -224 44 -277 14 -52 38 -163 55 -245 132 -636 251
-936 712 -1789 203 -376 597 -851 900 -1086 l63 -49 2588 0 c2063 0 2587 3
2587 13 0 6 -44 40 -98 74 -127 81 -322 243 -502 418 -139 135 -333 295 -360
295 -6 0 -44 -30 -84 -66 -241 -224 -531 -336 -865 -333 l-146 1 65 15 c353
78 611 177 785 301 88 62 165 130 165 145 0 16 -245 247 -262 247 -8 0 -32
-18 -53 -41 -83 -85 -327 -219 -465 -255 -61 -15 -252 -45 -258 -39 -1 1 32
15 75 30 264 92 598 270 633 336 14 25 6 49 -14 49 -9 0 -13 6 -10 14 4 9 -34
60 -97 133 -233 269 -484 599 -684 898 -124 186 -117 175 -164 266 -22 42 -46
79 -54 82 -14 5 -113 164 -219 352 -60 106 -121 228 -169 339 -22 50 -50 102
-63 116 -41 44 -139 179 -291 400 -509 739 -731 983 -920 1012 -27 4 -59 10
-71 13 -16 5 -32 -8 -84 -72 -142 -173 -235 -256 -375 -336 -279 -160 -649
-219 -884 -141 -84 29 -405 191 -479 243 -210 149 -359 347 -448 596 -20 57
-38 91 -48 93 -9 2 -16 -1 -16 -6z m2695 -1808 l102 -16 -24 -24 c-13 -13 -28
-24 -32 -24 -11 0 -125 -75 -149 -97 -10 -10 -58 -54 -105 -98 -48 -44 -87
-85 -87 -91 0 -6 -9 -19 -19 -29 -11 -9 -37 -44 -58 -76 -20 -32 -40 -59 -44
-59 -9 0 -88 -105 -116 -155 -91 -162 -127 -276 -138 -436 -6 -92 14 -349 27
-349 4 0 8 -13 8 -28 0 -27 28 -117 54 -177 8 -16 17 -41 21 -55 5 -14 19 -42
31 -62 13 -21 24 -42 24 -47 0 -5 6 -16 13 -23 8 -7 26 -32 40 -55 35 -56 225
-251 263 -271 18 -10 58 -35 90 -57 109 -75 264 -135 459 -180 127 -29 629
-60 788 -48 l88 6 -100 -102 c-56 -55 -106 -101 -111 -101 -11 0 -91 -50 -100
-62 -12 -15 -219 -108 -275 -122 -383 -99 -652 -109 -1031 -41 -328 59 -739
264 -902 449 -15 18 -35 35 -43 38 -8 3 -28 25 -44 49 -17 24 -35 49 -41 54
-13 11 -84 143 -84 156 0 8 -64 105 -85 129 -25 28 -125 234 -125 256 0 13 -4
26 -10 29 -5 3 -10 22 -10 42 0 47 -22 163 -30 163 -4 0 -10 17 -13 38 -3 20
-13 68 -21 105 -17 77 -14 333 4 367 5 10 10 29 10 41 0 39 47 172 96 274 71
144 239 364 279 365 6 0 26 14 45 32 46 43 238 152 320 182 330 122 703 162
1035 110z M14010 9663 c-34 -5 -265 -71 -315 -90 -40 -15 -194 -104 -217 -126
-7 -7 -45 -37 -83 -68 -39 -31 -85 -76 -103 -100 -84 -113 -100 -137 -124
-184 -89 -172 -119 -304 -113 -494 5 -159 25 -282 60 -356 7 -16 17 -43 21
-60 4 -16 10 -32 14 -35 4 -3 17 -26 28 -52 11 -27 25 -48 30 -48 5 0 21 -17
34 -37 14 -21 38 -52 54 -69 16 -17 41 -44 55 -60 15 -16 33 -34 40 -40 8 -6
37 -38 64 -70 101 -118 255 -260 318 -293 17 -10 79 -42 137 -73 126 -67 175
-83 304 -98 106 -13 197 -36 208 -53 18 -29 377 -36 547 -12 131 20 291 64
291 81 0 14 -3 15 -205 39 -172 21 -318 61 -452 126 -56 27 -108 49 -115 49
-20 0 -250 173 -308 231 -67 67 -200 226 -200 239 0 4 -14 25 -31 46 -17 22
-37 53 -45 69 -7 17 -18 37 -23 45 -20 32 -71 147 -71 161 0 8 -4 19 -9 24
-10 11 -42 118 -62 210 -32 141 -13 432 37 568 8 23 22 61 29 85 20 61 95 211
126 252 14 19 28 40 30 47 2 6 30 39 62 72 75 81 74 88 -13 74z M9007 11513
c-27 -145 -122 -308 -298 -510 -30 -34 -81 -102 -114 -150 -118 -173 -346
-382 -567 -519 -137 -85 -541 -286 -640 -319 -49 -17 -88 -33 -88 -37 0 -4 13
-34 30 -66 46 -91 84 -263 69 -307 -13 -35 -32 -45 -45 -24 -5 8 -47 10 -149
5 -148 -8 -621 18 -639 35 -5 5 -2 19 8 33 9 14 16 32 16 40 0 8 23 60 51 116
28 56 49 103 47 104 -1 2 -44 8 -95 15 -277 35 -546 143 -664 268 -133 140
-162 252 -114 444 l16 65 -39 92 c-52 119 -92 181 -159 242 -92 84 -83 87
-283 -94 -52 -48 -162 -139 -245 -204 -300 -234 -419 -396 -578 -787 -180
-443 -307 -699 -595 -1200 -358 -623 -697 -1149 -1000 -1548 -57 -75 -102
-143 -99 -151 13 -33 280 -167 445 -222 269 -91 794 -125 1209 -80 153 16 203
16 203 -4 0 -58 -405 -108 -780 -97 -560 17 -901 131 -1051 351 -13 20 -31 36
-39 36 -8 0 -61 -55 -117 -123 -209 -252 -440 -484 -655 -660 -49 -39 -88 -77
-88 -84 0 -18 -5 -18 555 32 1317 117 2265 179 3455 225 531 20 570 22 570 30
0 5 -9 24 -19 42 -31 54 -46 115 -34 141 12 27 69 44 194 57 278 31 386 40
484 43 l109 2 8 -50 c4 -27 3 -88 -2 -134 -5 -47 -8 -86 -6 -88 2 -2 230 1
507 7 277 5 619 10 759 10 l255 0 76 103 c362 486 719 1263 965 2095 41 141
104 347 139 457 102 322 124 405 135 511 6 54 18 126 27 159 31 115 29 126
-19 159 -182 125 -251 202 -215 238 7 7 28 56 46 108 18 52 53 147 78 210 l44
116 -39 68 c-25 41 -49 101 -62 156 -24 96 -28 102 -142 243 -165 203 -355
331 -651 441 -54 20 -111 39 -126 42 l-28 6 -16 -89z m-3532 -1712 c251 -61
408 -133 492 -225 95 -104 95 -103 38 -188 -27 -40 -78 -100 -114 -133 -36
-33 -116 -109 -179 -170 -117 -114 -131 -120 -132 -54 0 14 -42 117 -93 230
-52 112 -116 269 -142 349 -29 88 -55 150 -67 158 -23 16 -16 28 25 46 43 19
37 20 172 -13z m3204 -57 c11 -3 6 -13 -16 -37 -17 -18 -34 -48 -38 -67 -21
-102 -305 -568 -381 -626 -32 -25 -54 -25 -54 -1 0 7 -34 37 -75 67 -49 36
-96 81 -132 130 -31 41 -81 103 -111 137 -75 87 -69 97 103 183 167 84 459
204 535 220 33 8 139 3 169 -6z m-1737 -405 c267 -45 564 -242 720 -479 369
-560 266 -1226 -244 -1578 -351 -241 -780 -312 -1075 -178 -425 195 -722 864
-594 1340 24 92 120 336 132 336 4 0 19 25 33 55 170 372 589 577 1028 504z
m1519 -848 c244 -83 315 -115 440 -197 36 -24 76 -44 88 -44 27 0 27 -3 -10
-56 -65 -96 -181 -170 -439 -284 -192 -85 -242 -92 -255 -36 -9 38 -35 340
-35 402 0 99 37 264 58 264 5 0 74 -22 153 -49z m-3066 12 c32 -37 60 -105 73
-174 12 -68 5 -493 -10 -529 -34 -87 -163 -88 -333 -3 -55 27 -161 87 -236
134 -75 46 -157 96 -183 111 -61 36 -64 49 -31 118 l28 59 256 127 c229 113
381 183 404 184 4 0 19 -12 32 -27z m2797 -1111 c21 -22 272 -457 298 -517 11
-26 29 -83 41 -128 11 -45 27 -89 35 -98 29 -32 -15 -38 -99 -14 -29 8 -88 19
-132 25 -138 18 -587 134 -622 160 -31 22 -31 23 -17 62 29 84 82 164 164 253
47 50 125 135 175 189 96 103 114 111 157 68z m-2592 -105 c0 -2 80 -85 178
-183 219 -221 256 -266 248 -297 -10 -42 -45 -77 -76 -77 -16 0 -59 -16 -94
-36 -165 -90 -556 -113 -637 -37 -39 37 -39 37 35 147 71 107 156 267 207 394
18 45 46 98 62 117 l28 35 25 -29 c13 -16 24 -31 24 -34z m-2440 -27 c189
-121 561 -245 802 -266 87 -8 109 -20 77 -42 -60 -42 -511 53 -724 153 -92 43
-146 84 -185 139 -36 54 -33 56 30 16z M5350 9717 c0 -7 23 -44 51 -82 83
-114 134 -208 185 -345 27 -71 53 -130 58 -130 5 0 61 53 125 119 87 89 130
125 174 146 71 34 72 49 5 70 -29 10 -123 50 -208 90 -144 68 -343 145 -376
145 -8 0 -14 -6 -14 -13z M8305 9549 c-236 -70 -385 -120 -385 -132 0 -7 32
-37 71 -67 83 -64 138 -127 170 -193 13 -26 28 -47 35 -47 7 0 44 60 82 133
38 73 93 172 121 221 76 132 74 134 -94 85z M6575 9106 c-129 -26 -235 -75
-341 -160 -115 -91 -221 -239 -245 -339 -6 -29 -22 -71 -36 -93 -69 -120 -69
-477 0 -679 128 -373 363 -572 687 -583 192 -6 366 43 563 160 330 195 471
413 471 723 -1 474 -280 843 -722 956 -102 26 -285 33 -377 15z M8324 8428
c29 -100 37 -177 38 -350 1 -119 5 -188 11 -188 15 0 188 109 331 209 72 50
149 99 173 108 64 26 54 37 -59 62 -111 25 -182 50 -355 130 -127 58 -149 62
-139 29z M5170 8324 c-151 -67 -365 -154 -380 -154 -42 0 14 -37 151 -99 175
-81 247 -123 325 -194 75 -68 77 -66 67 66 -4 61 -8 185 -8 275 0 139 -2 162
-15 162 -8 -1 -71 -26 -140 -56z M8107 7261 c-98 -175 -205 -315 -272 -358
-53 -33 -57 -50 -12 -57 393 -65 477 -83 564 -121 97 -43 107 -28 41 63 -24
33 -95 163 -158 290 -63 128 -119 232 -125 232 -5 0 -22 -22 -38 -49z M5540
7123 c-52 -114 -132 -246 -211 -345 -38 -48 -69 -92 -69 -98 0 -28 193 1 397
60 76 22 160 43 188 46 49 6 105 43 105 68 0 6 -24 27 -52 46 -59 40 -183 162
-248 243 -59 74 -68 72 -110 -20z M10605 11509 c-2 -8 -27 -79 -56 -158 -69
-196 -109 -288 -147 -340 -18 -24 -32 -54 -32 -66 0 -12 -58 -141 -129 -286
-138 -281 -221 -464 -221 -484 0 -7 39 -30 87 -51 48 -22 156 -78 241 -126 84
-49 158 -88 164 -88 14 0 77 -38 108 -65 39 -34 351 -207 364 -202 7 3 45 85
85 183 148 360 373 880 422 975 27 53 83 145 124 204 41 58 75 110 75 114 0 4
-42 15 -92 25 -133 25 -193 47 -585 215 -384 164 -400 170 -408 150z m167
-214 c55 -10 149 -40 250 -79 90 -35 213 -81 273 -102 130 -44 121 -39 107
-67 -6 -12 -32 -79 -57 -149 -25 -69 -81 -207 -126 -305 -154 -338 -289 -682
-289 -734 0 -49 -33 -35 -440 194 -213 120 -253 145 -318 203 l-44 39 47 109
c83 194 308 618 398 749 26 38 47 74 47 82 0 14 47 75 58 75 4 0 46 -7 94 -15z
M10652 11168 c-25 -82 -61 -156 -173 -358 -123 -220 -269 -512 -269 -539 0 -4
19 -16 43 -27 23 -10 101 -54 172 -98 526 -319 489 -302 498 -231 17 124 216
651 349 924 43 90 77 169 75 175 -3 6 -29 18 -58 25 -94 24 -423 132 -464 153
-22 12 -56 34 -76 49 -56 44 -62 40 -97 -73z M11280 9940 c-27 -55 -50 -113
-50 -128 0 -40 37 -220 105 -507 31 -132 79 -343 105 -470 65 -308 183 -643
366 -1038 110 -238 332 -637 355 -637 5 0 9 -4 9 -9 0 -36 254 -366 438 -568
l75 -83 219 0 c169 0 218 3 218 13 0 7 -86 98 -191 202 -427 426 -628 710
-1000 1420 -309 589 -495 1198 -565 1843 -9 87 -25 80 -84 -38z M7070 9950
c-147 -11 -275 -31 -279 -43 -2 -6 -33 -53 -67 -105 -35 -51 -64 -97 -64 -101
0 -4 98 -12 218 -18 180 -9 235 -15 325 -38 59 -15 110 -25 114 -22 3 3 -13
61 -35 129 -22 68 -43 142 -47 166 -8 48 9 45 -165 32z M10216 9787 c-3 -56
-11 -129 -16 -162 -5 -33 -17 -125 -25 -205 -50 -466 -160 -881 -367 -1394
-210 -519 -522 -1085 -784 -1423 -35 -45 -64 -86 -64 -92 0 -8 68 -11 213 -11
l212 1 61 82 c458 615 724 1332 879 2367 40 272 51 328 111 584 24 103 44 196
44 206 0 16 -221 150 -248 150 -5 0 -12 -46 -16 -103z M11020 9035 c-30 -8
-116 -21 -190 -30 -214 -24 -196 -18 -203 -73 -4 -26 -23 -131 -43 -235 -21
-103 -35 -190 -31 -193 3 -3 46 4 96 15 150 35 400 71 499 71 50 0 92 2 92 4
0 1 -13 55 -30 117 -16 63 -38 164 -48 224 l-19 110 -34 2 c-19 1 -59 -5 -89
-12z M11370 8029 c-19 -5 -87 -13 -150 -19 -63 -5 -155 -19 -205 -30 -49 -11
-211 -31 -360 -46 -148 -14 -273 -28 -276 -32 -9 -12 -139 -366 -139 -381 0
-9 8 -12 23 -8 429 93 767 146 971 152 205 6 339 24 332 44 -20 62 -143 331
-151 330 -5 -1 -26 -5 -45 -10z M11885 7059 c-123 -25 -353 -53 -690 -84 -209
-19 -501 -46 -650 -60 -148 -14 -359 -31 -467 -37 l-197 -12 -49 -71 c-27 -38
-86 -116 -130 -171 -45 -56 -82 -107 -82 -113 0 -8 375 -11 1415 -11 856 0
1415 4 1415 9 0 5 -82 92 -183 193 -101 101 -215 225 -253 275 -38 51 -73 92
-79 92 -5 -1 -28 -5 -50 -10z M7090 6634 c-110 -28 -343 -56 -417 -52 -40 3
-73 1 -73 -4 0 -4 7 -35 16 -67 l17 -58 186 4 c241 5 332 12 335 26 2 7 13 44
25 83 11 39 21 73 21 77 0 10 -48 6 -110 -9z M13530 5010 c-8 -5 -25 -10 -36
-10 -14 0 -26 -10 -34 -30 -27 -65 -203 -208 -425 -345 -132 -81 -449 -245
-474 -245 -51 0 82 -96 444 -322 510 -317 1209 -707 2130 -1188 182 -95 403
-214 491 -266 89 -52 167 -94 174 -94 20 0 269 138 495 273 588 351 1128 762
1537 1168 87 86 158 163 158 171 0 10 -54 23 -202 50 -112 20 -525 106 -918
192 -919 199 -1432 305 -2230 460 -1018 198 -1076 208 -1110 186z m878 -300
c1828 -305 2219 -391 2912 -641 74 -27 144 -49 156 -49 72 0 21 -82 -175 -283
-336 -343 -652 -594 -924 -733 -61 -31 -171 -97 -245 -145 -73 -49 -139 -89
-145 -89 -7 0 -43 -18 -80 -40 -98 -57 -126 -63 -192 -40 -99 34 -218 96 -390
202 -220 136 -280 170 -580 325 -137 72 -401 218 -585 325 -417 242 -557 320
-885 493 -335 177 -453 245 -422 245 12 0 918 -446 1117 -550 579 -303 732
-389 1013 -568 84 -54 250 -151 370 -217 120 -66 256 -148 303 -182 96 -71 96
-71 138 -39 17 13 50 33 73 44 23 12 70 43 105 69 35 27 133 88 218 137 88 51
198 125 255 171 55 45 165 130 245 190 318 238 760 622 760 660 0 8 -74 27
-207 54 -416 85 -773 161 -988 210 -386 87 -772 164 -1705 341 -206 39 -512
101 -680 137 -168 36 -314 67 -325 70 -15 3 -33 -13 -73 -65 -117 -151 -317
-295 -539 -388 -51 -21 -94 -44 -95 -51 -2 -8 -8 -8 -23 3 -26 20 -11 33 118
102 123 67 229 142 354 249 82 70 249 188 272 192 3 1 385 -62 849 -139z
m-748 -61 c0 -14 -7 -19 -25 -19 -27 0 -32 -18 -15 -50 12 -22 3 -50 -16 -50
-8 0 -14 -9 -14 -21 0 -11 -21 -42 -47 -67 -44 -45 -49 -47 -97 -45 -47 2 -52
0 -67 -26 -16 -28 -18 -28 -116 -29 -158 -2 -177 45 -25 63 49 5 69 13 94 37
29 27 38 30 77 25 39 -4 48 -1 73 23 15 16 28 33 28 39 0 6 14 18 31 27 25 12
30 20 24 37 -16 51 -12 62 25 65 19 2 39 7 44 12 13 13 26 2 26 -21z M7595
4949 c-11 -5 -238 -34 -505 -64 -425 -49 -941 -116 -1860 -240 -355 -48 -1017
-130 -1250 -155 -382 -41 -498 -50 -737 -57 -171 -4 -243 -9 -243 -17 0 -18
71 -82 210 -191 69 -54 213 -176 320 -270 489 -429 463 -409 1070 -802 377
-243 548 -348 752 -461 191 -106 503 -262 524 -262 8 0 55 33 102 73 210 176
309 247 682 497 907 606 1580 1024 1903 1181 89 44 87 57 -15 99 -365 147
-679 377 -886 648 -26 34 -34 36 -67 21z m-52 -120 c30 -16 -126 -57 -248 -65
-65 -5 -161 -25 -345 -74 -583 -155 -1162 -277 -1665 -350 -357 -52 -466 -61
-865 -71 -450 -11 -520 -16 -520 -33 0 -6 110 -87 244 -179 133 -92 308 -217
387 -278 578 -440 767 -573 1070 -755 132 -78 375 -204 396 -204 5 0 37 20 70
45 34 24 139 92 234 151 94 59 217 144 273 189 307 249 857 612 1327 877 120
68 218 128 219 134 0 6 -21 26 -47 44 -219 155 -414 352 -482 488 l-22 43 22
-11 c27 -15 159 -147 303 -303 60 -65 145 -150 190 -190 51 -45 81 -79 81 -92
0 -15 -51 -52 -220 -158 -283 -177 -565 -363 -785 -517 -277 -194 -395 -272
-545 -357 -77 -44 -201 -123 -275 -176 -130 -93 -285 -182 -361 -206 -33 -11
-44 -8 -130 29 -366 158 -1139 654 -1494 959 -55 47 -194 179 -309 293 -209
206 -210 207 -182 218 49 18 157 29 361 35 126 4 264 15 375 30 96 14 285 36
420 50 659 68 1077 138 1905 317 294 63 569 122 593 127 2 1 13 -4 25 -10z
m-121 -201 c-2 -53 0 -58 19 -58 55 0 73 -38 44 -94 -22 -42 -19 -46 30 -46
80 0 42 -39 -43 -45 -63 -4 -96 16 -87 54 6 26 3 29 -27 35 -39 7 -74 29 -88
56 -9 16 -4 27 25 58 19 22 35 46 35 55 0 22 40 48 70 45 24 -3 25 -6 22 -60z
m253 -299 c4 -5 1 -24 -5 -40 -16 -39 -11 -43 44 -31 74 16 61 -30 -21 -72
-40 -20 -43 -20 -43 2 0 9 -10 22 -22 27 -17 8 -22 17 -20 38 3 27 3 27 -56
27 -46 0 -66 5 -88 23 l-29 22 35 6 c60 11 198 10 205 -2z M12020 4179 c-114
-47 -598 -159 -835 -194 -186 -27 -175 -24 -175 -48 0 -12 13 -103 30 -202
212 -1289 287 -1748 324 -2004 25 -167 47 -306 50 -308 7 -7 361 13 591 32
836 72 1523 197 2200 400 360 108 795 267 795 290 0 7 -120 90 -267 185 -828
536 -1648 1110 -2465 1727 -179 135 -195 143 -248 122z m161 -290 c258 -130
1123 -685 1469 -942 263 -196 365 -284 463 -402 27 -33 61 -66 76 -74 67 -35
125 -90 163 -153 l40 -67 -36 -34 c-75 -71 -572 -257 -1022 -382 -594 -166
-1254 -259 -1599 -226 -165 15 -269 32 -254 42 38 23 -19 430 -190 1349 -61
326 -73 403 -92 627 -14 166 -14 166 53 158 39 -5 81 0 158 19 171 40 462 96
547 105 140 15 159 13 224 -20z M11939 3870 c-83 -29 -168 -47 -375 -81 l-269
-43 -34 -38 -34 -38 47 -162 c57 -199 79 -306 155 -763 77 -459 117 -737 133
-920 7 -86 16 -145 23 -145 5 0 66 11 135 25 69 14 244 36 390 50 534 50 898
110 1325 216 352 88 865 250 865 274 0 8 -21 28 -47 46 -27 18 -64 47 -83 65
-19 18 -89 65 -155 104 -138 82 -190 121 -445 330 -246 202 -503 396 -920 695
-190 136 -395 287 -456 336 -62 49 -120 88 -130 88 -11 -1 -67 -18 -125 -39z
m150 -74 c17 -18 21 -30 15 -36 -7 -7 -16 -4 -29 10 -28 31 -43 25 -47 -17 -3
-35 -6 -38 -35 -41 -21 -2 -33 -9 -33 -18 0 -9 -10 -14 -29 -14 -16 0 -34 -7
-42 -16 -10 -12 -23 -14 -54 -9 -38 5 -43 3 -53 -20 -6 -14 -17 -26 -24 -26
-58 -5 -87 -4 -115 4 -25 8 -34 7 -49 -7 -41 -42 -122 -33 -125 14 -4 58 9 76
55 72 19 -2 37 1 41 7 10 17 40 13 68 -9 30 -24 55 -26 63 -5 4 10 14 13 30 9
19 -5 29 0 45 20 20 26 21 26 50 9 24 -15 33 -15 49 -5 11 7 31 10 44 6 16 -4
25 -1 29 11 5 11 14 14 32 9 22 -6 25 -3 25 23 0 71 38 83 89 29z M8964 3852
c-880 -757 -1975 -1681 -2088 -1762 -25 -18 -46 -39 -46 -45 0 -14 256 -99
540 -181 917 -262 1977 -418 3068 -450 l232 -7 0 859 c0 789 -13 1606 -25
1645 -5 15 -40 17 -308 22 -376 6 -637 33 -957 98 -79 16 -151 29 -160 29 -8
-1 -123 -94 -256 -208z m456 23 c10 -12 38 -15 136 -15 69 0 220 -11 337 -25
250 -29 553 -54 577 -48 29 8 78 -24 84 -54 4 -16 11 -282 16 -593 6 -311 13
-686 16 -835 5 -209 3 -309 -10 -445 -15 -155 -15 -175 -1 -183 33 -18 -5 -98
-56 -116 -17 -6 -142 -16 -277 -22 -666 -30 -1548 50 -1947 178 -60 19 -203
73 -316 119 -125 51 -244 93 -300 105 -52 11 -132 36 -179 56 -54 23 -102 37
-132 37 -25 1 -49 4 -53 7 -23 24 209 219 260 219 27 0 114 74 227 194 51 55
210 208 353 340 338 313 586 548 870 826 220 216 233 227 295 247 78 27 84 27
100 8z M9305 3790 c-49 -22 -95 -40 -101 -40 -6 0 -40 -33 -75 -72 -248 -283
-475 -524 -739 -788 -356 -357 -449 -440 -665 -603 -288 -217 -303 -231 -252
-241 12 -3 52 -7 89 -10 36 -3 131 -23 210 -44 78 -22 162 -43 186 -47 23 -4
42 -12 42 -18 0 -8 70 -20 213 -35 116 -13 295 -39 397 -57 564 -104 963 -143
1543 -152 328 -5 377 -4 377 9 0 8 -13 79 -29 159 -55 265 -62 337 -68 661 -5
285 10 1066 23 1186 l6 52 -138 0 c-293 0 -630 26 -803 61 -119 24 -110 25
-216 -21z m128 -86 c19 -25 23 -26 87 -20 60 6 67 5 86 -16 36 -39 34 -43 -14
-44 -26 0 -68 -4 -95 -8 -90 -16 -167 44 -122 94 24 26 33 25 58 -6z m324 -45
c8 -8 21 -8 47 1 36 12 76 1 76 -21 0 -7 14 -8 40 -4 23 4 53 2 74 -6 28 -10
42 -10 76 1 37 12 42 12 63 -8 29 -27 42 -27 75 -1 l27 21 27 -32 c27 -33 44
-92 32 -111 -4 -7 -20 -8 -41 -4 -29 5 -38 2 -50 -14 -18 -27 -72 -28 -100 -2
-12 11 -42 21 -74 25 -102 12 -184 15 -189 7 -3 -4 -27 -5 -55 -1 -27 4 -44 8
-37 9 16 1 16 31 -1 31 -15 0 -67 51 -67 66 0 15 39 54 53 54 7 0 18 -5 24
-11z"/>
<path id="trim" fill="#823d08" transform="translate(0.000000,2048.000000) scale(0.100000,-0.100000)" d="M10523 18603 c-122 -130 -233 -288 -233 -332 0 -10 -13 -86 -29 -168
-54 -271 -65 -500 -35 -715 26 -182 2 -271 -98 -371 -26 -26 -48 -52 -48 -57
0 -15 -13 -19 -114 -35 -199 -32 -405 29 -582 173 -94 77 -435 246 -559 278
-183 48 -453 45 -611 -7 -113 -37 -145 -64 -208 -182 -81 -151 -82 -150 77
-72 220 107 338 124 519 76 106 -29 312 -137 510 -268 184 -122 255 -155 452
-213 72 -21 150 -46 174 -54 53 -19 207 -56 233 -56 10 0 38 10 62 21 41 20
48 31 115 163 40 77 94 181 121 230 101 183 120 282 131 701 5 182 13 355 19
385 37 185 117 384 208 513 41 58 41 67 1 67 -27 0 -44 -12 -105 -77z M7352
16218 c-60 -122 -95 -225 -111 -328 -7 -41 -16 -93 -22 -115 -11 -45 58 -627
106 -890 112 -618 417 -1417 641 -1680 182 -215 294 -447 350 -724 14 -69 34
-160 44 -201 61 -243 44 -502 -50 -737 -201 -503 -841 -959 -1400 -999 -199
-14 -548 75 -733 186 -90 54 -102 53 -93 -7 4 -27 10 -75 13 -108 6 -59 7 -61
73 -119 184 -163 382 -231 675 -230 329 0 636 92 952 285 308 189 614 521 779
844 l37 75 10 227 c23 535 -34 751 -399 1506 -402 830 -576 1275 -709 1812
-117 471 -155 926 -100 1195 30 147 7 150 -63 8z M7838 16148 c-4 -91 19 -362
38 -458 35 -176 61 -235 122 -282 71 -53 83 -63 145 -117 57 -49 128 -96 204
-134 64 -33 250 -97 280 -97 13 0 40 -7 62 -16 40 -16 40 -16 88 17 140 97
296 264 416 446 36 56 71 104 77 108 30 19 3 19 -47 1 -50 -18 -80 -21 -218
-20 -241 1 -404 38 -610 140 -114 56 -330 208 -320 225 4 5 0 9 -8 9 -16 0
-207 195 -207 211 0 5 -4 9 -10 9 -5 0 -11 -19 -12 -42z M4981 13442 c-199
-103 -252 -317 -114 -455 87 -88 278 -156 332 -119 27 19 -4 47 -67 60 -128
26 -222 121 -222 223 0 49 55 166 117 251 52 71 38 83 -46 40z M4866 12892
c-3 -5 28 -58 68 -119 82 -125 100 -176 94 -262 -7 -96 -51 -149 -190 -225
-29 -17 -56 -29 -60 -28 -12 3 -9 -12 6 -33 11 -15 22 -17 69 -12 184 19 327
178 314 349 -8 92 -55 202 -110 256 -57 56 -174 101 -191 74z M12300 12375 c0
-32 -13 -67 -50 -138 l-50 -95 0 -144 c0 -326 59 -529 211 -731 93 -124 267
-257 359 -276 592 -121 958 -31 1278 316 51 56 109 112 127 125 19 12 35 28
35 35 0 10 -175 73 -203 73 -5 0 -39 -28 -76 -62 -156 -148 -352 -239 -552
-259 -360 -35 -556 -16 -730 72 -125 63 -226 232 -286 478 -51 213 -35 334 63
477 39 57 82 151 72 159 -2 1 -47 5 -100 7 l-98 5 0 -42z M5047 12123 c-4 -3
-7 -27 -7 -52 l0 -45 -27 26 c-40 37 -66 48 -112 48 -84 0 -84 -67 -1 -140 50
-44 50 -42 -10 -69 -27 -12 -50 -27 -50 -31 0 -17 41 -31 72 -25 l30 7 -29
-43 c-50 -74 -54 -85 -42 -113 25 -54 44 -44 136 68 36 44 34 46 49 -59 7 -54
17 -45 29 27 l6 37 36 -25 c20 -13 41 -23 47 -21 16 6 9 104 -10 156 l-17 44
32 26 c36 30 39 41 11 41 -18 0 -17 4 10 63 52 109 29 115 -72 18 l-38 -35 0
29 c0 61 -20 92 -43 68z M11670 11939 c0 -6 -21 -42 -46 -80 -43 -65 -108
-122 -260 -227 -41 -28 -204 -109 -238 -118 -34 -8 -33 -29 2 -42 164 -63 249
-92 266 -92 51 0 238 136 406 297 63 60 130 118 148 128 31 19 33 23 27 60 -8
50 4 44 -122 66 -124 21 -183 24 -183 8z M9032 11760 l3 -72 115 -35 c474
-143 821 -399 880 -653 23 -98 67 -215 82 -218 14 -3 135 254 145 309 4 24 -9
36 -169 150 -95 67 -218 157 -273 200 -264 202 -551 350 -748 384 l-38 6 3
-71z M10605 11509 c-2 -8 -27 -79 -56 -158 -69 -196 -109 -288 -147 -340 -18
-24 -32 -54 -32 -66 0 -12 -58 -141 -129 -286 -138 -281 -221 -464 -221 -484
0 -7 39 -30 87 -51 48 -22 156 -78 241 -126 84 -49 158 -88 164 -88 14 0 77
-38 108 -65 39 -34 351 -207 364 -202 7 3 45 85 85 183 148 360 373 880 422
975 27 53 83 145 124 204 41 58 75 110 75 114 0 4 -42 15 -92 25 -133 25 -193
47 -585 215 -384 164 -400 170 -408 150z m167 -214 c55 -10 149 -40 250 -79
90 -35 213 -81 273 -102 130 -44 121 -39 107 -67 -6 -12 -32 -79 -57 -149 -25
-69 -81 -207 -126 -305 -154 -338 -289 -682 -289 -734 0 -49 -33 -35 -440 194
-213 120 -253 145 -318 203 l-44 39 47 109 c83 194 308 618 398 749 26 38 47
74 47 82 0 14 47 75 58 75 4 0 46 -7 94 -15z M10808 10805 l-83 -105 -72 7
-73 6 0 -41 c0 -32 5 -44 26 -59 29 -21 27 -63 -2 -63 -34 0 -74 -56 -74 -103
0 -64 19 -76 62 -39 71 62 113 69 123 20 10 -49 39 -138 45 -138 13 0 45 69
65 139 l22 75 54 13 c30 6 67 12 83 13 28 0 96 56 96 79 0 21 -50 42 -119 50
-39 4 -73 10 -76 13 -11 10 17 142 37 178 19 32 19 35 2 47 -27 20 -28 20
-116 -92z M11280 9940 c-27 -55 -50 -113 -50 -128 0 -40 37 -220 105 -507 31
-132 79 -343 105 -470 65 -308 183 -643 366 -1038 110 -238 332 -637 355 -637
5 0 9 -4 9 -9 0 -36 254 -366 438 -568 l75 -83 219 0 c169 0 218 3 218 13 0 7
-86 98 -191 202 -427 426 -628 710 -1000 1420 -309 589 -495 1198 -565 1843
-9 87 -25 80 -84 -38z M7070 9950 c-147 -11 -275 -31 -279 -43 -2 -6 -33 -53
-67 -105 -35 -51 -64 -97 -64 -101 0 -4 98 -12 218 -18 180 -9 235 -15 325
-38 59 -15 110 -25 114 -22 3 3 -13 61 -35 129 -22 68 -43 142 -47 166 -8 48
9 45 -165 32z M10216 9787 c-3 -56 -11 -129 -16 -162 -5 -33 -17 -125 -25
-205 -50 -466 -160 -881 -367 -1394 -210 -519 -522 -1085 -784 -1423 -35 -45
-64 -86 -64 -92 0 -8 68 -11 213 -11 l212 1 61 82 c458 615 724 1332 879 2367
40 272 51 328 111 584 24 103 44 196 44 206 0 16 -221 150 -248 150 -5 0 -12
-46 -16 -103z M5350 9717 c0 -7 23 -44 51 -82 83 -114 134 -208 185 -345 27
-71 53 -130 58 -130 5 0 61 53 125 119 87 89 130 125 174 146 71 34 72 49 5
70 -29 10 -123 50 -208 90 -144 68 -343 145 -376 145 -8 0 -14 -6 -14 -13z
M14010 9663 c-34 -5 -265 -71 -315 -90 -40 -15 -194 -104 -217 -126 -7 -7 -45
-37 -83 -68 -39 -31 -85 -76 -103 -100 -84 -113 -100 -137 -124 -184 -89 -172
-119 -304 -113 -494 5 -159 25 -282 60 -356 7 -16 17 -43 21 -60 4 -16 10 -32
14 -35 4 -3 17 -26 28 -52 11 -27 25 -48 30 -48 5 0 21 -17 34 -37 14 -21 38
-52 54 -69 16 -17 41 -44 55 -60 15 -16 33 -34 40 -40 8 -6 37 -38 64 -70 101
-118 255 -260 318 -293 17 -10 79 -42 137 -73 126 -67 175 -83 304 -98 106
-13 197 -36 208 -53 18 -29 377 -36 547 -12 131 20 291 64 291 81 0 14 -3 15
-205 39 -172 21 -318 61 -452 126 -56 27 -108 49 -115 49 -20 0 -250 173 -308
231 -67 67 -200 226 -200 239 0 4 -14 25 -31 46 -17 22 -37 53 -45 69 -7 17
-18 37 -23 45 -20 32 -71 147 -71 161 0 8 -4 19 -9 24 -10 11 -42 118 -62 210
-32 141 -13 432 37 568 8 23 22 61 29 85 20 61 95 211 126 252 14 19 28 40 30
47 2 6 30 39 62 72 75 81 74 88 -13 74z M8305 9549 c-236 -70 -385 -120 -385
-132 0 -7 32 -37 71 -67 83 -64 138 -127 170 -193 13 -26 28 -47 35 -47 7 0
44 60 82 133 38 73 93 172 121 221 76 132 74 134 -94 85z M6575 9106 c-129
-26 -235 -75 -341 -160 -115 -91 -221 -239 -245 -339 -6 -29 -22 -71 -36 -93
-69 -120 -69 -477 0 -679 128 -373 363 -572 687 -583 192 -6 366 43 563 160
330 195 471 413 471 723 -1 474 -280 843 -722 956 -102 26 -285 33 -377 15z
M8324 8428 c29 -100 37 -177 38 -350 1 -119 5 -188 11 -188 15 0 188 109 331
209 72 50 149 99 173 108 64 26 54 37 -59 62 -111 25 -182 50 -355 130 -127
58 -149 62 -139 29z M5170 8324 c-151 -67 -365 -154 -380 -154 -42 0 14 -37
151 -99 175 -81 247 -123 325 -194 75 -68 77 -66 67 66 -4 61 -8 185 -8 275 0
139 -2 162 -15 162 -8 -1 -71 -26 -140 -56z M8107 7261 c-98 -175 -205 -315
-272 -358 -53 -33 -57 -50 -12 -57 393 -65 477 -83 564 -121 97 -43 107 -28
41 63 -24 33 -95 163 -158 290 -63 128 -119 232 -125 232 -5 0 -22 -22 -38
-49z M5540 7123 c-52 -114 -132 -246 -211 -345 -38 -48 -69 -92 -69 -98 0 -28
193 1 397 60 76 22 160 43 188 46 49 6 105 43 105 68 0 6 -24 27 -52 46 -59
40 -183 162 -248 243 -59 74 -68 72 -110 -20z M7090 6634 c-110 -28 -343 -56
-417 -52 -40 3 -73 1 -73 -4 0 -4 7 -35 16 -67 l17 -58 186 4 c241 5 332 12
335 26 2 7 13 44 25 83 11 39 21 73 21 77 0 10 -48 6 -110 -9z M13530 5010
c-8 -5 -25 -10 -36 -10 -14 0 -26 -10 -34 -30 -27 -65 -203 -208 -425 -345
-132 -81 -449 -245 -474 -245 -51 0 82 -96 444 -322 510 -317 1209 -707 2130
-1188 182 -95 403 -214 491 -266 89 -52 167 -94 174 -94 20 0 269 138 495 273
588 351 1128 762 1537 1168 87 86 158 163 158 171 0 10 -54 23 -202 50 -112
20 -525 106 -918 192 -919 199 -1432 305 -2230 460 -1018 198 -1076 208 -1110
186z m878 -300 c1828 -305 2219 -391 2912 -641 74 -27 144 -49 156 -49 72 0
21 -82 -175 -283 -336 -343 -652 -594 -924 -733 -61 -31 -171 -97 -245 -145
-73 -49 -139 -89 -145 -89 -7 0 -43 -18 -80 -40 -98 -57 -126 -63 -192 -40
-99 34 -218 96 -390 202 -220 136 -280 169 -580 325 -137 72 -416 227 -620
345 -389 225 -581 332 -935 518 -252 133 -303 163 -355 209 l-39 34 22 18 c12
9 64 40 115 67 123 67 229 142 354 249 82 70 249 188 272 192 3 1 385 -62 849
-139z M14650 4300 c-367 -36 -608 -140 -681 -294 -43 -91 -34 -133 40 -174
110 -62 409 -72 428 -15 11 32 -33 50 -138 57 -175 12 -249 34 -249 72 0 81
201 183 413 208 47 6 57 5 57 -8 0 -8 -5 -18 -10 -21 -16 -10 -58 -97 -65
-136 -30 -158 215 -333 495 -356 82 -6 194 12 305 48 209 70 237 218 80 425
-18 24 4 26 107 9 312 -52 568 -149 568 -215 0 -27 -55 -42 -301 -81 -219 -36
-218 -35 -64 -65 205 -41 424 9 491 111 59 90 -96 232 -344 315 -271 91 -825
149 -1132 120z M7595 4949 c-11 -5 -238 -34 -505 -64 -425 -49 -941 -116
-1860 -240 -355 -48 -1017 -130 -1250 -155 -382 -41 -498 -50 -737 -57 -171
-4 -243 -9 -243 -17 0 -18 71 -82 210 -191 69 -54 213 -176 320 -270 489 -429
463 -409 1070 -802 377 -243 548 -348 752 -461 191 -106 503 -262 524 -262 8
0 55 33 102 73 210 176 309 247 682 497 907 606 1580 1024 1903 1181 89 44 87
57 -15 99 -365 147 -679 377 -886 648 -26 34 -34 36 -67 21z m-14 -156 c75
-67 186 -179 313 -316 60 -65 145 -150 190 -190 51 -45 81 -79 81 -92 0 -15
-51 -52 -220 -158 -283 -177 -565 -363 -785 -517 -277 -194 -395 -272 -545
-357 -77 -44 -201 -123 -275 -176 -130 -93 -285 -182 -361 -206 -33 -11 -44
-8 -130 29 -366 158 -1139 654 -1494 959 -55 47 -194 179 -309 293 -209 206
-210 207 -182 218 49 18 157 29 361 35 126 4 264 15 375 30 96 14 285 36 420
50 659 68 1077 138 1905 317 467 101 588 127 596 127 4 1 30 -20 60 -46z
M6446 4333 c-11 -29 -6 -49 29 -97 74 -104 96 -249 59 -377 -42 -144 -372
-359 -553 -359 -189 0 -395 77 -635 239 -70 47 -192 120 -270 162 -165 89
-161 91 -121 -58 60 -220 149 -316 410 -443 453 -219 946 -177 1201 103 145
158 188 446 98 648 -44 98 -201 229 -218 182z M12020 4179 c-114 -47 -598
-159 -835 -194 -186 -27 -175 -24 -175 -48 0 -12 13 -103 30 -202 212 -1289
287 -1748 324 -2004 25 -167 47 -306 50 -308 7 -7 361 13 591 32 836 72 1523
197 2200 400 360 108 795 267 795 290 0 7 -120 90 -267 185 -828 536 -1648
1110 -2465 1727 -179 135 -195 143 -248 122z m161 -290 c258 -130 1123 -685
1469 -942 263 -196 365 -284 463 -402 27 -33 61 -66 76 -74 67 -35 125 -90
163 -153 l40 -67 -36 -34 c-75 -71 -572 -257 -1022 -382 -594 -166 -1254 -259
-1599 -226 -165 15 -269 32 -254 42 38 23 -19 430 -190 1349 -61 326 -73 403
-92 627 -14 166 -14 166 53 158 39 -5 81 0 158 19 171 40 462 96 547 105 140
15 159 13 224 -20z M12143 3538 c-6 -7 -13 -87 -17 -178 -4 -90 -9 -166 -11
-168 -7 -7 -210 39 -232 53 -58 38 -143 40 -143 4 0 -11 138 -149 149 -149 3
0 51 -44 105 -99 l98 -98 -12 -79 c-6 -43 -25 -141 -41 -217 -34 -163 -36
-205 -9 -257 29 -56 52 -66 107 -45 47 18 161 105 228 174 21 23 47 41 56 41
10 0 66 -50 126 -111 177 -182 198 -193 231 -126 15 31 -6 92 -94 269 -30 59
-54 111 -54 116 0 4 55 34 123 65 100 48 127 65 150 97 58 82 36 100 -258 204
-120 42 -223 83 -231 91 -13 12 -100 209 -163 368 -23 55 -24 57 -61 57 -21 0
-42 -6 -47 -12z M8964 3852 c-880 -757 -1975 -1681 -2088 -1762 -25 -18 -46
-39 -46 -45 0 -14 256 -99 540 -181 917 -262 1977 -418 3068 -450 l232 -7 0
859 c0 789 -13 1606 -25 1645 -5 15 -40 17 -308 22 -376 6 -637 33 -957 98
-79 16 -151 29 -160 29 -8 -1 -123 -94 -256 -208z m456 23 c10 -12 38 -15 136
-15 69 0 220 -11 337 -25 250 -29 553 -54 577 -48 29 8 78 -24 84 -54 4 -16
11 -282 16 -593 6 -311 13 -686 16 -835 5 -209 3 -309 -10 -445 -15 -155 -15
-175 -1 -183 33 -18 -5 -98 -56 -116 -17 -6 -142 -16 -277 -22 -666 -30 -1548
50 -1947 178 -60 19 -203 73 -316 119 -125 51 -244 93 -300 105 -52 11 -132
36 -179 56 -54 23 -102 37 -132 37 -25 1 -49 4 -53 7 -23 24 209 219 260 219
27 0 114 74 227 194 51 55 210 208 353 340 338 313 586 548 870 826 220 216
233 227 295 247 78 27 84 27 100 8z M9194 3551 c-44 -33 -99 -119 -108 -169
-7 -38 29 -81 68 -83 89 -4 136 24 155 96 11 41 -11 130 -40 161 -28 30 -27
30 -75 -5z M9706 3478 c-29 -39 -42 -83 -27 -92 6 -4 11 -16 11 -26 0 -46 87
-66 133 -30 33 26 42 67 26 122 -16 52 -23 58 -76 58 -36 0 -46 -5 -67 -32z
M10133 3314 c-68 -34 -132 -157 -119 -228 9 -46 58 -103 96 -111 51 -11 141
13 172 47 40 43 44 84 18 170 -36 118 -92 159 -167 122z M9425 3249 c-164 -38
-351 -188 -432 -345 -96 -184 -72 -329 73 -463 154 -141 275 -169 489 -115
249 64 403 315 340 553 -56 215 -168 330 -350 361 -27 5 -57 11 -65 13 -8 3
-33 1 -55 -4z M8756 3105 c-43 -43 -59 -67 -72 -112 l-17 -57 32 -28 c41 -37
138 -41 172 -7 55 55 57 148 5 226 -31 47 -56 43 -120 -22z M10169 2735 c-46
-35 -106 -125 -114 -175 -15 -91 86 -166 178 -131 57 22 94 158 65 242 -30 89
-68 108 -129 64z M8549 2530 c-70 -37 -119 -120 -119 -202 0 -50 52 -88 121
-88 56 0 88 22 125 87 26 43 26 46 13 101 -23 97 -76 135 -140 102z M9948
2234 c-80 -67 -110 -121 -113 -208 -3 -74 -3 -76 27 -101 28 -24 36 -26 121
-23 l90 3 20 38 c36 70 15 224 -42 294 -33 42 -49 41 -103 -3z M9237 2139
c-54 -29 -105 -110 -118 -190 -10 -63 -10 -64 18 -87 83 -69 201 -55 256 30
32 50 33 75 6 156 -34 102 -86 131 -162 91z"/>
<path id="eye" fill="#04837e" transform="translate(0.000000,2048.000000) scale(0.100000,-0.100000)" d="M7838 16148 c-4 -91 19 -362 38 -458 35 -176 61 -235 122 -282 71
-53 83 -63 145 -117 57 -49 128 -96 204 -134 64 -33 250 -97 280 -97 13 0 40
-7 62 -16 40 -16 40 -16 88 17 140 97 296 264 416 446 36 56 71 104 77 108 30
19 3 19 -47 1 -50 -18 -80 -21 -218 -20 -241 1 -404 38 -610 140 -114 56 -330
208 -320 225 4 5 0 9 -8 9 -16 0 -207 195 -207 211 0 5 -4 9 -10 9 -5 0 -11
-19 -12 -42z"/>
<path id="eye_glint" fill="#0fd077" transform="translate(0.000000,2048.000000) scale(0.100000,-0.100000)" d="M7846 16181 c-30 -48 16 -474 70 -648 24 -77 30 -85 79 -122 l54 -41
-39 75 c-79 156 -92 323 -35 439 17 33 39 65 50 70 11 6 22 12 24 14 3 1 -31
40 -75 85 -45 45 -90 95 -102 110 -11 15 -23 23 -26 18z M9222 15618 c-30 -10
-86 -23 -125 -29 l-72 -11 -2 -66 c-3 -161 -132 -338 -305 -420 -58 -28 -72
-42 -40 -42 10 0 23 -5 29 -11 25 -25 199 112 325 257 63 72 262 350 246 343
-2 -1 -27 -10 -56 -21z"/>
</svg>

After

Width:  |  Height:  |  Size: 46 KiB

View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://drx0r4ci8h5ts"
path="res://.godot/imported/fortune_teller_logo.svg-efad97bd871de6a5fbe287e31d86930a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/fortune_teller_logo.svg"
dest_files=["res://.godot/imported/fortune_teller_logo.svg-efad97bd871de6a5fbe287e31d86930a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.25
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -278,7 +278,7 @@ static func static_checks(b: TowerBoard) -> Array[Dictionary]:
add.call("range", t, "", rp)
match t.kind:
RollTable.KIND_LOOP:
expr.call("Loop rule", t.loop_expr)
expr.call("Repeat rule", t.loop_expr)
RollTable.KIND_CHOICE:
if t.choice == "pick" and t.entries.is_empty():
add.call("empty_choice", t, "", "Choice card has no options.")
@ -296,10 +296,10 @@ static func static_checks(b: TowerBoard) -> Array[Dictionary]:
add.call("effect", t, e.id, "Change \"%s\": %s" % [p["src"], p["error"]])
for target in e.pipes:
if b.get_table(target) == null:
add.call("missing_pipe", t, e.id, "Pipe to a table that doesn't exist (%s)." % target)
add.call("missing_pipe", t, e.id, "Thread to a table that doesn't exist (%s)." % target)
var ce := e.count_expr(target)
if ce != "":
expr.call("Pipe count", ce, e.id)
expr.call("Thread count", ce, e.id)
for id in Roller.endless_cycles(b):
var t := b.get_table(id)
add.call("cycle", t, "", "Can never finish: every result leads back into an endless cycle.")

View file

@ -24,8 +24,8 @@ const _OPS := {"*": "×", "/": "÷", "-": MINUS, "==": "=", "!=": "≠", ">=": "
## What each kind of card is called in the UI (search, inspector, settings, previews).
const KIND_LABELS := {
RollTable.KIND_ROLL: "Roll table", RollTable.KIND_CHOICE: "Choice", RollTable.KIND_LOOP: "Loop",
RollTable.KIND_ROUTER: "Router", RollTable.KIND_CHECK: "Check", RollTable.KIND_VARIABLE: "Variable",
RollTable.KIND_ROLL: "Roll table", RollTable.KIND_CHOICE: "Choice", RollTable.KIND_LOOP: "Repeat",
RollTable.KIND_ROUTER: "Branch", RollTable.KIND_CHECK: "Check", RollTable.KIND_VARIABLE: "Variable",
RollTable.KIND_SHEET: "Sheet",
}
## What each kind of choice is called (the + Card menu, settings, card, previews).
@ -516,7 +516,7 @@ static func why(fact: Dictionary, board: TowerBoard, plain: bool = true) -> Stri
var val := Expr.format_value(fact.get("value"))
var from_pipe := str(fact.get("from", "")) == "pipe"
if plain:
s = "%s was %s (%s)" % [_label(nm, L), val, "from the pipe" if from_pipe else "default"]
s = "%s was %s (%s)" % [_label(nm, L), val, "from the thread" if from_pipe else "default"]
else:
s = "input %s = %s (%s)" % [nm, val, "with" if from_pipe else "default"]
_:

View file

@ -85,16 +85,16 @@ static func lint_pipes(board: TowerBoard) -> Array[Dictionary]:
has_when = true
if Expr.check(pw) != "":
out.append({"table_id": t.id, "entry_id": e.id,
"message": "Pipe condition %s: %s" % [pw, Expr.check(pw)]})
"message": "Thread condition %s: %s" % [pw, Expr.check(pw)]})
if first_other != "" and not warned:
warned = true
out.append({"table_id": t.id, "entry_id": e.id,
"message": "The otherwise pipe to %s comes before a conditional pipe; put it last so it reads in order" % _table_name(board, first_other)})
"message": "The otherwise thread to %s comes before a conditional thread; put it last so it reads in order" % _table_name(board, first_other)})
elif e.is_otherwise(p) and first_other == "":
first_other = p
if first_other != "" and not has_when:
out.append({"table_id": t.id, "entry_id": e.id,
"message": "The otherwise pipe to %s always runs: no pipe on this result has a condition" % _table_name(board, first_other)})
"message": "The otherwise thread to %s always runs: no thread on this result has a condition" % _table_name(board, first_other)})
return out
@ -105,7 +105,7 @@ static func lint_router(t: RollTable) -> Array[Dictionary]:
if t.kind != RollTable.KIND_ROUTER:
return out
if t.entries.is_empty():
out.append({"table_id": t.id, "entry_id": "", "message": "This router has no cases"})
out.append({"table_id": t.id, "entry_id": "", "message": "This branch has no cases"})
for i in t.entries.size():
var e := t.entries[i]
var w := e.when.strip_edges()
@ -210,10 +210,10 @@ static func lint_inputs(board: TowerBoard, t: RollTable) -> Array[Dictionary]:
var src := str(w[nm])
if Expr.check(src) != "":
out.append({"table_id": t.id, "entry_id": e.id, "kind": "inputs", "level": "error",
"message": "Pipe input %s = %s: %s" % [nm, src, Expr.check(src)]})
"message": "Thread input %s = %s: %s" % [nm, src, Expr.check(src)]})
if target != null and target.find_input(nm).is_empty():
out.append({"table_id": t.id, "entry_id": e.id, "kind": "inputs", "level": "hint",
"message": "The pipe to %s passes %s, but that card has no input called %s" % [_table_name(board, p), nm, nm]})
"message": "The thread to %s passes %s, but that card has no input called %s" % [_table_name(board, p), nm, nm]})
return out

View file

@ -29,7 +29,7 @@ static func pipe_plan(e: TableEntry, ctx: RollContext, log: Array = [], why: Arr
var r := Expr.evaluate(w, ctx)
var fact := {"type": "when", "to": p, "expr": w, "values": Expr.values_read(w, ctx), "result": false}
if r["error"] != "":
log.append({"text": "Pipe condition %s: %s" % [w, r["error"]], "error": true})
log.append({"text": "Thread condition %s: %s" % [w, r["error"]], "error": true})
run = false
fact["error"] = str(r["error"])
else:
@ -62,7 +62,7 @@ static func with_values(e: TableEntry, target: String, ctx: RollContext, log: Ar
var src := str(w[nm])
var r := Expr.evaluate(src, ctx)
if r["error"] != "":
log.append({"text": "Pipe input %s = %s: %s" % [nm, src, r["error"]], "error": true})
log.append({"text": "Thread input %s = %s: %s" % [nm, src, r["error"]], "error": true})
else:
out[nm] = Expr.normalize(r["value"])
return out

View file

@ -87,7 +87,7 @@ func count_value(target: String, ctx: RollContext, log: Array = []) -> int:
return count_for(target)
var r := Expr.evaluate(e, ctx)
if r["error"] != "":
log.append({"text": "Pipe count %s: %s" % [e, r["error"]], "error": true})
log.append({"text": "Thread count %s: %s" % [e, r["error"]], "error": true})
return 0
return clampi(Expr.as_int(r, 0), 0, MAX_EXPR_COUNT)

View file

@ -256,7 +256,7 @@ static func write_text_atomic(path: String, text: String) -> Error:
func save(path: String = SAVE_PATH) -> bool:
var err := write_text_atomic(path, to_json())
if err != OK:
push_warning("Couldn't save the board to %s: %s" % [path, error_string(err)])
push_warning("Couldn't save the spread to %s: %s" % [path, error_string(err)])
return false
return true

View file

@ -1,21 +1,21 @@
# Getting started
TableTower holds [b]random tables[/b] for tabletop games. Each table is a card on the felt. Cards are joined by copper [b]pipes[/b], so one roll can lead on to the next: a travel roll finds a stranger, and the stranger gets a name.
Table Tarot holds [b]random tables[/b] for tabletop games. Each table is a card on the felt. Cards are joined by copper [b]threads[/b], so one roll can lead on to the next: a travel roll finds a stranger, and the stranger gets a name.
## Two modes
- [b]Play[/b] is for the game table. Click a die to roll, and read the result in the tray at the bottom.
- [b]Build[/b] is for making and changing tables. Click a card, a result or a pipe to edit it in the inspector on the right.
- [b]Build[/b] is for making and changing tables. Click a card, a result or a thread to edit it in the inspector on the right.
Switch between them with [b]Play | Build[/b] at the top left. Everything you build is saved as you go.
## Try the sample
The Fantasy Loot collection shows most features:
- [b]Wilderness Travel[/b] is a d100 table whose results pipe into other tables.
- [b]Party Roles[/b] deals each role once until the deck is reshuffled ([topic]Card mode[/topic]).
The Fantasy Loot spread shows most features:
- [b]Wilderness Travel[/b] is a d100 table whose results thread into other tables.
- [b]Party Roles[/b] deals each role once until the deck is reshuffled ([topic]Deck mode[/topic]).
- [b]Make Camp[/b] asks you to pick what the party does ([topic]Choice cards[/topic]).
- [b]Search the Ruins[/b] adds your [b]Luck[/b] to the roll, and two of its results can only be reached with good or bad luck ([topic]Roll modifiers[/topic]).
# Rolling
Click the die button on a card to roll it. The results flicker, one lands and lights up in brass, and the roll follows any pipes from that result to other cards.
Click the die button on a card to roll it. The results flicker, one lands and lights up in brass, and the roll follows any threads from that result to other cards.
- [b]Shift-click[/b] the die to skip the animation.
- Hover a result to read its details. A small ⓘ after a card's name means the card has details too.
- On a ranged card, the percentage beside each result is its chance right now.
@ -27,7 +27,7 @@ The tray at the bottom of the window shows the last roll as a row of steps, one
- [b]Why this?[/b] on a step explains it in plain words: what was rolled, any modifier, and why the roll went where it did.
- [b]Roll again[/b] repeats the last roll.
- [b]Copy ▾[/b] copies the result as plain text, as BBCode for forums, or with the details of each step.
- [b]Earlier[/b] lists your recent rolls. [b]Variables[/b] lists the values the board remembers between rolls, such as Luck.
- [b]Earlier[/b] lists your recent rolls. [b]Variables[/b] lists the values the spread remembers between rolls, such as Luck.
Drag the tray's top edge to make it taller or shorter. Double-click the edge to reset it.
@ -38,12 +38,12 @@ Switch to [b]Build[/b] to edit.
- The [b]×1[/b] beside a result is its weight. A weight of 3 makes that result three times as likely as a weight of 1.
- Hover a row to show its [b]×[/b] delete button.
- The card's [b]⋯[/b] menu has Table settings, Save as template, Collapse and Delete table.
- Click a card's title, a result's text or a pipe to edit it in the [b]inspector[/b] on the right. Drag the inspector's left edge to resize it.
- Click a card's title, a result's text or a thread to edit it in the [b]inspector[/b] on the right. Drag the inspector's left edge to resize it.
Every edit can be undone with [b]Ctrl+Z[/b] or the ↶ button, and redone with [b]Ctrl+Shift+Z[/b], [b]Ctrl+Y[/b] or ↷.
## Table settings
[b]Table settings…[/b] in the ⋯ menu sets the card's type, dice, details and tags, and turns on [topic]Card mode[/topic].
[b]Table settings…[/b] in the ⋯ menu sets the card's type, dice, details and tags, and turns on [topic]Deck mode[/topic].
# Ranged tables and dice
A [b]ranged table[/b] gives each result a range of numbers instead of a weight, the way printed tables do: 01–30 Travelers on the road, 31–50 Beasts on the hunt, and so on.
@ -53,17 +53,17 @@ A [b]ranged table[/b] gives each result a range of numbers instead of a weight,
Dice can be written `2d6`, `d20`, `3D` or `D3`. A missing count means 1 and missing sides mean 6, so `2D` is 2d6. To add a value to the dice, use a [topic]Roll modifiers[/topic] modifier.
# Pipes
A pipe carries the roll from a result to another card.
- In Build mode, drag from the ● at the right of a result onto another card to lay a pipe.
- When that result is rolled, the card at the other end is rolled too. The pipes of a roll light up in brass.
- Click a pipe on the felt to edit it in the inspector.
# Threads
A thread carries the roll from a result to another card.
- In Build mode, drag from the ● at the right of a result onto another card to lay a thread.
- When that result is rolled, the card at the other end is rolled too. The threads of a roll light up in brass.
- Click a thread on the felt to edit it in the inspector.
## Pipe options
## Thread options
- [b]Count[/b] rolls the next card more than once. It can be a number or an expression such as `1d3`.
- [b]Save as[/b] keeps the next card's result under a name, so later text can show it as `{name}`.
- [b]Only if[/b] runs the pipe only when a condition is true, such as `@gold >= 10`.
- [b]Otherwise[/b] runs the pipe only when none of the result's Only if pipes ran.
- [b]Only if[/b] runs the thread only when a condition is true, such as `@gold >= 10`.
- [b]Otherwise[/b] runs the thread only when none of the result's Only if threads ran.
- [b]Inputs[/b] pass values to a card that declares them.
# Roll modifiers
@ -76,11 +76,11 @@ A ranged table can add a [b]modifier[/b] to its dice, for rules like "roll 1d20
## In the sample
[b]Search the Ruins[/b] rolls 1d6 + Luck. With no Luck you can't reach "A tunnel caves in" or "A hidden vault". Pray at the shrine in [b]Make Camp[/b] to raise your Luck, gamble with the guards to lower it, then search again and watch the chances move. Why this? on the step names the modifier: "+1 for Luck".
Card mode decks ignore the modifier.
Deck mode decks ignore the modifier.
# Card mode
[b]Card mode[/b] turns a table into a deck of cards. Each result is dealt once, with no repeats, until the deck runs out.
- Turn it on in [b]Table settings… → Card mode[/b].
# Deck mode
[b]Deck mode[/b] turns a table into a deck of cards. Each result is dealt once, with no repeats, until the deck runs out.
- Turn it on in [b]Table settings… → Deck mode[/b].
- The card shows how many are left, for example [b]4 / 6 left[/b].
- [b]↻ Reshuffle[/b] under the card's name puts every card back.
- [b]When the deck runs out[/b] can reshuffle by itself or stop until you reshuffle.
@ -89,11 +89,11 @@ Card mode decks ignore the modifier.
# Choice cards
A choice card stops the roll and asks the player. Add one from [b]+ Card ▾[/b].
- [b]Which option[/b] lists the card's options to pick from. [b]Random[/b] is always offered too. The picked option runs exactly as if it had been rolled: its changes happen and its pipes follow.
- [b]Which option[/b] lists the card's options to pick from. [b]Random[/b] is always offered too. The picked option runs exactly as if it had been rolled: its changes happen and its threads follow.
- [b]How many[/b] asks for a number between a lowest and highest value.
- [b]Open ended[/b] asks for any text.
The question can show values, such as "Your Luck is {@luck}. What now?". Answers can be saved under a name for later. [b]Cancel[/b] in the pop-up stops the whole roll, and the pop-up can be minimized to look at the board first.
The question can show values, such as "Your Luck is {@luck}. What now?". Answers can be saved under a name for later. [b]Cancel[/b] in the pop-up stops the whole roll, and the pop-up can be minimized to look at the spread first.
## Options that come and go
An option can have [b]Show only if[/b], so it's offered only when a condition is true, such as `@gold >= 10`. A Which option card can also build its options from a collection of values, such as every skill the character has.
@ -101,7 +101,7 @@ An option can have [b]Show only if[/b], so it's offered only when a condition is
[b]Make Camp[/b] in the sample is a Which option card.
# Values and changes
A board can remember [b]values[/b] between rolls, such as Luck, Gold or the current town. In rules a value is written with @: `@luck`.
A spread can remember [b]values[/b] between rolls, such as Luck, Gold or the current town. In rules a value is written with @: `@luck`.
- Any result can have [b]changes[/b] that happen when it comes up: [b]Add 1 to Luck[/b], [b]Subtract 3 from Gold[/b], [b]Set Town to …[/b]. Edit them in the inspector as rows, or with Edit as text.
- A [b]Variable[/b] card gives a value a name, a type and a starting value, and shows what it is now. The sample's [b]Luck[/b] card starts at 0.
- A [b]Collection[/b] card groups related values, such as Skills, so they can be listed and picked from together.
@ -113,17 +113,17 @@ A board can remember [b]values[/b] between rolls, such as Luck, Gold or the curr
- Text values work as lists: `@traits += "Brave"` adds an item.
## Conditions
Conditions are used by Only if pipes, routers, loops and Show only if. In plain words they read "Luck is at least 2". As text: `@luck >= 2`, `@town = "Saltmere"`, `@gold > 0 and @luck < 3`.
Conditions are used by Only if threads, branches, repeats and Show only if. In plain words they read "Luck is at least 2". As text: `@luck >= 2`, `@town = "Saltmere"`, `@gold > 0 and @luck < 3`.
# Logic cards
Besides roll tables and choices, [b]+ Card ▾[/b] adds:
- [b]Check card[/b]: rolls dice plus a modifier against a target, such as 2d6 + Skill against 8, and follows its Success or Failure result.
- [b]Loop[/b]: repeats its Each time result a number of times, or while or until a condition holds, then runs Afterwards once.
- [b]Router[/b]: checks its cases from top to bottom (if, else if, otherwise) and follows the first one that's true.
- [b]Repeat[/b]: repeats its Each time result a number of times, or while or until a condition holds, then runs Afterwards once.
- [b]Branch[/b]: checks its cases from top to bottom (if, else if, otherwise) and follows the first one that's true.
- [b]Sheet[/b]: a page of text, such as a character sheet, that always shows the current values. A roll that reaches it prints it in the tray.
- [b]Variable[/b] and [b]Collection[/b]: see [topic]Values and changes[/topic].
Use [b]Test board[/b] to check that a board of logic cards works. See [topic]Testing a board[/topic].
Use [b]Test spread[/b] to check that a spread of logic cards works. See [topic]Testing a spread[/topic].
# Text in results
Result text can do more than plain words:
@ -140,7 +140,7 @@ Result text can do more than plain words:
- Ctrl-click or Shift-click cards to select several, or Ctrl-drag a box around them.
- Press [b]Ctrl+G[/b] to put them in a group: a frame that moves and collapses as one.
- Drag cards into or out of a group. The group's ⋯ menu renames, saves as a template, ungroups or deletes it.
- [b]Board ▾ → Pack collapsed groups[/b] moves collapsed groups together to close the gaps.
- [b]Spread ▾ → Pack collapsed groups[/b] moves collapsed groups together to close the gaps.
## Templates
A template is a saved card, group or selection that you can insert again, with blanks to fill in.
@ -148,29 +148,29 @@ A template is a saved card, group or selection that you can insert again, with b
- Insert one from [b]+ Card ▾ → From template…[/b].
- Built-in templates include a skill check, ask-and-repeat, a pick menu, a counter and a simple sheet.
# Collections, import and export
A [b]collection[/b] is one board of tables. Use the switcher beside Play | Build (it shows the collection's name) to switch, or to make a new collection, rename, duplicate or delete one.
# Spreads, import and export
A [b]spread[/b] is one layout of cards, saved under its own name. Use the switcher beside Play | Build (it shows the spread's name) to switch, or to make a new spread, rename, duplicate or delete one.
In Build mode, [b]Board ▾[/b] has:
- [b]Import as new collection…[/b] for TableTower JSON, JSON Canvas and GraphML files.
- [b]Export as…[/b] TableTower JSON, JSON Canvas, GraphML, a Mermaid diagram or Graphviz DOT.
In Build mode, [b]Spread ▾[/b] has:
- [b]Import as new spread…[/b] for Table Tarot JSON, JSON Canvas and GraphML files.
- [b]Export as…[/b] Table Tarot JSON, JSON Canvas, GraphML, a Mermaid diagram or Graphviz DOT.
Exports hold the tables only. Your roll history, decks and remembered values stay on this computer.
# Testing a board
[b]Board ▾ → Test board…[/b] rolls a card hundreds of times, answering every question at random, and reports:
# Testing a spread
[b]Spread ▾ → Test spread…[/b] rolls a card hundreds of times, answering every question at random, and reports:
- errors, such as a rule that can't be worked out
- dead ends, where a roll stops unexpectedly
- cards and results that never came up
- tips, such as an option that can never be offered
Click any item in the report to jump to that card. A board that can loop forever shows a warning in the top bar while you build.
Click any item in the report to jump to that card. A spread that can loop forever shows a warning in the top bar while you build.
# Finding your way
- [b]Search[/b] (the magnifier, or [b]Ctrl+F[/b]) finds cards by name, result, question, value or group, opens closed groups and flashes the card.
- Drag the felt to move around. The mouse wheel scrolls up and down, [b]Shift+wheel[/b] scrolls sideways and [b]Ctrl+wheel[/b] zooms.
- The zoom control at the top right shows the zoom. − and + step it, and the percentage opens [b]Fit board[/b], [b]Zoom to 100%[/b] and the minimap.
- The [b]minimap[/b] (press [b]M[/b]) shows the whole board in the corner. Click or drag on it to move there.
- The zoom control at the top right shows the zoom. − and + step it, and the percentage opens [b]Fit spread[/b], [b]Zoom to 100%[/b] and the minimap.
- The [b]minimap[/b] (press [b]M[/b]) shows the whole spread in the corner. Click or drag on it to move there.
## The View menu
- [b]Rules[/b]: show rules in [b]Plain words[/b] ("Subtract 1 from Luck") or as [b]Rule text[/b] (`@luck -= 1`).

View file

@ -250,7 +250,7 @@ static func import_canvas(text: String, sanitize: Callable = Callable()) -> Dict
for e in t4["entries"]:
e.erase("_has_pipes")
if edge_pipes > 0:
guesses.append("Built %d pipe(s) from edges and their labels." % edge_pipes)
guesses.append("Built %d thread(s) from edges and their labels." % edge_pipes)
var raw := {
"format_version": JsonIO.FORMAT_VERSION,
@ -259,7 +259,7 @@ static func import_canvas(text: String, sanitize: Callable = Callable()) -> Dict
"tables": tables,
}
if doc_extra.is_empty():
guesses.append("No collection name in the canvas; using a default.")
guesses.append("No spread name in the canvas; using a default.")
return JsonIO.finish_import(raw, sanitize, result)

View file

@ -215,7 +215,7 @@ static func import_graphml(text: String, sanitize: Callable = Callable()) -> Dic
tables.append(t2)
if not rich:
guesses.append("No TableTower data in this file; each node became a table and each edge an entry with a pipe.")
guesses.append("No Table Tarot data in this file; each node became a table and each edge an entry with a thread.")
var by_table := {}
for t3 in tables:
by_table[t3["id"]] = t3

View file

@ -49,7 +49,7 @@ static func import_json(text: String, sanitize: Callable = Callable()) -> Dictio
errors.append("Not valid JSON (line %d): %s" % [json.get_error_line(), json.get_error_message()])
return {"ok": false, "collection": {}, "errors": errors, "warnings": warnings}
if not (json.data is Dictionary):
errors.append("The file is not a collection (expected a JSON object).")
errors.append("The file is not a spread (expected a JSON object).")
return {"ok": false, "collection": {}, "errors": errors, "warnings": warnings}
return import_dict(json.data, sanitize)
@ -66,7 +66,7 @@ static func import_dict(data: Dictionary, sanitize: Callable = Callable()) -> Di
if (fv is int or fv is float) and fv > FORMAT_VERSION:
errors.append("format_version %s is newer than this version supports (%d)." % [str(fv), FORMAT_VERSION])
if not (data.get("tables") is Array):
errors.append("The collection has no \"tables\" list.")
errors.append("The spread has no \"tables\" list.")
return result
var raw_tables: Array = data["tables"]
for ti in raw_tables.size():
@ -93,8 +93,8 @@ static func import_dict(data: Dictionary, sanitize: Callable = Callable()) -> Di
c["name"] = clean.call(str(c["name"]))
if str(c["name"]) == "":
c["name"] = "Untitled collection"
warnings.append("The collection had no name; called it \"Untitled collection\".")
c["name"] = "Untitled spread"
warnings.append("The spread had no name; called it \"Untitled spread\".")
if str(c["id"]) == "":
c["id"] = slug(str(c["name"]), "collection")
@ -184,7 +184,7 @@ static func import_dict(data: Dictionary, sanitize: Callable = Callable()) -> Di
elif by_name.has(target.to_lower()):
target = by_name[target.to_lower()]
else:
warnings.append("\"%s\" pipes to unknown table \"%s\"." % [str(ed["text"]), target])
warnings.append("\"%s\" threads to unknown table \"%s\"." % [str(ed["text"]), target])
if p is Dictionary:
var np: Dictionary = (p as Dictionary).duplicate()
np["table"] = target

View file

@ -14,7 +14,7 @@ config/name="TableTower"
run/main_scene="res://ui/main.tscn"
config/features=PackedStringArray("4.7", "Forward Plus")
boot_splash/bg_color=Color(0.0706, 0.1882, 0.1216, 1)
config/icon="res://icon.svg"
config/icon="res://assets/art/fortune_teller.svg"
[display]

View file

@ -25,10 +25,10 @@ func _init() -> void:
_check(_has(probs, "effect", "start", "e1"), "a bad effect is found with its table and entry: %s" % str(probs))
_check(_has(probs, "expression", "badexpr", ""), "a bad dice expression is found")
_check(_has(probs, "expression", "pick", "") and _text_has(probs, "Prompt"), "a bad {= } in a prompt is found")
_check(_has(probs, "expression", "loop", "") and _text_has(probs, "Loop rule"), "a bad loop rule is found")
_check(_has(probs, "expression", "start", "e1") and _text_has(probs, "Pipe count"), "a bad pipe count is found")
_check(_has(probs, "expression", "loop", "") and _text_has(probs, "Repeat rule"), "a bad loop rule is found")
_check(_has(probs, "expression", "start", "e1") and _text_has(probs, "Thread count"), "a bad thread count is found")
_check(_has(probs, "range", "gap", "") and _text_has(probs, "No result for 3"), "a range gap is found")
_check(_has(probs, "missing_pipe", "start", "e1"), "a pipe to a missing table is found")
_check(_has(probs, "missing_pipe", "start", "e1"), "a thread to a missing table is found")
_check(_has(probs, "empty_choice", "empty", ""), "a choice card with no options is found")
_check(_has(probs, "cycle", "ping", ""), "an endless cycle is found")
_check(not _has(probs, "range", "okrange", "") and not _has(probs, "effect", "mine", ""), "good cards give no problems")
@ -163,7 +163,7 @@ func _board() -> TowerBoard:
be.range_lo = 2
be.range_hi = 12
bad.entries.append(be)
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "times")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "times")
loop.loop_expr = "3 *"
var empty := RollTable.create(RollTable.KIND_CHOICE, "empty", "Empty", "pick")
empty.entries.clear()

View file

@ -195,18 +195,18 @@ func _test_known_values() -> void:
order.append(v["name"])
for k in ["name", "label", "kind", "source"]:
_check(v.has(k), "%s has %s" % [v.get("name"), k])
_eq(order.slice(0, 3), ["@luck", "@town", "@skill_*"], "variable cards first, then collections")
_eq(order.slice(0, 3), ["@luck", "@town", "@skill_*"], "variable cards first, then spreads")
_eq(by["@luck"], {"name": "@luck", "label": "Luck", "kind": "number", "source": "variable", "table_id": "v_luck"}, "a variable card")
_eq(by["@town"]["kind"], "text", "text variable")
_eq(by["@town"]["label"], "Home Town", "label from the card")
_eq(by["@skill_*"]["kind"], "collection", "collection kind")
_eq(by["@skill_*"]["label"], "Skills", "collection label")
_eq(by["@skill_*"]["kind"], "collection", "spread kind")
_eq(by["@skill_*"]["label"], "Skills", "spread label")
_eq(by["@skill_pilot"]["label"], "Pilot", "member label")
_eq(by["@skill_pilot"]["collection"], "@skill_*", "member knows its collection")
_eq(by["@skill_pilot"]["collection"], "@skill_*", "member knows its spread")
_eq(by["@skill_pilot"]["source"], "effect", "effect target")
_eq(by["@traits"]["kind"], "list", "append makes a list")
_eq(by["@credits"]["kind"], "number", "number effect")
_eq(by["@weapon"]["source"], "save_as", "pipe save_as")
_eq(by["@weapon"]["source"], "save_as", "thread save_as")
_eq(by["hero"]["source"], "save_as", "[[ -> hero]] save")
_eq(by["@terms"]["kind"], "number", "number choice save_as")
_eq(by["tier"]["source"], "input", "card input")
@ -217,4 +217,4 @@ func _test_known_values() -> void:
_check(by.has("nat") and by.has("total") and by.has("effect"), "check chain names")
_check(not by.has("i") and not by.has("option"), "no loop, no dynamic pick")
_check(not by.has("@[option]") and not by.has("@x_*"), "no indirect or prefix targets")
_eq(Builder.known_values(null), [] as Array[Dictionary], "null board")
_eq(Builder.known_values(null), [] as Array[Dictionary], "null spread")

View file

@ -168,7 +168,7 @@ func _test_check_le_and_dice() -> void:
chk.entries[0].add_pipe("win")
chk.entries[1].add_pipe("lose")
b = _board([chk, _one("win", "Won with {total}"), _one("lose", "Lost")])
_eq(_texts(_roll(b, "chk")[0]), ["Success", "Won with 10"], "success pipes, total in text")
_eq(_texts(_roll(b, "chk")[0]), ["Success", "Won with 10"], "success threads, total in text")
func _test_check_errors() -> void:
@ -215,11 +215,11 @@ func _test_inputs_two_pipes() -> void:
bb.entries[0].set_pipe_with("show", {"tier": "3"})
var b := _board([start, a, bb, _show()])
var r := _roll(b, "start")
_eq(_texts(r[0]), ["go", "A", "Tier 2", "B", "Tier 3"], "two pipes pass different values")
_eq(_texts(r[0]), ["go", "A", "Tier 2", "B", "Tier 3"], "two threads pass different values")
var steps := Roller.flatten(r[0])
_eq(steps[2]["inputs"], {"tier": 2}, "step inputs")
_eq(steps[2]["why"][0], {"type": "input", "name": "tier", "value": 2, "from": "pipe"}, "input fact")
_eq(Describe.why(steps[2]["why"][0], b), "Tier was 2 (from the pipe)", "input sentence")
_eq(Describe.why(steps[2]["why"][0], b), "Tier was 2 (from the thread)", "input sentence")
_check(not (r[1] as RollContext).chain_vars.has("tier"), "tier is gone after the roll")
@ -334,7 +334,7 @@ func _test_inputs_snapshot() -> void:
func _test_inputs_loops_routers_choices_inline() -> void:
# Loop: each pass passes i.
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat")
loop.loop_expr = "3"
loop.entries[0].add_pipe("show")
loop.entries[0].set_pipe_with("show", {"tier": "i * 10"})
@ -363,15 +363,15 @@ func _test_inputs_loops_routers_choices_inline() -> void:
start.entries.append(e)
b = _board([start, router, _show()])
r = _roll(b, "start")
_eq(_texts(r[0]), ["go", "high", "Tier 200"], "router with inputs")
_eq(_texts(r[0]), ["go", "high", "Tier 200"], "branch with inputs")
var rstep: Dictionary = Roller.flatten(r[0])[1]
var types: Array = []
for f: Dictionary in rstep["why"]:
types.append(f["type"])
_eq(types, ["input", "case"], "router facts: input then case")
_eq(types, ["input", "case"], "branch facts: input then case")
_eq(Describe.why(rstep["why"][1], b), "Case 1 matched because Tier was 2 (needs 2 or more)", "case sentence with input")
e.set_pipe_with("route", {"tier": "1"})
_eq(_texts(_roll(b, "start")[0]), ["go", "low"], "router otherwise")
_eq(_texts(_roll(b, "start")[0]), ["go", "low"], "branch otherwise")
# Number choice: the Answer's pipe passes answer.
var ask := RollTable.create(RollTable.KIND_CHOICE, "ask", "Ask", "number")
ask.min_expr = "4"
@ -438,7 +438,7 @@ func _test_inputs_errors() -> void:
var r := _roll(b, "start")
_eq(_texts(r[0]), ["go", "Tier 1 extra 7"], "bad value uses the default; undeclared names still pass")
_eq(_errors(r[0]).size(), 1, "one error line")
_check(str(_errors(r[0])[0]).begins_with("Pipe input tier = 2 +"), "error names the input")
_check(str(_errors(r[0])[0]).begins_with("Thread input tier = 2 +"), "error names the input")
show.inputs = [{"name": "tier", "label": "", "default": "1 +"}]
e.set_pipe_with("show", {})
r = _roll(b, "start")
@ -450,7 +450,7 @@ func _test_inputs_errors() -> void:
func _test_collections() -> void:
var c := RollTable.create(RollTable.KIND_VARIABLE, "skills", "Skills", "collection")
_eq(c.var_type, "collection", "collection type")
_eq(c.var_type, "collection", "spread type")
_eq(c.var_name, "skill", "stem from the name")
_eq(c.initial, "", "no starting value")
_check(c.is_collection(), "is_collection")
@ -467,7 +467,7 @@ func _test_collections() -> void:
var r := _roll(b, "start", vars)
_eq(Describe.options(raise, b), "your Skills, level 1 or more", "options description")
var shown := Roller.variable_display(b, vars, c)
_check(shown["set"], "collection display is set")
_check(shown["set"], "spread display is set")
_check(str(shown["text"]).contains("Pilot") and str(shown["text"]).contains("Gun Combat"), "members listed: %s" % shown["text"])
var raised := int(_var(vars, "skill_pilot")) + int(_var(vars, "skill_gun_combat"))
_eq(raised, 4, "one member raised")
@ -478,7 +478,7 @@ func _test_collections() -> void:
fx.append(f)
_eq(fx.size(), 1, "options_where fact")
_eq(Describe.why(fx[0], b), "Offered 2 of 3 Skills (level 1 or more)", "options_where sentence")
_eq(Roller.variable_display(b, {}, c), {"text": "", "set": false, "error": ""}, "empty collection")
_eq(Roller.variable_display(b, {}, c), {"text": "", "set": false, "error": ""}, "empty spread")
# reset @skill_* still clears every member; a collection isn't declared.
var clear := _one("clear", "clear", "reset @skill_*")
b.tables.append(clear)
@ -491,7 +491,7 @@ func _test_collections() -> void:
_eq(_texts(_roll(b, "probe", v2)[0]), ["Pilot 1 / 1"], "list text and count")
# JSON.
var back := RollTable.from_dict(JSON.parse_string(JSON.stringify(c.to_dict())))
_eq(back.var_type, "collection", "collection survives JSON")
_eq(back.var_type, "collection", "spread survives JSON")
_eq(back.var_name, "skill", "stem survives JSON")
@ -572,7 +572,7 @@ func _test_json() -> void:
_eq(d["kind"], "check", "kind written")
_eq([d["check_dice"], d["check_mod"], d["check_cmp"], d["check_target"]], ["3d6", "dm(@str)", "le", "@skill"], "check keys")
_eq(d["inputs"], [{"name": "tier", "label": "Tier", "default": "1"}, {"name": "bonus"}], "inputs written without empty keys")
_eq(d["entries"][0]["pipes"], [{"table": "next", "with": {"level": "tier + 1"}}], "pipe with written")
_eq(d["entries"][0]["pipes"], [{"table": "next", "with": {"level": "tier + 1"}}], "thread with written")
var pd := plain.to_dict()
for k in ["check_dice", "check_mod", "check_cmp", "check_target", "inputs"]:
_check(not pd.has(k), "default %s left out" % k)
@ -639,9 +639,9 @@ func _test_lint() -> void:
_check(not target.is_empty() and target["level"] == "error" and target["kind"] == "check", "bad check target")
_check(not find.call("Check modifier dm(@str").is_empty(), "bad check modifier")
_check(not find.call("A check needs a Success").is_empty(), "missing Failure entry")
var bad_with: Dictionary = find.call("Pipe input tier = 2 +")
var bad_with: Dictionary = find.call("Thread input tier = 2 +")
_check(not bad_with.is_empty() and bad_with["level"] == "error" and bad_with["entry_id"] == "e1", "bad with expression is an error")
var hint: Dictionary = find.call("The pipe to Show passes extra")
var hint: Dictionary = find.call("The thread to Show passes extra")
_check(not hint.is_empty() and hint["level"] == "hint" and hint["kind"] == "inputs", "undeclared input is a hint")
_check(not find.call("Input \"Bad Name\" isn't a name").is_empty(), "bad input name")
_check(not find.call("Input Bad Name default").is_empty(), "bad input default")
@ -654,7 +654,7 @@ func _test_lint() -> void:
var hint_level := false
for p: Dictionary in probs:
kinds[p["kind"]] = true
if str(p["text"]).begins_with("The pipe to Show passes extra"):
if str(p["text"]).begins_with("The thread to Show passes extra"):
hint_level = p.get("level", "") == "hint"
_check(kinds.has("check") and kinds.has("inputs"), "static checks have check and inputs kinds: %s" % [kinds.keys()])
_check(hint_level, "static check keeps the hint level")
@ -662,4 +662,4 @@ func _test_lint() -> void:
var good := _board([RollTable.create(RollTable.KIND_CHECK, "c", "C"), _show()])
good.get_table("c").entries[0].add_pipe("show")
good.get_table("c").entries[0].set_pipe_with("show", {"tier": "total"})
_eq(BoardTester.static_checks(good), [] as Array[Dictionary], "clean board")
_eq(BoardTester.static_checks(good), [] as Array[Dictionary], "clean spread")

View file

@ -131,7 +131,7 @@ func _test_preview_content() -> void:
_check(d != null and d.kind == "pick", "the pick question opens")
if d == null:
return
_check(d.board == main.data, "the dialog finds the board")
_check(d.board == main.data, "the dialog finds the spread")
# Plain words (the default): effects and counts read as phrases.
_check(d.plain, "previews read in plain words by default")
var pp := d.preview_for_option(0)
@ -144,11 +144,11 @@ func _test_preview_content() -> void:
d.plain = false
# Option 1 pipes to a ranged table, twice.
var p := d.preview_for_option(0)
_check(p != null, "an option that pipes on has a preview")
_check(p != null, "an option that threads on has a preview")
_check(_has(p, "A **busy** place") or _has(p, "busy"), "the preview shows the option's details")
_check(_has(p, "@gold -= 5"), "the preview lists the option's effects")
_check(_has(p, "Loot") and _has(p, "d6"), "the piped table's name and dice show")
_check(_has(p, "×2"), "the pipe count shows")
_check(_has(p, "×2"), "the thread count shows")
_check(_has(p, "What the stalls sell"), "the piped table's details show")
_check(_has(p, "1–2") and _has(p, "3–5") and _has(p, "33%"), "ranged entries show their range and chance")
_check(_has(p, TablePreview.NEXT_HINT), "an entry that leads further gets a next-table hint")
@ -159,7 +159,7 @@ func _test_preview_content() -> void:
var q := d.preview_for_option(1)
_check(_has(q, "Which way?") and _has(q, "Choice card"), "a choice target shows its kind")
_check(_has(q, "Asks: Left or right?"), "a choice target shows its question")
_check(_has(q, "×@terms"), "an expression pipe count shows")
_check(_has(q, "×@terms"), "an expression thread count shows")
q.free()
_check(d.preview_for_option(2) == null, "an option with nothing to show has no preview")
main.rolling.cancel_choice()
@ -197,7 +197,7 @@ func _test_minimize() -> void:
d._input(_key(KEY_M))
_check(d.minimized and not d.card.is_visible_in_tree(), "M hides the dialog")
_check(d.pill.visible and _has(d.pill, "Question waiting: Where to?"), "the pill names the question")
_check(d.mouse_filter == Control.MOUSE_FILTER_IGNORE, "the board gets the mouse while minimized")
_check(d.mouse_filter == Control.MOUSE_FILTER_IGNORE, "the spread gets the mouse while minimized")
_check(not d._dim.visible, "the dim goes away")
_check(not d.preview_panel.visible, "the preview hides")
_check(not d.reply.finished and main.rolling.pending_choice() == d, "the question is still waiting")

View file

@ -74,25 +74,25 @@ func _board() -> TowerBoard:
func _test_labels() -> void:
var b := _board()
_eq(b.get_table("v_skills").var_name, "skill", "a collection's stem drops the final s")
_eq(b.get_table("v_skills").var_name, "skill", "a spread's stem drops the final s")
_eq(Describe.label("@str", b), "Strength", "variable card label")
_eq(Describe.label("@STR", b), "Strength", "labels ignore case")
_eq(Describe.label("@skill_gun_combat", b), "Gun Combat", "collection member label")
_eq(Describe.label("@skill_*", b), "Skills", "collection label")
_eq(Describe.label("@contact_*", b), "Contact values", "a prefix without a collection")
_eq(Describe.label("@soc_x", b), "Soc X", "no collection: pretty name")
_eq(Describe.label("@skill_gun_combat", b), "Gun Combat", "spread member label")
_eq(Describe.label("@skill_*", b), "Skills", "spread label")
_eq(Describe.label("@contact_*", b), "Contact values", "a prefix without a spread")
_eq(Describe.label("@soc_x", b), "Soc X", "no spread: pretty name")
_eq(Describe.label("@dex", b), "Dex", "unlabelled value")
_eq(Describe.label("tier", b), "Tier", "input label")
_eq(Describe.label("answer", b), "Answer", "chain label")
_eq(Describe.label("nat", b), "Natural roll", "nat label")
_eq(Describe.label("@[option]", b), "Chosen value", "indirect label")
_eq(Describe.label("@str", null), "Str", "no board")
_eq(Describe.label("@str", null), "Str", "no spread")
# The variable card wins over a collection.
b.tables.append(_var_card("v_pilot", "Piloting", "skill_pilot"))
_eq(Describe.label("@skill_pilot", b), "Piloting", "card label before collection")
_eq(Describe.label("@skill_pilot", b), "Piloting", "card label before spread")
# A collection doesn't declare its stem as a variable.
var ctx := Roller.new_context(b, RandomNumberGenerator.new(), {})
_check(ctx.declared("skill") == null, "a collection isn't a declared variable")
_check(ctx.declared("skill") == null, "a spread isn't a declared variable")
_check(ctx.declared("str") != null, "a number card is")
@ -101,7 +101,7 @@ func _test_labels() -> void:
func _test_effects() -> void:
var b := _board()
_eq(Describe.effect("@luck -= 1", b), "Luck −1", "subtract")
_eq(Describe.effect("@skill_pilot += 1", b), "Pilot +1", "add to a collection member")
_eq(Describe.effect("@skill_pilot += 1", b), "Pilot +1", "add to a spread member")
_eq(Describe.effect("@luck += -2", b), "Luck −2", "add a negative")
_eq(Describe.effect("@luck -= -2", b), "Luck +2", "subtract a negative")
_eq(Describe.effect("@town = \"Millbrook\"", b), "Town = Millbrook", "set text")
@ -112,7 +112,7 @@ func _test_effects() -> void:
_eq(Describe.effect("@age /= 2", b), "Age ÷2", "divide")
_eq(Describe.effect("@traits += \"Psionic\"", b), "Add Psionic to Traits", "append")
_eq(Describe.effect("@traits -= \"Psionic\"", b), "Remove Psionic from Traits", "remove")
_eq(Describe.effect("reset @skill_*", b), "Reset all Skills", "reset a collection")
_eq(Describe.effect("reset @skill_*", b), "Reset all Skills", "reset a spread")
_eq(Describe.effect("reset @contact_*", b), "Reset all Contact values", "reset a prefix")
_eq(Describe.effect("reset @luck", b), "Reset Luck", "reset a declared value")
_eq(Describe.effect("reset @dex", b), "Clear Dex", "reset an undeclared value")
@ -121,7 +121,7 @@ func _test_effects() -> void:
pick.options_from = "@skill_*"
_eq(Describe.effect("@[option] += 1", b, pick), "Chosen skill +1", "indirect on a skills card")
pick.options_from = "@contacts"
_eq(Describe.effect("@[option] += 1", b, pick), "Chosen value +1", "indirect outside a collection")
_eq(Describe.effect("@[option] += 1", b, pick), "Chosen value +1", "indirect outside a spread")
_eq(Describe.effect("hero = \"Bob\"", b), "Hero = Bob", "chain target")
_eq(Describe.effects("@luck -= 1; @str = 7\nreset @skill_*", b), ["Luck −1", "Strength = 7", "Reset all Skills"] as Array[String], "effects field")
@ -144,7 +144,7 @@ func _test_conditions() -> void:
_eq(Describe.condition("not @commissioned", b), "Commissioned is not set", "unset")
_eq(Describe.condition("option_value >= 1", b), "Chosen value is 1 or more", "chain value")
_eq(Describe.condition("tier = 3", b), "Tier is 3", "input")
_eq(Describe.condition("@skill_pilot >= 1", b), "Pilot is 1 or more", "collection member")
_eq(Describe.condition("@skill_pilot >= 1", b), "Pilot is 1 or more", "spread member")
_eq(Describe.condition("", b), "", "empty")
@ -171,14 +171,14 @@ func _test_options() -> void:
var t := RollTable.create(RollTable.KIND_CHOICE, "raise", "Raise", "pick")
_eq(Describe.options(t, b), "", "fixed card")
t.options_from = "@skill_*"
_eq(Describe.options(t, b), "your Skills", "collection source")
_eq(Describe.options(t, b), "your Skills", "spread source")
t.options_where = "option_value >= 1"
_eq(Describe.options(t, b), "your Skills, level 1 or more", "level filter")
t.options_where = "option != @last"
_eq(Describe.options(t, b), "your Skills, where Chosen option is not Last", "other filter")
t.options_where = ""
t.options_from = "@contact_*"
_eq(Describe.options(t, b), "your Contact values", "prefix without collection")
_eq(Describe.options(t, b), "your Contact values", "prefix without spread")
t.options_from = "@traits"
_eq(Describe.options(t, b), "your Traits", "list source")
t.options_from = "skills"
@ -191,7 +191,7 @@ func _test_pipes() -> void:
var b := _board()
var e := TableEntry.new("e1", "x")
e.add_pipe("tier3")
_eq(Describe.pipe(e, "tier3", b), "", "plain pipe")
_eq(Describe.pipe(e, "tier3", b), "", "plain thread")
e.set_pipe_with("tier3", {"tier": "3"})
e.set_pipe_when("tier3", "@luck >= 2")
_eq(Describe.pipe(e, "tier3", b), "Tier 3 · only if Luck is 2 or more", "input and condition")
@ -261,7 +261,7 @@ func _test_why_facts() -> void:
_eq(W.call({"type": "effect", "var": "@dex", "op": "reset", "before": 4, "after": null}), "Dex was cleared", "reset effect")
_eq(W.call({"type": "effect", "var": "@skill_*", "op": "reset", "count": 3}), "Reset all Skills (3)", "prefix reset")
_eq(W.call({"type": "effect", "var": "@luck", "op": "-=", "before": 2, "after": 1}, false), "@luck -=: 2 → 1", "effect text mode")
_eq(W.call({"type": "input", "name": "tier", "value": 3, "from": "pipe"}), "Tier was 3 (from the pipe)", "input")
_eq(W.call({"type": "input", "name": "tier", "value": 3, "from": "pipe"}), "Tier was 3 (from the thread)", "input")
_eq(W.call({"type": "input", "name": "tier", "value": 1, "from": "default"}), "Tier was 1 (default)", "input default")
_eq(W.call({"type": "show_if", "hidden": 2, "chosen_hidden": false}), "2 options hidden by their conditions", "show_if")
_eq(W.call({"type": "options_where", "from": "@skill_*", "expr": "option_value >= 1", "kept": 3, "total": 5}),

View file

@ -27,7 +27,7 @@ func _init() -> void:
var all: Array = main.current["all"]
_check(main.current.get("done", false), "fast roll is done immediately")
_check(main.current["steps"].size() == all.size(), "fast roll shows every step at once")
_check(main.board.pipes.pulse_key == "", "fast roll sends no bead down the pipes")
_check(main.board.pipes.pulse_key == "", "fast roll sends no bead down the threads")
var lit_steps := 0
for s: Dictionary in all:
if s.has("entry_id") and not s.get("stop", false):
@ -36,7 +36,7 @@ func _init() -> void:
_check(main.lit_entries.size() == lit_steps, "only the path's results are lit")
# Chains from Wilderness Travel are a single line, so n results have n - 1 pipes.
_check(main.lit_pipes.size() == maxi(0, lit_steps - 1),
"each link in the chain lights its pipe (%d pipes, %d results)" % [main.lit_pipes.size(), lit_steps])
"each link in the chain lights its thread (%d threads, %d results)" % [main.lit_pipes.size(), lit_steps])
for c in main.cards.values():
_check(not (c as TableCard)._rolling, "no card is left tumbling")

View file

@ -83,7 +83,7 @@ func _test_model() -> void:
_check(gone == ["b"] and b.get_table("b") == null and b.get_group(g.id) == null, "delete_group removes the group and its tables")
b.ungroup(h.id)
_check(b.groups.is_empty(), "ungroup removes the group")
_check(b.get_table("start").entries[0].pipes.is_empty(), "pipes into deleted tables go")
_check(b.get_table("start").entries[0].pipes.is_empty(), "threads into deleted tables go")
func _test_json() -> void:
@ -96,7 +96,7 @@ func _test_json() -> void:
g.size = Vector2(700, 300)
var text := b.to_json()
var b2 := TowerBoard.new()
_check(b2.load_json(text), "a board with groups loads")
_check(b2.load_json(text), "a spread with groups loads")
_check(b2.groups.size() == 1, "one group back")
var g2 := b2.groups[0]
_check(g2.id == g.id and g2.name == "Middle" and g2.collapsed and g2.details == g.details, "id, name, collapsed and details round-trip")
@ -106,7 +106,7 @@ func _test_json() -> void:
# Old files without groups load unchanged, and save without a groups key.
var old := TowerBoard.new()
var src := SampleBoard.create().to_dict()
_check(not src.has("groups"), "boards without groups write no groups key")
_check(not src.has("groups"), "spreads without groups write no groups key")
_check(old.load_dict(src) and old.groups.is_empty(), "an old file loads with no groups")
_check(old.to_json() == SampleBoard.create().to_json() or JSON.parse_string(old.to_json())["tables"].size() == src["tables"].size(), "an old file saves the same tables")
var v1 := TowerBoard.new()
@ -135,7 +135,7 @@ func _test_import() -> void:
_check(r["ok"] and gl[0]["members"] == ["a", "b"], "import maps members by id or name and drops unknown ones: %s" % str(gl[0]["members"]))
_check(str(r["warnings"]).contains("ghost"), "import warns about unknown members")
var b := TowerBoard.new()
_check(b.load_dict(r["collection"]) and b.groups.size() == 1 and b.groups[0].collapsed, "an imported collection keeps its groups")
_check(b.load_dict(r["collection"]) and b.groups.size() == 1 and b.groups[0].collapsed, "an imported spread keeps its groups")
var res := JsonIO.import_json(JsonIO.export_json(b.to_dict()))
_check(res["ok"] and res["collection"]["groups"][0]["members"] == ["a", "b"], "export and import round-trip groups")
@ -157,7 +157,7 @@ func _test_group_from_selection() -> void:
_check(g != null and g.members == ["a", "b"], "Group makes a group of the selection")
_check(main.selection.is_empty() and not main.editing._sel_bar.visible, "grouping clears the selection")
var node := main.group_node(g.id)
_check(node != null and node.get_parent() == main.board.groups, "an expanded group's frame sits behind the pipes")
_check(node != null and node.get_parent() == main.board.groups, "an expanded group's frame sits behind the threads")
var ra := Rect2(main.card_for("a").position, main.card_for("a").size)
var rb := Rect2(main.card_for("b").position, main.card_for("b").size)
_check(g.rect().encloses(ra) and g.rect().encloses(rb), "the frame fits around its members")
@ -178,12 +178,12 @@ func _test_collapse() -> void:
_check(main.card_for("start").visible and main.card_for("out").visible, "other cards stay")
var paths: Dictionary = main.board.pipes._paths
var into: PackedVector2Array = paths.get("start:e1>a", PackedVector2Array())
_check(not into.is_empty() and into[into.size() - 1].distance_to(node.inlet_point()) < 0.5, "a pipe into a member attaches to the group's inlet")
_check(not into.is_empty() and into[into.size() - 1].distance_to(node.inlet_point()) < 0.5, "a thread into a member attaches to the group's inlet")
var outp: PackedVector2Array = paths.get("b:e1>out", PackedVector2Array())
_check(not outp.is_empty() and is_equal_approx(outp[0].x, node.position.x + node.size.x), "a pipe out of a member leaves from the group's right edge")
_check(not outp.is_empty() and is_equal_approx(outp[0].x, node.position.x + node.size.x), "a thread out of a member leaves from the group's right edge")
_check(outp.is_empty() or outp[outp.size() - 1].distance_to(main.card_for("out").inlet_point()) < 0.5, "and still reaches its target")
_check(not paths.has("a:e1>b"), "pipes inside the collapsed group aren't drawn")
_check(main.board.pipes.pipe_at(into[into.size() / 2], 3.0) == "", "re-routed pipes can't be clicked")
_check(not paths.has("a:e1>b"), "threads inside the collapsed group aren't drawn")
_check(main.board.pipes.pipe_at(into[into.size() / 2], 3.0) == "", "re-routed threads can't be clicked")
var gp: Dictionary = main.board.pipes.group_ports
_check(not gp.is_empty(), "the group card gets an outlet port")
_check(main.data.to_dict()["groups"][0]["collapsed"] == true, "collapsed is saved")
@ -211,7 +211,7 @@ func _test_lit_and_choice() -> void:
break
_check(main.current.get("done", false), "the roll finishes after the answer")
_check(main.is_entry_lit("b", "e2") and main.is_entry_lit("out", "e1"), "the picked option and what follows are lit")
_check(main.lit_pipes.has("b:e2>out"), "the pipe out of the group is lit")
_check(main.lit_pipes.has("b:e2>out"), "the thread out of the group is lit")
node = main.group_node(g.id)
var keys := main.lit_keys_for_group(g)
_check(keys.has("b:e2") and (keys.has("a:e1") or keys.has("a:e2")), "the group knows its members' lit results: %s" % str(keys))
@ -222,7 +222,7 @@ func _test_lit_and_choice() -> void:
if row and not outp.is_empty():
var to_world := main.board.world.get_global_transform().affine_inverse()
var mid := (to_world * row.get_global_rect().get_center()).y
_check(absf(outp[0].y - mid) < 1.0, "a lit result's pipe leaves from its row on the group card")
_check(absf(outp[0].y - mid) < 1.0, "a lit result's thread leaves from its row on the group card")
main.prompt_hook = func(_req: Dictionary) -> Variant: return 0
# Fast roll: lights at once.
main.start_roll("start", true)
@ -331,7 +331,7 @@ func _test_ungroup_and_delete() -> void:
(b as Button).pressed.emit()
await process_frame
_check(main.data.groups.is_empty() and main.data.get_table("a") == null and main.data.get_table("b") == null, "deleting the group deletes its cards")
_check(main.card_for("a") == null and main.data.get_table("start").entries[0].pipes.is_empty(), "their cards and the pipes into them go")
_check(main.card_for("a") == null and main.data.get_table("start").entries[0].pipes.is_empty(), "their cards and the threads into them go")
_check(main.top_bar._toast.visible and main.top_bar._toast_undo.visible, "with an undo toast")
main.top_bar._undo()
await process_frame

View file

@ -83,7 +83,7 @@ func _board_dict() -> Dictionary:
{"id": "str", "name": "Strength", "kind": "variable", "var_name": "str", "var_type": "number", "initial": "9", "x": 40, "y": 330, "entries": []},
{"id": "luck", "name": "Luck", "kind": "variable", "var_name": "luck", "var_type": "number", "initial": "2", "x": 40, "y": 470, "entries": []},
{"id": "skills", "name": "Skills", "kind": "variable", "var_name": "skill", "var_type": "collection", "x": 40, "y": 610, "entries": []},
{"id": "rt", "name": "Router", "kind": "router", "x": 1000, "y": 40, "entries": [
{"id": "rt", "name": "Branch", "kind": "router", "x": 1000, "y": 40, "entries": [
{"id": "c1", "text": "Strong", "when": "@str >= 8"}, {"id": "c2", "text": "Otherwise"}]},
{"id": "lp", "name": "Repeat", "kind": "loop", "loop_mode": "times", "loop_expr": "3", "x": 1000, "y": 300,
"entries": [{"id": "e1", "text": "Each time"}, {"id": "e2", "text": "Afterwards"}]},
@ -114,21 +114,21 @@ func _test_selection() -> void:
print("Selection")
_check(insp.visible, "the inspector shows in Build mode")
_check(insp.selection.is_empty(), "nothing is selected at first")
_check(_has_text(insp, "Select a card, a result or a pipe to edit it."), "the empty state says how to select")
_check(_has_text(insp, "Select a card, a result or a thread to edit it."), "the empty state says how to select")
main.select_card("gate")
_eq(main.inspector_selection(), {"kind": "card", "tid": "gate"}, "select_card")
_check(insp.fields.has("check_dice"), "a check card shows its dice field")
main.select_result("beyond", "e2")
_eq(insp.selection.get("kind"), "result", "select_result")
_check(insp.effects != null and insp.pipe_parts.has("loot") and insp.pipe_parts.has("curios"), "a result shows its effects and both pipes")
_check(insp.effects != null and insp.pipe_parts.has("loot") and insp.pipe_parts.has("curios"), "a result shows its effects and both threads")
main.inspecting.select_pipe("beyond:e2>loot")
_eq(insp.selection.get("to"), "loot", "select_pipe")
_eq(insp.pipe_parts.keys(), ["loot"], "a pipe shows only its own box")
_eq(main.board.pipes.select_key, "beyond:e2>loot", "the selected pipe is highlighted on the board")
_eq(insp.pipe_parts.keys(), ["loot"], "a thread shows only its own box")
_eq(main.board.pipes.select_key, "beyond:e2>loot", "the selected thread is highlighted on the spread")
main.clear_inspector()
_check(insp.selection.is_empty(), "clear_inspector")
main.open_pipe_options("beyond:e2>curios", Vector2(10, 10))
_eq(insp.selection.get("to"), "curios", "clicking a pipe in Build selects it in the inspector")
_eq(insp.selection.get("to"), "curios", "clicking a thread in Build selects it in the inspector")
main.request_table_settings("loot")
_eq(insp.selection, {"kind": "card", "tid": "loot"}, "Table settings… selects the card")
main.select_result("beyond", "nope")
@ -274,7 +274,7 @@ func _test_otherwise() -> void:
main.select_result("beyond", "e2")
var loot_other: CheckBox = insp.pipe_parts["loot"]["otherwise"]
var cur_other: CheckBox = insp.pipe_parts["curios"]["otherwise"]
_check(cur_other.button_pressed and not cur_other.disabled, "the otherwise pipe is ticked")
_check(cur_other.button_pressed and not cur_other.disabled, "the otherwise thread is ticked")
_check(loot_other.disabled and not loot_other.button_pressed, "Otherwise is off while Only if is set")
insp.set_pipe_when("loot", "")
_check(not loot_other.disabled, "clearing Only if allows Otherwise")
@ -300,7 +300,7 @@ func _test_otherwise() -> void:
func _test_pipe_inputs() -> void:
print("Pipe inputs")
print("Thread inputs")
main.select_result("beyond", "e2")
var le: LineEdit = insp.pipe_parts["loot"]["inputs"]["tier"]
_eq(le.text, "3", "the target's input shows the passed value")
@ -360,13 +360,13 @@ func _test_check() -> void:
func _test_collection() -> void:
print("Collection members")
print("Spread members")
main.select_card("skills")
var t := _t("skills")
_eq(insp.members(t), [], "no members at first")
var item := InspectorCard.add_member(insp, t)
_eq(item, "new", "+ Add member")
_eq(main.persistent_vars.get("skill_new", {}).get("value"), 0, "it's the board value @skill_new = 0")
_eq(main.persistent_vars.get("skill_new", {}).get("value"), 0, "it's the spread value @skill_new = 0")
InspectorCard.set_member(insp, t, "new", "2")
InspectorCard.rename_member(insp, t, "new", "pilot")
_check(not main.persistent_vars.has("skill_new"), "renaming drops the old name")
@ -377,7 +377,7 @@ func _test_collection() -> void:
_check(InspectorKit.find_tagged(insp, "member.pilot.value") != null, "each member has a value field")
InspectorCard.remove_member(insp, t, "gun_combat")
_eq(insp.members(t), [["pilot", "2"]], "× removes a member")
_eq(Describe.label("@skill_pilot", main.data), "Pilot", "(members are labelled through the collection)")
_eq(Describe.label("@skill_pilot", main.data), "Pilot", "(members are labelled through the spread)")
await _frames()
@ -387,15 +387,15 @@ func _test_options() -> void:
var t := _t("learn")
_check(not t.is_dynamic(), "a fixed list at first")
var err := InspectorCard.set_options(insp, "@skill_*", "")
_eq(err, "", "From a collection")
_eq(err, "", "From a spread")
_check(t.is_dynamic() and t.options_from == "@skill_*", "options come from Skills")
var where: ConditionBuilder = insp.fields.get("options_where")
_check(where != null, "a where builder")
where.add_clause("option_value", "ge", "1")
_eq(t.options_where, "option_value >= 1", "where Its value is at least 1")
var picker: ValuePicker = insp.fields["options_from"]
_eq(picker.value, "@skill_*", "the source picker shows the collection")
_check(picker.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*"), "it offers collections")
_eq(picker.value, "@skill_*", "the source picker shows the spread")
_check(picker.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*"), "it offers spreads")
_check(not picker.items().any(func(it: Dictionary) -> bool: return it["name"] == "@luck"), "but not numbers")
_eq(insp.apply_settings({"options_mode": "fixed"}, true), "", "back to a fixed list")
_check(t.options_from == "" and not t.is_dynamic(), "options_from is cleared")
@ -407,14 +407,14 @@ func _test_value_picker() -> void:
var p := ValuePicker.new(main, "")
root.add_child(p)
var names := p.items().map(func(it: Dictionary) -> String: return it["name"])
_check(names.has("@luck") and names.has("@str"), "it lists the board's values")
_check(names.has("@luck") and names.has("@str"), "it lists the spread's values")
var luck: Dictionary = p.items().filter(func(it: Dictionary) -> bool: return it["name"] == "@luck")[0]
_eq([luck["label"], luck["kind"], luck["group"]], ["Luck", "number", "Variables"], "with label, kind and group")
_check(names.find("@luck") < names.find("@skill_pilot") or not names.has("@skill_pilot"), "variables come first")
_check(names.has("@skill_pilot"), "collection members with values are offered")
_check(not names.has("@skill_*"), "collection patterns only where they fit")
_check(names.has("@skill_pilot"), "spread members with values are offered")
_check(not names.has("@skill_*"), "spread patterns only where they fit")
p.allow_patterns = true
_check(p.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*" and it["group"] == "Collections"), "grouped under Collections")
_check(p.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*" and it["group"] == "Collections"), "grouped under Spreads")
_eq(p.filtered("lu").map(func(it: Dictionary) -> String: return it["name"]), ["@luck"], "search by label")
p.open_menu()
await _frames()
@ -428,12 +428,12 @@ func _test_value_picker() -> void:
var n := p.create_value("Fame", true)
_eq(n, "@fame", "+ New value… names it")
var card := main.variable_card("fame")
_check(card != null and card.name == "Fame", "Show on the board adds a variable card")
_check(card != null and card.name == "Fame", "Show on the spread adds a variable card")
_eq(got.back(), "@fame", "and picks it")
var steps := main.undo_redo.edits.undo_stack.size()
n = p.create_value("Mood", false)
_eq(n, "@mood", "without a card")
_check(main.variable_card("mood") == null and main.undo_redo.edits.undo_stack.size() == steps, "no card, no board change")
_check(main.variable_card("mood") == null and main.undo_redo.edits.undo_stack.size() == steps, "no card, no spread change")
p.queue_free()
await _frames()
@ -499,7 +499,7 @@ func _test_dirty_and_save() -> void:
main._saving_enabled = true
main._save_timer.stop()
insp.apply_settings({"tags": "loot, treasure"})
_check(main.edit_rev > rev, "an inspector edit marks the board dirty")
_check(main.edit_rev > rev, "an inspector edit marks the spread dirty")
_check(not main._save_timer.is_stopped(), "and schedules a save")
main._save_timer.stop()
main._saving_enabled = false
@ -507,7 +507,7 @@ func _test_dirty_and_save() -> void:
var copy := TowerBoard.new()
copy.load_dict(main.data.to_dict())
_eq(copy.get_table("loot").tags, ["loot", "treasure"], "the saved form has it")
_eq(copy.get_table("beyond").find_entry("e2").with_for("loot"), {"tier": "3"}, "pipe inputs are saved")
_eq(copy.get_table("beyond").find_entry("e2").with_for("loot"), {"tier": "3"}, "thread inputs are saved")
main.undo_redo._commit_edits()
_check(main.undo_redo.can_undo(), "and it's an undo step")
await _frames()
@ -533,7 +533,7 @@ func _test_other_cards() -> void:
_eq(rt.entries[2].id, "c2", "it goes before the Otherwise case")
insp.set_case_when(rt.entries[1].id, "@luck >= 1")
_eq(rt.entries[1].when, "@luck >= 1", "a case's condition")
_eq(Roller.lint_router(rt), [], "the router is fine")
_eq(Roller.lint_router(rt), [], "the branch is fine")
# A router case from the result side.
main.select_result("rt", "c1")
_check(insp.case_builder != null and insp.case_builder.clauses.size() == 1, "a case result shows its condition builder")
@ -557,13 +557,13 @@ func _test_add_kinds() -> void:
print("+ Card ▾")
var labels: Array = main.editing.ADD_KINDS.map(func(k: Array) -> String: return k[0])
_check(labels.any(func(s: String) -> bool: return s.begins_with("Check")), "Check card is in the menu")
_check(labels.any(func(s: String) -> bool: return s.begins_with("Collection")), "Collection is in the menu")
_check(labels.any(func(s: String) -> bool: return s.begins_with("Collection")), "Spread is in the menu")
_eq(main.editing._add_menu.text, "+ Card ▾", "the button reads + Card ▾")
var c := main.editing.add_table(RollTable.KIND_CHECK)
_check(c.kind == RollTable.KIND_CHECK and c.name == "Check" and c.entries.size() == 2, "adding a check card")
_eq(insp.selection.get("tid"), c.id, "a new card is selected in the inspector")
var col := main.editing.add_table(RollTable.KIND_VARIABLE, RollTable.VAR_COLLECTION)
_check(col.is_collection() and col.name == "Skills" and col.var_name == "skill_2", "adding a collection (%s, @%s)" % [col.name, col.var_name])
_check(col.is_collection() and col.name == "Skills" and col.var_name == "skill_2", "adding a spread (%s, @%s)" % [col.name, col.var_name])
var v := main.editing.add_table(RollTable.KIND_VARIABLE, "number")
_eq(v.name, "New variable", "a plain variable keeps its name")
await _frames()

View file

@ -87,11 +87,11 @@ func _test_pipe_save() -> void:
var ctx := Roller.new_context(b, _rng(3), store, {})
var n := Roller.roll(b, "src", ctx.rng, 0, {}, ctx)
# Text is expanded before pipes roll, so {foe} isn't set yet in the same entry.
_check((n["summary"] as String).contains("{foe?}"), "pipes roll after the entry's text")
_eq(ctx.lookup("foe"), "[b]Ogre[/b]", "pipe save_as stores the export BBCode in a chain var")
_check((n["summary"] as String).contains("{foe?}"), "threads roll after the entry's text")
_eq(ctx.lookup("foe"), "[b]Ogre[/b]", "thread save_as stores the export BBCode in a chain var")
_check(not (ctx.lookup("foe") as String).contains("url="), "saved value has no internal markers")
_check(store.has("pal") and store["pal"]["value"] == "Mira" and store["pal"]["source"] == "pals", "@ save goes to persistent vars with source: %s" % str(store))
_check(ctx.persistent_changed, "persistent_changed after a pipe save")
_check(ctx.persistent_changed, "persistent_changed after a thread save")
# A later table in the same chain sees the chain var.
var a := _table("a", "A", ["start"])
var c := _table("c", "C", ["uses {foe}"])
@ -100,7 +100,7 @@ func _test_pipe_save() -> void:
var b2 := _board([a, c, dst])
var n2 := Roller.roll(b2, "a", _rng(4))
var used: String = (n2["children"] as Array)[1]["summary"]
_eq(used, "uses [url=var:foe][b]Ogre[/b][/url]", "chain var from a pipe is used by a later pipe")
_eq(used, "uses [url=var:foe][b]Ogre[/b][/url]", "chain var from a thread is used by a later thread")
func _test_persistent_across_rolls() -> void:
@ -162,7 +162,7 @@ func _test_depth_limit() -> void:
for s in Roller.flatten(n2, []):
if s.get("inline", false):
inline += 1
_check(inline <= Roller.MAX_DEPTH and worst <= 2 * Roller.MAX_DEPTH + 1, "mixed pipes and refs stop at the reference limit (%d refs, depth %d)" % [inline, worst])
_check(inline <= Roller.MAX_DEPTH and worst <= 2 * Roller.MAX_DEPTH + 1, "mixed threads and refs stop at the reference limit (%d refs, depth %d)" % [inline, worst])
func _test_missing_and_unset() -> void:
@ -215,8 +215,8 @@ func _test_lit_and_steps() -> void:
var lp := {}
var lt := {}
Roller.collect_lit(n, le, lp, lt)
_check(lp.has(Roller.ref_key("quest", "quest0", "names")), "reference pipe is lit")
_check(lp.has(Roller.pipe_key("quest", "quest0", "names")), "real pipe is lit too")
_check(lp.has(Roller.ref_key("quest", "quest0", "names")), "reference thread is lit")
_check(lp.has(Roller.pipe_key("quest", "quest0", "names")), "real thread is lit too")
_check(Roller.is_ref_key(Roller.ref_key("a", "b", "c")) and not Roller.is_ref_key(Roller.pipe_key("a", "b", "c")), "ref keys are told apart")
_check((lt[Roller.entry_key("quest", "quest0")] as String).contains("Aldric"), "lit texts hold the expanded text")
# Steps survive JSON (history is saved as JSON).

View file

@ -57,12 +57,12 @@ func _test_json() -> void:
var small := _small()
var res2 := JsonIO.import_json(JsonIO.export_json(small))
_check(res2["ok"] and res2["collection"] == JsonIO.canonical(small), "small collection round-trips exactly")
_check(res2["ok"] and res2["collection"] == JsonIO.canonical(small), "small spread round-trips exactly")
_check(not JsonIO.export_json({"tables": [], "state": {"draws": 1}}).contains("state"), "export drops unknown/local keys")
# Legacy keys: triggers, die, collection name.
var legacy := JsonIO.import_json('{"format_version":1,"collection":"Old","tables":[{"id":"a","name":"A","die":20,"entries":[{"text":"x","triggers":["a"]}]}]}')
_check(legacy["ok"] and legacy["collection"]["name"] == "Old", "legacy collection key becomes name")
_check(legacy["ok"] and legacy["collection"]["name"] == "Old", "legacy spread key becomes name")
var lt: Dictionary = legacy["collection"]["tables"][0]
_check(lt["dice"] == "1d20" and lt["entries"][0]["pipes"] == ["a"] and lt["entries"][0]["id"] == "e1", "legacy die/triggers/missing entry id handled")
@ -81,8 +81,8 @@ func _test_json() -> void:
_check(ids.size() == 3, "table ids are unique after import")
_check(dt[0]["id"] == "t" and dt[1]["id"] != "t" and dt[2]["id"] == "third_table", "first keeps id, others get fresh ones")
_check(dt[0]["entries"][0]["id"] != dt[0]["entries"][1]["id"], "duplicate entry ids are fixed")
_check(dt[1]["entries"][0]["pipes"] == ["t"], "pipe by table name is resolved to the id")
_check(dt[2]["entries"][0]["pipes"] == ["t"], "pipe to the original id keeps pointing at the first table")
_check(dt[1]["entries"][0]["pipes"] == ["t"], "thread by table name is resolved to the id")
_check(dt[2]["entries"][0]["pipes"] == ["t"], "thread to the original id keeps pointing at the first table")
# Validation.
_check(not JsonIO.import_json("not json")["ok"], "garbage is rejected")
@ -119,13 +119,13 @@ func _test_canvas() -> void:
for e in doc["edges"]:
labels.append(str(e.get("label", "")))
_check(labels.has("×2 → weapon") and labels.has("ref → w2"), "canvas edge labels (%s)" % str(labels))
_check(doc["edges"].size() == 3, "canvas edges: 2 pipes + 1 ref (missing target skipped), got %d" % doc["edges"].size())
_check(doc["edges"].size() == 3, "canvas edges: 2 threads + 1 ref (missing target skipped), got %d" % doc["edges"].size())
var res := CanvasIO.import_canvas(text)
_check(res["ok"], "canvas imports")
var want := JsonIO.canonical(small)
var got: Dictionary = res["collection"]
_check(got["tables"] == want["tables"], "canvas round trip keeps every field")
_check(got["id"] == "demo" and got["name"] == small["name"], "canvas round trip keeps collection id and name")
_check(got["id"] == "demo" and got["name"] == small["name"], "canvas round trip keeps spread id and name")
# Group sizing: entries sit inside their group.
var ok_inside := true
@ -146,7 +146,7 @@ func _test_canvas() -> void:
var sample := SampleBoard.create().to_dict()
var big := CanvasIO.import_canvas(CanvasIO.export_canvas(sample))
_check(big["ok"] and _plain_tables(big["collection"]["tables"], sample) == _plain_tables(JsonIO.canonical(sample)["tables"], sample),
"sample board's roll tables survive a canvas round trip (logic keys are JSON-only)")
"sample spread's roll tables survive a canvas round trip (logic keys are JSON-only)")
func _test_canvas_stripped() -> void:
@ -172,8 +172,8 @@ func _test_canvas_stripped() -> void:
_check(loot["entries"][1]["text"] == "Melee weapon \"sharp\" [1]", "stripped: BBCode is gone from visible text")
var pipe: Variant = loot["entries"][1].get("pipes", [])[0]
_check(pipe is Dictionary and pipe["table"] == weapons["id"] and pipe["count"] == 2 and pipe["save_as"] == "weapon", "stripped: count and save_as parsed from edge label")
_check(weapons["entries"][1].get("pipes", []) == [loot["id"]], "stripped: plain pipe becomes a table id")
_check(not loot["entries"][2].has("pipes"), "stripped: reference edges do not become pipes")
_check(weapons["entries"][1].get("pipes", []) == [loot["id"]], "stripped: plain thread becomes a table id")
_check(not loot["entries"][2].has("pipes"), "stripped: reference edges do not become threads")
var found := false
for g in res["guesses"]:
found = found or (g as String).contains("1d6")
@ -194,9 +194,9 @@ func _test_mermaid_dot() -> void:
var m := MermaidExporter.export_mermaid(small)
_check(m.begins_with("graph LR"), "mermaid starts with graph LR")
_check(m.contains("t0[\"Loot\"]") and m.contains("t1[\"Weapons (1d6)\"]"), "mermaid nodes, dice in label")
_check(m.contains("t0 -->|\"") and m.contains("×2 → weapon") and m.contains("| t1"), "mermaid pipe edge with count and save_as")
_check(m.contains("t0 -->|\"") and m.contains("×2 → weapon") and m.contains("| t1"), "mermaid thread edge with count and save_as")
_check(m.contains("t0 -.->|\"") , "mermaid dashed edge for reference")
_check(m.contains("t1 -->|\"Sword") and m.contains("| t0"), "mermaid pipe back to Loot")
_check(m.contains("t1 -->|\"Sword") and m.contains("| t0"), "mermaid thread back to Loot")
_check(m.contains("missing: ghost") and m.contains(":::missing"), "mermaid marks the missing target")
_check(not m.contains("[b]") and not m.contains("[/b]"), "mermaid strips BBCode")
_check(m.contains("#quot;sharp#quot;") and m.contains("#91;1#93;"), "mermaid escapes quotes and brackets")
@ -209,9 +209,9 @@ func _test_mermaid_dot() -> void:
var d := DotExporter.export_dot(small)
_check(d.begins_with("digraph TableTower {") and d.strip_edges().ends_with("}"), "dot has a digraph wrapper")
_check(d.contains("Weapons (1d6)") and d.contains("PORT=\"e1\""), "dot table labels and entry ports")
_check(d.contains("t0:e1:e -> t1:head:w [label=\"×2 → weapon\"]"), "dot pipe edge from entry port to table")
_check(d.contains("t0:e1:e -> t1:head:w [label=\"×2 → weapon\"]"), "dot thread edge from entry port to table")
_check(d.contains("t0:e2:e -> t1:head:w [label=\"ref → w2\", style=dashed]"), "dot dashed reference edge")
_check(d.contains("t1:e1:e -> t0:head:w;"), "dot plain pipe edge")
_check(d.contains("t1:e1:e -> t0:head:w;"), "dot plain thread edge")
_check(d.contains("missing: ghost") and d.contains("color=red"), "dot marks the missing target")
_check(d.contains("&quot;sharp&quot;") and not d.contains("[b]"), "dot escapes quotes in HTML labels and strips BBCode")
_check(d.contains("label=\"Demo \\\"Set\\\"\""), "dot escapes quotes in strings")
@ -221,7 +221,7 @@ func _test_mermaid_dot() -> void:
# Big tables don't explode.
var sm := MermaidExporter.export_mermaid(SampleBoard.create().to_dict())
var sd := DotExporter.export_dot(SampleBoard.create().to_dict())
_check(sm.contains("graph LR") and sd.contains("more"), "sample board exports to mermaid and dot")
_check(sm.contains("graph LR") and sd.contains("more"), "sample spread exports to mermaid and dot")
func _test_graphml() -> void:
@ -245,13 +245,13 @@ func _test_graphml() -> void:
var sample := SampleBoard.create().to_dict()
var big := GraphMLIO.import_graphml(GraphMLIO.export_graphml(sample))
_check(big["ok"] and _plain_tables(big["collection"]["tables"], sample) == _plain_tables(JsonIO.canonical(sample)["tables"], sample),
"sample board's roll tables survive a graphml round trip (logic keys are JSON-only)")
"sample spread's roll tables survive a graphml round trip (logic keys are JSON-only)")
# Foreign GraphML: nodes become tables, edges entries.
var foreign := '<?xml version="1.0"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns"><key id="d0" for="node" attr.name="name" attr.type="string"/><graph edgedefault="directed"><node id="a"><data key="d0">Alpha</data></node><node id="b"><data key="d0">Beta</data></node><edge source="a" target="b"/></graph></graphml>'
var fres := GraphMLIO.import_graphml(foreign)
_check(fres["ok"] and fres["collection"]["tables"].size() == 2 and not (fres["guesses"] as Array).is_empty(), "foreign graphml imports with guesses")
_check(fres["collection"]["tables"][0]["entries"][0]["pipes"] == ["beta"], "foreign graphml edge becomes a pipe")
_check(fres["collection"]["tables"][0]["entries"][0]["pipes"] == ["beta"], "foreign graphml edge becomes a thread")
_check(not GraphMLIO.import_graphml("<nope/>")["ok"], "non-graphml is rejected")
# Write a file once to make sure the text survives disk.

View file

@ -299,7 +299,7 @@ func _test_choices() -> void:
_check(n.get("picked", false) and (n["entry"] as TableEntry).text == "Army" and n.get("kind") == "choice", "picked entry is the node's entry")
_eq(_var(vars, "branch"), "ground", "picked entry's effects run")
_eq(_var(vars, "career"), "Army", "save_as gets the picked text")
_check((n["children"] as Array).size() == 1 and Formatter.strip_tags((n["children"] as Array)[0]["summary"]) == "Then Army", "picked entry's pipes follow")
_check((n["children"] as Array).size() == 1 and Formatter.strip_tags((n["children"] as Array)[0]["summary"]) == "Then Army", "picked entry's threads follow")
_check(not n.has("value"), "a picked entry has no die value")
# pick: Random.
var randoms := {}
@ -323,7 +323,7 @@ func _test_choices() -> void:
_check(_var(vars, "terms") is int, "...as an int")
_eq(ctx.chain_vars.get("answer"), 4, "chain variable answer")
_eq(_var(vars, "total"), 14, "the Answer entry's effects see answer")
_eq((n["children"] as Array).size(), 4, "the Answer entry's pipe count can be an expression")
_eq((n["children"] as Array).size(), 4, "the Answer entry's thread count can be an expression")
_check(n.has("effects") and Effects.log_text(n["effects"]) == PackedStringArray(["Total +4 → 14"]), "effects log on the node: %s" % str(n.get("effects")))
var steps := Roller.flatten(n, [])
_check(steps[0].get("answer") == 4 and steps[0].get("kind") == "choice" and steps[0].has("effects"), "steps carry kind, answer and effects")
@ -382,7 +382,7 @@ func _test_choices() -> void:
func _test_loops() -> void:
# times
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "times")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "times")
loop.loop_expr = "3"
loop.entries[0].effects = "@sum += i"
loop.entries[0].text = "Pass {i}"
@ -396,13 +396,13 @@ func _test_loops() -> void:
_eq(n.get("summary"), "Repeated 3 times", "loop node text")
_eq(_var(vars, "sum"), 6, "i is 1, 2, 3")
_eq(_texts(Roller.flatten(n, [])), ["Repeated 3 times", "Pass 1", "Pass 2", "Pass 3", "Afterwards", "Done after 6"], "loop steps")
_check(not ctx.chain_vars.has("i"), "i is gone after the loop")
_check(not ctx.chain_vars.has("i"), "i is gone after the repeat")
var steps := Roller.flatten(n, [])
_check(steps[1].get("pass") == 1 and steps[1]["num"] == "1" and steps[4].get("after", false) and steps[0].get("passes") == 3, "pass and Afterwards steps are marked")
var le := {}
var lp := {}
Roller.collect_lit(n, le, lp)
_check(lp.has(Roller.pipe_key("loop", "e2", "done")) and not lp.has(Roller.pipe_key("loop", "e1", "loop")), "passes light no pipe; Afterwards' pipe is lit")
_check(lp.has(Roller.pipe_key("loop", "e2", "done")) and not lp.has(Roller.pipe_key("loop", "e1", "loop")), "passes light no thread; Afterwards' thread is lit")
loop.loop_expr = "0"
n = Roller.roll(b, "loop", _rng(2))
_check(n.get("passes") == 0 and (n["children"] as Array).size() == 1, "times 0 runs only Afterwards")
@ -447,7 +447,7 @@ func _test_loop_from_answer() -> void:
var q := RollTable.create(RollTable.KIND_CHOICE, "q", "How many?", "number")
q.max_expr = "10"
q.entries[0].add_pipe("loop")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "times")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "times")
loop.loop_expr = "answer"
loop.entries[0].effects = "@count += 1"
var b := _board([q, loop])
@ -488,7 +488,7 @@ func _test_cycles() -> void:
_check(steps.back().get("stop", false) and steps.back().get("limit", false), "the marker is a stop step")
_eq(ctx.halted, "Stopped after 10,000 actions", "ctx.halted")
_check(ms < 15000, "the endless cycle stops in reasonable time (%d ms)" % ms)
_eq(Roller.endless_cycles(b2), ["loop"] as Array[String], "a plain self-pipe is still flagged")
_eq(Roller.endless_cycles(b2), ["loop"] as Array[String], "a plain self-thread is still flagged")
# Mixed with inline references.
var r := _table("r", ["[[Loop]] and on"])
b2.tables.append(r)
@ -601,7 +601,7 @@ func _test_json() -> void:
num.min_expr = "1"
num.max_expr = "@max"
var txt := RollTable.create(RollTable.KIND_CHOICE, "txt", "Txt", "text")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Loop", "until")
var loop := RollTable.create(RollTable.KIND_LOOP, "loop", "Repeat", "until")
var vcard := RollTable.create(RollTable.KIND_VARIABLE, "var", "STR", "list")
vcard.initial = "\"a, b\""
var sheet := RollTable.create(RollTable.KIND_SHEET, "sheet", "Sheet")
@ -622,12 +622,12 @@ func _test_json() -> void:
_check(not plain["entries"][0].has("effects"), "an entry without effects has no effects key")
var d := num.to_dict()
_check(d["kind"] == "choice" and d["choice"] == "number" and d["min"] == "1" and d["max"] == "@max" and not d.has("save_as"), "choice keys: %s" % str(d))
_eq(roll.to_dict()["entries"][0]["pipes"], [{"table": "loop", "count": "@terms"}], "an expression pipe count")
_eq(roll.to_dict()["entries"][0]["pipes"], [{"table": "loop", "count": "@terms"}], "an expression thread count")
# RollTable round trip through JSON text.
var text := b.to_json()
var b2 := TowerBoard.new()
_check(b2.load_json(text), "board JSON loads")
_eq(b2.to_json(), text, "board JSON round-trips unchanged")
_check(b2.load_json(text), "spread JSON loads")
_eq(b2.to_json(), text, "spread JSON round-trips unchanged")
_eq(b2.get_table("roll").entries[0].count_expr("loop"), "@terms", "expression count survives")
# JsonIO canonical/import keep every new key.
var exported := JsonIO.export_json(b.to_dict())
@ -643,7 +643,7 @@ func _test_json() -> void:
var ct: Dictionary = canon["tables"][0]
_check(ct["kind"] == "choice" and ct["min"] == "2" and not ct.has("max"), "canonical keeps kind keys, numbers as text, drops defaults: %s" % str(ct))
_check(ct["entries"][0]["effects"] == "@a += 1" and ct["entries"][0]["pipes"] == [{"table": "y", "count": "@n"}, {"table": "z", "count": 3}], "canonical keeps effects and counts: %s" % str(ct["entries"][0]))
_eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "count": "@n"})), "×@n", "pipe label for an expression count")
_eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "count": "@n"})), "×@n", "thread label for an expression count")
# ---------------------------------------------------------------- scenario

View file

@ -85,9 +85,9 @@ func _var(name: String) -> Variant:
func _test_demo_file() -> void:
var text := FileAccess.get_file_as_string(DEMO)
var r := IoMenu.parse_import(text, IoMenu.detect_format("logic_demo.json", text))
_check(r["ok"] and (r["errors"] as Array).is_empty(), "the demo imports through Board ▾ → Import: %s" % str(r["errors"]))
_check(r["ok"] and (r["errors"] as Array).is_empty(), "the demo imports through Spread ▾ → Import: %s" % str(r["errors"]))
var b := TowerBoard.new()
_check(b.load_json(text), "the demo loads as a board")
_check(b.load_json(text), "the demo loads as a spread")
var kinds := {}
for t in b.tables:
kinds[t.kind + ("/" + t.choice if t.kind == "choice" else "")] = true
@ -110,7 +110,7 @@ func _test_cards() -> void:
var loop := main.card_for("explore")
_check(loop.rows.size() == 2 and loop.anchor_for("e1").size() > 0 and loop.anchor_for("e2").size() > 0,
"a loop card has Each time and Afterwards rows with outlets")
_eq(TableCard.loop_rule(loop.table), "× @rooms", "the loop rule reads × @rooms")
_eq(TableCard.loop_rule(loop.table), "× @rooms", "the repeat rule reads × @rooms")
var hp := main.card_for("v_hp")
_check(hp.rows.is_empty() and hp.anchor_for("x").is_empty(), "a variable card has no outlets")
var sheet := main.card_for("report")
@ -137,7 +137,7 @@ func _test_scripted() -> void:
for s: Dictionary in main.current["all"]:
if s.has("pass"):
passes += 1
_eq(passes, 3, "the number answer drives the loop")
_eq(passes, 3, "the number answer drives the repeat")
var last: Dictionary = (main.current["all"] as Array).back()
_eq(last.get("table_id"), "report", "the chain ends at the sheet")
_check(main.tray._headline.visible and Formatter.strip_tags(main.tray._headline_text.text).begins_with("Brin the delver"),
@ -186,7 +186,7 @@ func _test_dialog_answers() -> void:
_check(d != null and d.kind == "pick" and d._options.size() == 3, "then the pick pop-up with three options")
if d == null:
return
_check(main.is_entry_lit("explore", "e1") and main.is_entry_lit("explore", "e2"), "the loop's steps are lit before the pick")
_check(main.is_entry_lit("explore", "e1") and main.is_entry_lit("explore", "e2"), "the repeat's steps are lit before the pick")
d.answer(-1)
await process_frame
_check(main.rolling.pending_choice() == null and main.current.get("done", false), "Random finishes the roll")
@ -311,7 +311,7 @@ func _test_live_edits() -> void:
for c in main.tray._vars._list.get_children():
if c is HBoxContainer:
rows += 1
_check(rows >= 4, "the Variables tab lists every board variable, numbers included (%d rows)" % rows)
_check(rows >= 4, "the Variables tab lists every spread variable, numbers included (%d rows)" % rows)
var dlg := main.tray._vars.confirm_reset_all()
_check(dlg != null and dlg.is_inside_tree(), "Reset all asks first, in the app")
dlg.close()
@ -331,7 +331,7 @@ func _test_settings_rules() -> void:
c.entries[0].add_pipe("x")
var r := TableSettingsDialog.apply_settings(c, {"name": "C", "choice": "number", "min": "1", "max": "@top", "prompt": "How many?", "save_as": "@n"})
_check(r["ok"] and c.choice == "number" and c.entries.size() == 1 and c.entries[0].text == "Answer", "pick → number keeps one Answer row")
_check(Array(c.entries[0].pipes) == ["x"] and c.entries[0].effects == "@a = 1", "…with the first option's pipes and effects")
_check(Array(c.entries[0].pipes) == ["x"] and c.entries[0].effects == "@a = 1", "…with the first option's threads and effects")
_check(c.max_expr == "@top" and c.save_as == "@n", "min/max and save as applied")
var bad := TableSettingsDialog.apply_settings(c, {"name": "C", "choice": "number", "min": "1 +", "max": "5"})
_check(not bad["ok"] and c.min_expr == "1", "a bad min is refused and nothing changes")
@ -349,11 +349,11 @@ func _test_settings_rules() -> void:
var s := RollTable.create(RollTable.KIND_SHEET, "s", "S")
TableSettingsDialog.apply_settings(s, {"template": "HP {@hp}"})
_eq(s.entries[0].text, "HP {@hp}", "sheet template applied")
_eq(PipePopover._count_error("@terms"), "", "pipe counts take expressions")
_check(PipePopover._count_error("@terms +") != "", "bad pipe counts are flagged")
_eq(PipePopover._count_error("@terms"), "", "thread counts take expressions")
_check(PipePopover._count_error("@terms +") != "", "bad thread counts are flagged")
var e := TableEntry.new("e", "x")
e.set_pipe_count("y", "@terms")
_eq(PipeLayer._pipe_tag(e, "y"), "×@terms", "expression counts show on the pipe")
_eq(PipeLayer._pipe_tag(e, "y"), "×@terms", "expression counts show on the thread")
# Previews.
var pv := RichText.preview("{@skill_*} and {= dm(@str)} and {= 1 +}", main.data)
_check(pv.contains("{@skill_*}") and pv.contains("{= dm(@str)}"), "previews show {@x_*} and {= expr} readably")

View file

@ -149,7 +149,7 @@ func _test_pipes() -> void:
e.add_pipe("other")
e.add_pipe("dst", 3, "foe")
src.entries.append(e)
_check(e.pipes.size() == 2, "pipe targets stay unique")
_check(e.pipes.size() == 2, "thread targets stay unique")
var dst := RollTable.new("dst", "Dst")
dst.entries.append(_entry("d1", "Thing"))
var other := RollTable.new("other", "Other")
@ -157,19 +157,19 @@ func _test_pipes() -> void:
var b := _board([src, dst, other])
var n := Roller.roll(b, "src", _rng(1))
var kids: Array = n["children"]
_check(kids.size() == 4, "count 3 plus one plain pipe gives 4 children (got %d)" % kids.size())
_check(kids.size() == 4, "count 3 plus one plain thread gives 4 children (got %d)" % kids.size())
var saved := 0
for c: Dictionary in kids:
if c.get("save_as", "") == "foe":
saved += 1
_check(saved == 3, "save_as is set on the 3 counted children")
_check(not (kids[3] as Dictionary).has("save_as"), "plain pipe has no save_as")
_check(not (kids[3] as Dictionary).has("save_as"), "plain thread has no save_as")
_check(not n.has("save_as"), "root node has no save_as")
_check(Roller.flatten(n, []).size() == 5, "flatten walks counted children")
var lit_e := {}
var lit_p := {}
Roller.collect_lit(n, lit_e, lit_p)
_check(lit_p.has(Roller.pipe_key("src", "e1", "dst")), "counted pipe is lit")
_check(lit_p.has(Roller.pipe_key("src", "e1", "dst")), "counted thread is lit")
e.remove_pipe("dst")
_check(e.pipes == ["other"] and e.pipe_count.is_empty() and e.pipe_save.is_empty(), "remove_pipe clears options")
@ -177,7 +177,7 @@ func _test_pipes() -> void:
e.set_pipe_count("other", 0)
_check(e.count_for("other") == 1, "count below 1 clamps to 1")
e.set_pipe_save("other", "@loot")
_check(e.to_dict()["pipes"] == [{"table": "other", "save_as": "@loot"}], "save-only pipe serializes as object")
_check(e.to_dict()["pipes"] == [{"table": "other", "save_as": "@loot"}], "save-only thread serializes as object")
func _test_cards() -> void:
@ -263,7 +263,7 @@ func _test_cycles() -> void:
var board := _board([a, bt])
_check(Roller.endless_cycles(board) == ["a", "b"], "two-table loop is endless")
bt.entries.append(_entry("eb2", "exit"))
_check(Roller.endless_cycles(board).is_empty(), "an exit entry fixes the loop")
_check(Roller.endless_cycles(board).is_empty(), "an exit entry fixes the repeat")
bt.entries[1].weight = 0
_check(Roller.endless_cycles(board).size() == 2, "a zero-weight exit does not count")
bt.entries[1].weight = 1
@ -271,9 +271,9 @@ func _test_cycles() -> void:
var es := _entry("es", "again")
es.add_pipe("s")
self_t.entries.append(es)
_check(Roller.endless_cycles(_board([self_t])) == ["s"], "sole self-pipe is endless")
_check(Roller.endless_cycles(_board([self_t])) == ["s"], "sole self-thread is endless")
self_t.entries.append(_entry("es2", "done"))
_check(Roller.endless_cycles(_board([self_t])).is_empty(), "self-pipe on some entries is fine")
_check(Roller.endless_cycles(_board([self_t])).is_empty(), "self-thread on some entries is fine")
# An entry that pipes into a cycle and a fine table is still stuck.
var ok := RollTable.new("ok", "Ok")
ok.entries.append(_entry("k", "fine"))
@ -283,7 +283,7 @@ func _test_cycles() -> void:
em.add_pipe("mix")
mix.entries.append(em)
_check(Roller.endless_cycles(_board([ok, mix])) == ["mix"], "entry needing a cycle blocks its table")
_check(Roller.endless_cycles(SampleBoard.create()).is_empty(), "sample board has no endless cycles")
_check(Roller.endless_cycles(SampleBoard.create()).is_empty(), "sample spread has no endless cycles")
func _test_seed() -> void:
@ -313,17 +313,17 @@ func _test_json() -> void:
{"id": "e1", "text": "Low", "range": [1, 10], "pipes": ["x", {"table": "y", "count": 2, "save_as": "@pal"}]},
{"id": "e2", "text": "High", "range": [11, 20], "weight": 4, "details": "[b]hi[/b]"}]}]}
var b := TowerBoard.new()
_check(b.load_json(JSON.stringify(legacy)), "legacy board loads")
_check(b.load_json(JSON.stringify(legacy)), "legacy spread loads")
var t := b.get_table("old")
_check(t.dice == "1d20" and t.die_size() == 20 and t.dice_label() == "d20", "legacy die 20 becomes 1d20")
var e := t.entries[0]
_check(e.pipes == ["x", "y"] and e.count_for("y") == 2 and e.save_for("y") == "@pal" and e.count_for("x") == 1, "mixed string/object pipes load")
_check(e.pipes == ["x", "y"] and e.count_for("y") == 2 and e.save_for("y") == "@pal" and e.count_for("x") == 1, "mixed string/object threads load")
_check(t.entries[1].weight == 4 and t.entries[1].details == "[b]hi[/b]", "weight and entry details load")
var d := t.to_dict()
_check(not d.has("die") and d["dice"] == "1d20", "die is no longer written")
var ed: Dictionary = d["entries"][0]
_check(ed["pipes"] == ["x", {"table": "y", "count": 2, "save_as": "@pal"}], "pipes save in contract form")
_check(not (d["entries"][1] as Dictionary).has("pipes"), "empty pipes omitted")
_check(ed["pipes"] == ["x", {"table": "y", "count": 2, "save_as": "@pal"}], "threads save in contract form")
_check(not (d["entries"][1] as Dictionary).has("pipes"), "empty threads omitted")
var plain := RollTable.new("p", "P")
plain.entries.append(_entry("e", "x"))
@ -338,12 +338,12 @@ func _test_json() -> void:
plain.card_mode = true
plain.deck_empty = "stop"
var back := RollTable.from_dict(JSON.parse_string(JSON.stringify(plain.to_dict())))
_check(back.details == "Hello" and back.tags == ["a", "b"] and back.card_mode and back.deck_empty == "stop", "details, tags, card mode round-trip")
_check(back.details == "Hello" and back.tags == ["a", "b"] and back.card_mode and back.deck_empty == "stop", "details, tags, deck mode round-trip")
_check(back.to_dict() == plain.to_dict(), "table dict round-trips")
var sample := SampleBoard.create()
var copy := TowerBoard.new()
_check(copy.load_json(sample.to_json()) and copy.to_json() == sample.to_json(), "sample board JSON round-trips")
_check(copy.load_json(sample.to_json()) and copy.to_json() == sample.to_json(), "sample spread JSON round-trips")
func _test_sample() -> void:
@ -357,7 +357,7 @@ func _test_sample() -> void:
_check(not eids.has(e.id), "unique entry ids in %s" % t.id)
eids[e.id] = true
for p in e.pipes:
_check(s.get_table(p) != null, "pipe target %s exists" % p)
_check(s.get_table(p) != null, "thread target %s exists" % p)
var loot := s.get_table("loot")
_check(loot.entries[0].weight == 3 and absf(loot.chance(loot.entries[0]) - 3.0 / 8.0) < 1e-9, "gold weight 3 of 8")
var roles := s.get_table("party_roles")

View file

@ -104,9 +104,9 @@ func _test_lazy_cards() -> void:
var paths: Dictionary = main.board.pipes._paths
var gn := main.group_node("careers")
var into: PackedVector2Array = paths.get("start:e1>agent", PackedVector2Array())
_check(not into.is_empty() and into[into.size() - 1].distance_to(gn.inlet_point()) < 0.5, "a pipe into a hidden member still routes to its group")
_check(not into.is_empty() and into[into.size() - 1].distance_to(gn.inlet_point()) < 0.5, "a thread into a hidden member still routes to its group")
var out: PackedVector2Array = paths.get("skill:e1>gems", PackedVector2Array())
_check(out.is_empty(), "pipes inside one collapsed group aren't drawn")
_check(out.is_empty(), "threads inside one collapsed group aren't drawn")
main.toggle_group("careers")
await process_frame
_check(main.card_for("agent") != null and main.card_for("army") != null, "expanding the group builds its cards")
@ -122,10 +122,10 @@ func _test_lazy_cards() -> void:
var rev := main.board.geometry_rev
for i in 5:
await process_frame
_check(main.board.geometry_rev == rev, "nothing redraws while the board is idle")
_check(main.board.geometry_rev == rev, "nothing redraws while the spread is idle")
main.board.world.position += Vector2(30, 10)
await process_frame
_check(main.board.geometry_rev == rev, "panning doesn't redraw the pipe, port or card layers")
_check(main.board.geometry_rev == rev, "panning doesn't redraw the thread, port or card layers")
func _test_search() -> void:
@ -244,7 +244,7 @@ func _test_minimap() -> void:
main.top_bar.view_menu.sync()
var view_pm := main.top_bar.view_menu.get_popup()
_check(mm.visible and view_pm.is_item_checked(view_pm.get_item_index(ViewMenu.ID_MINIMAP)), "the minimap shows, and View ▾ has it checked")
_check(mm.position.x + mm.size.x <= main.board.size.x and mm.position.y + mm.size.y <= main.board.size.y, "in the board's bottom-right corner")
_check(mm.position.x + mm.size.x <= main.board.size.x and mm.position.y + mm.size.y <= main.board.size.y, "in the spread's bottom-right corner")
mm.set_world(Rect2(-100, -100, 4000, 2000))
var p := Vector2(1234, 567)
_check(mm.map_to_world(mm.world_to_map(p)).distance_to(p) < 0.01, "map and world coordinates round-trip")
@ -252,7 +252,7 @@ func _test_minimap() -> void:
main.board.center_on(Vector2(1900, 900))
var v := main.board.view_rect()
var vm := mm.view_rect_on_map()
_check(vm.position.distance_to(mm.world_to_map(v.position)) < 0.01 and absf(vm.size.x - v.size.x * mm._scale) < 0.01, "the view rect is the board's view, scaled")
_check(vm.position.distance_to(mm.world_to_map(v.position)) < 0.01 and absf(vm.size.x - v.size.x * mm._scale) < 0.01, "the view rect is the spread's view, scaled")
var target := mm.world_to_map(Vector2(500, 300))
mm.pan_to_map_point(target)
_check(main.board.view_rect().get_center().distance_to(Vector2(500, 300)) < 1.0, "clicking the map pans there")
@ -294,7 +294,7 @@ func _test_pack() -> void:
"reading order holds along the top row")
_check(after["end"].position.y > after["start"].position.y and after["pick"].position.x > after["end"].position.x, "and in the row below")
var bounds1 := main.board.content_bounds()
_check(bounds1.size.x < bounds0.size.x * 0.5 and bounds1.size.y < bounds0.size.y, "the board gets much smaller: %s -> %s" % [str(bounds0.size), str(bounds1.size)])
_check(bounds1.size.x < bounds0.size.x * 0.5 and bounds1.size.y < bounds0.size.y, "the spread gets much smaller: %s -> %s" % [str(bounds0.size), str(bounds1.size)])
var agent := main.data.get_table("agent")
_check(agent.position - main.data.get_group("careers").position == Vector2(22, 68), "members move with their group")
_check(main.top_bar._toast.visible and main.top_bar._toast_undo.visible, "with an undo toast")
@ -320,7 +320,7 @@ func _test_zoom_range() -> void:
main.board.set_zoom(0.01)
_check(is_equal_approx(main.board.zoom, BoardView.MIN_ZOOM) and BoardView.MIN_ZOOM <= 0.1, "zoom goes down to about 0.1")
main.board.fit()
_check(main.board.zoom < 0.35, "Fit can zoom below the old minimum for a wide board: %.2f" % main.board.zoom)
_check(main.board.zoom < 0.35, "Fit can zoom below the old minimum for a wide spread: %.2f" % main.board.zoom)
## Rects of the blocks Pack works on: groups (compact or frame) and loose cards.

View file

@ -344,7 +344,7 @@ func _test_json() -> void:
_check(not plain.has("options_from") and not plain.has("options_where"), "a fixed pick card has no options keys")
var col := {"format_version": 2, "id": "c", "name": "C", "tables": [d]}
var res := JsonIO.import_json(JsonIO.export_json(col))
_check(res["ok"], "the collection imports")
_check(res["ok"], "the spread imports")
var td: Dictionary = (res["collection"]["tables"] as Array)[0]
_check(str(td.get("options_from", "")) == "@skill_*" and str(td.get("options_where", "")) == "option_value >= 1" \
and str((td["entries"][1] as Dictionary).get("show_if", "")) == "@terms > 2", "export and import keep them")
@ -433,7 +433,7 @@ func _test_tester() -> void:
spend.entries.append(TableEntry.new("keep", "Keep it all"))
var b := _board([start, spend])
var report: Dictionary = await BoardTester.simulate(b, "start", {"runs": 100, "seed": 4})
_check(BoardTester.is_clean(report), "the simulator runs a dynamic board cleanly")
_check(BoardTester.is_clean(report), "the simulator runs a dynamic spread cleanly")
_check(not (report["unchosen"] as Dictionary).has("spend"), "both the Chosen entry and the fixed extra get chosen")
@ -471,7 +471,7 @@ func _test_dialog() -> void:
pp.free()
d.plain = false
var p := d.preview_for_option(1)
_check(p != null and _has(p, "@[option] += 1") and _has(p, "Next step"), "a dynamic option's preview shows the Chosen entry's effects and pipes")
_check(p != null and _has(p, "@[option] += 1") and _has(p, "Next step"), "a dynamic option's preview shows the Chosen entry's effects and threads")
_check(_has(p, "skill_gun_combat"), "the preview names the variable behind the option")
p.free()
# Key 3 answers the third option (Pilot).

View file

@ -184,7 +184,7 @@ func _test_why_sentences() -> void:
_eq(Describe.why(other, b), "Took Learn from it because no condition was true", "otherwise fact")
_eq(Describe.why(case_f, b), "Case 1 didn't match because Strength was 9 (needs 10 or more)", "case fact")
_eq(Describe.why(eff, b), "Luck went from 2 to 1", "effect fact")
_eq(Describe.why(inp, b), "Tier was 3 (from the pipe)", "input fact")
_eq(Describe.why(inp, b), "Tier was 3 (from the thread)", "input fact")
_check(Describe.why(when_f, b, false).contains("@luck >= 2"), "text mode keeps the rule as written")
# A step's reasons: the parent's pipe choices aimed at it, the parent's
# effects on the values they read, then its own facts.
@ -241,35 +241,35 @@ func _test_switch() -> void:
await process_frame
var beyond := main.card_for("beyond")
_check(_chips(beyond).has("@luck -= 1"), "Text view: the chip shows the stored statement")
_check(_has(main.card_for("rounds"), "while @luck > 0"), "Text view: the loop rule as written")
_check(_has(main.card_for("rounds"), "while @luck > 0"), "Text view: the repeat rule as written")
_check(_has(main.card_for("learn"), "Options from @skill_* · where option_value >= 1"), "Text view: the options source as written")
_check(_has(main.card_for("loot"), "input tier · default 1"), "Text view: inputs by name")
main.board.pipes._process(0.0)
_check(main.board.pipes._drawn_state.back() == false, "the pipe layer redraws for the Text view")
_check(main.board.pipes._drawn_state.back() == false, "the thread layer redraws for the Text view")
_set_plain(true)
await process_frame
_check(_chips(main.card_for("beyond")).has("Luck −1"), "switching back refreshes the chips")
main.board.pipes._process(0.0)
_check(main.board.pipes._drawn_state.back() == true, "and the pipes")
_check(main.board.pipes._drawn_state.back() == true, "and the threads")
func _test_pipe_labels() -> void:
var b := main.data
var vault := b.get_table("beyond").entries[1]
_eq(RulesView.pipe_label(vault, "loot", b, true), "Tier 3 · only if Luck is 2 or more", "plain pipe label")
_eq(RulesView.pipe_label(vault, "loot", b, true), "Tier 3 · only if Luck is 2 or more", "plain thread label")
_eq(RulesView.pipe_label(vault, "learn", b, true), "otherwise", "otherwise label")
_eq(RulesView.pipe_label(vault, "loot", b, false), "tier=3 if @luck >= 2", "text pipe label")
_eq(RulesView.pipe_label(b.get_table("gate").entries[0], "beyond", b, true), "", "a plain pipe has no label")
_eq(RulesView.pipe_label(vault, "loot", b, false), "tier=3 if @luck >= 2", "text thread label")
_eq(RulesView.pipe_label(b.get_table("gate").entries[0], "beyond", b, true), "", "a plain thread has no label")
func _test_router_and_choice() -> void:
var climb := main.card_for("climb")
_check(_has(climb, "if Strength is 10 or more"), "a router case reads in words")
_check(_has(climb, "if Strength is 10 or more"), "a branch case reads in words")
_check(_has(climb, "Otherwise"), "the last case reads Otherwise")
var learn := main.card_for("learn")
_check(_has(learn, "Options: your Skills, level 1 or more"), "a choice's options source reads in words")
_check(_has(learn, "only if Luck is at most 1"), "show_if reads only if …")
_check(_chips(learn).has("Chosen skill +1"), "the Chosen row's effect names the collection's member")
_check(_chips(learn).has("Chosen skill +1"), "the Chosen row's effect names the spread's member")
func _test_check_card() -> void:
@ -280,7 +280,7 @@ func _test_check_card() -> void:
_check(_has(gate, "8+") and _has(gate, "≤7"), "outlet ranges")
await process_frame
for eid in ["ok", "no"]:
_check(not gate.anchor_for(eid).is_empty(), "the %s outlet has a pipe anchor" % eid)
_check(not gate.anchor_for(eid).is_empty(), "the %s outlet has a thread anchor" % eid)
var ok_y: float = gate.anchor_for("ok").get("pos", Vector2.ZERO).y
var no_y: float = gate.anchor_for("no").get("pos", Vector2.ZERO).y
_check(no_y > ok_y, "Failure sits below Success")
@ -297,7 +297,7 @@ func _test_collection_and_inputs() -> void:
names.append(str(m.get_meta("member")))
_eq(names, ["@skill_athletics", "@skill_mechanic", "@skill_recon"], "members: set ones by label, then ones the rules name")
_check(_has(skills, "Mechanic") and _has(skills, "2") and _has(skills, "—"), "members show live values")
_check(_has(skills, "Collection · kept between rolls"), "the collection's kind line")
_check(_has(skills, "Collection · kept between rolls"), "the spread's kind line")
main.persistent_vars["skill_mechanic"] = {"value": 3, "source": ""}
main.refresh_live()
_check(_has(skills, "3"), "values refresh live")
@ -382,7 +382,7 @@ func _test_build_rows() -> void:
_check(not _has(beyond, "ƒ") and not _has(beyond, "Details"), "the inline effects / details editors are gone")
_check(_with_meta(beyond, "effects_chip").size() == 1, "one chip for the one entry with effects")
var climb := main.card_for("climb")
_check(not _with_meta(climb, "case_line").is_empty() and _has(climb, "if Strength is 10 or more"), "a Build router case shows its condition in words")
_check(not _with_meta(climb, "case_line").is_empty() and _has(climb, "if Strength is 10 or more"), "a Build branch case shows its condition in words")
var row: Control = beyond.rows["e2"]
var ev := InputEventMouseButton.new()
ev.button_index = MOUSE_BUTTON_LEFT
@ -399,7 +399,7 @@ func _test_build_rows() -> void:
gate.set_selected_entry("no")
_eq(gate.selected_entry(), "no", "the inspector can set the selection directly")
var adds := _with_meta(main.card_for("skills"), "collection_add")
_check(adds.size() == 1 and (adds[0] as Button).text == "+ Add skill", "the collection card has + Add skill in Build")
_check(adds.size() == 1 and (adds[0] as Button).text == "+ Add skill", "the spread card has + Add skill in Build")
if adds.size() == 1:
(adds[0] as Button).emit_signal("pressed")
_eq(main.get("picked").back(), ["card", "skills"], "+ Add selects the card for the inspector")

View file

@ -25,7 +25,7 @@ func _init() -> void:
_check(wild.range_problems() == "", "wilderness ranges have no gaps or overlaps")
_check(wild.num_label(wild.entries[5], 5) == "96–00", "last range reads 96–00")
for e in wild.entries:
_check(e.pipes.size() == 1, "range %s has exactly one pipe" % e.text)
_check(e.pipes.size() == 1, "range %s has exactly one thread" % e.text)
# Range weighting: 01–30 should come up about 30% of the time.
var counts := {}
@ -69,19 +69,19 @@ func _init() -> void:
_check(stops > 50 and stops < 150, "rolls into a gap stop with a message (%d/200)" % stops)
# A self-pipe stops at the action limit (docs/LOGIC.md §7) instead of looping forever.
var loop := RollTable.new("loop", "Loop")
var loop := RollTable.new("loop", "Repeat")
var again := TableEntry.new("e1", "Again")
again.pipes.append("loop")
loop.entries.append(again)
var b3 := TowerBoard.new()
b3.tables.append(loop)
var steps := Roller.flatten(Roller.roll(b3, "loop", rng), [])
_check(steps.size() == Roller.MAX_ACTIONS + 1 and str(steps[steps.size() - 1]["text"]) == Roller.limit_text(), "self-pipe stops at the action limit (%d steps)" % steps.size())
_check(steps.size() == Roller.MAX_ACTIONS + 1 and str(steps[steps.size() - 1]["text"]) == Roller.limit_text(), "self-thread stops at the action limit (%d steps)" % steps.size())
# JSON round trip keeps everything.
var copy := TowerBoard.new()
_check(copy.load_json(board.to_json()), "board JSON loads back")
_check(copy.to_json() == board.to_json(), "board JSON round-trips unchanged")
_check(copy.load_json(board.to_json()), "spread JSON loads back")
_check(copy.to_json() == board.to_json(), "spread JSON round-trips unchanged")
_check(copy.get_table("trinkets").collapsed, "collapsed state is saved")
# Removing a table removes pipes into it.
@ -91,7 +91,7 @@ func _init() -> void:
for e in t.entries:
if e.pipes.has("loot"):
dangling = true
_check(not dangling and copy.get_table("loot") == null, "removing a table removes pipes into it")
_check(not dangling and copy.get_table("loot") == null, "removing a table removes threads into it")
print("%s: %d failure(s)" % ["PASS" if _failures == 0 else "FAIL", _failures])
quit(1 if _failures else 0)

View file

@ -93,13 +93,13 @@ func _branch_board(str_value: int) -> TowerBoard:
func _test_when_otherwise() -> void:
_eq(_ids(_roll(_branch_board(10), "start")), ["start", "strong", "after"], "a true condition runs its pipe; otherwise is skipped")
_eq(_ids(_roll(_branch_board(10), "start")), ["start", "strong", "after"], "a true condition runs its thread; otherwise is skipped")
_eq(_ids(_roll(_branch_board(2), "start")), ["start", "weak", "after"], "the second condition can be the true one")
_eq(_ids(_roll(_branch_board(6), "start")), ["start", "plain", "after"], "no condition true: the otherwise pipe runs")
_eq(_ids(_roll(_branch_board(6), "start")), ["start", "plain", "after"], "no condition true: the otherwise thread runs")
# Two true conditions both run (pipes aren't else-if; use a router for that).
var b := _branch_board(10)
b.get_table("start").entries[0].set_pipe_when("weak", "@str > 1")
_eq(_ids(_roll(b, "start")), ["start", "strong", "weak", "after"], "every true condition runs, in pipe order")
_eq(_ids(_roll(b, "start")), ["start", "strong", "weak", "after"], "every true condition runs, in thread order")
# A condition clears otherwise, and otherwise can't be set while there's a condition.
var e := TableEntry.new("e1", "x")
e.add_pipe("y")
@ -115,8 +115,8 @@ func _test_when_otherwise() -> void:
var lit_e := {}
var lit_p := {}
Roller.collect_lit(_roll(_branch_board(10), "start"), lit_e, lit_p)
_check(lit_p.has(Roller.pipe_key("start", "e1", "strong")) and lit_p.has(Roller.pipe_key("start", "e1", "after")), "taken pipes light")
_check(not lit_p.has(Roller.pipe_key("start", "e1", "weak")) and not lit_p.has(Roller.pipe_key("start", "e1", "plain")), "skipped pipes stay dark")
_check(lit_p.has(Roller.pipe_key("start", "e1", "strong")) and lit_p.has(Roller.pipe_key("start", "e1", "after")), "taken threads light")
_check(not lit_p.has(Roller.pipe_key("start", "e1", "weak")) and not lit_p.has(Roller.pipe_key("start", "e1", "plain")), "skipped threads stay dark")
# ---------------------------------------------------------------- snapshot
@ -139,7 +139,7 @@ func _test_snapshot() -> void:
var vars := {}
var ids := _ids(_roll(b, "start", vars))
_eq(ids, ["start", "first", "second", "third"], "conditions and counts come from the snapshot, not the changed variables")
_eq(_var(vars, "x"), 1, "the first pipe's subtree did change @x")
_eq(_var(vars, "x"), 1, "the first thread's subtree did change @x")
# An otherwise pipe doesn't fire because a when pipe's subtree made the
# conditions false afterwards.
_check(not ids.has("fallback"), "otherwise reads the snapshot too")
@ -149,7 +149,7 @@ func _test_snapshot() -> void:
link.entries[0].add_pipe("link")
link.entries[0].set_pipe_when("link", "@k < 5")
var v2 := {}
_eq(_ids(_roll(_board([link]), "link", v2)).size(), 5, "a conditional self-pipe stops when its condition turns false")
_eq(_ids(_roll(_board([link]), "link", v2)).size(), 5, "a conditional self-thread stops when its condition turns false")
_eq(_var(v2, "k"), 5, "it ran five times")
@ -165,7 +165,7 @@ func _test_errors() -> void:
var tree := _roll(_board([start, _one("bad", "Bad"), _one("other", "Other")]), "start")
_eq(_ids(tree), ["start", "other"], "a condition that errors counts as false (so otherwise runs)")
var errs := _errors(tree)
_check(errs.size() == 1 and str(errs[0]).begins_with("Pipe condition @x + * 2"), "the error shows as an error line on the node: %s" % str(errs))
_check(errs.size() == 1 and str(errs[0]).begins_with("Thread condition @x + * 2"), "the error shows as an error line on the node: %s" % str(errs))
var step: Dictionary = Roller.flatten(tree)[0]
_check((step.get("effects", []) as Array).size() == 1, "the error line is in the step's effects")
@ -186,9 +186,9 @@ func _router_board() -> TowerBoard:
func _test_router() -> void:
var t := RollTable.create(RollTable.KIND_ROUTER, "r", "Router")
_eq(t.kind, "router", "create makes a router")
_eq(t.entries.size(), 2, "a new router has two cases")
var t := RollTable.create(RollTable.KIND_ROUTER, "r", "Branch")
_eq(t.kind, "router", "create makes a branch")
_eq(t.entries.size(), 2, "a new branch has two cases")
_eq(t.entries[0].text, "if …", "its first case")
_check(t.entries[0].when != "" and Expr.check(t.entries[0].when) == "", "the first case has a valid condition")
_check(t.entries[1].text == "Otherwise" and t.entries[1].when == "", "the second is Otherwise")
@ -197,7 +197,7 @@ func _test_router() -> void:
var vars := {"species": {"value": "Aslan", "source": ""}, "str": {"value": 10, "source": ""}}
var tree := _roll(b, "route", vars)
_eq(_ids(tree), ["route", "aslan"], "the first true case wins, even when a later one is true too")
_eq(str(tree.get("kind", "")), "router", "the node's kind is router")
_eq(str(tree.get("kind", "")), "router", "the node's kind is branch")
_eq(tree.get("case"), 0, "the node's case index")
_eq(_var(vars, "took"), "aslan", "the case's effects ran")
_eq(Formatter.strip_tags(str(tree["summary"])), "Aslan path", "the case's text is the summary")
@ -209,13 +209,13 @@ func _test_router() -> void:
# One action per router.
var ctx := Roller.new_context(b, _rng(), {})
Roller.roll(b, "route", ctx.rng, 0, {}, ctx)
_eq(ctx.actions, 2, "a router is one action (plus the table it pipes to)")
_eq(ctx.actions, 2, "a branch is one action (plus the table it threads to)")
# A case condition with an error counts as false and is reported.
b.get_table("route").entries[0].when = "@species = = 3 +"
var t3 := _roll(b, "route", {})
_eq(_ids(t3), ["route", "plain"], "an erroring case is skipped")
var errs := _errors(t3)
_check(errs.size() == 1 and str(errs[0]).begins_with("Case "), "the case error is on the router node: %s" % str(errs))
_check(errs.size() == 1 and str(errs[0]).begins_with("Case "), "the case error is on the branch node: %s" % str(errs))
# Lighting: the matched case is lit.
var le := {}
var lp := {}
@ -229,13 +229,13 @@ func _test_no_case() -> void:
r.entries.remove_at(2) # no Otherwise
var tree := _roll(b, "route", {})
_check(tree.has("stop") and str(tree["summary"]) == Roller.NO_CASE, "nothing matched: the node stops with \"No case matched\"")
_eq(str(tree.get("kind", "")), "router", "the stop node is a router node")
_eq(str(tree.get("kind", "")), "router", "the stop node is a branch node")
_eq(_ids(tree), ["route"], "nothing follows")
var step: Dictionary = Roller.flatten(tree)[0]
_check(step.get("stop", false) and str(step["text"]) == "No case matched", "the step shows it")
# A router with no cases at all.
r.entries.clear()
_check(_roll(b, "route", {}).has("stop"), "an empty router stops")
_check(_roll(b, "route", {}).has("stop"), "an empty branch stops")
# ---------------------------------------------------------------- file format
@ -253,9 +253,9 @@ func _test_json() -> void:
_eq(str(ed.get("when", "")), "@str >= 8", "an entry's when is written")
_check(not (d["entries"][2] as Dictionary).has("when"), "the Otherwise case has no when")
var pipes: Array = ed["pipes"]
_eq(pipes[1], {"table": "aslan", "count": 2, "save_as": "who", "when": "@str > 9"}, "a pipe's when is written with its other options")
_eq(pipes[2], {"table": "plain", "otherwise": true}, "an otherwise pipe")
_eq(pipes[0], "strong", "a plain pipe stays a bare id")
_eq(pipes[1], {"table": "aslan", "count": 2, "save_as": "who", "when": "@str > 9"}, "a thread's when is written with its other options")
_eq(pipes[2], {"table": "plain", "otherwise": true}, "an otherwise thread")
_eq(pipes[0], "strong", "a plain thread stays a bare id")
var back := RollTable.from_dict(d)
var be := back.entries[1]
_check(back.kind == "router" and be.when == "@str >= 8" and be.when_for("aslan") == "@str > 9" and be.is_otherwise("plain") and be.count_for("aslan") == 2 and be.save_for("aslan") == "who", "the table round-trips")
@ -266,10 +266,10 @@ func _test_json() -> void:
{"id": "b", "text": "B", "when": ""}]}]}
var c := JsonIO.canonical(raw)
var ce: Dictionary = c["tables"][0]["entries"][0]
_eq(str(c["tables"][0].get("kind", "")), "router", "canonical keeps kind router")
_eq(str(c["tables"][0].get("kind", "")), "router", "canonical keeps kind branch")
_eq(str(ce.get("when", "")), "@a = 1", "canonical keeps (trimmed) entry when")
_check(not (c["tables"][0]["entries"][1] as Dictionary).has("when"), "canonical drops an empty when")
_eq(ce["pipes"], [{"table": "y", "when": "@b"}, {"table": "z", "otherwise": true}, {"table": "w"}, {"table": "v"}], "canonical pipe conditions")
_eq(ce["pipes"], [{"table": "y", "when": "@b"}, {"table": "z", "otherwise": true}, {"table": "w"}, {"table": "v"}], "canonical thread conditions")
var text := JsonIO.export_json(b.to_dict())
var imp := JsonIO.import_json(text)
_check(imp["ok"], "the export imports")
@ -277,14 +277,14 @@ func _test_json() -> void:
b2.load_dict(imp["collection"])
var e2 := b2.get_table("route").entries[1]
_check(e2.when == "@str >= 8" and e2.when_for("aslan") == "@str > 9" and e2.is_otherwise("plain"), "a JSON export round-trips conditions")
_eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "when": "@str >= 8", "count": 2, "save_as": "w"})), "if @str >= 8 ×2 → w", "edge label for a conditional pipe")
_eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "otherwise": true})), "otherwise", "edge label for an otherwise pipe")
_eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "when": "@str >= 8", "count": 2, "save_as": "w"})), "if @str >= 8 ×2 → w", "edge label for a conditional thread")
_eq(JsonIO.pipe_label(JsonIO.pipe_info({"table": "y", "otherwise": true})), "otherwise", "edge label for an otherwise thread")
# ---------------------------------------------------------------- lint
func _test_lint() -> void:
_eq(Roller.lint_pipes(_router_board()), [] as Array[Dictionary], "a clean board has no lint")
_eq(Roller.lint_pipes(_router_board()), [] as Array[Dictionary], "a clean spread has no lint")
var b := _router_board()
var r := b.get_table("route")
# Otherwise first: the cases after it can't be chosen.
@ -311,9 +311,9 @@ func _test_lint() -> void:
msgs["%s:%s" % [item["table_id"], item["entry_id"]]] = str(msgs.get("%s:%s" % [item["table_id"], item["entry_id"]], "")) + str(item["message"]) + "|"
_check(str(msgs.get("route:c3", "")).contains("Otherwise case isn't last"), "Otherwise case not last: %s" % str(lint))
_check(str(msgs.get("route:c1", "")).begins_with("Case @str >= = 8"), "a bad case condition: %s" % str(lint))
_check(str(msgs.get("start:e1", "")).contains("Pipe condition (((") and str(msgs.get("start:e1", "")).contains("comes before a conditional pipe"), "a bad pipe condition, and otherwise before when: %s" % str(lint))
_check(str(msgs.get("lonely:e1", "")).contains("always runs"), "otherwise with no conditional pipe: %s" % str(lint))
_check(str(msgs.get("empty:", "")).contains("no cases"), "a router with no cases: %s" % str(lint))
_check(str(msgs.get("start:e1", "")).contains("Thread condition (((") and str(msgs.get("start:e1", "")).contains("comes before a conditional thread"), "a bad thread condition, and otherwise before when: %s" % str(lint))
_check(str(msgs.get("lonely:e1", "")).contains("always runs"), "otherwise with no conditional thread: %s" % str(lint))
_check(str(msgs.get("empty:", "")).contains("no cases"), "a branch with no cases: %s" % str(lint))
_eq(lint.size(), 6, "six lint items")
@ -322,12 +322,12 @@ func _test_cycles() -> void:
var link := _one("link", "Link", "@k += 1")
link.entries[0].add_pipe("link")
link.entries[0].set_pipe_when("link", "@k < 3")
_eq(Roller.endless_cycles(_board([link])), [] as Array[String], "a conditional self-pipe is not an endless cycle")
_eq(Roller.endless_cycles(_board([link])), [] as Array[String], "a conditional self-thread is not an endless cycle")
var r := RollTable.create(RollTable.KIND_ROUTER, "r", "R")
r.entries[0].add_pipe("r")
_eq(Roller.endless_cycles(_board([r])), [] as Array[String], "a router with a case that finishes is fine")
_eq(Roller.endless_cycles(_board([r])), [] as Array[String], "a branch with a case that finishes is fine")
r.entries[1].add_pipe("r")
_eq(Roller.endless_cycles(_board([r])), ["r"] as Array[String], "a router whose every case loops back is endless")
_eq(Roller.endless_cycles(_board([r])), ["r"] as Array[String], "a branch whose every case loops back is endless")
# ---------------------------------------------------------------- mini board
@ -390,9 +390,9 @@ func _test_mini_board() -> void:
_eq(_var(vars, "path"), "aslan" if pick == 0 else "human", "%s: @path" % label)
_check(_errors(tree).is_empty(), "%s: no errors" % label)
if use_router:
_check(ids.has("route") and ids.has("sheet"), "%s: through the router to the sheet" % label)
_check(ids.has("route") and ids.has("sheet"), "%s: through the branch to the sheet" % label)
# The router version lints clean and has no cycles.
_eq(Roller.lint_pipes(_species_board(true)), [] as Array[Dictionary], "the router board lints clean")
_eq(Roller.lint_pipes(_species_board(true)), [] as Array[Dictionary], "the branch spread lints clean")
# ---------------------------------------------------------------- UI helpers
@ -407,9 +407,9 @@ func _test_ui_helpers() -> void:
var bad := TableSettingsDialog.apply_settings(r, {"name": "R", "cases": ["@a = = 1", ""]})
_check(not bad["ok"] and str(bad["error"]).begins_with("Case 1"), "settings refuse a bad case: %s" % str(bad))
var ok := TableSettingsDialog.apply_settings(r, {"name": "R", "cases": ["@a = 1", ""], "card_mode": true, "ranged": true})
_check(ok["ok"] and r.entries[0].when == "@a = 1" and not r.card_mode and not r.is_ranged(), "settings set case conditions; no card mode or ranges: %s" % str(ok))
_check(TableSettingsRules.router_hint(["", "@a"]) != "" and TableSettingsRules.router_hint(["@a", ""]) == "", "router order hint")
_eq(TablePreview.kind_line(r), "Router · if / else if / otherwise", "preview kind line")
_check(ok["ok"] and r.entries[0].when == "@a = 1" and not r.card_mode and not r.is_ranged(), "settings set case conditions; no deck mode or ranges: %s" % str(ok))
_check(TableSettingsRules.router_hint(["", "@a"]) != "" and TableSettingsRules.router_hint(["@a", ""]) == "", "branch order hint")
_eq(TablePreview.kind_line(r), "Branch · if / else if / otherwise", "preview kind line")
# ---------------------------------------------------------------- checks

View file

@ -34,8 +34,8 @@ func _test_settings() -> void:
_check(r["ok"], "plain settings apply")
_check(t.name == "Gems" and t.details == "[b]x[/b]", "name trimmed, details kept")
_check(t.tags == ["a", "b"], "tags split and de-duplicated")
_check(t.card_mode and t.deck_empty == "stop", "card mode and deck_empty set")
_check(r["deck_reset"], "card mode change resets the deck")
_check(t.card_mode and t.deck_empty == "stop", "deck mode and deck_empty set")
_check(r["deck_reset"], "deck mode change resets the deck")
var bad := TableSettingsDialog.apply_settings(t, {"ranged": true, "dice": "banana", "name": "Changed"})
_check(not bad["ok"] and t.name == "Gems" and not t.is_ranged(), "invalid dice changes nothing")
@ -79,7 +79,7 @@ func _test_ranges() -> void:
z.entries[1].weight = 0
z.entries[0].pipes = ["a", "b"] as Array[String]
TableSettingsRules.assign_ranges(z)
_check(not z.entries[1].has_range and z.entries[0].pipes.size() == 1, "weight 0 skipped, extra pipe dropped")
_check(not z.entries[1].has_range and z.entries[0].pipes.size() == 1, "weight 0 skipped, extra thread dropped")
_check(z.entries[2].range_hi == 100, "last live entry reaches the top")
@ -96,10 +96,10 @@ func _test_collections() -> void:
var a := CollectionSwitcher.create_collection(lib, null, "Alpha")
a.tables.append(_plain_table())
var b := CollectionSwitcher.create_collection(lib, a, "Beta")
_check(lib.list().size() == 2, "two collections after create")
_check(lib.load_collection(a.id).tables.size() == 1, "creating saves the current collection first")
_check(lib.list().size() == 2, "two spreads after create")
_check(lib.load_collection(a.id).tables.size() == 1, "creating saves the current spread first")
var back := CollectionSwitcher.switch_collection(lib, b, a.id)
_check(back != null and back.id == a.id and back.tables.size() == 1, "switch loads the other collection")
_check(back != null and back.id == a.id and back.tables.size() == 1, "switch loads the other spread")
_check(CollectionSwitcher.switch_collection(lib, a, "missing") == null, "switch to a missing id is null")
_check(not CollectionSwitcher.rename_collection(lib, a, " "), "blank rename refused")
_check(CollectionSwitcher.rename_collection(lib, a, "Alpha Prime"), "rename works")
@ -108,12 +108,12 @@ func _test_collections() -> void:
_check(copy != null and copy.id != a.id and copy.tables.size() == 1, "duplicate copies the tables")
state.set_variable(a.id, "x", "1")
var next := CollectionSwitcher.delete_collection(lib, copy)
_check(next != null and next.id != copy.id and not lib.exists(copy.id), "delete returns another collection")
_check(state.get_variables(a.id).has("x"), "delete leaves other collections' state")
_check(next != null and next.id != copy.id and not lib.exists(copy.id), "delete returns another spread")
_check(state.get_variables(a.id).has("x"), "delete leaves other spreads' state")
for e in lib.list():
var c := lib.load_collection(str(e["id"]))
CollectionSwitcher.delete_collection(lib, c)
_check(lib.list().size() == 1, "deleting the last collection leaves a fresh empty one")
_check(lib.list().size() == 1, "deleting the last spread leaves a fresh empty one")
func _test_import() -> void:
@ -130,7 +130,7 @@ func _test_import() -> void:
var r := IoMenu.import_as_collection(lib, canvas, "loot.canvas")
_check(r["ok"], "canvas import ok: %s" % str(r["errors"]))
var b: TowerBoard = r["board"]
_check(b != null and lib.list().size() == before + 1 and lib.exists(b.id), "import adds a new collection")
_check(b != null and lib.list().size() == before + 1 and lib.exists(b.id), "import adds a new spread")
var all := ""
for t in b.tables:
all += t.name + "|"
@ -139,7 +139,7 @@ func _test_import() -> void:
_check(not all.contains("[url") and not all.contains("[img") and not all.contains("res://"), "import is sanitized: " + all)
_check(all.contains("[b]bold[/b]") and all.contains("[color=red]gem[/color]"), "safe tags survive: " + all)
var r2 := IoMenu.import_as_collection(lib, canvas, "loot.canvas")
_check(r2["ok"] and r2["board"].id != b.id, "importing twice makes two collections")
_check(r2["ok"] and r2["board"].id != b.id, "importing twice makes two spreads")
var bad := IoMenu.import_as_collection(lib, "{not json", "x.json")
_check(not bad["ok"] and not (bad["errors"] as Array).is_empty() and lib.list().size() == before + 2, "bad file adds nothing")
_check(IoMenu.detect_format("a.canvas", "") == "canvas" and IoMenu.detect_format("a", "<graphml/>") == "graphml", "format detection")

View file

@ -36,7 +36,7 @@ func _init() -> void:
# A preference picks the matching option every time.
var r2: Dictionary = await BoardTester.simulate(b, "start", {"runs": 20, "seed": 4, "prefer": "^Mine$"})
_check((r2["unchosen"] as Dictionary).has("pick"), "--prefer always picks the matching option")
_check(int((r2["table_hits"] as Dictionary).get("mine", 0)) == 20 * 3, "the preferred option's pipe ran on every pass")
_check(int((r2["table_hits"] as Dictionary).get("mine", 0)) == 20 * 3, "the preferred option's thread ran on every pass")
# The action limit is reported as a halt reason.
var r3: Dictionary = await BoardTester.simulate(b, "start", {"runs": 5, "seed": 5, "max_actions": 4})
_eq((r3["halted"] as Dictionary).get("Action limit", 0), 5, "the action limit is a halt reason")

View file

@ -85,7 +85,7 @@ func _test_library() -> void:
_check(lib.state.get_history("fantasy-loot").is_empty() and lib.state.get_history().size() == 1, "delete drops only its history")
_check(lib.state.get_setting("last_collection") == null, "delete clears last_collection if it pointed there")
_check(not lib.delete("fantasy-loot"), "deleting twice returns false")
_check(lib.load_collection("fantasy-loot") == null, "loading a missing collection returns null")
_check(lib.load_collection("fantasy-loot") == null, "loading a missing spread returns null")
func _test_migration() -> void:
@ -98,7 +98,7 @@ func _test_migration() -> void:
f.close()
var lib := LibraryStore.new(root)
var b := lib.migrate_legacy()
_check(b != null and b.name == "My Tables" and b.id == "my-tables", "legacy board imported as My Tables")
_check(b != null and b.name == "My Tables" and b.id == "my-tables", "legacy spread imported as My Tables")
_check(lib.load_collection("my-tables").tables.size() == sample.tables.size(), "imported tables are saved")
_check(not FileAccess.file_exists(legacy) and FileAccess.file_exists(legacy + ".bak"), "old file renamed to .bak")
_check(lib.migrate_legacy() == null, "migration is a no-op once done")
@ -107,7 +107,7 @@ func _test_migration() -> void:
var f2 := FileAccess.open(legacy, FileAccess.WRITE)
f2.store_string(JSON.stringify({"format_version": 1, "tables": sample.to_dict()["tables"]}))
f2.close()
_check(lib.migrate_legacy() == null and FileAccess.file_exists(legacy), "no migration when collections exist")
_check(lib.migrate_legacy() == null and FileAccess.file_exists(legacy), "no migration when spreads exist")
func _test_corrupt() -> void:
@ -120,7 +120,7 @@ func _test_corrupt() -> void:
var f2 := FileAccess.open(lib.path_for("wrongshape"), FileAccess.WRITE)
f2.store_string("[1, 2, 3]")
f2.close()
_check(lib.load_collection("broken") == null, "corrupt collection loads as null")
_check(lib.load_collection("broken") == null, "corrupt spread loads as null")
var ids: Array = []
for e in lib.list():
ids.append(e["id"])

View file

@ -61,8 +61,8 @@ func _test_make() -> void:
var t0: Dictionary = tpl["tables"][0]
var t1: Dictionary = tpl["tables"][1]
_check(t0["x"] == 0 and t0["y"] == 0 and t1["x"] == 300 and t1["y"] == 60, "positions are relative to the top-left: %s %s" % [str(t0["x"]), str(t1["x"])])
_check(t0["entries"][1]["pipes"] == [{"table": "outcome", "count": "{$n}", "save_as": "{$skill}_result"}], "internal pipes keep their target and options: %s" % str(t0["entries"][1]["pipes"]))
_check(t0["entries"][0]["pipes"] == [{"table": "Wounds", "outside": true}], "an outside pipe is recorded by name: %s" % str(t0["entries"][0]["pipes"]))
_check(t0["entries"][1]["pipes"] == [{"table": "outcome", "count": "{$n}", "save_as": "{$skill}_result"}], "internal threads keep their target and options: %s" % str(t0["entries"][1]["pipes"]))
_check(t0["entries"][0]["pipes"] == [{"table": "Wounds", "outside": true}], "an outside thread is recorded by name: %s" % str(t0["entries"][0]["pipes"]))
_check(not JSON.stringify(tpl).contains("\"wounds\""), "the outside table itself isn't in the template")
_check(TemplateKit.summary(tpl) == "2 cards: roll, choice", "summary: %s" % TemplateKit.summary(tpl))
# A group template keeps its group, relative to the frame's corner.
@ -94,16 +94,16 @@ func _test_insert() -> void:
_check(chk.id != "chk" and oc.id != "outcome" and chk.id != oc.id, "fresh table ids")
_check(chk.entries[0].id != "e1" and chk.entries[0].id != chk.entries[1].id, "fresh entry ids")
_check(chk.position == Vector2(1000, 500) and oc.position == Vector2(1300, 560), "placed at the origin, keeping the layout")
_check(chk.entries[1].pipes == [oc.id] and chk.entries[1].count_expr(oc.id) == "" and chk.entries[1].count_for(oc.id) == 2, "internal pipes follow the new ids, with their count")
_check(chk.entries[1].pipes == [oc.id] and chk.entries[1].count_expr(oc.id) == "" and chk.entries[1].count_for(oc.id) == 2, "internal threads follow the new ids, with their count")
_check(chk.entries[1].save_for(oc.id) == "pilot_result", "and their save_as, substituted")
_check(chk.entries[0].pipes == ["w1"] and oc.entries[1].pipes == ["w1"], "outside pipes relink to the table with that name (any case)")
_check((r["relinked"] as Array).size() == 2 and (r["dropped"] as Array).is_empty(), "relinked pipes are reported: %s" % str(r["relinked"]))
_check(chk.entries[0].pipes == ["w1"] and oc.entries[1].pipes == ["w1"], "outside threads relink to the table with that name (any case)")
_check((r["relinked"] as Array).size() == 2 and (r["dropped"] as Array).is_empty(), "relinked threads are reported: %s" % str(r["relinked"]))
var again := TemplateKit.insert(tpl, {}, b, Vector2.ZERO)
_check((again["tables"][0] as RollTable).id != chk.id, "a second insert gets new ids again")
_check((again["tables"][0] as RollTable).name == "{$skill} check", "missing values without a default stay as typed")
var empty := TowerBoard.new()
var r2 := TemplateKit.insert(tpl, {"skill": "a", "target": "1", "n": "1"}, empty, Vector2.ZERO)
_check((r2["dropped"] as Array).size() == 2 and (r2["tables"][0] as RollTable).entries[0].pipes.is_empty(), "outside pipes with no table of that name are dropped and listed: %s" % str(r2["dropped"]))
_check((r2["dropped"] as Array).size() == 2 and (r2["tables"][0] as RollTable).entries[0].pipes.is_empty(), "outside threads with no table of that name are dropped and listed: %s" % str(r2["dropped"]))
# Group templates make the group.
var gsrc := _board()
var g := gsrc.add_group("{$skill} block", ["chk", "outcome"])
@ -182,7 +182,7 @@ func _test_builtins() -> void:
var r := TemplateKit.insert(tpl, {}, b, Vector2(50, 50))
var text := b.to_json()
_check(not text.contains("{$"), "%s: defaults fill every placeholder" % row["id"])
_check((r["dropped"] as Array).is_empty(), "%s: no pipes lead outside" % row["id"])
_check((r["dropped"] as Array).is_empty(), "%s: no threads lead outside" % row["id"])
var declared := TemplateKit.detect_params(tpl)
for p: Dictionary in tpl["params"]:
_check(declared.has(str(p["name"])), "%s: param %s is used" % [row["id"], p["name"]])
@ -263,14 +263,14 @@ func _test_app() -> void:
for t in main.data.tables:
if t.kind == RollTable.KIND_VARIABLE and t.var_name == "counter":
var_card = t
_check(var_card != null and main.card_for(var_card.id) != null, "its variable card is on the board")
_check(var_card != null and main.card_for(var_card.id) != null, "its variable card is on the spread")
# Insert with values and an outside pipe that relinks.
var tpl := TemplateKit.make(_board(), ["chk", "outcome"], "selection", "Check")
var r := main.templating.insert_template(tpl, {"skill": "stealth", "target": "9", "n": "1"})
await process_frame
var chk: RollTable = r["tables"][0]
_check(main.card_for(chk.id) != null and chk.name == "stealth check", "the inserted cards appear")
_check(chk.entries[0].pipes == ["wounds"], "an outside pipe relinks to Wounds on this board")
_check(chk.entries[0].pipes == ["wounds"], "an outside thread relinks to Wounds on this spread")
var center := main.board.screen_to_world(main.board.size / 2.0)
var ext := TemplateKit.extent(tpl)
_check(chk.position.distance_to((center - ext / 2.0).round().max(Vector2(20, 20 + TableGroup.TITLE_H))) < 2.0, "placed around the view centre")
@ -284,7 +284,7 @@ func _test_app() -> void:
main.templating.insert_template(tpl, {"skill": "x", "target": "1", "n": "1"})
await process_frame
var rep := _top_modal()
_check(rep != null and rep.title_label.text.begins_with("Inserted"), "pipes that can't relink are listed in a report")
_check(rep != null and rep.title_label.text.begins_with("Inserted"), "threads that can't relink are listed in a report")
if rep:
rep.close()
# The card settings dialog offers Save as template.

View file

@ -40,7 +40,7 @@ func _test_bar() -> void:
texts.append((n as Button).text)
_check(not texts.has("Arrange ▾"), "Arrange ▾ is gone from the Build tools: %s" % str(texts))
var pm := bar._board_menu.get_popup()
_check(pm.get_item_index(IoMenu.ID_PACK) >= 0, "Board ▾ has Pack collapsed groups")
_check(pm.get_item_index(IoMenu.ID_PACK) >= 0, "Spread ▾ has Pack collapsed groups")
_check(main.nav._search_button.text == "", "Search is an icon button")
@ -54,7 +54,7 @@ func _test_zoom() -> void:
await _frames()
_eq(z.menu.text, "50% ▾", "and follows zoom changes from elsewhere")
z.activate(ZoomControl.ID_FIT)
_check(main.board.zoom != 0.5, "Fit board changes the zoom")
_check(main.board.zoom != 0.5, "Fit spread changes the zoom")
func _test_view_menu() -> void:
@ -132,7 +132,7 @@ func _test_card_menu() -> void:
func _test_help() -> void:
var titles := HelpDialog.titles()
_check(titles.size() >= 10 and titles.has("Card mode") and titles.has("Roll modifiers"), "help has its topics: %s" % str(titles))
_check(titles.size() >= 10 and titles.has("Deck mode") and titles.has("Roll modifiers"), "help has its topics: %s" % str(titles))
var src := FileAccess.get_file_as_string(HelpDialog.PATH)
var re := RegEx.create_from_string("\\[topic\\](.+?)\\[/topic\\]")
for m in re.search_all(src):
@ -141,9 +141,9 @@ func _test_help() -> void:
_check(str(t["body"]).length() > 80, "“%s” has text" % t["title"])
_check(HelpDialog._inline("`[[Loot]]`").contains("[lb][lb]Loot[rb][rb]"), "code spans keep their brackets")
var d := main.top_bar.help_menu.open("card MODE")
var d := main.top_bar.help_menu.open("deck MODE")
await _frames()
_eq(d.current, "Card mode", "Help opens at the asked topic, any case")
_eq(d.current, "Deck mode", "Help opens at the asked topic, any case")
d._on_meta("topic:Roll modifiers")
_eq(d.current, "Roll modifiers", "a topic link switches topics")
_check(d.text.get_parsed_text().contains("Luck"), "and shows its text")

View file

@ -250,20 +250,20 @@ func _test_results_and_tables() -> void:
_check(_label() == "Delete table Gems" and _t("a").entries[0].pipes.is_empty(), "deleting a table: %s" % _label())
main.undo_redo.undo()
await _frames()
_check(_t("b") != null and main.card_for("b") != null and _t("a").entries[0].pipes == ["b"], "undo brings the table, its card and the pipe into it back")
_check(_t("b") != null and main.card_for("b") != null and _t("a").entries[0].pipes == ["b"], "undo brings the table, its card and the thread into it back")
func _test_pipes() -> void:
print("Pipes")
print("Threads")
main.undo_redo._begin_edit()
_t("a").entries[1].pipes.append("c")
main.mark_dirty()
await _frames()
_check(_label() == "Add pipe Loot → Weapons", "laying a pipe: %s" % _label())
_check(_label() == "Add thread Loot → Weapons", "laying a thread: %s" % _label())
main.undo_redo.undo()
_check(_t("a").entries[1].pipes.is_empty(), "undo takes the pipe away")
_check(_t("a").entries[1].pipes.is_empty(), "undo takes the thread away")
main.remove_pipe("a:e1>b")
_check(_label() == "Delete pipe Loot → Gems" and main.top_bar._toast_undo.visible, "removing a pipe, with an undo toast: %s" % _label())
_check(_label() == "Delete thread Loot → Gems" and main.top_bar._toast_undo.visible, "removing a thread, with an undo toast: %s" % _label())
main.undo_redo.undo()
_check(_t("a").entries[0].pipes == ["b"], "undo lays it again")
var e := _t("a").entries[0]
@ -275,7 +275,7 @@ func _test_pipes() -> void:
e.set_pipe_count("b", 4)
main.mark_dirty()
await _frames()
_check(_steps() == n0 + 1 and _label() == "Edit pipe Loot → Gems", "nudging a pipe's count twice is one step: %s" % _label())
_check(_steps() == n0 + 1 and _label() == "Edit thread Loot → Gems", "nudging a thread's count twice is one step: %s" % _label())
await create_timer(EditHistory.COALESCE_SECS + 0.1).timeout
e.set_pipe_save("b", "gem")
main.mark_dirty()
@ -394,7 +394,7 @@ func _test_template_and_reset() -> void:
_check(_label() == "Reset sample" and _t("a") == null, "Reset sample is a step: %s" % _label())
main.undo_redo.undo()
await _frames()
_check(_t("a") != null and _t("a").name == "Loot" and main.data.get_group("g1") != null, "undo brings the board back")
_check(_t("a") != null and _t("a").name == "Loot" and main.data.get_group("g1") != null, "undo brings the spread back")
func _test_pack() -> void:
@ -558,7 +558,7 @@ func _test_play_mode() -> void:
func _test_collections() -> void:
print("Per-collection history")
print("Per-spread history")
main.add_entry("a")
var first := main.data
var h := main.undo_redo.edits
@ -566,7 +566,7 @@ func _test_collections() -> void:
other.load_dict({"format_version": 2, "id": "other", "name": "Other", "tables": [
{"id": "x", "name": "X", "x": 0, "y": 0, "entries": [{"id": "e1", "text": "x"}]}]})
await main.collections._show_collection(other)
_check(main.undo_redo.edits != h and not main.undo_redo.edits.can_undo(), "another collection has its own, empty history")
_check(main.undo_redo.edits != h and not main.undo_redo.edits.can_undo(), "another spread has its own, empty history")
main.add_entry("x")
_check(main.undo_redo.edits.undo_label() == "Add result to X", "edits there go to its history")
await main.collections._show_collection(first)
@ -577,12 +577,12 @@ func _test_collections() -> void:
func _test_big_board() -> void:
print("Big board")
print("Big spread")
var d: Dictionary = {}
var path := ""
for a in OS.get_cmdline_user_args():
if a.begins_with("--big-board="):
path = a.trim_prefix("--big-board=")
if a.begins_with("--big-spread="):
path = a.trim_prefix("--big-spread=")
if path != "" and FileAccess.file_exists(path):
d = JSON.parse_string(FileAccess.get_file_as_string(path))
else:
@ -630,13 +630,13 @@ func _test_big_board() -> void:
var t5 := Time.get_ticks_usec()
main.undo_redo.undo()
var undo_del_ms := (Time.get_ticks_usec() - t5) / 1000.0
_check(_t(u.id) != null, "undoing a deletion on the big board brings the card back")
print(" TIMING %d cards: one committed edit %.1f ms (snapshot %.1f ms); keystroke %.2f ms, of which mark_dirty's existing refresh %.2f ms; undo of an edit %.1f ms (board update %.1f ms); undo of a deletion %.1f ms; board %d chars, later step %d bytes" % [
_check(_t(u.id) != null, "undoing a deletion on the big spread brings the card back")
print(" TIMING %d cards: one committed edit %.1f ms (snapshot %.1f ms); keystroke %.2f ms, of which mark_dirty's existing refresh %.2f ms; undo of an edit %.1f ms (spread update %.1f ms); undo of a deletion %.1f ms; spread %d chars, later step %d bytes" % [
n, commit_ms, cap_ms, key_ms, base_ms, undo_ms, undo_one_ms, undo_del_ms, full, step_bytes])
_check(commit_ms < 250.0, "committing one edit stays quick: %.1f ms" % commit_ms)
_check(key_ms - base_ms < 1.0, "a keystroke doesn't snapshot the board: %.2f ms over %.2f ms" % [key_ms, base_ms])
_check(key_ms - base_ms < 1.0, "a keystroke doesn't snapshot the spread: %.2f ms over %.2f ms" % [key_ms, base_ms])
_check(step_bytes < full / 10, "a later step stores only the changed cards: %d of %d" % [step_bytes, full])
_check(_t(t.id).name.ends_with("(edited)") and not _t(t.id).name.ends_with("x"), "undo works on the big board")
_check(_t(t.id).name.ends_with("(edited)") and not _t(t.id).name.ends_with("x"), "undo works on the big spread")
func _synthetic_board(n: int) -> Dictionary:

View file

@ -34,7 +34,7 @@ const TAROT := {
## The original green felt and copper look, kept as a second set.
const FELT := {
"id": "felt", "name": "Felt", "builtin": true,
"pattern": "dots", "logo": "none", "card_frame": "plain",
"pattern": "dots", "logo": "tower", "card_frame": "plain",
"font_body": "atkinson", "font_display": "rokkitt",
"background": {"kind": "radial", "colors": ["#2a5c47", "#1f4a39"], "center": [0.35, 0.3]},
"panel": {"kind": "solid", "colors": ["#12301f"]},

View file

@ -115,7 +115,7 @@ func _build_pick() -> void:
var row := _option_row(k, o)
list.add_child(row)
_options.append(row)
var hint := note("Press 1–%d to choose, R for Random, M to look at the board, Esc to cancel." % mini(9, maxi(1, opts.size())))
var hint := note("Press 1–%d to choose, R for Random, M to look at the spread, Esc to cancel." % mini(9, maxi(1, opts.size())))
hint.add_theme_font_size_override("font_size", 13)
body.add_child(hint)
add_button("Cancel", "plain", func() -> void: answer(null))
@ -431,7 +431,7 @@ func _build_chrome() -> void:
add_child(preview_panel)
var min_btn := add_button("Minimize", "plain", minimize)
min_btn.tooltip_text = "Hide this question to look at the board (M or Tab)"
min_btn.tooltip_text = "Hide this question to look at the spread (M or Tab)"
footer.move_child(min_btn, 0)
var spacer := Control.new()
spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
@ -629,7 +629,7 @@ func preview_for_option(k: int) -> Control:
box.add_child(_rule())
var how := Describe.pipe(e, tid, board) if plain else PipeLayer._pipe_tag(e, tid)
if how != "":
var hl := Style.make_label(("Then: " if plain else "pipe: ") + how, Style.body_bold(), 12, Style.TRIM_DARK)
var hl := Style.make_label(("Then: " if plain else "thread: ") + how, Style.body_bold(), 12, Style.TRIM_DARK)
hl.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
hl.mouse_filter = Control.MOUSE_FILTER_IGNORE
hl.set_meta("pipe_line", true)

View file

@ -30,7 +30,7 @@ func setup(p_main: Main) -> void:
func refresh() -> void:
var n := main.data.name if main.data.name != "" else "Untitled"
text = "%s ▾" % (n if n.length() <= MAX_LABEL else n.substr(0, MAX_LABEL - 1) + "…")
tooltip_text = "Collection: %s" % n
tooltip_text = "Spread: %s" % n
func _fill() -> void:
@ -49,7 +49,7 @@ func _fill() -> void:
pm.set_item_disabled(0, true)
_ids.append(main.data.id)
pm.add_separator()
pm.add_item("New collection…", ID_NEW)
pm.add_item("New spread…", ID_NEW)
pm.add_item("Rename…", ID_RENAME)
pm.add_item("Duplicate", ID_DUPLICATE)
pm.add_item("Delete…", ID_DELETE)

View file

@ -250,7 +250,7 @@ func show_meta(owner: Control, meta: String) -> void:
"missing":
show_for(owner, "Missing table", "There's no table called [b]%s[/b]. Check the spelling, or add a table with that name." % RichText.plain(arg))
"unset":
show_for(owner, "{%s} isn't set" % arg, "Nothing has saved this variable yet. Save it earlier in the roll with [lb][lb]Table -> %s]] or a pipe's [i]Save as[/i]." % RichText.plain(arg))
show_for(owner, "{%s} isn't set" % arg, "Nothing has saved this variable yet. Save it earlier in the roll with [lb][lb]Table -> %s]] or a thread's [i]Save as[/i]." % RichText.plain(arg))
"deep":
show_for(owner, "Chain too deep", "The roll stopped after %d levels so a loop can't run forever." % Roller.MAX_DEPTH)
"error":
@ -277,7 +277,7 @@ func _show_var(owner: Control, name: String) -> void:
source = str(v.get("source", ""))
else:
value = (main.current.get("chain_vars", {}) as Dictionary).get(name)
var sub := "Saved for this collection" if persistent else "Saved for this roll"
var sub := "Saved for this spread" if persistent else "Saved for this roll"
var st := main.data.get_table(source) if source != "" else null
if st:
sub += " · from %s" % Formatter.strip_tags(st.name)
@ -292,7 +292,7 @@ func table_summary(t: RollTable) -> String:
var sub := "Choice · " + Describe.choice_label(t.choice).to_lower()
return sub + " · %d options" % t.entries.size() if t.choice == "pick" else sub
RollTable.KIND_LOOP:
return "Loop · " + RulesView.loop_rule(t, main.data, RulesView.plain(main))
return "Repeat · " + RulesView.loop_rule(t, main.data, RulesView.plain(main))
RollTable.KIND_VARIABLE:
if RulesView.plain(main):
return "Collection · kept between rolls" if t.is_collection() else "%s · kept between rolls" % t.var_type.capitalize()
@ -302,7 +302,7 @@ func table_summary(t: RollTable) -> String:
RollTable.KIND_SHEET:
return "Sheet"
RollTable.KIND_ROUTER:
return "Router · %d cases · the first true case is taken" % t.entries.size()
return "Branch · %d cases · the first true case is taken" % t.entries.size()
var dl := t.dice_label()
if t.clamps():
dl = RulesView.roll_line(t, main.data, RulesView.plain(main))

View file

@ -492,11 +492,11 @@ static func _table_label(ta: Dictionary, tb: Dictionary, b: Dictionary) -> Strin
return "Delete result “%s” from %s" % [_short(Formatter.strip_tags(str(e["removed"][0].get("text", "")))), tname]
return "Delete %d results from %s" % [e["removed"].size(), tname]
if not e["pipes_added"].is_empty():
return "Add pipe %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_added"][0])]
return "Add thread %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_added"][0])]
if not e["pipes_removed"].is_empty():
return "Delete pipe %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_removed"][0])]
return "Delete thread %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_removed"][0])]
if not e["pipes_changed"].is_empty():
return "Edit pipe %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_changed"][0])]
return "Edit thread %s → %s" % [tname, _name(b, "ids", "tables", e["pipes_changed"][0])]
if ta.get("name") != tb.get("name"):
var rest_a := ta.duplicate()
var rest_b := tb.duplicate()

View file

@ -9,7 +9,7 @@ var m: Main
func setup(p_main: Main) -> void:
m = p_main
Style.menu_button("Help ▾", false, self)
tooltip_text = "How to use TableTower (F1)"
tooltip_text = "How to use Table Tarot (F1)"
var pm := get_popup()
ModalCard.style_popup(pm)
var titles := HelpDialog.titles()

View file

@ -461,8 +461,8 @@ func _refresh_title() -> void:
func _empty() -> void:
_content.add_child(_head("Inspector", "Nothing selected"))
_content.add_child(InspectorKit.note("Select a card, a result or a pipe to edit it.", Style.MUTED, 15))
_content.add_child(InspectorKit.note("Click a card's title for the card, a result's text for the result, or a pipe on the felt for its options.", Style.MUTED, 13))
_content.add_child(InspectorKit.note("Select a card, a result or a thread to edit it.", Style.MUTED, 15))
_content.add_child(InspectorKit.note("Click a card's title for the card, a result's text for the result, or a thread on the felt for its options.", Style.MUTED, 13))
static func _title_of(s: String, fallback: String) -> String:
@ -512,7 +512,7 @@ func _result_section(t: RollTable, e: TableEntry) -> void:
var go := InspectorKit.vbox(8)
if e.pipes.is_empty():
go.add_child(InspectorKit.note("No pipes yet. Drag from the ● at the end of this result to a card.", Style.MUTED, 14))
go.add_child(InspectorKit.note("No threads yet. Drag from the ● at the end of this result to a card.", Style.MUTED, 14))
for p in e.pipes:
go.add_child(_pipe_box(t, e, p))
_content.add_child(InspectorKit.field("Then go to", go))
@ -524,8 +524,8 @@ func _pipe_section(t: RollTable, e: TableEntry, to: String) -> void:
_result_section(t, e)
return
var target := main.data.get_table(to)
_content.add_child(_head("Selected pipe", "%s → %s" % [_title_of(e.text, "(no text)"), _title_of(target.name, to) if target else to]))
var back := InspectorKit.link("Edit the whole result", "Show the result this pipe leaves from")
_content.add_child(_head("Selected thread", "%s → %s" % [_title_of(e.text, "(no text)"), _title_of(target.name, to) if target else to]))
var back := InspectorKit.link("Edit the whole result", "Show the result this thread leaves from")
back.add_theme_color_override("font_color", Style.MUTED)
back.pressed.connect(func() -> void: select({"kind": "result", "tid": t.id, "eid": e.id}))
_content.add_child(back)
@ -620,7 +620,7 @@ func _pipe_box(t: RollTable, e: TableEntry, to: String) -> Control:
when_box.add_child(cond)
v.add_child(when_box)
var other := InspectorKit.check_box("Otherwise", e.is_otherwise(to))
other.tooltip_text = "Runs only when none of this result's \"Only if\" pipes is true"
other.tooltip_text = "Runs only when none of this result's \"Only if\" threads is true"
other.toggled.connect(func(on: bool) -> void: set_pipe_otherwise(to, on))
parts["otherwise"] = other
v.add_child(other)
@ -629,7 +629,7 @@ func _pipe_box(t: RollTable, e: TableEntry, to: String) -> Control:
var cr := InspectorKit.flow()
cr.add_child(InspectorKit.word("Rolls"))
var count := InspectorKit.amount(e.count_text(to), "1")
count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the pipe runs)"
count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the thread runs)"
InspectorKit.tag(count, "pipe.%s.count" % to)
var cerr := InspectorKit.error_label()
count.text_changed.connect(func(s: String) -> void:
@ -658,7 +658,7 @@ func _pipe_box(t: RollTable, e: TableEntry, to: String) -> Control:
v.add_child(sr)
v.add_child(cerr)
var rm := InspectorKit.link("Delete pipe", "Delete this pipe")
var rm := InspectorKit.link("Delete thread", "Delete this thread")
rm.add_theme_color_override("font_color", Style.DANGER_INK)
rm.add_theme_color_override("font_hover_color", Style.DANGER_INK)
rm.pressed.connect(func() -> void: remove_pipe(to))
@ -678,8 +678,8 @@ func _refresh_otherwise(to: String) -> void:
var has_when := e.when_for(to) != ""
cb.disabled = has_when
cb.set_pressed_no_signal(e.is_otherwise(to))
cb.tooltip_text = "Turn off \"Only if\" first: a pipe with a condition isn't an otherwise pipe" if has_when \
else "Runs only when none of this result's \"Only if\" pipes is true"
cb.tooltip_text = "Turn off \"Only if\" first: a thread with a condition isn't an otherwise thread" if has_when \
else "Runs only when none of this result's \"Only if\" threads is true"
static func _chip(text: String, fg: Color, bg: Color) -> Control:

View file

@ -57,7 +57,7 @@ static func build(insp: Inspector, box: VBoxContainer, t: RollTable) -> void:
if t.kind != RollTable.KIND_VARIABLE:
box.add_child(_inputs(insp, t))
var more := InspectorKit.link("More settings…", "Card mode, colours and the other settings")
var more := InspectorKit.link("More settings…", "Deck mode, colours and the other settings")
more.pressed.connect(func() -> void: insp.main.open_table_settings(t.id))
box.add_child(more)
@ -67,7 +67,7 @@ static func build(insp: Inspector, box: VBoxContainer, t: RollTable) -> void:
static func _inputs(insp: Inspector, t: RollTable) -> Control:
var v := InspectorKit.vbox(5)
v.add_child(InspectorKit.flabel("Inputs"))
v.add_child(InspectorKit.note("Values a pipe into this card can pass, like a Tier. Each one has a starting value.", Style.MUTED, 13))
v.add_child(InspectorKit.note("Values a thread into this card can pass, like a Tier. Each one has a starting value.", Style.MUTED, 13))
var rows: Array = []
for inp: Dictionary in t.inputs:
rows.append(inp.duplicate())
@ -174,7 +174,7 @@ static func _check(insp: Inspector, box: VBoxContainer, t: RollTable, plain: boo
r3.add_child(cmp)
box.add_child(InspectorKit.field("Target", r3))
box.add_child(errs)
box.add_child(InspectorKit.note("Success and Failure are the card's two results; select one to give it changes and pipes.", Style.MUTED, 13))
box.add_child(InspectorKit.note("Success and Failure are the card's two results; select one to give it changes and threads.", Style.MUTED, 13))
refresh.call()
@ -524,7 +524,7 @@ static func _collection(insp: Inspector, box: VBoxContainer, t: RollTable) -> vo
var add := InspectorKit.link("+ Add member")
add.pressed.connect(func() -> void: add_member(insp, t))
v.add_child(add)
v.add_child(InspectorKit.note("Members are saved values of this board, like the Variables panel shows; they aren't part of undo.", Style.MUTED, 12))
v.add_child(InspectorKit.note("Members are saved values of this spread, like the Variables panel shows; they aren't part of undo.", Style.MUTED, 12))
box.add_child(InspectorKit.field("Members", v))
box.add_child(err)

View file

@ -11,7 +11,7 @@ const ID_EXPORT := 100
## Export formats: label, file extension, FileDialog filter.
const EXPORTS := [
{"key": "json", "label": "TableTower JSON", "ext": "json", "filter": "*.json ; TableTower JSON"},
{"key": "json", "label": "Table Tarot JSON", "ext": "json", "filter": "*.json ; Table Tarot JSON"},
{"key": "canvas", "label": "JSON Canvas", "ext": "canvas", "filter": "*.canvas ; JSON Canvas"},
{"key": "mermaid", "label": "Mermaid diagram (.mmd)", "ext": "mmd", "filter": "*.mmd ; Mermaid"},
{"key": "mermaid_md", "label": "Mermaid in Markdown (.md)", "ext": "md", "filter": "*.md ; Markdown"},
@ -20,8 +20,8 @@ const EXPORTS := [
]
const IMPORT_FILTERS: Array[String] = [
"*.json, *.canvas, *.graphml, *.xml ; TableTower, JSON Canvas or GraphML",
"*.json ; TableTower JSON",
"*.json, *.canvas, *.graphml, *.xml ; Table Tarot, JSON Canvas or GraphML",
"*.json ; Table Tarot JSON",
"*.canvas ; JSON Canvas",
"*.graphml, *.xml ; GraphML",
]
@ -34,19 +34,19 @@ signal pack_requested
func setup(can_reset: bool, can_import: bool) -> void:
Style.menu_button("Board ▾", false, self)
tooltip_text = "Test, arrange, import and export the board"
Style.menu_button("Spread ▾", false, self)
tooltip_text = "Test, arrange, import and export the spread"
var pm := get_popup()
ModalCard.style_popup(pm)
pm.add_item("Test board…", ID_TEST)
pm.add_item("Test spread…", ID_TEST)
pm.add_item("Reset sample", ID_RESET)
pm.add_separator("Arrange")
pm.add_item("Pack collapsed groups", ID_PACK)
pm.set_item_tooltip(pm.get_item_index(ID_PACK), "Move collapsed groups and the cards between them together, closing the gaps, in reading order")
pm.add_separator("Import")
pm.add_item("Import as new collection…", ID_IMPORT)
pm.add_item("Import as new spread…", ID_IMPORT)
pm.set_item_disabled(pm.get_item_index(ID_IMPORT), not can_import)
pm.add_separator("Export this collection")
pm.add_separator("Export this spread")
for i in EXPORTS.size():
pm.add_item("Export as " + str(EXPORTS[i]["label"]) + "…", ID_EXPORT + i)
pm.id_pressed.connect(func(id: int) -> void:
@ -128,10 +128,10 @@ static func import_as_collection(library: LibraryStore, text: String, file_name:
if b.name.strip_edges() == "":
b.name = file_name.get_file().get_basename()
if b.name.strip_edges() == "":
b.name = "Imported collection"
b.name = "Imported spread"
b.id = library.unique_id(LibraryStore.slugify(b.name))
if not library.save(b):
(out["errors"] as Array).append("Couldn't save the imported collection.")
(out["errors"] as Array).append("Couldn't save the imported spread.")
return out
out["ok"] = true
out["board"] = b

View file

@ -17,7 +17,7 @@ const HISTORY_SIZE := 6
const SAVE_DELAY := 0.6
const HINTS := {
Mode.PLAY: "Click a die to roll. Shift-click skips straight to the result.",
Mode.BUILD: "Click a card, a result or a pipe to edit it in the inspector. Drag from a ● to another card to lay a pipe.",
Mode.BUILD: "Click a card, a result or a thread to edit it in the inspector. Drag from a ● to another card to lay a thread.",
}
var data: TowerBoard
@ -90,6 +90,9 @@ func _init() -> void:
func _ready() -> void:
rng.randomize()
# The project keeps its old internal name so the user:// folder (saved
# spreads) doesn't move; the window shows the app's name.
get_window().title = "Table Tarot"
var args := OS.get_cmdline_user_args()
if args.has("--sample") or MainCli._arg_value(args, "--screenshot") != "":
_saving_enabled = false

View file

@ -51,7 +51,7 @@ func switch_collection(id: String) -> void:
m._save_timer.stop()
var b := CollectionSwitcher.switch_collection(m.library, m.data, id)
if b == null:
m.toast("Couldn't open that collection")
m.toast("Couldn't open that spread")
return
_show_collection(b)
@ -85,7 +85,7 @@ func _show_collection(b: TowerBoard) -> void:
func new_collection() -> void:
if not collections_enabled():
return
m._add_modal(ModalCard.ask_text("New collection", "Name", "", "Create", func(n: String) -> void:
m._add_modal(ModalCard.ask_text("New spread", "Name", "", "Create", func(n: String) -> void:
_show_collection(CollectionSwitcher.create_collection(m.library, m.data, n))
m.toast("Created “%s”" % m.data.name)
))
@ -94,7 +94,7 @@ func new_collection() -> void:
func rename_collection() -> void:
if not collections_enabled():
return
m._add_modal(ModalCard.ask_text("Rename collection", "Name", m.data.name, "Rename", func(n: String) -> void:
m._add_modal(ModalCard.ask_text("Rename spread", "Name", m.data.name, "Rename", func(n: String) -> void:
if CollectionSwitcher.rename_collection(m.library, m.data, n):
m.top_bar._switcher.refresh()
))
@ -105,7 +105,7 @@ func duplicate_collection() -> void:
return
var copy := CollectionSwitcher.duplicate_collection(m.library, m.data, m.data.name + " copy")
if copy == null:
m.toast("Couldn't duplicate the collection")
m.toast("Couldn't duplicate the spread")
return
_show_collection(copy)
m.toast("Duplicated as “%s”" % copy.name)
@ -115,7 +115,7 @@ func delete_collection() -> void:
if not collections_enabled():
return
var msg := "Delete “%s” and its saved decks, variables and history? This can't be undone." % m.data.name
m._add_modal(ModalCard.confirm("Delete collection", msg, "Delete", func() -> void:
m._add_modal(ModalCard.confirm("Delete spread", msg, "Delete", func() -> void:
var gone := m.data.name
var gone_id := m.data.id
var next := CollectionSwitcher.delete_collection(m.library, m.data)
@ -136,7 +136,7 @@ func export_collection(format: Dictionary) -> void:
func import_collection() -> void:
if not collections_enabled():
return
m.file_dialog("Import as a new collection", IoMenu.IMPORT_FILTERS, FileDialog.FILE_MODE_OPEN_FILE, _import_file)
m.file_dialog("Import as a new spread", IoMenu.IMPORT_FILTERS, FileDialog.FILE_MODE_OPEN_FILE, _import_file)
func _import_file(path: String) -> void:
@ -153,7 +153,7 @@ func _import_file(path: String) -> void:
m._add_modal(IoMenu.report_dialog(
"Imported “%s”" % r["board"].name if r["ok"] else "Couldn't import %s" % path.get_file(), r))
elif r["ok"]:
m.toast("Imported “%s” as a new collection" % r["board"].name)
m.toast("Imported “%s” as a new spread" % r["board"].name)
# ----- Test board -----

View file

@ -18,8 +18,8 @@ const ADD_KINDS := [
["Choice: which option", RollTable.KIND_CHOICE, "pick", "New choice"],
["Choice: how many", RollTable.KIND_CHOICE, "number", "How many?"],
["Choice: open ended", RollTable.KIND_CHOICE, "text", "What is it?"],
["Loop", RollTable.KIND_LOOP, "times", "Repeat"],
["Router: if / else if / otherwise", RollTable.KIND_ROUTER, "", "Router"],
["Repeat", RollTable.KIND_LOOP, "times", "Repeat"],
["Branch: if / else if / otherwise", RollTable.KIND_ROUTER, "", "Branch"],
["Variable", RollTable.KIND_VARIABLE, "number", "New variable"],
["Collection (Skills, Contacts…)", RollTable.KIND_VARIABLE, RollTable.VAR_COLLECTION, "Skills"],
["Sheet", RollTable.KIND_SHEET, "", "Sheet"],
@ -147,7 +147,7 @@ func reset_sample() -> void:
await m.get_tree().process_frame
await m.get_tree().process_frame
m.board.fit()
m.toast("Board reset to the sample tables", true)
m.toast("Spread reset to the sample tables", true)
func add_entry(tid: String) -> void:
@ -221,7 +221,7 @@ func remove_pipe(key: String) -> void:
if card:
card.rebuild()
m.undo_redo._end_edit()
m.toast("Deleted pipe from “%s” to %s" % [e.text, target.name if target else to], true)
m.toast("Deleted thread from “%s” to %s" % [e.text, target.name if target else to], true)
func start_link(tid: String, eid: String) -> void:
@ -252,7 +252,7 @@ func finish_link() -> void:
if e == null or e.pipes.has(over.table.id):
return
if over.table.kind == RollTable.KIND_VARIABLE:
m.toast("Variable cards aren't rolled, so pipes can't lead into them. Use a change such as @%s += 1." % over.table.var_name)
m.toast("Variable cards aren't rolled, so threads can't lead into them. Use a change such as @%s += 1." % over.table.var_name)
return
m.undo_redo._begin_edit()
# A result may pipe into several cards (fan-out); a new pipe adds to the others.

View file

@ -213,7 +213,7 @@ func confirm_delete_group(gid: String) -> void:
return
var n := g.members.size()
m._add_modal(ModalCard.confirm("Delete group",
"Delete “%s” and the %d %s in it? Pipes from other cards into them are removed too. You can undo this from the message that follows." % [Formatter.strip_tags(g.name), n, "card" if n == 1 else "cards"],
"Delete “%s” and the %d %s in it? Threads from other cards into them are removed too. You can undo this from the message that follows." % [Formatter.strip_tags(g.name), n, "card" if n == 1 else "cards"],
"Delete group and cards", func() -> void: delete_group(gid), true))

View file

@ -250,7 +250,7 @@ func pack_collapsed_groups() -> int:
m.toast("Already packed")
return 0
m.undo_redo._end_edit("Pack collapsed groups")
m.toast("Packed the board: moved %d %s" % [moved, "block" if moved == 1 else "blocks"], true)
m.toast("Packed the spread: moved %d %s" % [moved, "block" if moved == 1 else "blocks"], true)
await m.get_tree().process_frame
await m.get_tree().process_frame
m.board.fit()

View file

@ -4,7 +4,7 @@ extends RefCounted
## Saved in user://templates (TemplateLibrary), shared by every collection.
## --sample runs keep them in memory only.
const TEMPLATE_FILTER := "*.json ; TableTower template"
const TEMPLATE_FILTER := "*.json ; Table Tarot template"
var m: Main
@ -106,7 +106,7 @@ func insert_template(tpl: Dictionary, values: Dictionary) -> Dictionary:
else:
m.toast(msg + " · %d left out" % dropped.size(), true)
var d := ModalCard.new("Inserted “%s”" % str(tpl.get("name", "template")), 540.0)
d.body.add_child(ModalCard.note("These pipes led to cards outside the template, and this collection has no card with that name, so they were left out. Lay them again by hand, or rename a card and insert again.", Style.INK))
d.body.add_child(ModalCard.note("These threads led to cards outside the template, and this spread has no card with that name, so they were left out. Lay them again by hand, or rename a card and insert again.", Style.INK))
d.body.add_child(ModalCard.section("Left out (%d)" % dropped.size()))
for what: String in dropped:
d.body.add_child(ModalCard.note("• " + what, Style.INK))

View file

@ -30,6 +30,28 @@ func _init(p_main: Main) -> void:
m = p_main
## The theme's logo (Style.LOGO): the fortune-teller mascot, the old tower
## mark, or none.
func _logo() -> Control:
match Style.LOGO:
"fortune_teller":
var tr := TextureRect.new()
tr.texture = preload("res://assets/art/fortune_teller_logo.svg")
tr.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
tr.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
tr.texture_filter = CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS
tr.custom_minimum_size = Vector2(46, 46)
tr.size_flags_vertical = Control.SIZE_SHRINK_CENTER
return tr
"tower":
var mark := Control.new()
mark.custom_minimum_size = Vector2(20, 24)
mark.size_flags_vertical = Control.SIZE_SHRINK_CENTER
mark.draw.connect(func() -> void: Icons.draw_tower(mark, Vector2(0, 0), 20.0 / 22.0, Style.ON_BG, Style.ACCENT))
return mark
return null
func _build_top_bar() -> Control:
var bar := PanelContainer.new()
bar.add_theme_stylebox_override("panel", Style.panel_box([16, 10, 16, 10]))
@ -39,12 +61,10 @@ func _build_top_bar() -> Control:
var brand := HBoxContainer.new()
brand.add_theme_constant_override("separation", 9)
var mark := Control.new()
mark.custom_minimum_size = Vector2(20, 24)
mark.size_flags_vertical = Control.SIZE_SHRINK_CENTER
mark.draw.connect(func() -> void: Icons.draw_tower(mark, Vector2(0, 0), 20.0 / 22.0, Style.ON_BG, Style.ACCENT))
brand.add_child(mark)
var title := Style.make_label("TableTower", Style.display(), 23, Style.ON_BG)
var mark := _logo()
if mark:
brand.add_child(mark)
var title := Style.make_label("Table Tarot", Style.display(), 23, Style.ON_BG)
title.size_flags_vertical = Control.SIZE_SHRINK_CENTER
brand.add_child(title)
h.add_child(brand)

View file

@ -64,7 +64,7 @@ func setup(p_main: Main) -> void:
_count.custom_minimum_size = Vector2(64, 0)
_count.alignment = HORIZONTAL_ALIGNMENT_CENTER
_count.max_length = 60
_count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the pipe runs)"
_count.tooltip_text = "A number, or an expression such as @terms, answer or 1d3 (worked out when the thread runs)"
_count.add_theme_stylebox_override("normal", field_ok)
_count.add_theme_stylebox_override("focus", field_focus)
_count.text_changed.connect(func(s: String) -> void:
@ -98,7 +98,7 @@ func setup(p_main: Main) -> void:
_when.placeholder_text = "always (or e.g. @str >= 8)"
_when.size_flags_horizontal = Control.SIZE_EXPAND_FILL
_when.max_length = 200
_when.tooltip_text = "The pipe runs only when this is true. Every condition on the result is checked once, before any of its pipes run."
_when.tooltip_text = "The thread runs only when this is true. Every condition on the result is checked once, before any of its threads run."
_when.add_theme_stylebox_override("normal", field_ok)
_when.add_theme_stylebox_override("focus", field_focus)
_when.text_changed.connect(func(_s: String) -> void: _check_when())
@ -121,7 +121,7 @@ func setup(p_main: Main) -> void:
other_row.add_child(pad)
_otherwise = CheckBox.new()
_otherwise.text = "Otherwise"
_otherwise.tooltip_text = "Runs only when none of this result's \"Only if\" pipes is true"
_otherwise.tooltip_text = "Runs only when none of this result's \"Only if\" threads is true"
_otherwise.add_theme_font_override("font", Style.body())
_otherwise.add_theme_font_size_override("font_size", 14)
_otherwise.add_theme_color_override("font_color", Style.INK)
@ -162,7 +162,7 @@ func setup(p_main: Main) -> void:
v.add_child(hint)
var remove := Button.new()
remove.text = "Delete pipe"
remove.text = "Delete thread"
remove.add_theme_font_size_override("font_size", 14)
var rn := Style.bordered(Style.box(Color(0, 0, 0, 0), 6, [10, 4, 10, 4]), 1, Style.DASH)
var rh := Style.bordered(Style.box(Style.WARN_BG, 6, [10, 4, 10, 4]), 1, Style.DANGER_INK)

View file

@ -158,7 +158,7 @@ func setup(p_main: Main) -> void:
_tab_earlier.pressed.connect(func() -> void: set_side(Side.EARLIER))
tabs.add_child(_tab_earlier)
_tab_vars = _tab("VARIABLES")
_tab_vars.tooltip_text = "Saved variables for this collection"
_tab_vars.tooltip_text = "Saved variables for this spread"
_tab_vars.pressed.connect(func() -> void: set_side(Side.VARIABLES))
tabs.add_child(_tab_vars)

View file

@ -172,7 +172,7 @@ func build() -> void:
box.add_child(pbox)
RollTable.KIND_ROUTER:
box.add_child(ModalCard.section("Cases (if / else if / otherwise)"))
box.add_child(ModalCard.note("Checked top to bottom when the chain arrives; the first true case is chosen, and its effects, text and pipes run like a rolled result. An empty condition is Otherwise: it always matches, so keep it last. Add, remove and reorder cases on the card."))
box.add_child(ModalCard.note("Checked top to bottom when the chain arrives; the first true case is chosen, and its effects, text and threads run like a rolled result. An empty condition is Otherwise: it always matches, so keep it last. Add, remove and reorder cases on the card."))
for i in table.entries.size():
var e := table.entries[i]
var le := LineEdit.new()
@ -184,7 +184,7 @@ func build() -> void:
var label := Formatter.strip_tags(e.text).strip_edges()
box.add_child(ModalCard.field("Case %d%s" % [i + 1, (" · " + label) if label != "" else ""], le))
if table.entries.is_empty():
box.add_child(ModalCard.note("This router has no cases yet: add some on the card."))
box.add_child(ModalCard.note("This branch has no cases yet: add some on the card."))
_case_note = ModalCard.note("", Style.WARN_INK)
box.add_child(_case_note)
_:
@ -255,7 +255,7 @@ func refresh() -> void:
_minmax_row.visible = _choice == "number"
var msg := ""
if _choice != table.choice and table.choice == "pick":
msg = "Only the first option is kept, as the Answer result (its changes and pipes stay)."
msg = "Only the first option is kept, as the Answer result (its changes and threads stay)."
elif _choice != table.choice and _choice == "pick":
msg = "The Answer result becomes the first option; two more are added."
elif _choice == "pick" and _options_mode == "vars" and table.is_dynamic():
@ -265,7 +265,7 @@ func refresh() -> void:
elif _choice == "pick":
msg = "The player picks one of the card's options, or Random."
else:
msg = "The answer goes in {answer}; the Answer result's changes and pipes run after it."
msg = "The answer goes in {answer}; the Answer result's changes and threads run after it."
_choice_note.text = msg
_mark(_save_as, s["save_as"] == "" or TableSettingsRules._re(TableSettingsRules.SAVE_PATTERN).search(TemplateKit.probe(s["save_as"])) != null)
var pick := _choice == "pick"

View file

@ -35,7 +35,7 @@ func text_edit(e: TableEntry, index: int, chosen: bool) -> LineEdit:
var loop_rows := TableCardRows.LOOP_ROWS
if table.kind == RollTable.KIND_LOOP:
edit.placeholder_text = loop_rows[clampi(index, 0, 1)]
edit.tooltip_text = "%s: shown each pass ({i} is the pass number)" % loop_rows[0] if index == 0 else "%s: runs once when the loop ends" % loop_rows[1]
edit.tooltip_text = "%s: shown each pass ({i} is the pass number)" % loop_rows[0] if index == 0 else "%s: runs once when the repeat ends" % loop_rows[1]
elif table.kind == RollTable.KIND_ROUTER:
edit.placeholder_text = "Result text"
edit.text_changed.connect(func(s: String) -> void:

View file

@ -258,14 +258,14 @@ func _make_kind_header(_build: bool) -> Control:
RollTable.KIND_ROUTER:
if not _build:
return null
var rl := Style.make_label("Router · the first true case is chosen", Style.body(true), 12, Style.MUTED)
var rl := Style.make_label("Branch · the first true case is chosen", Style.body(true), 12, Style.MUTED)
rl.mouse_filter = Control.MOUSE_FILTER_IGNORE
rl.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
return rl
RollTable.KIND_VARIABLE:
var txt := "@%s · %s" % [table.var_name, table.var_type]
if table.is_collection():
txt = "Collection · kept between rolls" if plain else "@%s_* (board values)" % table.var_name
txt = "Collection · kept between rolls" if plain else "@%s_* (spread values)" % table.var_name
elif plain:
txt = "%s · kept between rolls" % table.var_type.capitalize()
var l := Style.make_label(txt, Style.body(true), 12, Style.MUTED)
@ -313,7 +313,7 @@ func make_inputs_box() -> Control:
var p := PanelContainer.new()
p.mouse_filter = Control.MOUSE_FILTER_PASS
p.add_theme_stylebox_override("panel", DashedBox.new())
p.tooltip_text = "Values a pipe into this card can pass (\"with\"); a roll that starts here uses the starting values"
p.tooltip_text = "Values a thread into this card can pass (\"with\"); a roll that starts here uses the starting values"
wrap.add_child(p)
var v := TableCard.vbox(2)
p.add_child(v)

View file

@ -117,7 +117,7 @@ func make_row(e: TableEntry, index: int, build: bool, ranged: bool, numw: float)
al.size_flags_horizontal = Control.SIZE_EXPAND_FILL
al.size_flags_vertical = Control.SIZE_SHRINK_CENTER
al.mouse_filter = Control.MOUSE_FILTER_PASS
al.tooltip_text = "Its effects and pipes run after the player answers ({answer} holds the answer)"
al.tooltip_text = "Its effects and threads run after the player answers ({answer} holds the answer)"
col.add_child(al)
else:
if chosen:
@ -336,7 +336,7 @@ func make_sheet_row(e: TableEntry, build: bool) -> Control:
var tools := TableCard.vbox(2)
if e.effects.strip_edges() != "":
tools.add_child(_effects_chip(e))
var pv := Style.make_label("Preview on the board in Play", Style.body_italic(true), 12, Style.MUTED)
var pv := Style.make_label("Preview on the spread in Play", Style.body_italic(true), 12, Style.MUTED)
pv.size_flags_vertical = Control.SIZE_SHRINK_CENTER
tools.add_child(pv)
v.add_child(tools)

View file

@ -89,13 +89,13 @@ static func kind_line(t: RollTable) -> String:
RollTable.KIND_CHOICE:
return "Choice card · " + Describe.choice_label(t.choice).to_lower()
RollTable.KIND_LOOP:
return "Loop card"
return "Repeat card"
RollTable.KIND_VARIABLE:
return "Collection card" if t.is_collection() else "Variable card"
RollTable.KIND_SHEET:
return "Sheet card"
RollTable.KIND_ROUTER:
return "Router · if / else if / otherwise"
return "Branch · if / else if / otherwise"
RollTable.KIND_CHECK:
return "Check card · " + t.check_dice.strip_edges()
var s := "Roll table · " + t.dice_label()

View file

@ -157,7 +157,7 @@ func _build() -> void:
var card_box := VBoxContainer.new()
card_box.add_theme_constant_override("separation", 6)
card_box.add_child(section("Card mode"))
card_box.add_child(section("Deck mode"))
card_box.add_child(segmented(["Off", "On"], 1 if _card_mode else 0, func(i: int) -> void:
_card_mode = i == 1
_refresh()
@ -273,7 +273,7 @@ func _refresh() -> void:
if _ranged and not table.is_ranged():
msgs.append("Each entry gets a range sized by its weight; adjust them on the card.")
if _ranged and TableSettingsRules.extra_pipe_count(table) > 0:
msgs.append("A range takes one pipe, so extra pipes on a result will be dropped.")
msgs.append("A range takes one thread, so extra threads on a result will be dropped.")
if not _ranged and table.is_ranged():
msgs.append("Ranges are removed; results become plain picks.")
_type_note.text = " ".join(msgs)

View file

@ -41,9 +41,9 @@ static func kind_problems(t: RollTable, s: Dictionary) -> PackedStringArray:
RollTable.KIND_LOOP:
var src := TemplateKit.probe(str(s.get("loop_expr", t.loop_expr)).strip_edges())
if src == "":
out.append("The loop needs a count or a condition.")
out.append("The repeat needs a count or a condition.")
elif Expr.check(src) != "":
out.append("Loop rule: " + Expr.check(src))
out.append("Repeat rule: " + Expr.check(src))
RollTable.KIND_ROUTER:
var cases: Array = s.get("cases", [])
for i in cases.size():

View file

@ -41,7 +41,7 @@ static func save_dialog(tpl: Dictionary, on_save: Callable) -> ModalCard:
if p is Dictionary and bool((p as Dictionary).get("outside", false)):
outside += 1
if outside > 0:
d.body.add_child(ModalCard.note("%d %s to cards outside the template. When it's inserted they relink to a card with the same name, if there is one." % [outside, "pipe leads" if outside == 1 else "pipes lead"]))
d.body.add_child(ModalCard.note("%d %s to cards outside the template. When it's inserted they relink to a card with the same name, if there is one." % [outside, "thread leads" if outside == 1 else "threads lead"]))
d.body.add_child(ModalCard.section("Parameters"))
var rows: Array = []

View file

@ -188,7 +188,7 @@ func _rename(id: String, old: String) -> void:
func _delete(id: String, tname: String) -> void:
main._add_modal(ModalCard.confirm("Delete template", "Delete the template “%s”? Cards already inserted from it stay on their boards." % tname,
main._add_modal(ModalCard.confirm("Delete template", "Delete the template “%s”? Cards already inserted from it stay on their spreads." % tname,
"Delete", func() -> void:
if lib.delete(id):
refresh()

View file

@ -41,7 +41,7 @@ var _report_text := ""
## `p_main` is the Main node (it has `data`, `card_for()`, `board` and, when
## present, `focus_table()`).
func _init(p_main: Node = null) -> void:
super._init("Test board", 640.0)
super._init("Test spread", 640.0)
main = p_main
board = p_main.get("data") if p_main != null else null
_build()
@ -242,7 +242,7 @@ func _show_report(report: Dictionary, problems: Array) -> void:
var items: Array = []
for p: Dictionary in problems:
items.append({"table_id": p["table_id"], "entry_id": p["entry_id"],
"text": "%s%s: %s" % [_table_label(p["table_id"]) if board.get_table(p["table_id"]) != null else "Board",
"text": "%s%s: %s" % [_table_label(p["table_id"]) if board.get_table(p["table_id"]) != null else "Spread",
"" if str(p["entry_id"]) == "" else ", result " + str(p["entry_id"]), p["text"]]})
_add_section("Problems", "Static checks", items, true)
# Errors: effect / expression errors, unset markers and action-limit halts
@ -389,7 +389,7 @@ func report_text() -> String:
func _compose_text(report: Dictionary, problems: Array) -> String:
var out := PackedStringArray()
out.append("Test board: %s, starting from %s" % [board.name, _table_label(str(report.get("start", "")))])
out.append("Test spread: %s, starting from %s" % [board.name, _table_label(str(report.get("start", "")))])
out.append(summary.text)
out.append("")
out.append("\n".join(BoardTester.format_problems(problems, 1000)))

View file

@ -55,7 +55,7 @@ const TOKENS := [
["VALUE_BORDER", "Value box border", false],
]
const PATTERNS := [["none", "None"], ["dots", "Dots"], ["stars", "Stars"]]
const LOGOS := [["fortune_teller", "Fortune teller"], ["none", "None"]]
const LOGOS := [["fortune_teller", "Fortune teller"], ["tower", "Tower"], ["none", "None"]]
const CARD_FRAMES := [["ornate", "Beaded"], ["plain", "Plain"]]
## The open spread, handed across the scene reload that applies a theme.

View file

@ -277,7 +277,7 @@ func _ask_new(initial: String) -> void:
le.placeholder_text = "e.g. Luck"
ModalCard.style_line_edit(le)
d.body.add_child(ModalCard.field("Name", le))
var cb := InspectorKit.check_box("Show on the board", true)
var cb := InspectorKit.check_box("Show on the spread", true)
cb.tooltip_text = "Adds a variable card, so the value has a label and a starting value, and shows while you play"
d.body.add_child(cb)
var hint := ModalCard.note("")

View file

@ -62,7 +62,7 @@ func render() -> void:
var names := main.variable_names()
_reset_all.disabled = names.is_empty()
if names.is_empty():
var empty := RichText.label("No saved variables yet. A pipe that saves as [color=#%s]@name[/color], a change such as [color=#%s]@hp = 10[/color], or [lb][lb]Table -> @name]] in a result, keeps its value here." % [Style.ACCENT.to_html(false), Style.ACCENT.to_html(false)],
var empty := RichText.label("No saved variables yet. A thread that saves as [color=#%s]@name[/color], a change such as [color=#%s]@hp = 10[/color], or [lb][lb]Table -> @name]] in a result, keeps its value here." % [Style.ACCENT.to_html(false), Style.ACCENT.to_html(false)],
14, Style.ON_BG_MUTED, false)
_list.add_child(empty)
for n in names:

View file

@ -20,10 +20,10 @@ func setup(p_main: Main) -> void:
var zout := _step_button("−", "Zoom out", 1.0 / STEP)
add_child(zout)
menu = ModalCard.bar_menu_button("100% ▾")
menu.tooltip_text = "Zoom: fit the board, 100% or the minimap"
menu.tooltip_text = "Zoom: fit the spread, 100% or the minimap"
menu.custom_minimum_size.x = 86
var pm := menu.get_popup()
pm.add_item("Fit board", ID_FIT)
pm.add_item("Fit spread", ID_FIT)
pm.set_item_tooltip(pm.get_item_index(ID_FIT), "Show every table")
pm.add_item("Zoom to 100%", ID_ACTUAL)
pm.add_separator()