Move the log popup to the main window

The quiz reports point changes with an event_logged signal, and the main
window adds them to the log. Alt+L is handled by the main window.
This commit is contained in:
Sansan committed 2026-10-06 11:13:11 +02:00
1 parent e94c75e84d
commit 5cdec5cc8f
8 files changed
+30 -27

No files matched your search

+6 -8
View File
@@ -11,6 +11,9 @@ extends Control
## reloaded from it.
signal server_changed
## Emitted with a line for the game log, e.g. when a player gets a point.
signal event_logged(text: String)
@onready
var open_button: Button = $Open
@@ -50,9 +53,6 @@ var new_character_select: Control = %NewCharacterSelect
@onready
var music_player_container: MusicPlayer = $MusicPlayer
@onready
var log_window: Control = %Log
@onready
var debug_label: Label = $DebugLabel
@@ -117,8 +117,6 @@ func _input(event: InputEvent) -> void:
if event.alt_pressed && event.keycode == KEY_RIGHT:
print("Alt + RIGHT pressed")
music_player_container.seek(5)
if event.alt_pressed && event.keycode == KEY_L:
log_window.toggle()
## Disables the buttons that use the song list while the server syncs it.
@@ -168,7 +166,7 @@ func play_next_song() -> void:
func _popups() -> Array[PopupWindow]:
return [settings_window, new_character_select, winner_window, log_window]
return [settings_window, new_character_select, winner_window]
# The cache size can be changed in the settings. Waiting until the settings are closed
@@ -245,7 +243,7 @@ func _on_player_added(new_player_object: PlayerObject) -> void:
func _on_point_given(player_object: PlayerObject) -> void:
print("_on_point_given")
log_window.add_log_row(player_object.player_name + " got a point")
event_logged.emit(player_object.player_name + " got a point")
if Playlist.currently_playing_song >= 0:
Playlist.add_point(player_object.id)
update_song_list()
@@ -257,7 +255,7 @@ func _on_make_point_given_sound() -> void:
func _on_point_taken(player_object: PlayerObject) -> void:
print("_on_point_taken")
log_window.add_log_row(player_object.player_name + " lost a point")
event_logged.emit(player_object.player_name + " lost a point")
music_player_container.play_sound_effect(preload("res://sounds/itemequip.wav"))
if Playlist.currently_playing_song >= 0:
Playlist.remove_point(player_object.id)