Skip to content

Commit

Permalink
Added Toggle basic functionality to File Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
krazynez committed Jul 3, 2023
1 parent e6dea3d commit 9115db2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions extras/menus/arkMenu/include/browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum{
DELETE,
RENAME,
CREATE,
TOGGLE_USB,
MS0_DIR,
EF0_DIR,
FTP_DIR,
Expand Down Expand Up @@ -206,6 +207,7 @@ class Browser : public SystemEntry{
void makedir();
void makefile();
void createNew();
void toggleUSB();

void rename();

Expand Down
23 changes: 20 additions & 3 deletions extras/menus/arkMenu/src/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ typedef BrowserFolder Folder;

extern "C" int kuKernelLoadModule(const char*, int, void*);

#define MAX_OPTIONS 12
#define MAX_OPTIONS 13

static char* pEntries[MAX_OPTIONS] = {
(char*) "Cancel",
(char*) "Copy",
Expand All @@ -44,6 +45,7 @@ static char* pEntries[MAX_OPTIONS] = {
(char*) "Delete",
(char*) "Rename",
(char*) "Create new",
(char*) "Toggle USB ",
(char*) "Go to ms0:/",
(char*) "Go to ef0:/",
(char*) "Go to ftp:/",
Expand Down Expand Up @@ -96,6 +98,9 @@ Browser::Browser(){
if (IS_VITA(common::getArkConfig()) || psp_model == PSP_GO){
pEntries[UMD_DIR] = NULL;
}

pEntries[7] = "Toggle USB ON";

}

Browser::~Browser(){
Expand Down Expand Up @@ -1478,6 +1483,16 @@ void Browser::createNew(){
}
}


void Browser::toggleUSB() {
if(strcmp(pEntries[7],"Toggle USB ON") == 0) {
pEntries[7] = "Toggle USB OFF";
}
else {
pEntries[7] = "Toggle USB ON";
}
}

void Browser::drawOptionsMenu(){

switch (optionsDrawState){
Expand All @@ -1495,11 +1510,12 @@ void Browser::drawOptionsMenu(){
case 2: // draw menu
optionsAnimX = 0;
optionsAnimY = 52;
common::getImage(IMAGE_DIALOG)->draw_scale(0, 52, 140, 220);
//common::getImage(IMAGE_DIALOG)->draw_scale(0, 52, 140, 220);
common::getImage(IMAGE_DIALOG)->draw_scale(0, 32, 140, 220);

{
int x = 10;
int y = 80;
int y = 50;
static TextScroll scroll = {0, 0, 0, 125};
for (int i=0; i<MAX_OPTIONS; i++){
if (pEntries[i] == NULL) continue;
Expand Down Expand Up @@ -1630,6 +1646,7 @@ void Browser::options(){
case DELETE: this->removeSelection(); break;
case RENAME: this->rename(); break;
case CREATE: this->createNew(); break;
case TOGGLE_USB: this->toggleUSB(); break;
case MS0_DIR: this->cwd = ROOT_DIR; this->refreshDirs(); break;
case FTP_DIR: this->cwd = FTP_ROOT; this->refreshDirs(); break;
case EF0_DIR: this->cwd = GO_ROOT; this->refreshDirs(); break;
Expand Down

0 comments on commit 9115db2

Please sign in to comment.