aboutsummaryrefslogtreecommitdiff
path: root/game/src/GameSession/Minimap.gd
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-05-01 01:34:59 +0200
committer GitHub <noreply@github.com>2023-05-01 01:34:59 +0200
commitb1e985e0774598b3add22069be50f891e981fd79 (patch)
treee18e9cb252030e9b40ff91463ed117dd00a65789 /game/src/GameSession/Minimap.gd
parent1f8545facd248bbf4ea0cd551fea5f7d9b0efdce (diff)
parent2fec521cc6bbe7b2cda0eef3b830acbfc8b68333 (diff)
Merge pull request #103 from OpenVic2Project/terrain
Cosmetic terrain + Hashmaps
Diffstat (limited to 'game/src/GameSession/Minimap.gd')
-rw-r--r--game/src/GameSession/Minimap.gd10
1 files changed, 9 insertions, 1 deletions
diff --git a/game/src/GameSession/Minimap.gd b/game/src/GameSession/Minimap.gd
index 05c662b..f5d972a 100644
--- a/game/src/GameSession/Minimap.gd
+++ b/game/src/GameSession/Minimap.gd
@@ -5,13 +5,21 @@ signal minimap_clicked(pos_clicked : Vector2)
const _action_click : StringName = &"map_click"
@export var _minimap_texture : Control
+var _minimap_shader : ShaderMaterial
var _viewport_points : PackedVector2Array
func _ready():
_minimap_texture.custom_minimum_size = Vector2(GameSingleton.get_aspect_ratio(), 1.0) * 150
- if Events.ShaderManager.set_up_shader(_minimap_texture.get_material(), false) != OK:
+ var minimap_material := _minimap_texture.get_material()
+ if Events.ShaderManager.set_up_shader(minimap_material, false) != OK:
push_error("Failed to set up minimap shader")
+ else:
+ _minimap_shader = minimap_material
+
+func _on_province_selected(index : int) -> void:
+ if _minimap_shader != null:
+ _minimap_shader.set_shader_parameter(Events.ShaderManager.param_selected_index, index)
# REQUIREMENTS
# * SS-80