Fixed light icons. Made the search "better". Added more shortcuts and tried to fix som bugs.

This commit is contained in:
2024-08-15 20:10:22 +02:00
parent 1a7b371161
commit e8171d81a9
35 changed files with 705 additions and 262 deletions

View File

@@ -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.")