Improve piece hint visuals.
This commit is contained in:
parent
b7b9f52de9
commit
da1ff0a96f
@ -604,15 +604,15 @@ const INTERFACE = {
|
|||||||
border_color = INTERFACE.Color.TileBorder;
|
border_color = INTERFACE.Color.TileBorder;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw border hints
|
|
||||||
if(!is_hover && draw_piece && piece !== null) { draw.hints(piece); }
|
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
ctx.fillStyle = border_color;
|
ctx.fillStyle = border_color;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
draw.hex();
|
draw.hex();
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
|
// Draw border hints
|
||||||
|
if(!is_hover && draw_piece && piece !== null) { draw.hints(piece); }
|
||||||
|
|
||||||
// Draw background
|
// Draw background
|
||||||
ctx.fillStyle = background_color;
|
ctx.fillStyle = background_color;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@ -922,7 +922,7 @@ const INTERFACE = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hints(piece) {
|
hints(piece) {
|
||||||
let scale = 0.96 * this.scale;
|
let scale = 0.92 * this.scale;
|
||||||
let half_scale = scale * 0.5;
|
let half_scale = scale * 0.5;
|
||||||
|
|
||||||
let movement = piece.moves();
|
let movement = piece.moves();
|
||||||
@ -1003,11 +1003,6 @@ const INTERFACE = {
|
|||||||
this.ctx.save();
|
this.ctx.save();
|
||||||
this.ctx.translate(x, y);
|
this.ctx.translate(x, y);
|
||||||
|
|
||||||
// Draw hints
|
|
||||||
if(piece !== null) {
|
|
||||||
this.hints(piece);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
if(piece.player == GAME.Const.Player.Dawn) { this.ctx.fillStyle = INTERFACE.Color.DawnDark; }
|
if(piece.player == GAME.Const.Player.Dawn) { this.ctx.fillStyle = INTERFACE.Color.DawnDark; }
|
||||||
else { this.ctx.fillStyle = INTERFACE.Color.DuskDark; }
|
else { this.ctx.fillStyle = INTERFACE.Color.DuskDark; }
|
||||||
@ -1016,6 +1011,11 @@ const INTERFACE = {
|
|||||||
this.hex();
|
this.hex();
|
||||||
this.ctx.fill();
|
this.ctx.fill();
|
||||||
|
|
||||||
|
// Draw hints
|
||||||
|
if(piece !== null) {
|
||||||
|
this.hints(piece);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw background.
|
// Draw background.
|
||||||
if(piece.player == GAME.Const.Player.Dawn) { this.ctx.fillStyle = INTERFACE.Color.DawnDarkest; }
|
if(piece.player == GAME.Const.Player.Dawn) { this.ctx.fillStyle = INTERFACE.Color.DawnDarkest; }
|
||||||
else { this.ctx.fillStyle = INTERFACE.Color.DuskDarkest; }
|
else { this.ctx.fillStyle = INTERFACE.Color.DuskDarkest; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user