LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.
https://livesplit.org/
Apache License 2.0
212 stars 58 forks source link

Add FileSelection Widget #748

Closed AlexKnauth closed 11 months ago

AlexKnauth commented 11 months ago

This adds a FileSelection Widget to the Auto Splitting Runtime.

Companion PRs:

The asr-debugger and LiveSplit.AutoSplittingRuntime companion branches both implement this as a button in the settings Gui that opens a file dialog when pressed. The user can select a file, and the WASI-compatible path to that file gets stored in the settings map.

The asr companion branch adds a FileSelection type that implements the Widget trait such that an auto-splitter can put it in their settings gui like this:

#[derive(Gui)]
pub struct SettingsGui {
    /// General Settings
    _general_settings: Title,
    /// Select a text file
    #[filter = "*.txt"]
    text_file: FileSelection,
}