From cbdb3a4e52f15f000ba7db4381cdd8572b03f9b7 Mon Sep 17 00:00:00 2001 From: notdraimdev Date: Mon, 25 Nov 2024 20:27:27 +0100 Subject: [PATCH] adjusted playing now window + adjustments to the save system --- main.gd | 5 +++-- playing_now_window.gd | 2 +- playing_now_window.tscn | 10 ---------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/main.gd b/main.gd index f2cdc8a..a71f75f 100644 --- a/main.gd +++ b/main.gd @@ -76,7 +76,7 @@ var currentSongName:String var currentArtistName:String var currentAlbumName:String -var LoadingSaveFailed:bool +var LoadingSaveFailed:bool = true @onready var loading_failed_screen: Control = $LoadingFailedScreen # Called when the node enters the scene tree for the first time. @@ -645,6 +645,7 @@ func loadUserdata() -> Dictionary: content = json.parse_string(Marshalls.base64_to_utf8(file.get_as_text())) file.close() if content != null: + LoadingSaveFailed = false return content else: LoadingSaveFailed = true @@ -672,13 +673,13 @@ func loadPlaylists(): if file.get_as_text() != "" and file2.get_as_text() != "": var PlaylistsLocationTemp var PlaylistsTemp - LoadingSaveFailed PlaylistsLocationTemp = json.parse_string(file.get_as_text()) PlaylistsTemp = json.parse_string(file2.get_as_text()) if (PlaylistsTemp == null) or (PlaylistsLocationTemp == null): printerr("Loading playlists failed") LoadingSaveFailed = true else: + LoadingSaveFailed = false Playlists = PlaylistsTemp PlaylistsLocation = PlaylistsLocationTemp print(PlaylistsLocation) diff --git a/playing_now_window.gd b/playing_now_window.gd index 4bdca20..c29115c 100644 --- a/playing_now_window.gd +++ b/playing_now_window.gd @@ -17,5 +17,5 @@ func SongChanged(): print("SongChanged: ", ParentScene.currentSongName) desctibtor.text = 'Now Playing: "' + ParentScene.currentSongName + '"' if ParentScene.currentArtistName: - desctibtor.text += " from " + ParentScene.currentArtistName + desctibtor.text += " uploaded by " + ParentScene.currentArtistName #ParentWindow.size = size * 2 diff --git a/playing_now_window.tscn b/playing_now_window.tscn index a8a24e2..8ee8e06 100644 --- a/playing_now_window.tscn +++ b/playing_now_window.tscn @@ -9,13 +9,3 @@ script = ExtResource("1_f0rac") [node name="Desctibtor" type="Label" parent="."] layout_mode = 2 - -[node name="ColorRect" type="ColorRect" parent="Desctibtor"] -z_index = -2 -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0.187176, 0.187176, 0.187176, 0.101961)