@@ -16,7 +16,7 @@ fn main() {
16
16
let gfx = Gfx :: init ( ) . unwrap ( ) ;
17
17
18
18
#[ cfg( all( feature = "romfs" , romfs_exists) ) ]
19
- let _romfs = ctru:: romfs:: RomFS :: init ( ) . unwrap ( ) ;
19
+ let _romfs = ctru:: services :: romfs:: RomFS :: init ( ) . unwrap ( ) ;
20
20
21
21
FileExplorer :: init ( & apt, & hid, & gfx) . run ( ) ;
22
22
}
@@ -56,15 +56,15 @@ impl<'a> FileExplorer<'a> {
56
56
self . hid . scan_input ( ) ;
57
57
let input = self . hid . keys_down ( ) ;
58
58
59
- if input. contains ( KeyPad :: KEY_START ) {
59
+ if input. contains ( KeyPad :: START ) {
60
60
break ;
61
- } else if input. contains ( KeyPad :: KEY_B ) && self . path . components ( ) . count ( ) > 1 {
61
+ } else if input. contains ( KeyPad :: B ) && self . path . components ( ) . count ( ) > 1 {
62
62
self . path . pop ( ) ;
63
63
self . console . clear ( ) ;
64
64
self . print_menu ( ) ;
65
- } else if input. contains ( KeyPad :: KEY_A ) {
65
+ } else if input. contains ( KeyPad :: A ) {
66
66
self . get_input_and_run ( Self :: set_next_path) ;
67
- } else if input. contains ( KeyPad :: KEY_X ) {
67
+ } else if input. contains ( KeyPad :: X ) {
68
68
self . get_input_and_run ( Self :: set_exact_path) ;
69
69
}
70
70
@@ -147,11 +147,11 @@ impl<'a> FileExplorer<'a> {
147
147
self . hid . scan_input ( ) ;
148
148
let input = self . hid . keys_down ( ) ;
149
149
150
- if input. contains ( KeyPad :: KEY_A ) {
150
+ if input. contains ( KeyPad :: A ) {
151
151
break ;
152
152
}
153
153
154
- if input. contains ( KeyPad :: KEY_START ) {
154
+ if input. contains ( KeyPad :: START ) {
155
155
self . running = false ;
156
156
return ;
157
157
}
@@ -162,17 +162,16 @@ impl<'a> FileExplorer<'a> {
162
162
163
163
fn get_input_and_run ( & mut self , action : impl FnOnce ( & mut Self , String ) ) {
164
164
let mut keyboard = Swkbd :: default ( ) ;
165
- let mut new_path_str = String :: new ( ) ;
166
165
167
- match keyboard. get_utf8 ( & mut new_path_str ) {
168
- Ok ( Button :: Right ) => {
166
+ match keyboard. get_string ( 2048 ) {
167
+ Ok ( ( path , Button :: Right ) ) => {
169
168
// Clicked "OK"
170
- action ( self , new_path_str ) ;
169
+ action ( self , path ) ;
171
170
}
172
- Ok ( Button :: Left ) => {
171
+ Ok ( ( _ , Button :: Left ) ) => {
173
172
// Clicked "Cancel"
174
173
}
175
- Ok ( Button :: Middle ) => {
174
+ Ok ( ( _ , Button :: Middle ) ) => {
176
175
// This button wasn't shown
177
176
unreachable ! ( )
178
177
}
0 commit comments