0x004C1799
| 310 | |
| 311 | // 0x004C1799 |
| 312 | static void onScrollMouseDown(Ui::Window& window, [[maybe_unused]] int16_t x, int16_t y, [[maybe_unused]] uint8_t scroll_index) |
| 313 | { |
| 314 | const uint16_t currentRow = y / kRowHeight; |
| 315 | if (currentRow > window.rowCount) |
| 316 | { |
| 317 | return; |
| 318 | } |
| 319 | const Jukebox::MusicId currentTrack = playlist[currentRow]; |
| 320 | |
| 321 | auto& config = Config::get().audio; |
| 322 | |
| 323 | // Toggle the track in question. |
| 324 | config.customJukebox[currentTrack] ^= true; |
| 325 | |
| 326 | // Do not allow there being 0 tracks enabled |
| 327 | uint16_t numTracksSelected = std::ranges::count(config.customJukebox, true); |
| 328 | if (numTracksSelected == 0) |
| 329 | { |
| 330 | config.customJukebox[currentTrack] = true; |
| 331 | numTracksSelected = 1; |
| 332 | } |
| 333 | |
| 334 | updateStatusBar(window, numTracksSelected); |
| 335 | Config::write(); |
| 336 | Audio::revalidateCurrentTrack(); |
| 337 | window.invalidate(); |
| 338 | } |
| 339 | |
| 340 | // 0x004C1771 |
| 341 | static void onScrollMouseOver(Ui::Window& window, [[maybe_unused]] int16_t x, int16_t y, [[maybe_unused]] uint8_t scroll_index) |
nothing calls this directly
no test coverage detected