You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			27 lines
		
	
	
		
			802 B
		
	
	
	
		
			GDScript
		
	
			
		
		
	
	
			27 lines
		
	
	
		
			802 B
		
	
	
	
		
			GDScript
		
	
| extends Control
 | |
| 
 | |
| @onready var sub_item_list: Array[Variant] = [$LockItem, $CoreItem, $WeaponItem, $PlayerStatusItem]
 | |
| 
 | |
| 
 | |
| func _ready():
 | |
|     SignalManager.character_status_changed.connect(on_character_status_changed)
 | |
| 
 | |
| 
 | |
| func on_character_status_changed(id: int, status_name: String, value) -> void:
 | |
|     if id != Global.character_mgr.get_player_id():
 | |
|         return
 | |
|     var func_name: String = "on_%s_changed" % status_name
 | |
|     for sub_item in sub_item_list:
 | |
|         if sub_item.has_method(func_name):
 | |
|             sub_item.call(func_name, value)
 | |
| 
 | |
| 
 | |
| func input_action_pressed(key: String):
 | |
|     match key:
 | |
|         "menu":
 | |
|             Global.ui_mgr.close("hud")
 | |
|             Global.ui_mgr.pause_open("menu")
 | |
|         "status":
 | |
|             Global.ui_mgr.close("hud")
 | |
|             Global.ui_mgr.pause_open("status")
 |