1+ use std:: ops:: Not ;
2+
13use egui_extras:: { Column , TableBuilder } ;
24use game_scanner:: prelude:: * ;
35use image:: DynamicImage ;
@@ -65,10 +67,26 @@ impl SelectedRule {
6567 fn to_rule ( & self ) -> Rule {
6668 Rule {
6769 alias : self . alias . clone ( ) ,
68- match_app_name : Some ( self . match_app_name . clone ( ) ) ,
69- match_bin_name : Some ( self . match_bin_name . clone ( ) ) ,
70- match_bin_path : Some ( self . match_bin_path . clone ( ) ) ,
71- match_win_name : Some ( self . match_win_name . clone ( ) ) ,
70+ match_app_name : self
71+ . match_app_name
72+ . is_empty ( )
73+ . not ( )
74+ . then_some ( self . match_app_name . clone ( ) ) ,
75+ match_bin_name : self
76+ . match_bin_name
77+ . is_empty ( )
78+ . not ( )
79+ . then_some ( self . match_bin_name . clone ( ) ) ,
80+ match_bin_path : self
81+ . match_bin_path
82+ . is_empty ( )
83+ . not ( )
84+ . then_some ( self . match_bin_path . clone ( ) ) ,
85+ match_win_name : self
86+ . match_win_name
87+ . is_empty ( )
88+ . not ( )
89+ . then_some ( self . match_win_name . clone ( ) ) ,
7290 profile_index : self . profile_index ,
7391 }
7492 }
@@ -255,7 +273,7 @@ impl App for MainApp {
255273 alias : game. name ,
256274 match_bin_path : game
257275 . path
258- . map ( |path| path. display ( ) . to_string ( ) ) ,
276+ . map ( |path| path. display ( ) . to_string ( ) + "*" ) ,
259277 ..Default :: default ( )
260278 } ;
261279 config. rules . push ( rule. clone ( ) ) ;
@@ -266,6 +284,10 @@ impl App for MainApp {
266284 * open_new_rule_setup = false ;
267285 }
268286 }
287+
288+ if ui. button ( "Cancel" ) . clicked ( ) {
289+ * open_new_rule_setup = false ;
290+ }
269291 } ) ;
270292 } ) ;
271293 } ;
0 commit comments