| 73 | } |
| 74 | |
| 75 | void ScriptPickerOverlay::update(const InputState& input) |
| 76 | { |
| 77 | (void)input; |
| 78 | const int count = rowCount(); |
| 79 | mHid.update(count > 0 ? count : 1); |
| 80 | |
| 81 | u32 kDown = hidKeysDown(); |
| 82 | if ((kDown & KEY_A) && count > 0) { |
| 83 | ScriptCatalog::Entry entry = mEntries[mHid.fullIndex()]; |
| 84 | auto pick = mOnPick; // copy to the stack: removeOverlay() destroys *this |
| 85 | screen.removeOverlay(); // dismiss the picker before running the callback |
| 86 | pick(entry); |
| 87 | return; |
| 88 | } |
| 89 | if (kDown & KEY_B) { |
| 90 | screen.removeOverlay(); |
| 91 | return; |
| 92 | } |
| 93 | } |
nothing calls this directly
no test coverage detected