adjusted playing now window + adjustments to the save system

This commit is contained in:
notdraimdev
2024-11-25 20:27:27 +01:00
parent 0c21592f91
commit cbdb3a4e52
3 changed files with 4 additions and 13 deletions
+3 -2
View File
@@ -76,7 +76,7 @@ var currentSongName:String
var currentArtistName:String var currentArtistName:String
var currentAlbumName:String var currentAlbumName:String
var LoadingSaveFailed:bool var LoadingSaveFailed:bool = true
@onready var loading_failed_screen: Control = $LoadingFailedScreen @onready var loading_failed_screen: Control = $LoadingFailedScreen
# Called when the node enters the scene tree for the first time. # 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())) content = json.parse_string(Marshalls.base64_to_utf8(file.get_as_text()))
file.close() file.close()
if content != null: if content != null:
LoadingSaveFailed = false
return content return content
else: else:
LoadingSaveFailed = true LoadingSaveFailed = true
@@ -672,13 +673,13 @@ func loadPlaylists():
if file.get_as_text() != "" and file2.get_as_text() != "": if file.get_as_text() != "" and file2.get_as_text() != "":
var PlaylistsLocationTemp var PlaylistsLocationTemp
var PlaylistsTemp var PlaylistsTemp
LoadingSaveFailed
PlaylistsLocationTemp = json.parse_string(file.get_as_text()) PlaylistsLocationTemp = json.parse_string(file.get_as_text())
PlaylistsTemp = json.parse_string(file2.get_as_text()) PlaylistsTemp = json.parse_string(file2.get_as_text())
if (PlaylistsTemp == null) or (PlaylistsLocationTemp == null): if (PlaylistsTemp == null) or (PlaylistsLocationTemp == null):
printerr("Loading playlists failed") printerr("Loading playlists failed")
LoadingSaveFailed = true LoadingSaveFailed = true
else: else:
LoadingSaveFailed = false
Playlists = PlaylistsTemp Playlists = PlaylistsTemp
PlaylistsLocation = PlaylistsLocationTemp PlaylistsLocation = PlaylistsLocationTemp
print(PlaylistsLocation) print(PlaylistsLocation)
+1 -1
View File
@@ -17,5 +17,5 @@ func SongChanged():
print("SongChanged: ", ParentScene.currentSongName) print("SongChanged: ", ParentScene.currentSongName)
desctibtor.text = 'Now Playing: "' + ParentScene.currentSongName + '"' desctibtor.text = 'Now Playing: "' + ParentScene.currentSongName + '"'
if ParentScene.currentArtistName: if ParentScene.currentArtistName:
desctibtor.text += " from " + ParentScene.currentArtistName desctibtor.text += " uploaded by " + ParentScene.currentArtistName
#ParentWindow.size = size * 2 #ParentWindow.size = size * 2
-10
View File
@@ -9,13 +9,3 @@ script = ExtResource("1_f0rac")
[node name="Desctibtor" type="Label" parent="."] [node name="Desctibtor" type="Label" parent="."]
layout_mode = 2 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)