ccf9813c80
Alle Texte stehen in einer Tabelle mit Deutsch und Englisch, die das Spiel zur Laufzeit liest. Die Tasten werden in Code angelegt, nach physischer Position. SaveStore verwaltet den Spielerschlüssel dieser Installation, schreibt den Speicherstand über eine temporäre Datei, legt unbrauchbare Stände beiseite und behält die zehn neuesten Aufzeichnungen. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
19 lines
640 B
GDScript
19 lines
640 B
GDScript
class_name TestFiles
|
|
extends RefCounted
|
|
## Temporary folders below user://tests for tests that write files, so that
|
|
## tests never touch the player's real key, save or recordings.
|
|
|
|
|
|
static func temporary_dir(label: String) -> String:
|
|
var path := "user://tests".path_join("%s-%d" % [label, Time.get_ticks_usec()])
|
|
DirAccess.make_dir_recursive_absolute(path)
|
|
return path
|
|
|
|
|
|
static func remove_dir(path: String) -> void:
|
|
for file in DirAccess.get_files_at(path):
|
|
DirAccess.remove_absolute(path.path_join(file))
|
|
for directory in DirAccess.get_directories_at(path):
|
|
remove_dir(path.path_join(directory))
|
|
DirAccess.remove_absolute(path)
|