Global refactor
This commit is contained in:
parent
3868af29e3
commit
0589ca4e23
180 changed files with 249 additions and 401 deletions
5
gui/hud/player_ammo_display.gd
Normal file
5
gui/hud/player_ammo_display.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends Label
|
||||
|
||||
|
||||
func on_ammo_updated(ammo: int, remaining_ammo: int):
|
||||
text = str(ammo)+"/"+str(remaining_ammo)
|
||||
1
gui/hud/player_ammo_display.gd.uid
Normal file
1
gui/hud/player_ammo_display.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://gan0amqbhi4i
|
||||
5
gui/hud/player_healthbar.gd
Normal file
5
gui/hud/player_healthbar.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends ProgressBar
|
||||
|
||||
|
||||
func on_hp_changed(to: int):
|
||||
value = to
|
||||
1
gui/hud/player_healthbar.gd.uid
Normal file
1
gui/hud/player_healthbar.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://vmhlmhd6gjx6
|
||||
22
gui/hud/player_round_display.gd
Normal file
22
gui/hud/player_round_display.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
extends Label
|
||||
|
||||
@export var our_side: bool
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
Session.round_started.connect(update)
|
||||
Session.session_started.connect(update)
|
||||
|
||||
func update():
|
||||
if our_side:
|
||||
match Lobby.get_team():
|
||||
Session.TEAMS.DEFENCE:
|
||||
text = str(Session.defender_score)
|
||||
Session.TEAMS.ATTACK, Session.TEAMS.SPECTATE, Session.TEAMS.UNASSIGNED:
|
||||
text = str(Session.attacker_score)
|
||||
else:
|
||||
match Lobby.get_team():
|
||||
Session.TEAMS.DEFENCE:
|
||||
text = str(Session.attacker_score)
|
||||
Session.TEAMS.ATTACK, Session.TEAMS.SPECTATE, Session.TEAMS.UNASSIGNED:
|
||||
text = str(Session.defender_score)
|
||||
1
gui/hud/player_round_display.gd.uid
Normal file
1
gui/hud/player_round_display.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bala54fa32e35
|
||||
8
gui/hud/player_round_time.gd
Normal file
8
gui/hud/player_round_time.gd
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
extends Label
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
var seconds_u = int(round(Session.reference_round_time))
|
||||
var seconds = seconds_u % 60
|
||||
@warning_ignore("integer_division")
|
||||
var minutes = seconds_u / 60
|
||||
text = str(minutes)+":"+str(seconds).pad_zeros(2)
|
||||
1
gui/hud/player_round_time.gd.uid
Normal file
1
gui/hud/player_round_time.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bos7nftlx8tv3
|
||||
Loading…
Add table
Add a link
Reference in a new issue