Login screen, adds music manager, fixes kalulu hide and show sounds, fixes global theme
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
extends Resource
|
||||
class_name DeviceSettings
|
||||
|
||||
|
||||
# List of current known logins for teachers
|
||||
const possible_logins: = {
|
||||
"kalulu" : "kalulu",
|
||||
}
|
||||
|
||||
|
||||
@export var language : String :
|
||||
set(value):
|
||||
language = value
|
||||
@@ -10,14 +17,8 @@ class_name DeviceSettings
|
||||
@export var device_id : int
|
||||
|
||||
|
||||
# List of current known logins for teachers
|
||||
const possible_logins: = {
|
||||
"kalulu" : "kalulu",
|
||||
}
|
||||
|
||||
|
||||
func _init():
|
||||
# Gets the OS language and Checks if it is supported
|
||||
# Gets the OS language and checks if it is supported
|
||||
var osLanguage = OS.get_locale_language();
|
||||
if osLanguage and osLanguage in DirAccess.open("res://language_resources").get_directories():
|
||||
language = osLanguage
|
||||
@@ -30,6 +31,5 @@ func _init():
|
||||
|
||||
|
||||
func get_folder_path() -> String:
|
||||
var file_path := "user://" + teacher + "/" + str(device_id) + "/" + language + "/"
|
||||
var file_path := "user:/".path_join(teacher).path_join(str(device_id)).path_join(language)
|
||||
return file_path
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ border_color = Color(0, 0, 0, 1)
|
||||
[resource]
|
||||
AcceptDialog/styles/panel = SubResource("StyleBoxFlat_nikxc")
|
||||
Button/font_sizes/font_size = 32
|
||||
Button/colors/font_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
Button/constants/outline_size = 1
|
||||
Button/fonts/font = ExtResource("1_shpmh")
|
||||
FileDialog/icons/back_folder = ExtResource("1_mdn6k")
|
||||
FileDialog/icons/forward_folder = ExtResource("2_hbp6q")
|
||||
FileDialog/icons/parent_folder = ExtResource("3_1nwm4")
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
extends Resource
|
||||
class_name TeacherSettings
|
||||
|
||||
enum Type {
|
||||
Teacher,
|
||||
Parent
|
||||
}
|
||||
|
||||
@export var type : Type
|
||||
@export var devices_number : int
|
||||
@export var students_number : int
|
||||
# Faire une ressource Student ici plutot
|
||||
@export var students_passwords : Array
|
||||
|
||||
func _init(t : Type, devices : int, students: int):
|
||||
|
||||
type = t
|
||||
devices_number = devices
|
||||
students_number = students
|
||||
|
||||
var leftovers := students_number%devices_number
|
||||
|
||||
for i in devices:
|
||||
|
||||
var nb = students_number/devices_number
|
||||
if leftovers > 0:
|
||||
nb+= 1
|
||||
leftovers -=1
|
||||
|
||||
var passwords := []
|
||||
for j in nb:
|
||||
# TODO Fetch an unique password here
|
||||
passwords.append(str(j))
|
||||
|
||||
students_passwords.append(passwords)
|
||||
|
||||
print(students_passwords)
|
||||
Reference in New Issue
Block a user