Skip to content

Commit

Permalink
Attempts to fix #208
Browse files Browse the repository at this point in the history
Slashes in file-path string gives error on windows. Using std::path::Path should make it viable cross-platform. 
(Note that I've only tested this on windows)

Former-commit-id: 06d0cd2
  • Loading branch information
MarcusSakae authored Feb 25, 2023
1 parent 8547298 commit f6403a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/world_interaction/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use bevy_egui::egui::TextStyle::{Body, Button};
use bevy_egui::{egui, EguiContext, EguiPlugin};
use leafwing_input_manager::prelude::ActionState;
use serde::{Deserialize, Serialize};
use std::path::Path;
use unicode_segmentation::UnicodeSegmentation;

mod resources;
Expand Down Expand Up @@ -47,7 +48,11 @@ fn set_current_dialog(
mut actions_frozen: ResMut<ActionsFrozen>,
) -> Result<()> {
for dialog_event in dialog_events.iter() {
let path = format!("dialogs/{}.dlg.ron", dialog_event.dialog.0);
let path = Path::new("dialogs")
.join(&dialog_event.dialog.0)
.with_extension("dlg.ron")
.to_string_lossy()
.to_string();
let dialog_handle = match dialog_handles.dialogs.get(&path) {
Some(handle) => handle,
None => {
Expand Down

0 comments on commit f6403a7

Please sign in to comment.