🐛 multiplayer fix

This commit is contained in:
anyreso 2024-05-12 17:18:09 -04:00
parent 7498d4206c
commit de902271df
26 changed files with 147 additions and 147 deletions

View file

@ -30,16 +30,16 @@ func _unhandled_input(event : InputEvent) -> void:
elif event.is_action_released("scoreboard"):
hide()
func add_participant(participant : MatchParticipantComponent) -> void:
func add_participant(participant : MatchParticipant) -> void:
_add_scoreboard_entry.rpc(participant.player_id, participant.username)
func remove_participant(participant : MatchParticipantComponent) -> void:
func remove_participant(participant : MatchParticipant) -> void:
_remove_scoreboard_entry.rpc(participant.player_id)
func increment_kill_count(participant : MatchParticipantComponent) -> void:
func increment_kill_count(participant : MatchParticipant) -> void:
_entries[participant.player_id].kills += 1
func add_score_to_player(participant : MatchParticipantComponent, amount : int) -> void:
func add_score_to_player(participant : MatchParticipant, amount : int) -> void:
var player_id : int = participant.player_id
var entry : ScoreboardEntry = _entries[player_id]
_update_scoreboard_entry.rpc(player_id, entry.username, entry.kills, entry.score + amount)

View file

@ -9,6 +9,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_k2wav")
[node name="Panel" type="Panel" parent="."]
@ -18,6 +19,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="MarginContainer" type="MarginContainer" parent="Panel"]
layout_mode = 1
@ -26,11 +28,13 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_constants/margin_left = 64
theme_override_constants/margin_top = 64
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer"]
layout_mode = 2
mouse_filter = 2
[node name="Label" type="Label" parent="Panel/MarginContainer/VBoxContainer"]
layout_mode = 2
@ -42,6 +46,7 @@ text = "Scoreboard"
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
theme_override_constants/h_separation = 32
theme_override_constants/v_separation = 16
columns = 3