mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Improved injection / paste handling
This commit is contained in:
parent
e388dd4ca7
commit
5d69a7186f
@ -7,7 +7,7 @@
|
||||
#include "virtual.h"
|
||||
#include "image.h"
|
||||
|
||||
#define VERSION "0.5.5"
|
||||
#define VERSION "0.5.6"
|
||||
|
||||
#define N_PANES 2
|
||||
#define IMG_DRV "789I"
|
||||
@ -508,10 +508,12 @@ u32 GodMode() {
|
||||
char origstr[18 + 1];
|
||||
TruncateString(origstr, clipboard->entry[0].name, 18, 10);
|
||||
u64 offset = ShowHexPrompt(0, 8, "Inject data from %s?\nSpecifiy offset below.", origstr);
|
||||
if ((offset != (u64) -1) && !FileInjectFile(curr_entry->path, clipboard->entry[0].path, (u32) offset))
|
||||
if (offset != (u64) -1) {
|
||||
if (!FileInjectFile(curr_entry->path, clipboard->entry[0].path, (u32) offset))
|
||||
ShowPrompt(false, "Failed injecting %s", origstr);
|
||||
clipboard->n_entries = 0;
|
||||
}
|
||||
}
|
||||
} else if (*current_path && ((pad_state & BUTTON_B) || // one level down
|
||||
((pad_state & BUTTON_A) && (curr_entry->type == T_DOTDOT)))) {
|
||||
char old_path[256];
|
||||
@ -643,9 +645,11 @@ u32 GodMode() {
|
||||
if (clipboard->n_entries == 1) {
|
||||
char namestr[20+1];
|
||||
TruncateString(namestr, clipboard->entry[0].name, 20, 12);
|
||||
snprintf(promptstr, 64, "Copy / Move \"%s\" here?", namestr);
|
||||
} else snprintf(promptstr, 64, "Copy / Move %lu paths here?", clipboard->n_entries);
|
||||
if ((user_select = ShowSelectPrompt(2, optionstr, promptstr))) {
|
||||
snprintf(promptstr, 64, "Paste \"%s\" here?", namestr);
|
||||
} else snprintf(promptstr, 64, "Paste %lu paths here?", clipboard->n_entries);
|
||||
user_select = (!GetVirtualSource(clipboard->entry[0].path) && !GetVirtualSource(current_path)) ?
|
||||
ShowSelectPrompt(2, optionstr, promptstr) : (ShowPrompt(true, promptstr) ? 1 : 0);
|
||||
if (user_select) {
|
||||
for (u32 c = 0; c < clipboard->n_entries; c++) {
|
||||
char namestr[36+1];
|
||||
TruncateString(namestr, clipboard->entry[c].name, 36, 12);
|
||||
@ -659,9 +663,9 @@ u32 GodMode() {
|
||||
} else ShowPrompt(false, "Failed moving path:\n%s", namestr);
|
||||
}
|
||||
}
|
||||
}
|
||||
clipboard->n_entries = 0;
|
||||
GetDirContents(current_dir, current_path);
|
||||
}
|
||||
ClearScreenF(true, false, COLOR_STD_BG);
|
||||
}
|
||||
} else { // switched command set
|
||||
|
Loading…
x
Reference in New Issue
Block a user