From f8fa335207b44aee8dbd7f9862bd6ba44a87835a Mon Sep 17 00:00:00 2001 From: unfa Date: Sat, 11 Sep 2021 23:15:06 +0200 Subject: [PATCH] Fixed scoretab --- Game/Assets/HUD/HUD.gd | 9 ++++----- Game/Assets/HUD/HUD.tscn | 9 +-------- Game/Main.gd | 9 +++++++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Game/Assets/HUD/HUD.gd b/Game/Assets/HUD/HUD.gd index 56157ea..a6e667d 100644 --- a/Game/Assets/HUD/HUD.gd +++ b/Game/Assets/HUD/HUD.gd @@ -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() diff --git a/Game/Assets/HUD/HUD.tscn b/Game/Assets/HUD/HUD.tscn index 9f1385b..7c9d0f2 100644 --- a/Game/Assets/HUD/HUD.tscn +++ b/Game/Assets/HUD/HUD.tscn @@ -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 diff --git a/Game/Main.gd b/Game/Main.gd index 16ebfac..5eea00f 100644 --- a/Game/Main.gd +++ b/Game/Main.gd @@ -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