mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
Store worlds in user data dir
This commit is contained in:
parent
d2da1b39ed
commit
d7f57a2176
8 changed files with 98 additions and 30 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::path::Path;
|
||||
|
||||
use egui_inspect::{derive::Inspect, inspect};
|
||||
use s2dc::{vec2, MobileEntity};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
@ -52,8 +54,8 @@ impl Player {
|
|||
self.col_en.en.pos.y + self.col_en.en.bb.y
|
||||
}
|
||||
|
||||
pub(crate) fn save(&self) {
|
||||
let result = std::fs::write("player.dat", rmp_serde::to_vec(self).unwrap());
|
||||
pub(crate) fn save(&self, path: &Path) {
|
||||
let result = std::fs::write(path.join("player.dat"), rmp_serde::to_vec(self).unwrap());
|
||||
log::info!("{result:?}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue