mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 14:00:47 +00:00
Add checkered colors for defended borders (#691)
## Description: The borders near a defense post are currently colored differently, but too discreetly for the user. I suggest coloring them with a checkerboard pattern.   ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: IngloriousTom
This commit is contained in:
@@ -267,15 +267,13 @@ export class TerritoryLayer implements Layer {
|
||||
)
|
||||
.filter((u) => u.unit.owner() == owner).length > 0
|
||||
) {
|
||||
const useDefendedBorderColor = playerIsFocused
|
||||
? this.theme.focusedDefendedBorderColor()
|
||||
: this.theme.defendedBorderColor(owner);
|
||||
this.paintCell(
|
||||
this.game.x(tile),
|
||||
this.game.y(tile),
|
||||
useDefendedBorderColor,
|
||||
255,
|
||||
);
|
||||
const borderColors = this.theme.defendedBorderColors(owner);
|
||||
const x = this.game.x(tile);
|
||||
const y = this.game.y(tile);
|
||||
const lightTile =
|
||||
(x % 2 == 0 && y % 2 == 0) || (y % 2 == 1 && x % 2 == 1);
|
||||
const borderColor = lightTile ? borderColors.light : borderColors.dark;
|
||||
this.paintCell(x, y, borderColor, 255);
|
||||
} else {
|
||||
const useBorderColor = playerIsFocused
|
||||
? this.theme.focusedBorderColor()
|
||||
|
||||
Reference in New Issue
Block a user