bevyengine / bevyengine/bevy

Feature request: File dialog handling

Open
#2,032 16 comments 6 reactions 0 assignees View on GitHub
A-UI C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Native open/save file dialogs are surprisingly hard to do in Rust, and Bevy makes them even harder. The only crate I'm aware is able to show file dialogs across all main platforms is [`rfd`](https://github.com/PolyMeilex/rfd). However, due to some bug in [`winit`](https://github.com/rust-windowing/winit), a dependency of Bevy, only asynchronous file dialogs seem to work (see the discussion in [this](https://github.com/PolyMeilex/rfd/issues/11) issue). Getting asynchronous code to work with Bevy would probably require either changing some Bevy internals, or fixing code further down the dependency chain.

In other words, file dialogs are currently very hard in Bevy, and having them already implemented would be very convenient.

## What solution would you like?

If possible, I'd like that there were something like a resource that somehow handled opening a file dialog across platforms and returning its result. It could be gated behind a feature if this doesn't work across all platforms, or requires many extra dependencies. If this turns out to be infeasible, an optional plugin for a window simulating a file dialog would still be very useful.

## What alternative(s) have you considered?

I considered using other dependencies, but this doesn't seem to work due to the reasons outlined above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.