Fixed settings and updated player view. Fixed many other smaler things
This commit is contained in:
44
Settings.gd
44
Settings.gd
@@ -1,26 +1,27 @@
|
||||
extends Node
|
||||
|
||||
#var default_path: String = "http://192.168.86.100:8085"
|
||||
#var default_path: String = "https://music.sanplex.tech"
|
||||
var default_path: String = "https://tmusic.sanplex.tech"
|
||||
var selected_server = 0
|
||||
|
||||
var is_local: bool = false
|
||||
|
||||
var stop_after_current: bool = false
|
||||
var hide_next_track: bool = false
|
||||
var stop_after_current: bool = true
|
||||
var hide_next_track: bool = true
|
||||
var add_to_stats: bool = false
|
||||
var use_low_played_mode: bool = false
|
||||
var winning_score: int = 20
|
||||
var fullscreen: bool = false
|
||||
|
||||
var version: String = "0.9.0-Beta"
|
||||
|
||||
var version: String = "0.7.8-Beta"
|
||||
var whats_new: String = "Changelog:
|
||||
0.9.0-Beta: Fixed settings and updated the player view
|
||||
0.8.0-Beta: Fixed reset buttons and some other small things
|
||||
0.7.8-Beta: Added shortcuts. Added dialog for winner. Started cleaning code.
|
||||
0.7.5-Beta: Added settings menu, most things don't do anythig yet
|
||||
0.7-Beta: Can now hop between songs"
|
||||
|
||||
var whats_left: String = "Things left to do:
|
||||
Fix reset buttons
|
||||
Fix settings
|
||||
Fix graphics in lists
|
||||
Fix layout
|
||||
Fix for local play
|
||||
@@ -33,28 +34,31 @@ Alt + X = Play/Pause
|
||||
Alt + C = Next Song
|
||||
Alt + V = Show Answer"
|
||||
|
||||
|
||||
#play = X
|
||||
#nästa = c
|
||||
#visa svar = v
|
||||
#lägga till poäng? 1, 2, 3, 4, 5, 6
|
||||
|
||||
|
||||
func make_request2(address: String, func_name: Callable) -> void:
|
||||
var error_handling = func(result, response_code, headers, body):
|
||||
var json = JSON.new()
|
||||
var error = json.parse(body.get_string_from_utf8())
|
||||
if error == OK:
|
||||
var data_received = json.get_data()
|
||||
print("data_received: ", data_received)
|
||||
func_name.call(data_received)
|
||||
|
||||
var http_request = HTTPRequest.new()
|
||||
func make_request2(address: String, func_name: Callable, expect_data: bool) -> void:
|
||||
var error_handling = func(_result: int, response_code: int, _headers: PackedStringArray, body: PackedByteArray):
|
||||
if response_code == 200:
|
||||
if !expect_data:
|
||||
func_name.call()
|
||||
else:
|
||||
var json = JSON.new()
|
||||
var error = json.parse(body.get_string_from_utf8())
|
||||
if error == OK:
|
||||
var data_received = json.get_data()
|
||||
print("data_received: ", data_received)
|
||||
func_name.call(data_received)
|
||||
|
||||
var http_request: HTTPRequest = HTTPRequest.new()
|
||||
add_child(http_request)
|
||||
http_request.request_completed.connect(error_handling)
|
||||
|
||||
# Perform a GET request. The URL below returns JSON as of writing.
|
||||
var error = http_request.request(default_path + address)
|
||||
if error != OK:
|
||||
var request_error = http_request.request(default_path + address)
|
||||
if request_error != OK:
|
||||
push_error("An error occurred in the HTTP request.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user