#20 #24 Winnersong can be stopped. Inspirationlist speed can be changed. Some other small fixes
All checks were successful
Build / build (push) Successful in 1m36s

This commit is contained in:
2025-12-27 14:05:56 +01:00
parent 2a32cc34ef
commit b4ba96cf63
6 changed files with 84 additions and 19 deletions

View File

@@ -4,8 +4,6 @@ var SCROLL: float = 0
var delay: float = 0.02 #seconds var delay: float = 0.02 #seconds
var wait: float = 0 var wait: float = 0
var SPEED: int = 1
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
wait = delay wait = delay
@@ -18,13 +16,13 @@ func _process(delta: float) -> void:
#SCROLL DOWN #SCROLL DOWN
if SCROLL == 1: if SCROLL == 1:
if (scroll_vertical + get_v_scroll_bar().page) < get_v_scroll_bar().max_value: if (scroll_vertical + get_v_scroll_bar().page) < get_v_scroll_bar().max_value:
scroll_vertical += SPEED scroll_vertical += Settings.inspiration_list_speed
else: else:
scroll_back_up() scroll_back_up()
#SCROLL UP #SCROLL UP
elif SCROLL == -1: elif SCROLL == -1:
if scroll_vertical != 0: if scroll_vertical != 0:
scroll_vertical -= SPEED scroll_vertical -= Settings.inspiration_list_speed
else: else:
scroll_to_bottom() scroll_to_bottom()

View File

@@ -151,9 +151,8 @@ func _ready() -> void:
print("is_debug") print("is_debug")
debug_label.visible = true debug_label.visible = true
Settings.is_debug = true Settings.is_debug = true
Settings.default_path = "http://localhost:8080" settings_window.set_winning_score(5)
Settings.selected_server = 3 settings_window.set_selected_server(4)
Settings.winning_score = 5
if is_mac: if is_mac:
print("is_mac") print("is_mac")
next_button.pressed.connect(play_next_song) next_button.pressed.connect(play_next_song)
@@ -390,6 +389,7 @@ func _on_sync_finished() -> void:
sound_test_button.disabled = false sound_test_button.disabled = false
reset_playlist_button.disabled = false reset_playlist_button.disabled = false
show_answer_button.disabled = false show_answer_button.disabled = false
reset_points()
func get_suggestion_list() -> void: func get_suggestion_list() -> void:
print("get_suggestion_list") print("get_suggestion_list")
@@ -472,7 +472,7 @@ func _on_player_won(winning_player_id: int) -> void:
winner_picture.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL winner_picture.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL
winner_picture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED winner_picture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
winner_picture.texture = Settings.player_array[winning_player_id].character winner_picture.texture = Settings.player_array[winning_player_id].character
music_player_container.play_sound(preload("res://sounds/winning.mp3")) music_player_container.play_song(preload("res://sounds/winning.mp3"))
Settings.add_to_stats = false Settings.add_to_stats = false
func _on_player_removed(player_to_remove: int) -> void: func _on_player_removed(player_to_remove: int) -> void:

View File

@@ -151,10 +151,8 @@ func play_sound(sound_name: AudioStream) -> void:
if stream != null: if stream != null:
music_time_label.text = format_text(progress_slider.value, stream.get_length()) music_time_label.text = format_text(progress_slider.value, stream.get_length())
func play_song(body: PackedByteArray) -> void: func play_song(song: AudioStream) -> void:
var sound: AudioStream = AudioStreamMP3.new() audio_player.stream = song
sound.data = body
audio_player.stream = sound
audio_player.play() audio_player.play()
sound_player.stop() sound_player.stop()
song_finished = false song_finished = false
@@ -186,7 +184,11 @@ func play_song_object(song_object_no: int) -> void:
update_song_list.emit() update_song_list.emit()
func get_sound_test_song() -> void: func get_sound_test_song() -> void:
Settings.make_request2("/music/soundTest", play_song, true) var test_sound: Callable = func test_sound(body: PackedByteArray) -> void:
var sound: AudioStream = AudioStreamMP3.new()
sound.data = body
play_song(sound)
Settings.make_request2("/music/soundTest", test_sound, true)
##### LOCAL ##### LOCAL
var local_path: String = '/Users/sebastian/ResilioSync/Sorterat_test/Metal Gear Solid 4 - Guns of the Patriots/2-16 Metal Gear Saga.mp3' var local_path: String = '/Users/sebastian/ResilioSync/Sorterat_test/Metal Gear Solid 4 - Guns of the Patriots/2-16 Metal Gear Saga.mp3'

View File

@@ -2,8 +2,6 @@ extends Node
var default_path: String = "https://music.sanplex.tech" var default_path: String = "https://music.sanplex.tech"
var selected_server: int = 0 var selected_server: int = 0
#var default_path: String = "https://tmusic.sanplex.tech"
#var selected_server: int = 1
var is_local: bool = false var is_local: bool = false
@@ -17,15 +15,19 @@ var use_low_played_mode: bool = false
var winning_score: int = 20 var winning_score: int = 20
var fullscreen: bool = false var fullscreen: bool = false
var play_local: bool = false var play_local: bool = false
var inspiration_list_speed: int = 1
var player_array: Array[PlayerObject] var player_array: Array[PlayerObject]
var edit_players: bool = false var edit_players: bool = false
var currently_syncing: bool = false var currently_syncing: bool = false
var character_select_open: bool = false var character_select_open: bool = false
var version: String = "1.7.0" var version: String = "1.7.5"
var whats_new: String = "Changelog: var whats_new: String = "Changelog:
1.7.5:
#20: The winner song can now be stopped
#24: The speed of the inspiration list can now be changed
1.7.0: 1.7.0:
#22: Now block add player if player name is empty #22: Now block add player if player name is empty
#23: Add a log for when points are given to players #23: Add a log for when points are given to players

