Skip to content

Commit

Permalink
- Consistently show "Up to parent directory" in carousel view.
Browse files Browse the repository at this point in the history
- Enable navigation with L/R triggers in device selection.
  • Loading branch information
Extrems committed Jan 6, 2024
1 parent 5edd35b commit 7ebb025
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 3 additions & 0 deletions cube/swiss/source/devices/filemeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ void populate_meta(file_handle *f) {
devices[DEVICE_CUR]->closeFile(bannerFile);
free(bannerFile);
}
else if (f->fileAttrib == IS_SPECIAL) {
f->meta->displayName = "Up to parent directory";
}
}
}

Expand Down
18 changes: 7 additions & 11 deletions cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void drawFilesCarousel(file_handle** directory, int num_files, uiDrawObj_t *cont
populate_meta(&((*directory)[current_view_start]));
browserObject = DrawFileCarouselEntry(((getVideoMode()->fbWidth / 2) - (main_entry_width / 2)), y_base,
((getVideoMode()->fbWidth / 2) + (main_entry_width / 2)), y_base + main_entry_height,
parentLink ? "Up to parent directory" : getRelativePath((*directory)[current_view_start].name, curDir.name),
getRelativePath((*directory)[current_view_start].name, curDir.name),
&((*directory)[current_view_start]), 0);
((*directory)[current_view_start]).uiObj = browserObject;
DrawAddChild(containerPanel, browserObject);
Expand Down Expand Up @@ -2291,13 +2291,9 @@ void select_device(int type)

// Find the first device that meets the requiredFeatures and is available
while((allDevices[curDevice] == NULL) || !(deviceHandler_getDeviceAvailable(allDevices[curDevice])||showAllDevices) || !(allDevices[curDevice]->features & requiredFeatures)) {
curDevice ++;
if( (curDevice >= MAX_DEVICES)){
curDevice = 0;
}
curDevice = (curDevice + 1) % MAX_DEVICES;
}



uiDrawObj_t *deviceSelectBox = NULL;
while(1) {
// Device selector
Expand Down Expand Up @@ -2356,7 +2352,7 @@ void select_device(int type)
}
DrawPublish(deviceSelectBox);
while (!(padsButtonsHeld() &
(PAD_BUTTON_RIGHT|PAD_BUTTON_LEFT|PAD_BUTTON_B|PAD_BUTTON_A|PAD_BUTTON_X|PAD_TRIGGER_Z) ))
(PAD_BUTTON_RIGHT|PAD_BUTTON_LEFT|PAD_BUTTON_B|PAD_BUTTON_A|PAD_BUTTON_X|PAD_TRIGGER_L|PAD_TRIGGER_R|PAD_TRIGGER_Z) ))
{ VIDEO_WaitVSync (); }
u16 btns = padsButtonsHeld();
if((btns & PAD_BUTTON_X) && (allDevices[curDevice]->location & (LOC_MEMCARD_SLOT_A | LOC_MEMCARD_SLOT_B | LOC_SERIAL_PORT_2)))
Expand All @@ -2374,10 +2370,10 @@ void select_device(int type)
}
}
else {
if(btns & PAD_BUTTON_RIGHT) {
if(btns & (PAD_BUTTON_RIGHT|PAD_TRIGGER_R)) {
direction = 1;
}
if(btns & PAD_BUTTON_LEFT) {
if(btns & (PAD_BUTTON_LEFT|PAD_TRIGGER_L)) {
direction = -1;
}
}
Expand Down Expand Up @@ -2405,7 +2401,7 @@ void select_device(int type)
}
while ((padsButtonsHeld() &
(PAD_BUTTON_RIGHT|PAD_BUTTON_LEFT|PAD_BUTTON_B|PAD_BUTTON_A
|PAD_BUTTON_X|PAD_BUTTON_UP|PAD_BUTTON_DOWN|PAD_TRIGGER_Z) ))
|PAD_BUTTON_X|PAD_TRIGGER_L|PAD_TRIGGER_R|PAD_TRIGGER_Z) ))
{ VIDEO_WaitVSync (); }
DrawDispose(deviceSelectBox);
}
Expand Down

0 comments on commit 7ebb025

Please sign in to comment.