extends Node var seenPath = OS.get_user_data_dir() + "/globalSeen.txt"; var arraySeenTexts:Array; func _ready(): DeserializeSeen(); func DeserializeSeen(): var file = File.new(); if not file.file_exists(seenPath): arraySeenTexts = []; SerializeSeen(); else : file.open(seenPath, File.READ); arraySeenTexts = str2var(file.get_pascal_string()); file.close() func SerializeSeen(): var file = File.new(); file.open(seenPath, File.WRITE); file.store_pascal_string(var2str(arraySeenTexts)); file.close() func AddSeen(text): if not text in arraySeenTexts and text != "": arraySeenTexts.push_back(text); func CheckIfSeen(text:String)->bool: return text in arraySeenTexts;