@thegraid/hexlib 1.2.7 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/choosers.d.ts +11 -2
- package/dist/choosers.d.ts.map +1 -1
- package/dist/choosers.js +13 -3
- package/dist/choosers.js.map +1 -1
- package/dist/game-play.d.ts +2 -1
- package/dist/game-play.d.ts.map +1 -1
- package/dist/game-play.js +2 -2
- package/dist/game-play.js.map +1 -1
- package/dist/game-setup.d.ts.map +1 -1
- package/dist/game-setup.js +2 -1
- package/dist/game-setup.js.map +1 -1
- package/dist/hex-intfs.d.ts +0 -6
- package/dist/hex-intfs.d.ts.map +1 -1
- package/dist/hex-intfs.js +1 -0
- package/dist/hex-intfs.js.map +1 -1
- package/dist/hex.d.ts +1 -2
- package/dist/hex.d.ts.map +1 -1
- package/dist/hex.js +2 -1
- package/dist/hex.js.map +1 -1
- package/dist/meeple.d.ts +1 -1
- package/dist/meeple.d.ts.map +1 -1
- package/dist/meeple.js +2 -1
- package/dist/meeple.js.map +1 -1
- package/dist/player-panel.d.ts +4 -4
- package/dist/player-panel.d.ts.map +1 -1
- package/dist/player-panel.js +11 -9
- package/dist/player-panel.js.map +1 -1
- package/dist/player.d.ts.map +1 -1
- package/dist/player.js +2 -0
- package/dist/player.js.map +1 -1
- package/dist/scenario-parser.d.ts.map +1 -1
- package/dist/scenario-parser.js +4 -6
- package/dist/scenario-parser.js.map +1 -1
- package/dist/shapes.d.ts +7 -222
- package/dist/shapes.d.ts.map +1 -1
- package/dist/shapes.js +9 -377
- package/dist/shapes.js.map +1 -1
- package/dist/table.d.ts +5 -8
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +12 -18
- package/dist/table.js.map +1 -1
- package/dist/text-log.js +1 -1
- package/dist/text-log.js.map +1 -1
- package/dist/tile.d.ts +2 -2
- package/dist/tile.d.ts.map +1 -1
- package/dist/tile.js +1 -1
- package/dist/tile.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/shapes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C
|
|
2
|
-
import { afterUpdate,
|
|
3
|
-
import { Graphics, Shape
|
|
1
|
+
import { C } from "@thegraid/common-lib";
|
|
2
|
+
import { afterUpdate, PaintableShape, TextInRect } from "@thegraid/easeljs-lib";
|
|
3
|
+
import { Graphics, Shape } from "@thegraid/easeljs-module";
|
|
4
4
|
import { H } from "./hex-intfs";
|
|
5
5
|
import { TP } from "./table-params";
|
|
6
6
|
export class C1 {
|
|
@@ -9,154 +9,6 @@ export class C1 {
|
|
|
9
9
|
static lightgrey2 = 'rgb(225,225,225)'; // needs to contrast with WHITE influence lines
|
|
10
10
|
static lightgrey_8 = 'rgb(225,225,225,.8)'; // needs to contrast with WHITE influence lines
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Usage: ??? [obsolete?]
|
|
14
|
-
* - ps = super.makeShape(); // ISA PaintableShape
|
|
15
|
-
* - ps.cgf = (color) => new CGF(color);
|
|
16
|
-
* - ...
|
|
17
|
-
* - ps.paint(red); --> ps.graphics = gf(red) --> new CG(red);
|
|
18
|
-
* -
|
|
19
|
-
* - const cgf: CGF = (color: string, g = new Graphics()) => {
|
|
20
|
-
* - return g.f(this.color).dc(0, 0, rad);
|
|
21
|
-
* - }
|
|
22
|
-
* - }
|
|
23
|
-
*/
|
|
24
|
-
// The "origin story" was to create new Shapes without subclassing.
|
|
25
|
-
// Just make a new PaintableShape with its CGF
|
|
26
|
-
// can even compose by passing/invoking the CGF of other Shapes.
|
|
27
|
-
// the tricky bit for that is finding the 'inherited' CGF;
|
|
28
|
-
// maybe a known static; or constructor arg: either a CGF or a PS instance.
|
|
29
|
-
export class PaintableShape extends Shape {
|
|
30
|
-
_cgf;
|
|
31
|
-
colorn;
|
|
32
|
-
/** if supplied in contructor, cgf extends a clone [otherwise use new Graphics()] */
|
|
33
|
-
_g0;
|
|
34
|
-
/** initial/baseline Graphics, cgf extends to create cgfGraphics */
|
|
35
|
-
get g0() {
|
|
36
|
-
return this._g0?.clone() ?? new Graphics(); // clone, so original is not mutated.
|
|
37
|
-
}
|
|
38
|
-
/** previous/current Graphics that were rendered. (optimization... paint(color, true) to override) */
|
|
39
|
-
cgfGraphics; // points to this.graphics after cgf runs.
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param _cgf Create Graphics Function
|
|
43
|
-
* @param colorn paint with this color
|
|
44
|
-
* @param g0 Graphics to clone (or create); used as baseline Graphics for each paint()
|
|
45
|
-
*/
|
|
46
|
-
constructor(_cgf, colorn = C.BLACK, g0) {
|
|
47
|
-
super();
|
|
48
|
-
this._cgf = _cgf;
|
|
49
|
-
this.colorn = colorn;
|
|
50
|
-
this._g0 = g0;
|
|
51
|
-
this.name = className(this); // visible in debugger
|
|
52
|
-
}
|
|
53
|
-
// if caller is buiding a Graphics that will operate on existing cache, may be false.
|
|
54
|
-
updateCacheInPaint = true; // except for unusual cases
|
|
55
|
-
get cgf() { return this._cgf; }
|
|
56
|
-
/** set new cgf; and clear "previously rendered Graphics" */
|
|
57
|
-
set cgf(cgf) {
|
|
58
|
-
this._cgf = cgf;
|
|
59
|
-
if (this.cgfGraphics) {
|
|
60
|
-
this.paint(this.colorn, true);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/** render graphics from cgf. */
|
|
64
|
-
paint(colorn = this.colorn, force = false) {
|
|
65
|
-
if (force || this.graphics !== this.cgfGraphics || this.colorn !== colorn) {
|
|
66
|
-
// need to repaint, even if same color:
|
|
67
|
-
this.graphics = this.g0; // reset to initial Graphics.
|
|
68
|
-
this.graphics = this.cgfGraphics = this.cgf(this.colorn = colorn); // apply this.cgf(color)
|
|
69
|
-
if (this.updateCacheInPaint && this.cacheID)
|
|
70
|
-
this.updateCache();
|
|
71
|
-
}
|
|
72
|
-
return this.graphics;
|
|
73
|
-
}
|
|
74
|
-
// easeljs does: BitMap, Sprite (Frame?), Text, Filter, BitmapCache, BlurFilter
|
|
75
|
-
// easeljs does Container as union of bounds provided by children.
|
|
76
|
-
/**
|
|
77
|
-
* Paintable shape can & should calculate its Bounds.
|
|
78
|
-
*
|
|
79
|
-
* Subclasses should override to calculate their bounds.
|
|
80
|
-
* @param x
|
|
81
|
-
* * undefined -> calculate bounds,
|
|
82
|
-
* * null -> remove bounds,
|
|
83
|
-
* * number -> set to {x, y, width, height}
|
|
84
|
-
* @param y
|
|
85
|
-
* @param width
|
|
86
|
-
* @param height
|
|
87
|
-
*/
|
|
88
|
-
setBounds(x, y, width, height) {
|
|
89
|
-
if (x === undefined) {
|
|
90
|
-
const cached = this.cacheID; // undefined | number >= 1
|
|
91
|
-
this.uncache(); // setBounds(null, 0, 0, 0); // not nec'sary/useful
|
|
92
|
-
const { x, y, w, h } = this.calcBounds();
|
|
93
|
-
super.setBounds(x, y, w, h);
|
|
94
|
-
if (cached)
|
|
95
|
-
this.cache(x, y, w, h); // recache if previously cached
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
super.setBounds(x, y, width, height);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
/** subclass to override to compute actual bounds of their Shape. */
|
|
102
|
-
calcBounds() {
|
|
103
|
-
return { x: 0, y: 0, w: 5, h: 5 };
|
|
104
|
-
}
|
|
105
|
-
/** ensure PaintableShape is cached; expect setBounds() already done. */
|
|
106
|
-
setCacheID() {
|
|
107
|
-
if (this.cacheID)
|
|
108
|
-
return; // also: if already cached, get/setBounds is useless
|
|
109
|
-
let b = this.getBounds();
|
|
110
|
-
if (!b) {
|
|
111
|
-
const { x, y, w, h } = this.calcBounds();
|
|
112
|
-
b = { x, y, width: w, height: h };
|
|
113
|
-
}
|
|
114
|
-
this.cache(b.x, b.y, b.width, b.height);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/** an n-sided Polygon, tilted */
|
|
118
|
-
export class PolyShape extends PaintableShape {
|
|
119
|
-
rad = TP.hexRad;
|
|
120
|
-
nsides = 4;
|
|
121
|
-
pSize = 0;
|
|
122
|
-
tilt = 0;
|
|
123
|
-
fillc = C.grey;
|
|
124
|
-
strokec = C.black;
|
|
125
|
-
/**
|
|
126
|
-
* pscgf() invokes drawPoly(0,0,...);
|
|
127
|
-
*
|
|
128
|
-
* To adjust (x,y): supply g0 = new Graphics().mt(x,y)
|
|
129
|
-
* @param params \{ rad, nsides, pSize, tilt, fillc, strokec }
|
|
130
|
-
* @param g0 Graphics base
|
|
131
|
-
*/
|
|
132
|
-
constructor({ rad, nsides, pSize, tilt, fillc, strokec }, g0) {
|
|
133
|
-
super((fillc) => this.pscgf(fillc), fillc, g0);
|
|
134
|
-
this.nsides = nsides ?? 4;
|
|
135
|
-
this.rad = rad ?? TP.hexRad;
|
|
136
|
-
this.pSize = pSize ?? 0;
|
|
137
|
-
this.tilt = tilt ?? 0;
|
|
138
|
-
this.fillc = fillc ?? C.grey;
|
|
139
|
-
this.strokec = strokec ?? C.black;
|
|
140
|
-
this._cgf = this.pscgf;
|
|
141
|
-
this.paint(fillc);
|
|
142
|
-
}
|
|
143
|
-
/** set fillc and strokec, invoke drawPoly(0, 0, ...) */
|
|
144
|
-
pscgf(fillc, g = this.g0) {
|
|
145
|
-
((this.fillc = fillc) ? g.f(fillc) : g.ef());
|
|
146
|
-
(this.strokec ? g.s(this.strokec) : g.es());
|
|
147
|
-
g.dp(0, 0, this.rad, this.nsides, this.pSize, this.tilt * H.degToRadians);
|
|
148
|
-
return g;
|
|
149
|
-
}
|
|
150
|
-
setBounds(x, y, width, height) {
|
|
151
|
-
if (x === undefined) {
|
|
152
|
-
// overestimate: without nsides & tilt
|
|
153
|
-
this.setBounds(-this.rad, -this.rad, 2 * this.rad, 2 * this.rad);
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
super.setBounds(x, y, width, height);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
12
|
/**
|
|
161
13
|
* A colored PaintableShape that fills a Hex.
|
|
162
14
|
*
|
|
@@ -201,103 +53,6 @@ export class HexShape extends PaintableShape {
|
|
|
201
53
|
}
|
|
202
54
|
}
|
|
203
55
|
}
|
|
204
|
-
export class EllipseShape extends PaintableShape {
|
|
205
|
-
fillc;
|
|
206
|
-
radx;
|
|
207
|
-
rady;
|
|
208
|
-
strokec;
|
|
209
|
-
/**
|
|
210
|
-
* ellipse centered on (0,0), axis is NS/EW, rotate after.
|
|
211
|
-
* @param radx radius in x dir
|
|
212
|
-
* @param rady radisu in y dir
|
|
213
|
-
* retain g0, to use as baseline Graphics for each paint()
|
|
214
|
-
*/
|
|
215
|
-
constructor(fillc = C.white, radx = TP.hexRad / 2, rady = TP.hexRad / 2, strokec = C.black, g0) {
|
|
216
|
-
super((fillc) => this.cscgf(fillc), strokec, g0);
|
|
217
|
-
this.fillc = fillc;
|
|
218
|
-
this.radx = radx;
|
|
219
|
-
this.rady = rady;
|
|
220
|
-
this.strokec = strokec;
|
|
221
|
-
this._cgf = this.cscgf; // overwrite to remove indirection...
|
|
222
|
-
this.paint(fillc);
|
|
223
|
-
}
|
|
224
|
-
cscgf(fillc, g = this.g0) {
|
|
225
|
-
((this.fillc = fillc) ? g.f(fillc) : g.ef());
|
|
226
|
-
(this.strokec ? g.s(this.strokec) : g.es());
|
|
227
|
-
g.de(-this.radx, -this.rady, 2 * this.radx, 2 * this.rady);
|
|
228
|
-
return g;
|
|
229
|
-
}
|
|
230
|
-
setBounds(x, y, width, height) {
|
|
231
|
-
if (x === undefined) {
|
|
232
|
-
this.setBounds(-this.radx, -this.rady, 2 * this.radx, 2 * this.rady);
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
super.setBounds(x, y, width, height);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Circle centered on (0,0)
|
|
241
|
-
* @param rad radius
|
|
242
|
-
* retain g0, to use as baseline Graphics for each paint()
|
|
243
|
-
*/
|
|
244
|
-
export class CircleShape extends EllipseShape {
|
|
245
|
-
constructor(fillc = C.white, rad = TP.hexRad / 2, strokec = C.black, g0) {
|
|
246
|
-
super(fillc, rad, rad, strokec, g0);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
/** a Rectangular Shape, maybe with rounded corners */
|
|
250
|
-
export class RectShape extends PaintableShape {
|
|
251
|
-
strokec;
|
|
252
|
-
// compare to Bounds;
|
|
253
|
-
// this._bounds: Rectangle === { x, y, width, height }
|
|
254
|
-
// this._rectangle: Rectangle === { x, y, width, height }
|
|
255
|
-
_rect;
|
|
256
|
-
_cRad = 0;
|
|
257
|
-
/**
|
|
258
|
-
* Paint a rectangle (possibly with rounded corners) with fillc and stroke.
|
|
259
|
-
* @param rect \{ x=0, y=0, w=hexRad, h=hexRad, r=0 } origin, extent and corner radius of Rectangle
|
|
260
|
-
* @param fillc [C.white] color to paint the rectangle, '' for no fill
|
|
261
|
-
* @param strokec [C.black] stroke color, '' for no stroke
|
|
262
|
-
* @param g0 [new Graphics()] Graphics to clone and extend during paint()
|
|
263
|
-
*/
|
|
264
|
-
constructor({ x = 0, y = 0, w = TP.hexRad, h = TP.hexRad, r = 0 }, fillc = C.white, strokec = C.black, g0) {
|
|
265
|
-
super((fillc) => this.rscgf(fillc), fillc, g0);
|
|
266
|
-
this.strokec = strokec;
|
|
267
|
-
this._cgf = this.rscgf; // replace ()=>{} with direct function (now that we can say 'this')
|
|
268
|
-
this._cRad = r;
|
|
269
|
-
this._rect = { x, y, w, h };
|
|
270
|
-
this.setBounds(x, y, w, h);
|
|
271
|
-
this.paint(fillc, true); // this.graphics = rscgf(...)
|
|
272
|
-
}
|
|
273
|
-
/** update any of {x, y, w, h, r} for future paint() or setBounds(...) */
|
|
274
|
-
setRectRad({ x = this._rect.x, y = this._rect.y, w = this._rect.w, h = this._rect.h, r = this._cRad }) {
|
|
275
|
-
this._cRad = r ?? this._cRad;
|
|
276
|
-
this._rect = { x, y, w, h };
|
|
277
|
-
}
|
|
278
|
-
setBounds(x, y, width, height) {
|
|
279
|
-
if (x === undefined) {
|
|
280
|
-
const b = this._rect;
|
|
281
|
-
this.setBounds(b.x, b.y, b.w, b.h); // TODO: include strokeSize, which we don't have.. being in user-supplied g0
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
super.setBounds(x, y, width, height); // can be different from _rect
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
rscgf(fillc, g = this.g0) {
|
|
288
|
-
const { x, y, w, h } = this._rect;
|
|
289
|
-
(fillc ? g.f(fillc) : g.ef());
|
|
290
|
-
(this.strokec ? g.s(this.strokec) : g.es());
|
|
291
|
-
if (this._cRad === 0) {
|
|
292
|
-
g.dr(x, y, w, h);
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
g.rr(x, y, w, h, this._cRad);
|
|
296
|
-
// note: there is also a drawRoundRectComplex(x,y,w,h,rTL,rTR,rBR,rBL)
|
|
297
|
-
}
|
|
298
|
-
return g;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
56
|
/** from hextowns, with translucent center circle. */
|
|
302
57
|
export class TileShape extends HexShape {
|
|
303
58
|
static fillColor = C1.lightgrey_8; // 'rgba(200,200,200,.8)'
|
|
@@ -339,129 +94,8 @@ export class LegalMark extends Shape {
|
|
|
339
94
|
parent.addChild(this);
|
|
340
95
|
}
|
|
341
96
|
}
|
|
342
|
-
/** Container with a colored RectShape behind the given DisplayObject. */
|
|
343
|
-
export class RectWithDisp extends NamedContainer {
|
|
344
|
-
/** draws a RectShape around disp, with border, no strokec */
|
|
345
|
-
rectShape = new RectShape({ x: 0, y: 0, w: 8, h: 8, r: 0 }, C.WHITE, '');
|
|
346
|
-
/** DisplayObject displayed above a RectShape of color */
|
|
347
|
-
disp;
|
|
348
|
-
_border;
|
|
349
|
-
/** extend RectShape around DisplayObject bounds. */
|
|
350
|
-
get border() { return this._border; }
|
|
351
|
-
set border(b) {
|
|
352
|
-
this._border = b;
|
|
353
|
-
this.setBounds(undefined, 0, 0, 0);
|
|
354
|
-
}
|
|
355
|
-
_corner;
|
|
356
|
-
/** corner radius, does not repaint/recache */
|
|
357
|
-
get corner() { return this._corner; }
|
|
358
|
-
set corner(r) {
|
|
359
|
-
this._corner = r;
|
|
360
|
-
this.rectShape.setRectRad({ r });
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Create Container a RectShape behind the given DisplayOBject.
|
|
364
|
-
*
|
|
365
|
-
* The RectShape extends around (disp.getBounds() ?? { 0, 0, 10, 10 })
|
|
366
|
-
* @param disp a DisplayObject
|
|
367
|
-
* @param color [WHITE] of background RectShape.
|
|
368
|
-
* @param border [5] extend RectShape around disp
|
|
369
|
-
* @param corner [0] corner radius
|
|
370
|
-
* @param cgf [tscgf] CGF for the RectShape
|
|
371
|
-
*/
|
|
372
|
-
constructor(disp, color = C.WHITE, border = 5, corner = 0, cgf) {
|
|
373
|
-
super('rectWithDisp'); // ISA new Container()
|
|
374
|
-
if (cgf)
|
|
375
|
-
this.rectShape._cgf = cgf; // HasA RectShape & DisplayObject
|
|
376
|
-
this.disp = disp;
|
|
377
|
-
this.border = border;
|
|
378
|
-
this.corner = corner; // _rShape._cRad = corner
|
|
379
|
-
this.setBounds(undefined, 0, 0, 0); // calc (disp + border) -> rectShape -> this
|
|
380
|
-
this.paint(color); // set initial color, Graphics
|
|
381
|
-
this.addChild(this.rectShape, this.disp);
|
|
382
|
-
}
|
|
383
|
-
/** RectWithDisp.paint(color) paints new color for the backing RectShape. */
|
|
384
|
-
paint(color = this.rectShape.colorn, force = false) {
|
|
385
|
-
this.rectShape.rscgf;
|
|
386
|
-
return this.rectShape.paint(color, force);
|
|
387
|
-
}
|
|
388
|
-
/** uses PaintableShape.setCacheID. */
|
|
389
|
-
setCacheID() {
|
|
390
|
-
this.rectShape.setCacheID.call(this); //invoke from a PaintableShape
|
|
391
|
-
}
|
|
392
|
-
/** Extend around (disp.getBound() ?? {0, 0, 10, 10})
|
|
393
|
-
*
|
|
394
|
-
* override if (disp.bounds +/- border) is not what you want.
|
|
395
|
-
*/
|
|
396
|
-
calcBounds() {
|
|
397
|
-
const { x, y, width: w, height: h } = this.disp.getBounds() ?? { x: 0, y: 0, width: 10, height: 10 };
|
|
398
|
-
const db = this.border, { x: dx, y: dy } = this.disp;
|
|
399
|
-
const b = { x: dx + x - db, y: dy + y - db, w: w + 2 * db, h: h + 2 * db };
|
|
400
|
-
return b;
|
|
401
|
-
}
|
|
402
|
-
// Bounds = calcBounds (disp.bounds + border) -> rectShape._rect [& cRad] -> this._bounds
|
|
403
|
-
/**
|
|
404
|
-
* Note: if you addChild() to this Container, setBounds(undefined) won't consider them
|
|
405
|
-
* unless you override calcBounds() to do a Rectangle.union()
|
|
406
|
-
*/
|
|
407
|
-
setBounds(x, y, width, height) {
|
|
408
|
-
if (x === undefined) {
|
|
409
|
-
const cached = this.cacheID;
|
|
410
|
-
this.uncache();
|
|
411
|
-
const { x, y, w, h } = this.calcBounds();
|
|
412
|
-
this.rectShape.setRectRad({ x, y, w, h });
|
|
413
|
-
this.rectShape.setBounds(x, y, w, h); // setBounds to _rect
|
|
414
|
-
super.setBounds(x, y, w, h);
|
|
415
|
-
if (cached)
|
|
416
|
-
this.cache(x, y, w, h); // recache if previously cached
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
super.setBounds(x, y, width, height);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
/** A Text label above a colored RectShape.
|
|
424
|
-
*
|
|
425
|
-
* Configure the border width [.3] and corner radius [0].
|
|
426
|
-
*/
|
|
427
|
-
export class TextInRect extends RectWithDisp {
|
|
428
|
-
/** Text object displayed above a RectShape of color */
|
|
429
|
-
get label() { return this.disp; }
|
|
430
|
-
/** extend RectShape around Text bounds; fraction of line height. */
|
|
431
|
-
get border() { return this._border * this.disp.getMeasuredLineHeight(); }
|
|
432
|
-
set border(tb) {
|
|
433
|
-
this._border = tb;
|
|
434
|
-
this.setBounds(undefined, 0, 0, 0);
|
|
435
|
-
}
|
|
436
|
-
/** corner radius; fraction of line height. */
|
|
437
|
-
get corner() { return this._corner; }
|
|
438
|
-
set corner(tr) {
|
|
439
|
-
this._corner = tr; // get corner() returns this unscaled value
|
|
440
|
-
// but internally, _cRad is scaled by lineHeight
|
|
441
|
-
const r = tr * this.disp.getMeasuredLineHeight();
|
|
442
|
-
this.rectShape.setRectRad({ r });
|
|
443
|
-
}
|
|
444
|
-
/** the string inside the Text label. */
|
|
445
|
-
get label_text() { return this.disp.text; }
|
|
446
|
-
set label_text(txt) {
|
|
447
|
-
this.disp.text = txt;
|
|
448
|
-
this.setBounds(undefined, 0, 0, 0);
|
|
449
|
-
this.paint(undefined, true);
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Create Container with Text above a RectShape.
|
|
453
|
-
* @param text label
|
|
454
|
-
* @param color [C.WHITE] of background RectShape.
|
|
455
|
-
* @param border [.3] extend RectShape around Text; fraction of fontSize
|
|
456
|
-
* @param corner [0] corner radius as fraction of fontSize
|
|
457
|
-
* @param cgf [tscgf] CGF for the RectShape
|
|
458
|
-
*/
|
|
459
|
-
constructor(label, color, border = .3, corner = 0, cgf) {
|
|
460
|
-
super(label, color, border, corner, cgf); // ISA new Container()
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
97
|
// From ankh, 'done' button to move to next phase or action.
|
|
464
|
-
/**
|
|
98
|
+
/** A CenterText in a TextInRect. */
|
|
465
99
|
export class UtilButton extends TextInRect {
|
|
466
100
|
/**
|
|
467
101
|
* Create Container with CenterText above a RectShape.
|
|
@@ -469,9 +103,9 @@ export class UtilButton extends TextInRect {
|
|
|
469
103
|
* on(rollover|rollout, this.rollover(mouseIn))
|
|
470
104
|
*
|
|
471
105
|
* initially visible & mouseEnabled, but deactivated.
|
|
472
|
-
* @param label if
|
|
473
|
-
* @param color [undefined = C.WHITE] of the background
|
|
106
|
+
* @param label if string: new CenterText(label, fontSize, textColor)
|
|
474
107
|
* @param options
|
|
108
|
+
* * bgColor [undefined = C.WHITE] of the background
|
|
475
109
|
* * border: [undefined = .3] for background, fraction of fontSize
|
|
476
110
|
* * corner: [undefined = 0] corner radius of background
|
|
477
111
|
* * fontSize: [TP.hexRad/2] if Text not supplied
|
|
@@ -480,10 +114,9 @@ export class UtilButton extends TextInRect {
|
|
|
480
114
|
* * active: [false] supply true|false to activate(active, visible) including stage?.update()
|
|
481
115
|
* @param cgf [tscgf] CGF for the RectShape
|
|
482
116
|
*/
|
|
483
|
-
constructor(label,
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
super(text, color, border, corner, cgf);
|
|
117
|
+
constructor(label, options = {}, cgf) {
|
|
118
|
+
super(label, options, cgf);
|
|
119
|
+
const { rollover, active, visible } = options;
|
|
487
120
|
this.rollover = rollover ?? (() => { });
|
|
488
121
|
this.on('rollover', () => this._active && this.rollover(true), this);
|
|
489
122
|
this.on('rollout', () => this._active && this.rollover(false), this);
|
|
@@ -495,7 +128,6 @@ export class UtilButton extends TextInRect {
|
|
|
495
128
|
this.visible = !!options.visible;
|
|
496
129
|
}
|
|
497
130
|
}
|
|
498
|
-
get fontSize() { return this.label.getMeasuredLineHeight(); }
|
|
499
131
|
/** When activated, this.rollover(mouseIn) is invoked when mouse enter/exits this button. */
|
|
500
132
|
rollover;
|
|
501
133
|
_active = false;
|
package/dist/shapes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapes.js","sourceRoot":"","sources":["../src/shapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAQ,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAiB,QAAQ,EAAa,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3F,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,E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C;IACvC;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,GAAG,IAAI,EAAE,OAAO,GAAG,MAAM;QACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CAAC,KAAkB,EAAE,QAAa,IAAI,EAAE,IAAI,GAAG,KAAK;QAC5D,IAAI,IAAI;YAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC9B,4EAA4E;QAC5E,qEAAqE;QACrE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IACjC,CAAC;CACF"}
|
package/dist/table.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/// <reference types="easeljs" />
|
|
2
|
-
/// <reference types="createjs-lib" />
|
|
3
2
|
/// <reference types="@thegraid/easeljs-lib/dist/createjs-functions" />
|
|
4
|
-
import { Constructor,
|
|
5
|
-
import {
|
|
3
|
+
import { Constructor, XY, XYWH } from "@thegraid/common-lib";
|
|
4
|
+
import { Dispatcher, Dragger, DragInfo, DropdownStyle, NamedContainer, NamedObject, ParamGUI, RectShape, ScaleableContainer } from "@thegraid/easeljs-lib";
|
|
5
|
+
import { Container, DisplayObject, Shape, Stage, Text } from "@thegraid/easeljs-module";
|
|
6
6
|
import { type GamePlay } from "./game-play";
|
|
7
7
|
import { Scenario } from "./game-setup";
|
|
8
8
|
import type { GameState } from "./game-state";
|
|
9
9
|
import { Hex, HexM, IdHex, IHex2, RecycleHex } from "./hex";
|
|
10
|
-
import { XYWH } from "./hex-intfs";
|
|
11
10
|
import { Player } from "./player";
|
|
12
11
|
import { PlayerPanel } from "./player-panel";
|
|
13
|
-
import { HexShape,
|
|
12
|
+
import { HexShape, UtilButton } from "./shapes";
|
|
14
13
|
import { Tile } from "./tile";
|
|
15
14
|
import { TileSource } from "./tile-source";
|
|
16
15
|
export interface Dragable {
|
|
@@ -49,11 +48,9 @@ declare class TextLog extends NamedContainer {
|
|
|
49
48
|
*
|
|
50
49
|
* uses a HexMap\<IHex2\>
|
|
51
50
|
*/
|
|
52
|
-
export declare class Table {
|
|
51
|
+
export declare class Table extends Dispatcher {
|
|
53
52
|
static table: Table;
|
|
54
53
|
static stageTable(obj: DisplayObject): Table;
|
|
55
|
-
disp: EventDispatcher;
|
|
56
|
-
namedOn(Aname: string, type: string, listener: (eventObj: any) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): void;
|
|
57
54
|
gamePlay: GamePlay;
|
|
58
55
|
stage: Stage;
|
|
59
56
|
bgRect: Shape;
|
package/dist/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAS,WAAW,EAAe,EAAE,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAwC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAa,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAa,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvN,OAAO,EAAE,SAAS,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAElG,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAU,KA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E;IAKV;;;;;;OAMG;IACH,aAAa;CAWd;AACD,KAAK,IAAI,GAAG,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/dist/table.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AT, C, F, S, stime } from "@thegraid/common-lib";
|
|
2
|
+
import { afterUpdate, CenterText, CircleShape, Dispatcher, Dragger, KeyBinder, NamedContainer, ParamGUI, RectShape, ScaleableContainer } from "@thegraid/easeljs-lib";
|
|
3
|
+
import { Container, Graphics, Shape, Text } from "@thegraid/easeljs-module";
|
|
3
4
|
import { EBC, PidChoice } from "./choosers";
|
|
4
5
|
import { TileEvent } from "./game-play";
|
|
5
6
|
import { RecycleHex } from "./hex";
|
|
6
7
|
import { PlayerPanel } from "./player-panel";
|
|
7
|
-
import {
|
|
8
|
+
import { HexShape, UtilButton } from "./shapes";
|
|
8
9
|
import { playerColor0, playerColor1, TP } from "./table-params";
|
|
9
10
|
import { Tile } from "./tile";
|
|
10
11
|
/** to own file... */
|
|
@@ -64,16 +65,11 @@ class TextLog extends NamedContainer {
|
|
|
64
65
|
*
|
|
65
66
|
* uses a HexMap\<IHex2\>
|
|
66
67
|
*/
|
|
67
|
-
export class Table {
|
|
68
|
+
export class Table extends Dispatcher {
|
|
68
69
|
static table;
|
|
69
70
|
static stageTable(obj) {
|
|
70
71
|
return obj.stage.table;
|
|
71
72
|
}
|
|
72
|
-
disp = this;
|
|
73
|
-
namedOn(Aname, type, listener, scope, once, data, useCapture = false) {
|
|
74
|
-
const list2 = this.disp.on(type, listener, scope, once, data, useCapture);
|
|
75
|
-
list2.Aname = Aname;
|
|
76
|
-
}
|
|
77
73
|
gamePlay;
|
|
78
74
|
stage;
|
|
79
75
|
bgRect;
|
|
@@ -98,8 +94,7 @@ export class Table {
|
|
|
98
94
|
hexC;
|
|
99
95
|
overlayCont = new NamedContainer('overlay');
|
|
100
96
|
constructor(stage) {
|
|
101
|
-
|
|
102
|
-
EventDispatcher.initialize(this);
|
|
97
|
+
super();
|
|
103
98
|
// backpointer so Containers can find their Table (& curMark)
|
|
104
99
|
Table.table = stage.table = this;
|
|
105
100
|
this.stage = stage;
|
|
@@ -232,7 +227,7 @@ export class Table {
|
|
|
232
227
|
console.log(stime('GamePlay', `.reCacheTiles: TP.cacheTiles=`), TP.cacheTiles, this.scaleCont.scaleX);
|
|
233
228
|
Tile.allTiles.forEach(tile => {
|
|
234
229
|
const rad = tile.radius;
|
|
235
|
-
tile.
|
|
230
|
+
tile.setBoundsNull();
|
|
236
231
|
if (tile.cacheID) {
|
|
237
232
|
tile.uncache();
|
|
238
233
|
const { x, y, width, height } = tile.getBounds() ?? { x: -rad, y: -rad, width: 2 * rad, height: 2 * rad };
|
|
@@ -613,7 +608,7 @@ export class Table {
|
|
|
613
608
|
* @returns actionCont
|
|
614
609
|
*/
|
|
615
610
|
addDoneButton(cont = this.scaleCont, cx = 0, cy = 0, align = 'center') {
|
|
616
|
-
const doneButton = this.doneButton = new UtilButton('Done', 'lightgreen');
|
|
611
|
+
const doneButton = this.doneButton = new UtilButton('Done', { bgColor: 'lightgreen' });
|
|
617
612
|
doneButton.disp.textAlign = align; // Note: baseline is still 'middle'
|
|
618
613
|
const { x, y, width: w, height: h } = doneButton.getBounds();
|
|
619
614
|
doneButton.name = 'doneButton';
|
|
@@ -850,7 +845,7 @@ export class Table {
|
|
|
850
845
|
moveTileToHex(tile, ihex) {
|
|
851
846
|
const hex = this.hexMap.getHex(ihex);
|
|
852
847
|
this.hexMap.showMark(hex);
|
|
853
|
-
this.
|
|
848
|
+
this.dispatchEvent(new TileEvent(S.add, tile, hex)); // -> GamePlay.playerMoveEvent(hex, sc)
|
|
854
849
|
}
|
|
855
850
|
/** default scaling-up value */
|
|
856
851
|
upscale = 1.5;
|
|
@@ -880,8 +875,7 @@ export class Table {
|
|
|
880
875
|
KeyBinder.keyBinder.setKey('S-Space', () => this.dragTarget());
|
|
881
876
|
KeyBinder.keyBinder.setKey('t', () => this.toggleText());
|
|
882
877
|
// of dubious utility...
|
|
883
|
-
|
|
884
|
-
KeyBinder.keyBinder.setKey("p", { func: () => getOop(), thisArg: this });
|
|
878
|
+
KeyBinder.keyBinder.setKey("p", () => this.stage.getObjectsUnderPoint(500, 100, 1));
|
|
885
879
|
}
|
|
886
880
|
/** put a Rectangle Shape at (0,0) with XYWH bounds as given */
|
|
887
881
|
setBackground(parent, bounds, bgColor = TP.bgColor) {
|
|
@@ -920,9 +914,9 @@ export class Table {
|
|
|
920
914
|
views = [this.viewA, this.viewZ];
|
|
921
915
|
}
|
|
922
916
|
views.forEach(view => {
|
|
923
|
-
KeyBinder.keyBinder.setKey(view.isk,
|
|
917
|
+
KeyBinder.keyBinder.setKey(view.isk, () => invokeView(view));
|
|
924
918
|
if (view.ssk)
|
|
925
|
-
KeyBinder.keyBinder.setKey(view.ssk,
|
|
919
|
+
KeyBinder.keyBinder.setKey(view.ssk, () => saveView(view));
|
|
926
920
|
});
|
|
927
921
|
if (views?.[0])
|
|
928
922
|
KeyBinder.keyBinder.dispatchChar(views[0].isk);
|