Improve piece hint visuals.

This commit is contained in:
yukirij 2024-10-12 18:56:50 -07:00
parent b7b9f52de9
commit da1ff0a96f

View File

@ -604,15 +604,15 @@ const INTERFACE = {
border_color = INTERFACE.Color.TileBorder;
}
// Draw border hints
if(!is_hover && draw_piece && piece !== null) { draw.hints(piece); }
// Draw border
ctx.fillStyle = border_color;
ctx.beginPath();
draw.hex();
ctx.fill();
// Draw border hints
if(!is_hover && draw_piece && piece !== null) { draw.hints(piece); }
// Draw background
ctx.fillStyle = background_color;
ctx.beginPath();
@ -922,7 +922,7 @@ const INTERFACE = {
}
hints(piece) {
let scale = 0.96 * this.scale;
let scale = 0.92 * this.scale;
let half_scale = scale * 0.5;
let movement = piece.moves();
@ -1003,11 +1003,6 @@ const INTERFACE = {
this.ctx.save();
this.ctx.translate(x, y);
// Draw hints
if(piece !== null) {
this.hints(piece);
}
// Draw border
if(piece.player == GAME.Const.Player.Dawn) { this.ctx.fillStyle = INTERFACE.Color.DawnDark; }
else { this.ctx.fillStyle = INTERFACE.Color.DuskDark; }
@ -1016,6 +1011,11 @@ const INTERFACE = {
this.hex();
this.ctx.fill();
// Draw hints
if(piece !== null) {
this.hints(piece);
}
// Draw background.
if(piece.player == GAME.Const.Player.Dawn) { this.ctx.fillStyle = INTERFACE.Color.DawnDarkest; }
else { this.ctx.fillStyle = INTERFACE.Color.DuskDarkest; }