private void onTriggerDelete(SaveFileItemPanel fileItem) { var filePath = GlobalPath.save + fileItem.Name + ".save"; System.IO.File.Delete(filePath); fileItem.QueueFree(); }
internal void GenerateFileItems(bool enableLoad, Action <string> onTriggerLoad, Action <string> onTriggerDelete) { foreach (var filePath in System.IO.Directory.EnumerateFiles(GlobalPath.save, "*.save")) { var fileItem = SaveFileItemPanel.Instance(this, enableLoad, filePath); fileItem.actTriggerLoad = onTriggerLoad; fileItem.actTriggerDelete = onTriggerDelete; } }
private void onTriggerLoad(SaveFileItemPanel fileItem) { EmitSignal(nameof(LoadSaveFile), fileItem.Name); fileItem.QueueFree(); }