45 lines
886 B
C
45 lines
886 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <I18n.h>
|
||
|
|
|
||
|
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
#include "../Activity.h"
|
||
|
|
#include "util/ButtonNavigator.h"
|
||
|
|
|
||
|
|
class EndOfBookMenuActivity final : public Activity {
|
||
|
|
public:
|
||
|
|
enum class Action {
|
||
|
|
ARCHIVE,
|
||
|
|
DELETE,
|
||
|
|
TABLE_OF_CONTENTS,
|
||
|
|
BACK_TO_BEGINNING,
|
||
|
|
CLOSE_BOOK,
|
||
|
|
CLOSE_MENU,
|
||
|
|
};
|
||
|
|
|
||
|
|
explicit EndOfBookMenuActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, const std::string& bookPath)
|
||
|
|
: Activity("EndOfBookMenu", renderer, mappedInput), bookPath(bookPath) {
|
||
|
|
buildMenuItems();
|
||
|
|
}
|
||
|
|
|
||
|
|
void onEnter() override;
|
||
|
|
void onExit() override;
|
||
|
|
void loop() override;
|
||
|
|
void render(RenderLock&&) override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
struct MenuItem {
|
||
|
|
Action action;
|
||
|
|
StrId labelId;
|
||
|
|
};
|
||
|
|
|
||
|
|
std::string bookPath;
|
||
|
|
std::vector<MenuItem> menuItems;
|
||
|
|
int selectedIndex = 0;
|
||
|
|
ButtonNavigator buttonNavigator;
|
||
|
|
|
||
|
|
void buildMenuItems();
|
||
|
|
};
|