View File

@@ -33,15 +33,21 @@ var lower_cache_button: Button = %LowerCacheButton
@onready @onready
var increase_cache_button: Button = %IncreaseCacheButton var increase_cache_button: Button = %IncreaseCacheButton
@onready
var inspiration_speed_label: Label = %InspirationListSpeedLabel
@onready
var lower_inspiration_speed_button: Button = %LowerInspirationSpeedButton
@onready
var increase_inspiration_speed_button: Button = %IncreaseInspirationSpeedButton
@onready @onready
var select_server_button: OptionButton = %SelectServerButton var select_server_button: OptionButton = %SelectServerButton
@onready @onready
var fullscreen_button: CheckButton = %FullscreenButton var fullscreen_button: CheckButton = %FullscreenButton
#@onready
#var quick_sync_button := $QuickSyncButton
@onready @onready
var local_button: CheckButton = %LocalButton var local_button: CheckButton = %LocalButton
@@ -60,6 +66,8 @@ func _ready() -> void:
increase_winning_score_button.pressed.connect(increase_winning_score) increase_winning_score_button.pressed.connect(increase_winning_score)
lower_cache_button.pressed.connect(lower_cache) lower_cache_button.pressed.connect(lower_cache)
increase_cache_button.pressed.connect(increase_cache) increase_cache_button.pressed.connect(increase_cache)
lower_inspiration_speed_button.pressed.connect(lower_inspiration_speed)
increase_inspiration_speed_button.pressed.connect(increase_inspiration_speed)
fullscreen_button.pressed.connect(fullscreen) fullscreen_button.pressed.connect(fullscreen)
local_button.pressed.connect(local_play) local_button.pressed.connect(local_play)
@@ -69,6 +77,7 @@ func _ready() -> void:
low_played_button.button_pressed = Settings.use_low_played_mode low_played_button.button_pressed = Settings.use_low_played_mode
score_label.text = str(Settings.winning_score) score_label.text = str(Settings.winning_score)
cache_label.text = str(Playlist.number_of_tracks_to_preload) cache_label.text = str(Playlist.number_of_tracks_to_preload)
inspiration_speed_label.text = str(Settings.inspiration_list_speed)
fullscreen_button.button_pressed = Settings.fullscreen fullscreen_button.button_pressed = Settings.fullscreen
select_server_button.select(Settings.selected_server) select_server_button.select(Settings.selected_server)
select_server_button.item_selected.connect(select_server) select_server_button.item_selected.connect(select_server)
@@ -110,6 +119,10 @@ func increase_winning_score() -> void:
Settings.winning_score += 1 Settings.winning_score += 1
score_label.text = str(Settings.winning_score) score_label.text = str(Settings.winning_score)
func set_winning_score(new_score: int) -> void:
Settings.winning_score = new_score
score_label.text = str(Settings.winning_score)
func lower_cache() -> void: func lower_cache() -> void:
Playlist.number_of_tracks_to_preload -= 1 Playlist.number_of_tracks_to_preload -= 1
if Playlist.number_of_tracks_to_preload < 1: if Playlist.number_of_tracks_to_preload < 1:
@@ -120,7 +133,29 @@ func increase_cache() -> void:
Playlist.number_of_tracks_to_preload += 1 Playlist.number_of_tracks_to_preload += 1
cache_label.text = str(Playlist.number_of_tracks_to_preload) cache_label.text = str(Playlist.number_of_tracks_to_preload)
func lower_inspiration_speed() -> void:
Settings.inspiration_list_speed -= 1
if Settings.inspiration_list_speed < 1:
Settings.inspiration_list_speed = 1
inspiration_speed_label.text = str(Settings.inspiration_list_speed)
func increase_inspiration_speed() -> void:
Settings.inspiration_list_speed += 1
inspiration_speed_label.text = str(Settings.inspiration_list_speed )
func select_server(new_server: int) -> void: func select_server(new_server: int) -> void:
print("select_server")
Settings.default_path = select_server_button.get_item_text(new_server)
Settings.selected_server = new_server
print("Settings.default_path: " + Settings.default_path)
print("Settings.selected_server: " + str(Settings.selected_server))
print("new_server: " + str(new_server))
print("select_server_button.get_item_text(new_server): " + select_server_button.get_item_text(new_server))
server_changed.emit()
func set_selected_server(new_server: int) -> void:
print("set_selected_server")
select_server_button.select(new_server)
Settings.default_path = select_server_button.get_item_text(new_server) Settings.default_path = select_server_button.get_item_text(new_server)
Settings.selected_server = new_server Settings.selected_server = new_server
print("Settings.default_path: " + Settings.default_path) print("Settings.default_path: " + Settings.default_path)

View File

@@ -123,6 +123,34 @@ focus_mode = 0
action_mode = 0 action_mode = 0
text = "+1" text = "+1"
[node name="InspirationHBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
layout_mode = 2
[node name="InspirationListSpeedTitle" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer"]
layout_mode = 2
text = "Inspiration List Speed: "
[node name="InspirationListSpeedLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "1"
[node name="LowerInspirationSpeedButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
focus_mode = 0
action_mode = 0
text = "-1"
[node name="IncreaseInspirationSpeedButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
focus_mode = 0
action_mode = 0
text = "+1"
[node name="SelectServerButton" type="OptionButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"] [node name="SelectServerButton" type="OptionButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2