Why is `FlxSave.validate` private?
FlxSave.validate and FlxSave.validateAndWarn are not public functions. Is there a reason for this? The requirement of needing a @:privateAccess call seems unnecessary.
Fields such as invalidChars are also private, this could be avoided by making the setter null.
if we make validate public, it should be renamed to something less vague like validateSavePath (keep and deprecate the old private func too in case anyone was using @:privateAccess, and rather than making invalidChars read only, lets add a public isValidSavePath().
Also if you're calling save.bind() with a custom path, there's a good chance you're doing something wrong. The preferred way of using a custom save path is to change the title and company fields in your project.xml's app node. Can you talk about why you need this?
Also if you're calling
save.bind()with a custom path, there's a good chance you're doing something wrong. The preferred way of using a custom save path is to change thetitleandcompanyfields in your project.xml's app node. Can you talk about why you need this?
I'm making a syetem where the player can select multiple saves, or have the ability to create new ones while also being able to change their name, I want to validate the name inputted to make sure it's valid
what about having multiple save slots under one actual save? pretty sure you can use a Maps in FlxSave or if not, can use DynamicAccess, example:
final data:DynamicAccess<{score:Int, levelsCompleted:Int}> = cast FlxG.save.data;
if (data.exists(saveSlotName))
{
final slotData = data.get(saveSlotName);
trace('score: ${slotData.score}, levels completed: ${slotData.levelsCompleted}');
}
else
{
data.set(saveSlotName, { score: 0, levelsCompleted:0 });
trace('No existing slot named "$saveSlotName", creating new one');
FlxG.save.data.flush();
}