emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.92k stars 1.52k forks source link

Customize eframe persistence file path #3927

Open C0D3-M4513R opened 5 months ago

C0D3-M4513R commented 5 months ago

Is your feature request related to a problem? Please describe.

When making an app, where you want to allow saving to a custom location (e.g. because you want your users to be able to work on multiple projects at once), you basically have to create a custom eframe::Storage implementation, which for me boils down to just copying the file that eframe::native::FileStorage resides in, removing the profiler macros and making the eframe::native::FileStorage::from_ron_filepath public.

Describe the solution you'd like

just make eframe::native::FileStorage::from_ron_filepath public

Describe alternatives you've considered

just copy the existing implementation

Additional context

emilk commented 5 months ago

Sure - you wanna make a PR? 🙏

YgorSouza commented 2 weeks ago

Did #4423 resolve this?

C0D3-M4513R commented 2 weeks ago

Not really no. I was thinking of being able to load/save from multiple different locations during the lifetime of an app (without re-creating the window). Something like being able to choose a project file to load/save to.

Your pr seems like it fixes the directory location on application start.