From 80dada9c16b4759c977dd4b253a0dbb1da1b55ae Mon Sep 17 00:00:00 2001 From: d0k3 Date: Thu, 16 Feb 2017 02:44:49 +0100 Subject: [PATCH] Don't allow unlocking all write permissions at once --- source/godmode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/godmode.c b/source/godmode.c index ae63c9b..158613c 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -54,7 +54,8 @@ void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* c ((clipboard->n_entries) ? (1<<1) : 0) | ((CheckSDMountState()) ? (1<<2) : 0) | ((GetMountState()) ? (1<<3) : 0) | - (curr_pane<<4); + ((GetWritePermissions() > PERM_BASE) ? (1<<4) : 0) | + (curr_pane<<5); if (state_prev != state_curr) { ClearScreenF(true, false, COLOR_STD_BG); @@ -144,9 +145,9 @@ void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* c #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" : "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"), - (*curr_path) ? "" : (CheckSDMountState()) ? "R+B - Unmount SD card\n" : "R+B - Remount SD card\n", + ((GetWritePermissions() > PERM_BASE) ? "R+Y - Relock write permissions\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", "R+L - Make a Screenshot\n", "R+\x1B\x1A - Switch to prev/next pane\n", @@ -1211,7 +1212,8 @@ u32 GodMode() { ClearScreenF(false, true, COLOR_STD_BG); GetDirContents(current_dir, current_path); } 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 if ((curr_drvtype & DRV_VIRTUAL) && (pad_state & BUTTON_X)) {