File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed
Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ thiserror = "1.0"
4343uuid = " 0.8"
4444wavefront_obj = " 5.1.0"
4545xxtea = " 0.2.0"
46+ shellexpand = " 3.1"
4647
4748[target .'cfg(target_os = "android")' .dependencies ]
4849ndk-glue = " 0.5.0"
Original file line number Diff line number Diff line change @@ -11,8 +11,11 @@ impl YaobowConfig {
1111
1212 let mut builder = config:: Config :: builder ( ) ;
1313
14- if std:: path:: PathBuf :: from ( config_name) . exists ( ) {
15- builder = builder. add_source ( config:: File :: new ( config_name, config:: FileFormat :: Toml ) ) ;
14+ if let Ok ( expanded) = shellexpand:: full ( config_name) {
15+ let path = std:: path:: PathBuf :: from ( expanded. as_ref ( ) ) ;
16+ if path. exists ( ) {
17+ builder = builder. add_source ( config:: File :: new ( expanded. as_ref ( ) , config:: FileFormat :: Toml ) ) ;
18+ }
1619 }
1720
1821 let cfg = ydirs:: config_dir ( ) . join ( config_name) ;
Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ impl TitleSelectionDirector {
144144 let zip = PathBuf :: from ( ASSET_PATH ) ;
145145 let local1 = PathBuf :: from ( "./yaobow/yaobow-assets" ) ;
146146 let local2 = PathBuf :: from ( "../yaobow-assets" ) ;
147+ let local3 = PathBuf :: from ( "/usr/share/yaobow/yaobow-assets" ) ;
147148
148149 if Path :: exists ( & zip) {
149150 let local = ZipFs :: new ( std:: fs:: File :: open ( zip) . unwrap ( ) ) ;
@@ -157,6 +158,10 @@ impl TitleSelectionDirector {
157158 let local = LocalFs :: new ( & local2) ;
158159 vfs = vfs. mount ( PathBuf :: from ( "/" ) , local) ;
159160 Some ( Rc :: new ( vfs) )
161+ } else if Path :: exists ( & local3) {
162+ let local = LocalFs :: new ( & local3) ;
163+ vfs = vfs. mount ( PathBuf :: from ( "/" ) , local) ;
164+ Some ( Rc :: new ( vfs) )
160165 } else {
161166 None
162167 }
Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ impl YaobowApplicationLoader {
7373 pub fn new ( app : ComRc < IApplication > ) -> Self {
7474 Self {
7575 app,
76+ #[ cfg( linux) ]
77+ config : YaobowConfig :: load ( "~/.config/openpal3.toml" , "OPENPAL3" ) ,
78+ #[ cfg( not( linux) ) ]
7679 config : YaobowConfig :: load ( "openpal3.toml" , "OPENPAL3" ) ,
7780 selected_game : Rc :: new ( RefCell :: new ( None ) ) ,
7881 }
You can’t perform that action at this time.
0 commit comments