Skip to content

Commit

Permalink
no more saveContent ig
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Nov 24, 2024
1 parent 00b7b47 commit 2ec4332
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
5 changes: 0 additions & 5 deletions source/funkin/editors/SaveSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ class SaveSubstate extends MusicBeatSubstate {
public override function create() {
super.create();

#if mobile
MobileUtil.saveContent(options.defaultSaveFile, data);
close();
#else
var fileDialog = new FileDialog();
fileDialog.onCancel.add(function() close());
fileDialog.onSelect.add(function(str) {
CoolUtil.safeSaveFile(str, data);
close();
});
fileDialog.browse(SAVE, options.saveExt.getDefault(Path.extension(options.defaultSaveFile)), options.defaultSaveFile);
#end
}

public override function update(elapsed:Float) {
Expand Down
19 changes: 0 additions & 19 deletions source/mobile/funkin/backend/utils/MobileUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,6 @@ class MobileUtil
return daPath;
}

public static function saveContent(fileName:String, fileData:String, ?alert:Bool = true):Void
{
try
{
if (!FileSystem.exists('saves'))
FileSystem.createDirectory('saves');

File.saveContent('saves/$fileName', fileData);
if (alert)
NativeAPI.showMessageBox("Success!", '$fileName has been saved.', MSG_INFORMATION);
}
catch (e:haxe.Exception)
if (alert)
NativeAPI.showMessageBox("Error!", '$fileName couldn\'t be saved.\n(${e.message})', MSG_ERROR);
else
trace('$fileName couldn\'t be saved. (${e.message})');
}


#if android
public static function requestPermissionsFromUser():Void
{
Expand Down

0 comments on commit 2ec4332

Please sign in to comment.