#pragma once #include #include #include "../Activity.h" #include "util/ButtonNavigator.h" class XtcReaderChapterSelectionActivity final : public Activity { std::shared_ptr xtc; ButtonNavigator buttonNavigator; uint32_t currentPage = 0; int selectorIndex = 0; const std::function onGoBack; const std::function onSelectPage; int getPageItems() const; int findChapterIndexForPage(uint32_t page) const; public: explicit XtcReaderChapterSelectionActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, const std::shared_ptr& xtc, uint32_t currentPage, const std::function& onGoBack, const std::function& onSelectPage) : Activity("XtcReaderChapterSelection", renderer, mappedInput), xtc(xtc), currentPage(currentPage), onGoBack(onGoBack), onSelectPage(onSelectPage) {} void onEnter() override; void onExit() override; void loop() override; void render(Activity::RenderLock&&) override; };