Don't allow unlocking all write permissions at once

This commit is contained in:
d0k3 2017-02-16 02:44:49 +01:00
parent 23d50fb718
commit 80dada9c16

View File

@ -54,7 +54,8 @@ void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* c
((clipboard->n_entries) ? (1<<1) : 0) | ((clipboard->n_entries) ? (1<<1) : 0) |
((CheckSDMountState()) ? (1<<2) : 0) | ((CheckSDMountState()) ? (1<<2) : 0) |
((GetMountState()) ? (1<<3) : 0) | ((GetMountState()) ? (1<<3) : 0) |
(curr_pane<<4); ((GetWritePermissions() > PERM_BASE) ? (1<<4) : 0) |
(curr_pane<<5);
if (state_prev != state_curr) { if (state_prev != state_curr) {
ClearScreenF(true, false, COLOR_STD_BG); ClearScreenF(true, false, COLOR_STD_BG);
@ -144,9 +145,9 @@ void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* c
#endif #endif
(*curr_path) ? ((clipboard->n_entries == 0) ? "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - COPY file(s) / [+R] CREATE dir\n" : (*curr_path) ? ((clipboard->n_entries == 0) ? "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - COPY file(s) / [+R] CREATE dir\n" :
"L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - PASTE file(s) / [+R] CREATE dir\n") : "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - PASTE file(s) / [+R] CREATE dir\n") :
((GetWritePermissions() > PERM_BASE) ? "R+Y - Relock write permissions\n" : "R+Y - Unlock write permissions\n"), ((GetWritePermissions() > PERM_BASE) ? "R+Y - Relock write permissions\n" : ""),
(*curr_path) ? "" : (CheckSDMountState()) ? "R+B - Unmount SD card\n" : "R+B - Remount SD card\n",
(*curr_path) ? "" : (GetMountState()) ? "R+X - Unmount image\n" : "", (*curr_path) ? "" : (GetMountState()) ? "R+X - Unmount image\n" : "",
(*curr_path) ? "" : (CheckSDMountState()) ? "R+B - Unmount SD card\n" : "R+B - Remount SD card\n",
(*curr_path) ? "R+A - Search directory\n" : "R+A - Search drive\n", (*curr_path) ? "R+A - Search directory\n" : "R+A - Search drive\n",
"R+L - Make a Screenshot\n", "R+L - Make a Screenshot\n",
"R+\x1B\x1A - Switch to prev/next pane\n", "R+\x1B\x1A - Switch to prev/next pane\n",
@ -1211,7 +1212,8 @@ u32 GodMode() {
ClearScreenF(false, true, COLOR_STD_BG); ClearScreenF(false, true, COLOR_STD_BG);
GetDirContents(current_dir, current_path); GetDirContents(current_dir, current_path);
} else if (switched && (pad_state & BUTTON_Y)) { } else if (switched && (pad_state & BUTTON_Y)) {
SetWritePermissions((GetWritePermissions() > PERM_BASE) ? PERM_BASE : PERM_ALL, false); SetWritePermissions(PERM_BASE, false);
ClearScreenF(false, true, COLOR_STD_BG);
} }
} else if (!switched) { // standard unswitched command set } else if (!switched) { // standard unswitched command set
if ((curr_drvtype & DRV_VIRTUAL) && (pad_state & BUTTON_X)) { if ((curr_drvtype & DRV_VIRTUAL) && (pad_state & BUTTON_X)) {