mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 00:14:36 +00:00
Focused player border highlight (#304)
Tried to implement feature to outline player under mouse cursor. Intention is to improve gameplay and provide a way to estimate players territories for strategic planning / avoid attacking wrong players with confusingly similar colors. When you stop cursor at the player - his borders will be drawn in white color. To focus on other player - click or move cursor to other player. To hide outline - click on empty space (water, land). "Focus" UI feature also triggers outline for the target player (easier to see who exactly is that you are looking at).     Done via getting player under mouse cursor, setting it as global focusedPlayer and painting borders in white color. Tried to maintain minimal changes and utilize existing rendering queue. Also added hover delays to avoid excessive redraws and provide better experience. Redraws only happens when focusedPlayer changes - one time for old focused player to clean outline and one time for new focused player.
This commit is contained in:
committed by
GitHub
parent
849d612314
commit
72016f3dd4
@@ -142,6 +142,7 @@ export class TransformHandler {
|
||||
}
|
||||
|
||||
onGoToPlayer(event: GoToPlayerEvent) {
|
||||
this.game.setFocusedPlayer(event.player);
|
||||
this.clearTarget();
|
||||
this.target = new Cell(
|
||||
event.player.nameLocation().x,
|
||||
|
||||
Reference in New Issue
Block a user