A little folders cleanup
This commit is contained in:
parent
997e3c0982
commit
545da7be1f
90 changed files with 68 additions and 1661 deletions
32
scripts/Classes/profile.gd
Normal file
32
scripts/Classes/profile.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class_name Profile
|
||||
|
||||
var profile_meta = {
|
||||
'hash' : {},
|
||||
'meta' : {
|
||||
'created_in_version' : Game.gameversion,
|
||||
'creation_date' : Time.get_datetime_string_from_system(),
|
||||
'last_version' : Game.gameversion,
|
||||
'last_updated' : Time.get_datetime_string_from_system(),
|
||||
'profile_name' : "",
|
||||
'legit' : true
|
||||
}
|
||||
}
|
||||
|
||||
var path : set = _set_path
|
||||
|
||||
var is_root : set = _check_root
|
||||
|
||||
func _check_root(file_path):
|
||||
return file_path == "user://.cosmic"
|
||||
|
||||
func _set_path(name):
|
||||
return "user://{name}.cosmic".format({"name" : name})
|
||||
|
||||
static func create(meta):
|
||||
var profile = Profile.new()
|
||||
profile.profile_meta = meta
|
||||
profile.path = profile.profile_meta['meta']['profile_name']
|
||||
profile.is_root = profile.path
|
||||
if profile.is_root:
|
||||
profile.profile_meta['profiles'] = {}
|
||||
return profile
|
||||
Loading…
Add table
Add a link
Reference in a new issue