diff options
Diffstat (limited to 'scripts/map')
| -rw-r--r-- | scripts/map/Tile.cs | 6 | ||||
| -rw-r--r-- | scripts/map/TileDefinition.cs | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/scripts/map/Tile.cs b/scripts/map/Tile.cs index 67b9be5..39f7486 100644 --- a/scripts/map/Tile.cs +++ b/scripts/map/Tile.cs @@ -44,9 +44,10 @@ public partial class Tile : Sprite2D /// Elementos neste tile estão dentro do campo de visão do jogador. /// </summary> public bool IsInView { - get => this.isInView; + get => isInView; set { - this.isInView = value; + isInView = value; + Modulate = isInView ? definition.LitColor : definition.DarkColor; if (IsInView && !IsExplored) { IsExplored = true; } @@ -72,6 +73,7 @@ public partial class Tile : Sprite2D /// <param name="definition">Definição do tile.</param> public void SetDefinition(TileDefinition definition) { this.definition = definition; + Modulate = definition.DarkColor; Texture = definition.Texture; IsWalkable = definition.IsWalkable; IsTransparent = definition.IsTransparent; diff --git a/scripts/map/TileDefinition.cs b/scripts/map/TileDefinition.cs index 235508a..84e5cc1 100644 --- a/scripts/map/TileDefinition.cs +++ b/scripts/map/TileDefinition.cs @@ -9,6 +9,10 @@ public partial class TileDefinition : Resource [ExportCategory("Visuals")] [Export] public Texture2D Texture { get; set; } + [Export(PropertyHint.ColorNoAlpha)] + public Color LitColor { get; set; } = Colors.White; + [Export(PropertyHint.ColorNoAlpha)] + public Color DarkColor { get; set; } = Colors.White; [ExportCategory("Mechanics")] [Export] |
