weapon display
This commit is contained in:
parent
553f8ea77a
commit
8fadd143c3
26 changed files with 491 additions and 46 deletions
18
gui/weapon_display/weapon_display_indicator.gd
Normal file
18
gui/weapon_display/weapon_display_indicator.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
extends Container
|
||||
|
||||
const CURRENT_COLOR = Color("ffffff")
|
||||
const NOT_CURRENT_COLOR = Color("d4d4d4")
|
||||
|
||||
@onready var texture: TextureRect = $Texture
|
||||
@onready var button_mark: Label = $Mark
|
||||
@export var lookup_slot: StringName
|
||||
@export var lookup_action: StringName
|
||||
|
||||
func _ready():
|
||||
button_mark.text = InputMap.get_action_description(lookup_action).left(1)
|
||||
|
||||
func set_weapon(resource: WeaponResource):
|
||||
texture.texture = resource.preview
|
||||
|
||||
func set_current(current):
|
||||
texture.self_modulate = CURRENT_COLOR if current else NOT_CURRENT_COLOR
|
||||
Loading…
Add table
Add a link
Reference in a new issue