diff --git a/MainWindow.gd b/MainWindow.gd
index f8a3386..d189ba5 100644
--- a/MainWindow.gd
+++ b/MainWindow.gd
@@ -133,7 +133,15 @@ var current_player: Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
- next_button.pressed.connect(music_player_container.fetch_next_song)
+ var is_debug := OS.has_feature("debug")
+ var is_mac := OS.has_feature("macos")
+ if is_debug:
+ print("is_debug")
+ Settings.default_path = "http://localhost:8080"
+ Settings.selected_server = 3
+ if is_mac:
+ print("is_mac")
+ next_button.pressed.connect(next_track)
show_answer_button.pressed.connect(show_answer_pressed)
search_button.pressed.connect(show_search)
sync_button.pressed.connect(sync_games)
@@ -147,6 +155,7 @@ func _ready() -> void:
character_select.connect("character_selected", _on_character_selected)
new_player_name_field.connect("enter_key_pressed", add_player)
music_player_container.connect("add_to_queue", _on_add_to_queue)
+ music_player_container.connect("show_answer", show_answer_pressed)
add_players_button.pressed.connect(add_players)
add_player_button.pressed.connect(add_player)
@@ -154,18 +163,39 @@ func _ready() -> void:
get_suggestion_list()
fetch_full_music_list_at_start()
+
+func _input(event: InputEvent) -> void:
+ if event is InputEventKey and event.pressed:
+ if event.alt_pressed && event.keycode == KEY_UP:
+ print("Alt + UP pressed")
+ music_player_container.change_volume(0.05)
+ if event.alt_pressed && event.keycode == KEY_DOWN:
+ print("Alt + DOWN pressed")
+ music_player_container.change_volume(-0.05)
+ if event.alt_pressed && event.keycode == KEY_LEFT:
+ print("Alt + LEFT pressed")
+ music_player_container.seek(-5)
+ if event.alt_pressed && event.keycode == KEY_RIGHT:
+ print("Alt + RIGHT pressed")
+ music_player_container.seek(5)
+
+func next_track() -> void:
+ next_button.disabled = true
+ music_player_container.fetch_next_song()
func reset_playlist() -> void:
print("reset_playlist")
Settings.make_request2("/music/reset", fetch_full_music_list_at_start, false)
func reset_points() -> void:
+ print("reset_points")
var players_to_reset: Array = players.get_children()
for player_to_reset: Node in players_to_reset:
if player_to_reset.has_method("reset_points"):
player_to_reset.reset_points()
func show_about() -> void:
+ print("show_about")
about_popup.visible = true
version_label.text = Settings.version
whats_new_label.text = Settings.whats_new
@@ -173,32 +203,43 @@ func show_about() -> void:
coming_label.text = Settings.whats_left
func show_settings() -> void:
+ print("show_settings")
settings_popup.visible = true
func get_statistics() -> void:
+ print("get_statistics")
statistic_popup.visible = true
statistic_label.text = "Total amount of games in the playlist: " + str(games.size())
func _on_add_to_queue() -> void:
- print("add_to_queue")
+ print("_on_add_to_queue")
+ next_button.disabled = false
Settings.make_request2("/music/addQue", fetched, false)
game_label.text = "????????"
song_label.text = "??????"
func sync_games() -> void:
- var games_synced: Callable = func() -> void:
+ print("sync_games")
+ sync_button.disabled = true
+ var games_synced: Callable = func games_synced() -> void:
+ sync_button.disabled = false
sync_popup.visible = true
print("games_synced")
reset_playlist()
get_suggestion_list()
+ search_view.get_list_of_games()
Settings.make_request2("/sync", games_synced, false)
func get_suggestion_list() -> void:
- var populate_list: Callable = func(array: Array) -> void:
+ print("get_suggestion_list")
+ var populate_list: Callable = func(array) -> void:
if typeof(array) == TYPE_ARRAY:
+ games = []
games.append_array(array)
for game: String in games:
var inspiration_label: Label= Label.new()
+ inspiration_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
+ inspiration_label.add_theme_font_size_override("font_size", 20)
inspiration_label.text = game
inspiration_label.autowrap_mode = TextServer.AUTOWRAP_WORD
inspiration_list.add_child(inspiration_label)
@@ -208,13 +249,16 @@ func get_suggestion_list() -> void:
Settings.make_request2("/music/all", populate_list, true)
func add_players() -> void:
+ print("add_players")
add_player_container.visible = !add_player_container.visible
new_player_name_field.grab_focus()
func add_player() -> void:
+ print("add_player")
var new_player: Node = player.instantiate()
new_player.player_name = new_player_name_field.text
new_player.player_score = new_player_name_field.text + ": 0"
+ new_player.id = Settings.get_next_player_id()
new_player_name_field.text = ""
players.add_child(new_player)
new_player.connect("change_character_clicked", _on_player_change_character_clicked.bind(new_player))
@@ -224,17 +268,20 @@ func add_player() -> void:
new_player.connect("player_removed", _on_player_removed.bind(new_player))
func _on_player_won(player_name: String) -> void:
+ print("_on_player_won")
winner_popup.visible = true
winner_label.text = player_name + " won!!"
music_player_container.play_sound(preload("res://sounds/winning.mp3"))
func show_search() -> void:
+ print("show_search")
if search_view.visible == false:
search_view.visible = true
else:
search_view.visible = false
func show_answer_pressed() -> void:
+ print("show_answer_pressed")
var show_fetched: Callable = func(data_received: Dictionary) -> void:
print("show_fetched data_received: ", data_received)
game_label.text = data_received.Game
@@ -243,12 +290,14 @@ func show_answer_pressed() -> void:
var actual_string: String = format_string % [(data_received.SongNo+1), data_received.Game, data_received.Song]
if next_label == null:
next_label = Label.new()
+ next_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
+ next_label.add_theme_font_size_override("font_size", 20)
next_label.text = actual_string
Settings.make_request2("/music/info", show_fetched, true)
func fetch_full_music_list_at_start() -> void:
print("fetch_full_music_list_at_start")
- var show_music_list_at_start: Callable = func(data: Array) -> void:
+ var show_music_list_at_start: Callable = func(data) -> void:
if data == null:
song_list = []
Settings.delete_children(music_list)
@@ -256,8 +305,12 @@ func fetch_full_music_list_at_start() -> void:
if typeof(data) == TYPE_ARRAY:
song_list = []
song_list.append_array(data)
+ print("song_list", song_list)
for song: Dictionary in song_list:
var music_list_label: Label = Label.new()
+ music_list_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
+ music_list_label.add_theme_font_size_override("font_size", 20)
+ music_list_label.autowrap_mode = TextServer.AUTOWRAP_WORD
var format_string: String = "%d. %s - %s"
var actual_string: String = format_string % [(song.SongNo+1), song.Game, song.Song]
music_list_label.text = actual_string
@@ -269,14 +322,17 @@ func fetch_full_music_list_at_start() -> void:
Settings.make_request2("/music/list", show_music_list_at_start, true)
func fetch_full_music_list(event: InputEvent, song_no: int) -> void:
+ print("fetch_full_music_list")
if (event is InputEventMouseButton && event.pressed && event.button_index == MOUSE_BUTTON_LEFT):
- var show_music_list: Callable = func(data_received: Array) -> void:
+ var show_music_list: Callable = func(data_received) -> void:
if typeof(data_received) == TYPE_ARRAY:
song_list = []
song_list.append_array(data_received)
Settings.delete_children(music_list)
for song: Dictionary in song_list:
var music_label: Label= Label.new()
+ music_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
+ music_label.add_theme_font_size_override("font_size", 20)
game_label.text = song.Game
song_label.text = song.Song
var format_string: String = "%d. %s - %s"
@@ -294,13 +350,14 @@ func fetch_full_music_list(event: InputEvent, song_no: int) -> void:
Settings.make_request2("/music?song=" + str(song_no), music_player_container.play_song, true)
Settings.make_request2("/music/info", show_answer, true)
-func show_answer(answer: JSON) -> void:
- print("show_answer1: ", answer)
- game_label.text = answer.Game
- song_label.text = answer.Song
+func show_answer(answer: Dictionary) -> void:
+ print("show_answer1: ", answer)
+ game_label.text = answer.Game
+ song_label.text = answer.Song
func fetched() -> void:
- var show_fetched_list: Callable = func(data_received: Array) -> void:
+ print("fetched")
+ var show_fetched_list: Callable = func(data_received) -> void:
if typeof(data_received) == TYPE_ARRAY:
song_list = []
song_list.append_array(data_received)
@@ -308,6 +365,8 @@ func fetched() -> void:
song_list.remove_at(song_list.size() - 1)
for song: Dictionary in song_list:
var fetched_song_label: Label = Label.new()
+ fetched_song_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
+ fetched_song_label.add_theme_font_size_override("font_size", 20)
var format_string: String = "%d. %s - %s"
var actual_string: String = format_string % [(song.SongNo+1), song.Game, song.Song]
fetched_song_label.text = actual_string
@@ -319,6 +378,8 @@ func fetched() -> void:
for song: Label in songs:
song.remove_theme_color_override("font_color")
next_label = Label.new()
+ next_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
+ next_label.add_theme_font_size_override("font_size", 20)
next_label.add_theme_color_override("font_color", Color(1, 0.5, 0))
next_label.text = "??? - ???"
next_label.mouse_filter = Control.MOUSE_FILTER_PASS
@@ -329,6 +390,7 @@ func fetched() -> void:
Settings.make_request2("/music/list", show_fetched_list, true)
func song_clicked(event: InputEvent, clicked_song_label: Label, song_no: int) -> void:
+ print("song_clicked")
if (event is InputEventMouseButton && event.pressed && event.button_index == MOUSE_BUTTON_LEFT):
print("Song Clicked: " + str(song_no))
songs = music_list.get_children()
@@ -339,6 +401,7 @@ func song_clicked(event: InputEvent, clicked_song_label: Label, song_no: int) ->
Settings.make_request2("/music/info", show_answer, true)
func _on_player_removed(new_player: Node) -> void:
+ print("_on_player_removed")
players.remove_child(new_player)
func _on_player_change_character_clicked(new_player: Node) -> void:
@@ -368,6 +431,7 @@ func dir_contents(path: String) -> void:
dir.list_dir_begin()
var file_name: String = dir.get_next()
songs.clear()
+ games = []
while file_name != "":
if dir.current_is_dir():
#print("Found directory: " + file_name)
diff --git a/MainWindow.tscn b/MainWindow.tscn
index b7d19f3..9e5a3cb 100644
--- a/MainWindow.tscn
+++ b/MainWindow.tscn
@@ -1,11 +1,10 @@
-[gd_scene load_steps=26 format=3 uid="uid://xwq863o6uvsu"]
+[gd_scene load_steps=25 format=3 uid="uid://xwq863o6uvsu"]
[ext_resource type="Script" path="res://MainWindow.gd" id="1_eu0t5"]
[ext_resource type="PackedScene" uid="uid://b16on0oscg1bv" path="res://CharacterSelect.tscn" id="2_76kf4"]
[ext_resource type="Script" path="res://InsperationScrollContainer.gd" id="2_gxtxm"]
-[ext_resource type="AudioStream" uid="uid://n2g8jddr85h2" path="res://01. Opening.mp3" id="4_5kvsq"]
+[ext_resource type="Texture2D" uid="uid://bcfmpd7h512ef" path="res://icons/person_add_light.svg" id="5_31tjv"]
[ext_resource type="PackedScene" uid="uid://ds15cgsf8vpvc" path="res://MusicPlayer.tscn" id="5_emn36"]
-[ext_resource type="Texture2D" uid="uid://o5go6smk7hm1" path="res://icons/person_add_alt_1-black-36dp.svg" id="7_75f2e"]
[ext_resource type="Script" path="res://MusicListScrollContainer.gd" id="7_dj026"]
[ext_resource type="Script" path="res://PlayerNameField.gd" id="7_qsdfy"]
[ext_resource type="Theme" uid="uid://rxexo3ur85as" path="res://LightGrayTheme.tres" id="7_wxbv6"]
@@ -76,6 +75,7 @@ offset_right = 1920.0
offset_bottom = 56.0
[node name="Title" type="Label" parent="."]
+texture_filter = 1
layout_mode = 2
offset_left = 64.0
offset_top = 12.0
@@ -104,6 +104,7 @@ access = 2
show_hidden_files = true
[node name="ScrollContainer" type="ScrollContainer" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1216.0
offset_top = 128.0
@@ -114,6 +115,7 @@ vertical_scroll_mode = 3
script = ExtResource("2_gxtxm")
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"]
+texture_filter = 1
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
@@ -126,6 +128,7 @@ offset_right = 1152.0
offset_bottom = 384.0
[node name="GameLabel" type="Label" parent="VBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
label_settings = SubResource("LabelSettings_qspbu")
@@ -133,6 +136,7 @@ horizontal_alignment = 1
autowrap_mode = 2
[node name="SongLabel" type="Label" parent="VBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
label_settings = SubResource("LabelSettings_3m52w")
@@ -141,6 +145,12 @@ autowrap_mode = 2
[node name="CharacterSelect" parent="." instance=ExtResource("2_76kf4")]
visible = false
+top_level = true
+layout_mode = 0
+offset_left = 616.0
+offset_top = 264.0
+offset_right = 776.0
+offset_bottom = 424.0
[node name="MusicPlayer" parent="." instance=ExtResource("5_emn36")]
layout_mode = 0
@@ -150,16 +160,12 @@ anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
offset_left = 65.0
-offset_top = 1048.0
-offset_right = 1854.0
-offset_bottom = 1080.0
+offset_top = 992.0
+offset_right = 1856.0
+offset_bottom = 1024.0
grow_horizontal = 1
grow_vertical = 1
-[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
-stream = ExtResource("4_5kvsq")
-bus = &"music"
-
[node name="Players" type="PanelContainer" parent="."]
layout_mode = 0
offset_left = 1216.0
@@ -175,6 +181,7 @@ custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
[node name="Label" type="Label" parent="Players/VBoxContainer/HBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
size_flags_horizontal = 3
@@ -184,11 +191,14 @@ horizontal_alignment = 1
vertical_alignment = 1
[node name="AddPlayersButton" type="TextureButton" parent="Players/VBoxContainer/HBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
size_flags_horizontal = 8
+focus_mode = 0
+action_mode = 0
shortcut = SubResource("Shortcut_jafqj")
-texture_normal = ExtResource("7_75f2e")
+texture_normal = ExtResource("5_31tjv")
[node name="AddPlayerContainer" type="HBoxContainer" parent="Players/VBoxContainer"]
visible = false
@@ -208,6 +218,7 @@ placeholder_text = "Player name"
script = ExtResource("7_qsdfy")
[node name="AddPlayerButton" type="Button" parent="Players/VBoxContainer/AddPlayerContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
text = "Add"
@@ -219,52 +230,70 @@ size_flags_horizontal = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_k1ygi")
[node name="ResetPlaylistButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1359.0
offset_top = 66.0
offset_right = 1470.0
offset_bottom = 97.0
+focus_mode = 0
+action_mode = 0
text = "Reset playlist"
[node name="ResetPointsButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1487.0
offset_top = 66.0
offset_right = 1598.0
offset_bottom = 97.0
+focus_mode = 0
+action_mode = 0
text = "Reset points"
[node name="SyncButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1615.0
offset_top = 66.0
offset_right = 1726.0
offset_bottom = 97.0
+focus_mode = 0
+action_mode = 0
text = "Sync games"
[node name="SoundTestButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1743.0
offset_top = 66.0
offset_right = 1854.0
offset_bottom = 97.0
+focus_mode = 0
+action_mode = 0
text = "Sound test"
[node name="ShowAnswerButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 65.0
offset_top = 944.0
offset_right = 176.0
offset_bottom = 975.0
+focus_mode = 0
+action_mode = 0
shortcut = SubResource("Shortcut_a7fvb")
text = "Show answer"
[node name="NextButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 193.0
offset_top = 944.0
offset_right = 368.0
offset_bottom = 975.0
+focus_mode = 0
+action_mode = 0
shortcut = SubResource("Shortcut_d6fml")
text = "Randomize new track"
@@ -282,54 +311,70 @@ follow_focus = true
script = ExtResource("7_dj026")
[node name="MusicList" type="VBoxContainer" parent="MusicListPanel/ScrollContainer"]
+texture_filter = 1
layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 3
[node name="SearchButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1488.0
offset_top = 8.0
offset_right = 1558.0
offset_bottom = 48.0
+focus_mode = 0
+action_mode = 0
shortcut = SubResource("Shortcut_fbju4")
text = "Search"
[node name="SettingsButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1584.0
offset_top = 8.0
offset_right = 1654.0
offset_bottom = 48.0
+focus_mode = 0
+action_mode = 0
text = "Settings"
[node name="StatisticsButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1680.0
offset_top = 8.0
offset_right = 1758.0
offset_bottom = 48.0
+focus_mode = 0
+action_mode = 0
text = "Statistics"
[node name="AboutButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 1784.0
offset_top = 8.0
offset_right = 1854.0
offset_bottom = 48.0
+focus_mode = 0
+action_mode = 0
text = "About"
[node name="Search" parent="." instance=ExtResource("9_5ijvr")]
visible = false
layout_mode = 1
-offset_left = 349.196
-offset_top = 81.2367
-offset_right = 349.196
-offset_bottom = 81.2367
+offset_left = 56.0
+offset_top = 96.0
+offset_right = 56.0
+offset_bottom = 96.0
[node name="SyncPopupPanel" type="PopupPanel" parent="."]
initial_position = 2
size = Vector2i(140, 70)
[node name="Label" type="Label" parent="SyncPopupPanel"]
+texture_filter = 1
offset_left = 4.0
offset_top = 4.0
offset_right = 136.0
@@ -343,6 +388,7 @@ initial_position = 2
size = Vector2i(450, 100)
[node name="Label" type="Label" parent="StatisticsPopupPanel"]
+texture_filter = 1
offset_left = 4.0
offset_top = 4.0
offset_right = 446.0
@@ -351,6 +397,7 @@ text = "Statistics"
horizontal_alignment = 1
[node name="StatisticsLabel" type="Label" parent="StatisticsPopupPanel"]
+texture_filter = 1
offset_left = 4.0
offset_top = 4.0
offset_right = 446.0
@@ -370,15 +417,18 @@ offset_right = 844.0
offset_bottom = 706.0
[node name="Label" type="Label" parent="AboutPopupPanel/VBoxContainer"]
+texture_filter = 1
layout_mode = 2
text = "Music Player Randomizer"
horizontal_alignment = 1
[node name="VersionLabel" type="Label" parent="AboutPopupPanel/VBoxContainer"]
+texture_filter = 1
layout_mode = 2
horizontal_alignment = 1
[node name="AboutLabel" type="Label" parent="AboutPopupPanel/VBoxContainer"]
+texture_filter = 1
layout_mode = 2
text = "Try your video game music knowledge with this VGM randomizer, invite your friends and see who is the best."
horizontal_alignment = 1
@@ -388,6 +438,7 @@ layout_mode = 2
size_flags_vertical = 3
[node name="NewLabel" type="Label" parent="AboutPopupPanel/VBoxContainer/HBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
size_flags_horizontal = 3
@@ -396,10 +447,12 @@ text = "0.7-Beta: Can now hop between songs"
autowrap_mode = 2
[node name="ShortcutsLabel" type="Label" parent="AboutPopupPanel/VBoxContainer/HBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
[node name="CommingLabel" type="Label" parent="AboutPopupPanel/VBoxContainer/HBoxContainer"]
+texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
size_flags_horizontal = 3
@@ -429,6 +482,7 @@ initial_position = 2
size = Vector2i(350, 100)
[node name="WinnerLabel" type="Label" parent="WinnerPopupPanel"]
+texture_filter = 1
offset_left = 4.0
offset_top = 4.0
offset_right = 346.0
diff --git a/MusicListScrollContainer.gd b/MusicListScrollContainer.gd
index 68ba7bc..0d63ea0 100644
--- a/MusicListScrollContainer.gd
+++ b/MusicListScrollContainer.gd
@@ -5,4 +5,4 @@ var max_value = 0;
func _draw():
if max_value != self.get_v_scroll_bar().max_value:
max_value = self.get_v_scroll_bar().max_value
- self.scroll_vertical = max_value
\ No newline at end of file
+ self.scroll_vertical = max_value
diff --git a/MusicPlayer.gd b/MusicPlayer.gd
index 568fff1..a0a5f08 100644
--- a/MusicPlayer.gd
+++ b/MusicPlayer.gd
@@ -16,20 +16,24 @@ var audio_player: AudioStreamPlayer = $AudioStreamPlayer
@onready
var progress_slider: HSlider = $MusicPlayerContainer/MusicPlayerSlider
+@onready
+var volume_slider: HSlider = $MusicPlayerContainer/VolumeSlider
+
@onready
var music_time_label: Label = $MusicPlayerContainer/MusicTimeLabel
@onready
var path: String = '/Users/sebastian/ResilioSync/Sorterat_test/Metal Gear Solid 4 - Guns of the Patriots/2-16 Metal Gear Saga.mp3'
-var play_icon: Texture = preload("res://icons/play_icon.svg")
-var pause_icon: Texture = preload("res://icons/pause_icon.svg")
+var play_icon: Texture = preload("res://icons/play_icon_light.svg")
+var pause_icon: Texture = preload("res://icons/pause_icon_light.svg")
var songs: Array = []
var is_changing: bool = false
var playback_position: float
var stream: AudioStream
+var song_finished: bool = false
signal fetched
signal winner(player_name: String)
@@ -42,6 +46,8 @@ func _ready() -> void:
restart_button.pressed.connect(restart)
progress_slider.drag_started.connect(_on_drag_started)
progress_slider.drag_ended.connect(_on_drag_ended)
+
+ audio_player.finished.connect(_on_finished)
func _process(_delta: float) -> void:
if audio_player.has_stream_playback() && !is_changing && !audio_player.stream_paused:
@@ -55,14 +61,17 @@ func format_time(time: float) -> String:
var mins: String = "%02d" % floor(time / 60)
var sec: String = "%02d" % round(fmod(time, 60))
return mins + ":" + sec
-
+
func format_text(part: float, total: float) -> String:
return format_time(part) + " / " + format_time(total)
func play_or_pause() -> void:
- if audio_player.stream_paused:
+ if song_finished:
+ restart()
+ elif audio_player.stream_paused:
play_button.texture_normal = pause_icon
audio_player.stream_paused = false
+ song_finished = false
audio_player.seek(playback_position)
print("continue")
progress_slider.max_value = round(stream.get_length())
@@ -75,12 +84,17 @@ func play_or_pause() -> void:
func restart() -> void:
audio_player.stop()
audio_player.stream_paused = false
+ song_finished = false
progress_slider.value = 0
playback_position = audio_player.get_playback_position()
audio_player.seek(playback_position)
play_button.texture_normal = pause_icon
audio_player.play()
+func _on_finished() -> void:
+ play_button.texture_normal = play_icon
+ song_finished = true
+
func _on_drag_started() -> void:
is_changing = true
@@ -88,7 +102,18 @@ func _on_drag_ended(_changed: bool) -> void:
audio_player.seek(progress_slider.value)
playback_position = progress_slider.value
is_changing = false
+
+func seek(position: float) -> void:
+ progress_slider.value += position
+ is_changing = true
+ audio_player.seek(progress_slider.value)
+ playback_position = progress_slider.value
+ is_changing = false
+func change_volume(value: float) -> void:
+ volume_slider.value += value
+ volume_slider.change_volume(volume_slider.value)
+
func _on_point_triggered(point: String) -> void:
if point == "first":
var value: int = randi_range(0, 10)
@@ -104,6 +129,7 @@ func _on_point_triggered(point: String) -> void:
func play_sound(sound_name: AudioStream) -> void:
audio_player.stream = sound_name
audio_player.play()
+ song_finished = false
play_button.texture_normal = pause_icon
stream = audio_player.stream
progress_slider.max_value = round(stream.get_length())
@@ -114,32 +140,43 @@ func play_song(body: PackedByteArray) -> void:
sound.data = body
audio_player.stream = sound
audio_player.play()
+ song_finished = false
play_button.texture_normal = pause_icon
stream = audio_player.stream
progress_slider.max_value = round(stream.get_length())
progress_slider.tick_count = round(stream.get_length() / 60)
func song_fetched(body: PackedByteArray) -> void:
+ if audio_player.is_playing():
+ audio_player.stop()
+ await get_tree().create_timer(1.0).timeout
print("song_fetched")
var sound: AudioStream = AudioStreamMP3.new()
sound.data = body
print("play given song")
audio_player.stream = sound
audio_player.play()
+ song_finished = false
play_button.texture_normal = pause_icon
stream = audio_player.stream
progress_slider.max_value = round(stream.get_length())
progress_slider.tick_count = round(stream.get_length() / 60)
- add_to_queue.emit()
if Settings.add_to_stats:
- Settings.make_request3("/music/played")
+ print("add to stats")
+ Settings.make_request3("/music/addPlayed")
if !Settings.stop_after_current:
audio_player.finished.connect(fetch_next_song)
if !Settings.hide_next_track:
show_answer.emit()
+
+ add_to_queue.emit()
func fetch_next_song() -> void:
+ #if audio_player.is_playing():
+ # audio_player.stop()
+ # await get_tree().create_timer(1.0).timeout
+ print("fetch_next_song")
var url: String = ""
if Settings.use_low_played_mode:
url = "/music/rand/low"
diff --git a/MusicPlayer.tscn b/MusicPlayer.tscn
index 64993a6..1e389d8 100644
--- a/MusicPlayer.tscn
+++ b/MusicPlayer.tscn
@@ -1,11 +1,31 @@
-[gd_scene load_steps=6 format=3 uid="uid://ds15cgsf8vpvc"]
+[gd_scene load_steps=10 format=3 uid="uid://ds15cgsf8vpvc"]
[ext_resource type="Script" path="res://MusicPlayer.gd" id="1_t24ra"]
[ext_resource type="AudioStream" uid="uid://n2g8jddr85h2" path="res://01. Opening.mp3" id="2_xti80"]
-[ext_resource type="Texture2D" uid="uid://balbkfmupmj8u" path="res://icons/play_icon.svg" id="3_2ym83"]
-[ext_resource type="Texture2D" uid="uid://cu5d30apj6os6" path="res://icons/134221_refresh_reload_repeat_update_arrow_icon.svg" id="4_1grnq"]
+[ext_resource type="Texture2D" uid="uid://comxqfiykp54f" path="res://icons/play_icon_light.svg" id="3_6g308"]
+[ext_resource type="Texture2D" uid="uid://ccb6rvbldlgdg" path="res://icons/reload_light_icon.svg" id="4_jleuo"]
[ext_resource type="PackedScene" uid="uid://w400rnew7453" path="res://volume_slider.tscn" id="5_iifuj"]
+[sub_resource type="InputEventKey" id="InputEventKey_r4qo3"]
+device = -1
+alt_pressed = true
+keycode = 88
+physical_keycode = 88
+key_label = 88
+unicode = 120
+
+[sub_resource type="Shortcut" id="Shortcut_ipcfh"]
+events = [SubResource("InputEventKey_r4qo3")]
+
+[sub_resource type="InputEventKey" id="InputEventKey_2nvce"]
+device = -1
+alt_pressed = true
+keycode = 90
+unicode = 90
+
+[sub_resource type="Shortcut" id="Shortcut_i7swq"]
+events = [SubResource("InputEventKey_2nvce")]
+
[node name="MusicPlayer" type="PanelContainer"]
anchors_preset = 8
anchor_left = 0.5
@@ -23,6 +43,7 @@ script = ExtResource("1_t24ra")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_xti80")
+bus = &"music"
[node name="MusicPlayerContainer" type="HBoxContainer" parent="."]
layout_mode = 2
@@ -31,14 +52,20 @@ size_flags_vertical = 4
[node name="PlayTextureButton" type="TextureButton" parent="MusicPlayerContainer"]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
-texture_normal = ExtResource("3_2ym83")
+focus_mode = 0
+action_mode = 0
+shortcut = SubResource("Shortcut_ipcfh")
+texture_normal = ExtResource("3_6g308")
ignore_texture_size = true
stretch_mode = 0
[node name="RestartTextureButton" type="TextureButton" parent="MusicPlayerContainer"]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
-texture_normal = ExtResource("4_1grnq")
+focus_mode = 0
+action_mode = 0
+shortcut = SubResource("Shortcut_i7swq")
+texture_normal = ExtResource("4_jleuo")
ignore_texture_size = true
stretch_mode = 0
flip_h = true
diff --git a/Player.gd b/Player.gd
index a00869a..f61a729 100644
--- a/Player.gd
+++ b/Player.gd
@@ -28,6 +28,9 @@ var player_name: String
@export
var player_score: String
+@export
+var id: int
+
var is_first_point: bool = true
# Called when the node enters the scene tree for the first time.
@@ -38,6 +41,53 @@ func _ready() -> void:
remove_player.pressed.connect(func(): player_removed.emit())
player_name_field.text = player_score
+func _input(event: InputEvent) -> void:
+ if event is InputEventKey and event.pressed:
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_1:
+ check_player(1, false)
+ elif event.alt_pressed && event.keycode == KEY_1:
+ check_player(1, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_2:
+ check_player(2, false)
+ elif event.alt_pressed && event.keycode == KEY_2:
+ check_player(2, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_3:
+ check_player(3, false)
+ elif event.alt_pressed && event.keycode == KEY_3:
+ check_player(3, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_4:
+ check_player(4, false)
+ elif event.alt_pressed && event.keycode == KEY_4:
+ check_player(4, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_5:
+ check_player(5, false)
+ elif event.alt_pressed && event.keycode == KEY_5:
+ check_player(5, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_6:
+ check_player(6, false)
+ elif event.alt_pressed && event.keycode == KEY_6:
+ check_player(6, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_7:
+ check_player(7, false)
+ elif event.alt_pressed && event.keycode == KEY_7:
+ check_player(7, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_8:
+ check_player(8, false)
+ elif event.alt_pressed && event.keycode == KEY_8:
+ check_player(8, true)
+ if event.alt_pressed && event.ctrl_pressed && event.keycode == KEY_9:
+ check_player(9, false)
+ elif event.alt_pressed && event.keycode == KEY_9:
+ check_player(9, true)
+
+func check_player(pressed: int, add: bool):
+ if (id == pressed):
+ print("Player " + str(id) + " pressed")
+ if add:
+ add_point()
+ else:
+ minus_point()
+
func add_point():
if is_first_point:
is_first_point = false
diff --git a/Player.tscn b/Player.tscn
index e9cffad..58cfea2 100644
--- a/Player.tscn
+++ b/Player.tscn
@@ -2,7 +2,7 @@
[ext_resource type="Script" path="res://Player.gd" id="1_if4kc"]
[ext_resource type="Texture2D" uid="uid://r4as0nmtoa7p" path="res://noCharacter.png" id="2_hpj3s"]
-[ext_resource type="Texture2D" uid="uid://t1tnj6nqpi4a" path="res://icons/person_remove-black-36dp.svg" id="3_5cuu3"]
+[ext_resource type="Texture2D" uid="uid://b2kj6m8qpsgb1" path="res://icons/person_remove_light.svg" id="3_j3uxe"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_821k2"]
bg_color = Color(0.180392, 0.180392, 0.180392, 1)
@@ -53,6 +53,8 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_w10e8")
[node name="Character" type="TextureButton" parent="HBoxContainer"]
custom_minimum_size = Vector2(80, 40)
layout_mode = 2
+focus_mode = 0
+action_mode = 0
texture_normal = ExtResource("2_hpj3s")
ignore_texture_size = true
stretch_mode = 5
@@ -65,6 +67,8 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_78a8g")
[node name="AddPoint" type="Button" parent="HBoxContainer"]
custom_minimum_size = Vector2(40, 40)
layout_mode = 2
+focus_mode = 0
+action_mode = 0
text = "+1"
[node name="Panel5" type="Panel" parent="HBoxContainer"]
@@ -75,6 +79,8 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_i56hb")
[node name="RemovePoint" type="Button" parent="HBoxContainer"]
custom_minimum_size = Vector2(40, 40)
layout_mode = 2
+focus_mode = 0
+action_mode = 0
text = "-1"
[node name="Panel" type="Panel" parent="HBoxContainer"]
@@ -86,4 +92,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_b2crt")
custom_minimum_size = Vector2(40, 40)
layout_mode = 2
size_flags_horizontal = 3
-texture_normal = ExtResource("3_5cuu3")
+focus_mode = 0
+action_mode = 0
+texture_normal = ExtResource("3_j3uxe")
+stretch_mode = 0
diff --git a/PlayerNameField.gd b/PlayerNameField.gd
index a85a6ae..2d06140 100644
--- a/PlayerNameField.gd
+++ b/PlayerNameField.gd
@@ -16,9 +16,9 @@ func _input(event):
if event is InputEventKey and event.pressed:
if event.alt_pressed && event.keycode == KEY_A:
close_pressed.emit()
-
- if event.keycode == KEY_ENTER || event.keycode == KEY_KP_ENTER:
- enter_key_pressed.emit()
+ if has_focus():
+ if event.keycode == KEY_ENTER || event.keycode == KEY_KP_ENTER:
+ enter_key_pressed.emit()
func _on_text_changed():
if text.contains("\n"):
diff --git a/SearchWindow.gd b/SearchWindow.gd
index 87eec84..1b2f3b1 100644
--- a/SearchWindow.gd
+++ b/SearchWindow.gd
@@ -15,7 +15,7 @@ var search_bar := $Searchbar
var games := []
# Called when the node enters the scene tree for the first time.
-func _ready():
+func _ready() -> void:
get_list_of_games()
clear_button.pressed.connect(clear)
close_button.pressed.connect(close)
@@ -23,47 +23,86 @@ func _ready():
search_bar.text_changed.connect(search)
visibility_changed.connect(focus)
-func focus():
+func focus() -> void:
if self.visible == true:
search_bar.grab_focus()
+ clear()
-func close():
+func close() -> void:
clear()
self.visible = false
-func search():
+func search() -> void:
print(search_bar.text)
Settings.delete_children(search_list)
- for game in games:
- if is_match(search_bar.text, game):
- var label := Label.new()
- label.text = game
- label.autowrap_mode = TextServer.AUTOWRAP_WORD
- search_list.add_child(label)
-
-func is_match(search_term: String, game_name: String) -> bool:
- search_term = search_term.replace(" ", "").replace("é", "e").to_lower()
- game_name = game_name.replace(" ", "").replace("é", "e").to_lower()
+ for game: String in games:
+ if is_match_exact(search_bar.text, game):
+ add_game(game)
+ for game: String in games:
+ if is_match_contains(clean_term(search_bar.text), clean_term(game)):
+ add_game(game)
+ for game: String in games:
+ if is_match_regex(clean_term(search_bar.text), clean_term(game)):
+ add_game(game)
+
+func clean_term(term: String) -> String:
+ return term.replace(" ", "").replace("é", "e").replace("+", "plus").replace("&", "and").replace("'n", "and").to_lower()
+
+func is_match_exact(search_term: String, game_name: String) -> bool:
+ search_term = search_term.to_lower()
+ game_name = game_name.to_lower()
+ if search_term == "":
+ return true
+ elif game_name.contains(search_term):
+ return true
+ else:
+ return false
+
+func is_match_contains(search_term: String, game_name: String) -> bool:
+ if search_term == "":
+ return true
+ elif game_name.contains(search_term):
+ return true
+ else:
+ return false
+
+func is_match_regex(search_term: String, game_name: String) -> bool:
if search_term == "":
return true
elif compile_regex(search_term).search(game_name):
return true
else:
return false
+
+func add_game(game: String) -> void:
+ var label := Label.new()
+ label.text = game
+ print("game: " + game)
+ label.autowrap_mode = TextServer.AUTOWRAP_WORD
+ if !game_exists(game):
+ search_list.add_child(label)
+
+func game_exists(game: String) -> bool:
+ var game_exists: bool = false
+ for child: Label in search_list.get_children():
+ if child.text == game:
+ game_exists = true
+ return game_exists
func compile_regex(search_term: String) -> RegEx:
var regex = RegEx.new()
var regText: String = ".*"
for letter in search_term:
regText += letter + ".*"
- print(regText)
+ #print(regText)
regex.compile(regText)
return regex
func get_list_of_games() -> void:
- var handle_games = func(array):
+ var handle_games = func handle_games(array):
if typeof(array) == TYPE_ARRAY:
+ games = []
games.append_array(array)
for game in games:
var label := Label.new()
@@ -74,7 +113,7 @@ func get_list_of_games() -> void:
print("Unexpected data")
Settings.make_request2("/music/all/order", handle_games, true)
-func clear():
+func clear() -> void:
search_bar.text = ""
search()
search_bar.grab_focus()
diff --git a/SearchWindow.tscn b/SearchWindow.tscn
index 3c0dfca..620e2f6 100644
--- a/SearchWindow.tscn
+++ b/SearchWindow.tscn
@@ -17,24 +17,31 @@ offset_right = 1152.0
offset_bottom = 640.0
[node name="ClearButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 880.0
offset_top = 24.0
offset_right = 944.0
offset_bottom = 64.0
scale = Vector2(2, 2)
+focus_mode = 0
+action_mode = 0
text = "Clear"
[node name="CloseButton" type="Button" parent="."]
+texture_filter = 1
layout_mode = 2
offset_left = 1032.0
offset_top = 24.0
offset_right = 1082.0
offset_bottom = 64.0
scale = Vector2(2, 2)
+focus_mode = 0
+action_mode = 0
text = "Close"
[node name="Searchbar" type="TextEdit" parent="."]
+texture_filter = 1
layout_mode = 0
offset_left = 64.0
offset_top = 24.0
diff --git a/Settings.gd b/Settings.gd
index 072d28d..2ace87a 100644
--- a/Settings.gd
+++ b/Settings.gd
@@ -1,18 +1,20 @@
extends Node
var default_path: String = "https://tmusic.sanplex.tech"
-var selected_server: int = 0
+var selected_server: int = 1
var is_local: bool = false
var stop_after_current: bool = true
var hide_next_track: bool = true
-var add_to_stats: bool = false
+var add_to_stats: bool = true
var use_low_played_mode: bool = false
var winning_score: int = 20
var fullscreen: bool = false
var play_local: bool = false
+var number_of_players: int = 0
+
var version: String = "0.9.0-Beta"
var whats_new: String = "Changelog:
@@ -31,6 +33,7 @@ Change some buttons to icons"
var shortcuts: String = "Shortcuts:
Alt + S = Search
Alt + A = Add Players
+Alt + Z = Reset
Alt + X = Play/Pause
Alt + C = Next Song
Alt + V = Show Answer"
@@ -40,8 +43,15 @@ Alt + V = Show Answer"
#visa svar = v
#lägga till poäng? 1, 2, 3, 4, 5, 6
+func get_next_player_id() -> int:
+ number_of_players += 1
+ return number_of_players
+
func make_request2(address: String, func_name: Callable, expect_data: bool) -> void:
+ print("func_name: ", func_name.get_method())
+ print("get_object: ", func_name.get_object())
var error_handling: Callable = func(_result: int, response_code: int, _headers: PackedStringArray, body: PackedByteArray) -> void:
+ print("request done to address: ", default_path + address)
if response_code == 200:
if !expect_data:
func_name.call()
@@ -52,7 +62,10 @@ func make_request2(address: String, func_name: Callable, expect_data: bool) -> v
var data_received = json.get_data()
#print("data_received: ", data_received)
print("data_received type: ", typeof(data_received))
- func_name.call(data_received)
+ if typeof(data_received) == TYPE_ARRAY:
+ func_name.call(data_received)
+ elif func_name != null:
+ func_name.call(data_received)
else:
print("song_received")
func_name.call(body)
@@ -62,6 +75,7 @@ func make_request2(address: String, func_name: Callable, expect_data: bool) -> v
http_request.request_completed.connect(error_handling)
# Perform a GET request. The URL below returns JSON as of writing.
+ print("address: ", default_path + address)
var request_error: int = http_request.request(default_path + address)
if request_error != OK:
push_error("An error occurred in the HTTP request.")
diff --git a/SettingsWindow.gd b/SettingsWindow.gd
index ef7fd94..abaff9e 100644
--- a/SettingsWindow.gd
+++ b/SettingsWindow.gd
@@ -38,7 +38,7 @@ func _ready():
low_played_button.pressed.connect(low_played)
lower_winning_score_button.pressed.connect(lower_winning_score)
increase_winning_score_button.pressed.connect(increase_winning_score)
- select_server_button.pressed.connect(select_server)
+ #select_server_button.pressed.connect(select_server)
fullscreen_button.pressed.connect(fullscreen)
local_button.pressed.connect(local_play)
@@ -47,6 +47,7 @@ func _ready():
add_to_database_button.button_pressed = Settings.add_to_stats
low_played_button.button_pressed = Settings.use_low_played_mode
select_server_button.select(Settings.selected_server)
+ select_server_button.item_selected.connect(select_server)
func fullscreen():
Settings.fullscreen = !Settings.fullscreen
@@ -78,6 +79,10 @@ func increase_winning_score():
Settings.winning_score += 1
score_label.text = str(Settings.winning_score)
-func select_server() -> void:
- Settings.default_path = select_server_button.get_item_text(select_server_button.selected)
- Settings.selected_server = select_server_button.selected
+func select_server(new_server: int) -> void:
+ 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))
diff --git a/SettingsWindow.tscn b/SettingsWindow.tscn
index 5231380..ce10e5e 100644
--- a/SettingsWindow.tscn
+++ b/SettingsWindow.tscn
@@ -26,12 +26,14 @@ horizontal_alignment = 1
[node name="StopAfterCurrentCheckButton" type="CheckButton" parent="."]
layout_mode = 2
size_flags_horizontal = 0
+button_pressed = true
action_mode = 0
text = "Stop after current"
[node name="HideNextTrackCheckButton" type="CheckButton" parent="."]
layout_mode = 2
size_flags_horizontal = 0
+button_pressed = true
action_mode = 0
text = "Hide next track"
@@ -61,23 +63,29 @@ text = "20"
[node name="LowerButton" type="Button" parent="HBoxContainer"]
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
+focus_mode = 0
+action_mode = 0
text = "-1"
[node name="IncreaseButton" type="Button" parent="HBoxContainer"]
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="."]
layout_mode = 2
-item_count = 3
+item_count = 4
selected = 0
-popup/item_0/text = "https://tmusic.sanplex.tech"
-popup/item_0/id = 0
-popup/item_1/text = "https://music.sanplex.tech"
-popup/item_1/id = 1
+popup/item_0/text = "https://music.sanplex.tech"
+popup/item_0/id = 1
+popup/item_1/text = "https://tmusic.sanplex.tech"
+popup/item_1/id = 0
popup/item_2/text = "http://192.168.86.100:8085"
popup/item_2/id = 2
+popup/item_3/text = "http://localhost:8080"
+popup/item_3/id = 3
[node name="FullscreenButton" type="CheckButton" parent="."]
layout_mode = 2
diff --git a/export_presets.cfg b/export_presets.cfg
index 20b657a..a972cc0 100644
--- a/export_presets.cfg
+++ b/export_presets.cfg
@@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
-export_path="../../ResilioSync/Sorterat/MusicPlayer_0.9.0_Beta.exe"
+export_path="../../ResilioSync/Sorterat/MusicPlayer_1.0.2.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
@@ -31,7 +31,7 @@ codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
-application/modify_resources=true
+application/modify_resources=false
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
@@ -42,6 +42,7 @@ application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
+application/export_angle=0
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
@@ -59,6 +60,9 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
+dotnet/include_scripts_content=false
+dotnet/include_debug_symbols=true
+dotnet/embed_build_outputs=false
debug/export_console_script=1
[preset.1]
@@ -94,6 +98,7 @@ application/version="1.0"
application/copyright=""
application/copyright_localized={}
application/min_macos_version="10.12"
+application/export_angle=0
display/high_res=true
xcode/platform_build="14C18"
xcode/sdk_version="13.1"
@@ -127,6 +132,7 @@ codesign/entitlements/app_sandbox/files_downloads=0
codesign/entitlements/app_sandbox/files_pictures=0
codesign/entitlements/app_sandbox/files_music=0
codesign/entitlements/app_sandbox/files_movies=0
+codesign/entitlements/app_sandbox/files_user_selected=0
codesign/entitlements/app_sandbox/helper_executables=[]
codesign/custom_options=PackedStringArray()
notarization/notarization=0
@@ -163,6 +169,9 @@ open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
+dotnet/include_scripts_content=false
+dotnet/include_debug_symbols=true
+dotnet/embed_build_outputs=false
debug/export_console_script=1
notarization/apple_team_id=""
@@ -203,3 +212,6 @@ progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)
+dotnet/include_scripts_content=false
+dotnet/include_debug_symbols=true
+dotnet/embed_build_outputs=false
diff --git a/icons/134221_refresh_reload_repeat_update_arrow_icon.svg.import b/icons/134221_refresh_reload_repeat_update_arrow_icon.svg.import
deleted file mode 100644
index 7bb9409..0000000
--- a/icons/134221_refresh_reload_repeat_update_arrow_icon.svg.import
+++ /dev/null
@@ -1,37 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://cu5d30apj6os6"
-path="res://.godot/imported/134221_refresh_reload_repeat_update_arrow_icon.svg-2f211a3a6698868bbe9157ba00acac34.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://icons/134221_refresh_reload_repeat_update_arrow_icon.svg"
-dest_files=["res://.godot/imported/134221_refresh_reload_repeat_update_arrow_icon.svg-2f211a3a6698868bbe9157ba00acac34.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=false
-editor/convert_colors_with_editor_theme=false
diff --git a/icons/pause_icon.svg.import b/icons/pause_icon.svg.import
deleted file mode 100644
index 613b194..0000000
--- a/icons/pause_icon.svg.import
+++ /dev/null
@@ -1,37 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://dy3s5efx3t48l"
-path="res://.godot/imported/pause_icon.svg-68ce3214f66117eb84625596d75649f0.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://icons/pause_icon.svg"
-dest_files=["res://.godot/imported/pause_icon.svg-68ce3214f66117eb84625596d75649f0.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=false
-editor/convert_colors_with_editor_theme=false
diff --git a/icons/pause_icon.svg b/icons/pause_icon_dark.svg
similarity index 100%
rename from icons/pause_icon.svg
rename to icons/pause_icon_dark.svg
diff --git a/icons/pause_icon_light.png b/icons/pause_icon_light.png
new file mode 100644
index 0000000..11e3501
Binary files /dev/null and b/icons/pause_icon_light.png differ
diff --git a/icons/pause_icon_light.svg b/icons/pause_icon_light.svg
new file mode 100644
index 0000000..abbc2da
--- /dev/null
+++ b/icons/pause_icon_light.svg
@@ -0,0 +1,44 @@
+
+
diff --git a/icons/person_add_alt_1-black-36dp.svg.import b/icons/person_add_alt_1-black-36dp.svg.import
deleted file mode 100644
index c1d43a0..0000000
--- a/icons/person_add_alt_1-black-36dp.svg.import
+++ /dev/null
@@ -1,37 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://o5go6smk7hm1"
-path="res://.godot/imported/person_add_alt_1-black-36dp.svg-25623c537799fb927948ac6a1b469357.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://icons/person_add_alt_1-black-36dp.svg"
-dest_files=["res://.godot/imported/person_add_alt_1-black-36dp.svg-25623c537799fb927948ac6a1b469357.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=false
-editor/convert_colors_with_editor_theme=false
diff --git a/icons/person_add_alt_1-black-36dp.svg b/icons/person_add_dark.svg
similarity index 100%
rename from icons/person_add_alt_1-black-36dp.svg
rename to icons/person_add_dark.svg
diff --git a/icons/person_add_light.svg b/icons/person_add_light.svg
new file mode 100644
index 0000000..d0832cf
--- /dev/null
+++ b/icons/person_add_light.svg
@@ -0,0 +1,65 @@
+
+
diff --git a/icons/person_remove-black-36dp.svg.import b/icons/person_remove-black-36dp.svg.import
deleted file mode 100644
index 9982c29..0000000
--- a/icons/person_remove-black-36dp.svg.import
+++ /dev/null
@@ -1,37 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://t1tnj6nqpi4a"
-path="res://.godot/imported/person_remove-black-36dp.svg-963386011d14140f65e426970f38ba33.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://icons/person_remove-black-36dp.svg"
-dest_files=["res://.godot/imported/person_remove-black-36dp.svg-963386011d14140f65e426970f38ba33.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=false
-editor/convert_colors_with_editor_theme=false
diff --git a/icons/person_remove-black-36dp.svg b/icons/person_remove_dark.svg
similarity index 100%
rename from icons/person_remove-black-36dp.svg
rename to icons/person_remove_dark.svg
diff --git a/icons/person_remove_light.svg b/icons/person_remove_light.svg
new file mode 100644
index 0000000..ac75433
--- /dev/null
+++ b/icons/person_remove_light.svg
@@ -0,0 +1,65 @@
+
+
diff --git a/icons/play_icon.svg.import b/icons/play_icon.svg.import
deleted file mode 100644
index 4db4969..0000000
--- a/icons/play_icon.svg.import
+++ /dev/null
@@ -1,37 +0,0 @@
-[remap]
-
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://balbkfmupmj8u"
-path="res://.godot/imported/play_icon.svg-0a6a03003397e38401a1f89bcd5454b2.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://icons/play_icon.svg"
-dest_files=["res://.godot/imported/play_icon.svg-0a6a03003397e38401a1f89bcd5454b2.ctex"]
-
-[params]
-
-compress/mode=0
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=0
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/normal_map_invert_y=false
-process/hdr_as_srgb=false
-process/hdr_clamp_exposure=false
-process/size_limit=0
-detect_3d/compress_to=1
-svg/scale=1.0
-editor/scale_with_editor_scale=false
-editor/convert_colors_with_editor_theme=false
diff --git a/icons/play_icon.svg b/icons/play_icon_dark.svg
similarity index 100%
rename from icons/play_icon.svg
rename to icons/play_icon_dark.svg
diff --git a/icons/play_icon_light.png b/icons/play_icon_light.png
new file mode 100644
index 0000000..b6d46a3
Binary files /dev/null and b/icons/play_icon_light.png differ
diff --git a/icons/play_icon_light.svg b/icons/play_icon_light.svg
new file mode 100644
index 0000000..1b6d905
--- /dev/null
+++ b/icons/play_icon_light.svg
@@ -0,0 +1,38 @@
+
+
diff --git a/icons/134221_refresh_reload_repeat_update_arrow_icon.svg b/icons/reload_dark_icon.svg
similarity index 100%
rename from icons/134221_refresh_reload_repeat_update_arrow_icon.svg
rename to icons/reload_dark_icon.svg
diff --git a/icons/reload_light_icon.png b/icons/reload_light_icon.png
new file mode 100644
index 0000000..3024c0e
Binary files /dev/null and b/icons/reload_light_icon.png differ
diff --git a/icons/reload_light_icon.svg b/icons/reload_light_icon.svg
new file mode 100644
index 0000000..0d0ccfe
--- /dev/null
+++ b/icons/reload_light_icon.svg
@@ -0,0 +1,37 @@
+
+
diff --git a/icons/reload_light_icon_bigger.svg b/icons/reload_light_icon_bigger.svg
new file mode 100644
index 0000000..0dc91d0
--- /dev/null
+++ b/icons/reload_light_icon_bigger.svg
@@ -0,0 +1,40 @@
+
+
diff --git a/project.godot b/project.godot
index 2e1d219..13e44a1 100644
--- a/project.godot
+++ b/project.godot
@@ -13,7 +13,6 @@ config_version=5
config/name="MusicPlayer"
run/main_scene="res://MainWindow.tscn"
config/features=PackedStringArray("4.2", "Forward Plus")
-run/low_processor_mode=true
config/icon="res://icon.svg"
[autoload]
@@ -31,6 +30,7 @@ window/size/viewport_width=1920
window/size/viewport_height=1080
window/energy_saving/keep_screen_on=false
window/stretch/mode="canvas_items"
+window/vsync/vsync_mode=2
[dotnet]
@@ -41,10 +41,20 @@ project/assembly_name="MusicPlayer"
version_control/plugin_name="GitPlugin"
version_control/autoload_on_startup=true
-[dotnet]
+[input]
-project/assembly_name="MusicPlayer"
+ui_accept={
+"deadzone": 0.5,
+"events": []
+}
+ui_select={
+"deadzone": 0.5,
+"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
+]
+}
[rendering]
textures/vram_compression/import_s3tc_bptc=true
+textures/default_filters/use_nearest_mipmap_filter=true
+textures/decals/filter=0
diff --git a/volume_slider.gd b/volume_slider.gd
index 23de4da..3e8751e 100644
--- a/volume_slider.gd
+++ b/volume_slider.gd
@@ -13,3 +13,6 @@ func _ready():
func _on_value_changed(changed_value: float) -> void:
AudioServer.set_bus_volume_db(_bus, linear_to_db(changed_value))
+
+func change_volume(changed_value: float) -> void:
+ AudioServer.set_bus_volume_db(_bus, linear_to_db(changed_value))