26 lines
656 B
GDScript
26 lines
656 B
GDScript
extends TextureRect
|
|
class_name CurrencyMemberSprite
|
|
|
|
@export var currency: Currency
|
|
@export var allegiance: Allegiance
|
|
|
|
func _ready() -> void:
|
|
sync()
|
|
|
|
func sync():
|
|
set_instance_shader_parameter("border_color", allegiance.color)
|
|
set_instance_shader_parameter("fill_color", currency.color)
|
|
%CollisionShape2D.shape.size = custom_minimum_size
|
|
|
|
|
|
func _on_area_2d_mouse_entered() -> void:
|
|
UserContext.focus_member(self)
|
|
|
|
|
|
func _on_area_2d_mouse_exited() -> void:
|
|
UserContext.unfocus_member(self)
|
|
|
|
func _unhandled_input(event: InputEvent) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
pass
|
|
|