Skip to content

Commit

Permalink
Merge pull request #3 from TurtIeSocks/platform-agnostic
Browse files Browse the repository at this point in the history
fix: file/folder separator compatibility
  • Loading branch information
TurtIeSocks authored Nov 13, 2024
2 parents a15d46b + e7614a9 commit ef6cb3b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
File renamed without changes.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ impl AudioFile {
fn pascal_case(&self) -> String {
let mut parts: Vec<String> = self
.path
.split(|c: char| c.is_whitespace() || "-_.\\".contains(c))
.split(|c: char| {
c.is_whitespace() || "-_.".contains(c) || c == std::path::MAIN_SEPARATOR
})
.filter(|s| !s.is_empty())
.map(|s| {
let mut chars = s.chars();
Expand Down
2 changes: 1 addition & 1 deletion examples/event_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn set_channel_settings(mut ew: EventWriter<SettingsEvent<SfxChannel>>) {
// Set the playback settings for a specific track in the channel
let track_settings_event = SfxChannel::settings_event()
.with_settings(PlaybackSettings::LOOP)
.with_track(AudioFiles::BackgroundOGG);
.with_track(AudioFiles::MusicBackgroundOGG);

ew.send_batch(vec![
vol_event,
Expand Down
3 changes: 2 additions & 1 deletion examples/volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ fn setup(mut commands: Commands, mut ew: EventWriter<PlayEvent<MusicChannel>>) {

// Adjusting Music & Global will affect this sound
ew.send(
MusicChannel::play_event(AudioFiles::BackgroundOGG).with_settings(PlaybackSettings::LOOP),
MusicChannel::play_event(AudioFiles::MusicBackgroundOGG)
.with_settings(PlaybackSettings::LOOP),
);
}

Expand Down

0 comments on commit ef6cb3b

Please sign in to comment.