mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 15:17:37 +03:00
syntax
This commit is contained in:
parent
e4c8ef07dd
commit
067a36a7b4
@ -95,29 +95,39 @@ void HomeActivity::loop() {
|
||||
const int menuCount = getMenuItemCount();
|
||||
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
// Menu order: [Continue Reading], [Recent Books], Browse, File transfer, Settings
|
||||
// Calculate index offsets based on what's shown
|
||||
int idx = selectorIndex;
|
||||
|
||||
if (hasContinueReading && idx == 0) {
|
||||
onContinueReading();
|
||||
return;
|
||||
}
|
||||
if (hasContinueReading) idx--;
|
||||
|
||||
if (hasRecentBooks && idx == 0) {
|
||||
onRecentBooksOpen();
|
||||
return;
|
||||
}
|
||||
if (hasRecentBooks) idx--;
|
||||
|
||||
// Now idx is 0-based for: Browse, File transfer, Settings
|
||||
if (idx == 0) {
|
||||
onReaderOpen();
|
||||
} else if (idx == 1) {
|
||||
onFileTransferOpen();
|
||||
} else if (idx == 2) {
|
||||
onSettingsOpen();
|
||||
if (hasContinueReading && hasRecentBooks) {
|
||||
// Menu: Continue Reading, Recent Books, Browse, File transfer, Settings
|
||||
if (selectorIndex == 0) {
|
||||
onContinueReading();
|
||||
} else if (selectorIndex == 1) {
|
||||
onRecentBooksOpen();
|
||||
} else if (selectorIndex == 2) {
|
||||
onReaderOpen();
|
||||
} else if (selectorIndex == 3) {
|
||||
onFileTransferOpen();
|
||||
} else if (selectorIndex == 4) {
|
||||
onSettingsOpen();
|
||||
}
|
||||
} else if (hasContinueReading) {
|
||||
// Menu: Continue Reading, Browse, File transfer, Settings
|
||||
if (selectorIndex == 0) {
|
||||
onContinueReading();
|
||||
} else if (selectorIndex == 1) {
|
||||
onReaderOpen();
|
||||
} else if (selectorIndex == 2) {
|
||||
onFileTransferOpen();
|
||||
} else if (selectorIndex == 3) {
|
||||
onSettingsOpen();
|
||||
}
|
||||
} else {
|
||||
// Menu: Browse, File transfer, Settings
|
||||
if (selectorIndex == 0) {
|
||||
onReaderOpen();
|
||||
} else if (selectorIndex == 1) {
|
||||
onFileTransferOpen();
|
||||
} else if (selectorIndex == 2) {
|
||||
onSettingsOpen();
|
||||
}
|
||||
}
|
||||
} else if (prevPressed) {
|
||||
selectorIndex = (selectorIndex + menuCount - 1) % menuCount;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user