Fixed scoretab

remotes/1705377932733043820/tmp_refs/heads/unbroken
unfa 2021-09-11 23:15:06 +02:00
parent 5797bf44fa
commit f8fa335207
3 changed files with 12 additions and 15 deletions

View File

@ -10,7 +10,7 @@ extends Control
func _ready():
pass # Replace with function body.
func update_score_table():
func update_scoretab():
$ScoreTable/VBoxContainer/ScoreTab.text = ''
var scores = []
@ -26,10 +26,9 @@ func update_score_table():
if main.player_list.get(j).score == i:
$ScoreTable/VBoxContainer/ScoreTab.text += str(i) + " - " + main.player_list.get(j).name + "\n"
func score_table(show := true):
func scoretab(show := true):
if show:
update_score_table()
update_scoretab()
$ScoreTable.show()
else:
$ScoreTable.hide()
@ -49,4 +48,4 @@ func _process(delta):
$RespawnCountdown.visible = false
if $ScoreTable.visible: # update the scores every frame when player is watching the score table
update_score_table()
update_scoretab()

View File

@ -301,14 +301,7 @@ offset_right = 619.0
offset_bottom = 315.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "blah
blblblbblbl
blblb
blb
lb
lb
lb
lblblbbl"
text = "scoretab"
custom_effects = []
structured_text_bidi_override_options = []
script = null

View File

@ -6,8 +6,8 @@ enum NetworkRole {NONE, CLIENT, SERVER, DEDICATED_SERVER, RELAY_SERVER}
const NET_PORT = 12597
const NET_SERVER = "liblast.unfa.xyz"
#const NET_SERVER = "localhost"
#const NET_SERVER = "liblast.unfa.xyz"
const NET_SERVER = "localhost"
var peer = ENetMultiplayerPeer.new()
@ -169,6 +169,11 @@ func _input(_event) -> void:
focus = GameFocus.MENU
elif focus == GameFocus.MENU:
focus = GameFocus.GAME
if Input.is_action_just_pressed("show_scoretab"):
hud.scoretab(true)
elif Input.is_action_just_released("show_scoretab"):
hud.scoretab(false)
#@remote func st(player_list):
# self.player_list = player_list