fixed saving & added first basic save creation menu
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class_name Config
|
||||
extends Resource
|
||||
extends SaveFile
|
||||
|
||||
@export var fullscreen: bool = ProjectSettings.get_setting("display/window/size/mode") == Window.MODE_EXCLUSIVE_FULLSCREEN | Window.MODE_FULLSCREEN
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
class_name Profile
|
||||
extends Resource
|
||||
extends SaveFile
|
||||
|
||||
@export var your_name: String = "Joel"
|
||||
@export var villain_friend_name: String = "Josh"
|
||||
@export var stupid_friend_name: String = "Kevin"
|
||||
@export var named_things: Dictionary[StringName, String] = {
|
||||
"player_name": "Joel",
|
||||
"villain_friend": "Josh",
|
||||
"stupid_friend": "Kevin",
|
||||
"favourite_candy": "Chocolate"
|
||||
}
|
||||
|
||||
14
scripts/resources/save_file.gd
Normal file
14
scripts/resources/save_file.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
class_name SaveFile
|
||||
extends Resource
|
||||
|
||||
@export var save_name = "Save"
|
||||
|
||||
func _init(p_save_name = "Save") -> void:
|
||||
save_name = p_save_name
|
||||
|
||||
func save() -> void: Save.save(self)
|
||||
func load() -> void: Save.load(self)
|
||||
|
||||
func reset() -> void:
|
||||
Save.file.erase_section(save_name)
|
||||
Save.file.save(Save.save_path)
|
||||
1
scripts/resources/save_file.gd.uid
Normal file
1
scripts/resources/save_file.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dru7lnuaadb87
|
||||
Reference in New Issue
Block a user