Skip to content

Commit

Permalink
Combined FPS and FPS Graph into one menu
Browse files Browse the repository at this point in the history
  • Loading branch information
redraz committed Dec 28, 2023
1 parent fdee9dd commit 5688f8e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class GraphsMenu : public tsl::Gui {
GraphsMenu() {}

virtual tsl::elm::Element* createUI() override {
rootFrame = new tsl::elm::OverlayFrame("Ultra Monitor", "Graphs");
rootFrame = new tsl::elm::OverlayFrame("Ultra Monitor", "FPS");
auto list = new tsl::elm::List();

auto comFPSGraph = new tsl::elm::ListItem("FPS");
auto comFPSGraph = new tsl::elm::ListItem("Graph");
comFPSGraph->setClickListener([](uint64_t keys) {
if (keys & KEY_A) {
tsl::changeTo<com_FPSGraph>();
Expand All @@ -29,6 +29,16 @@ class GraphsMenu : public tsl::Gui {
});
list->addItem(comFPSGraph);

auto comFPSCounter = new tsl::elm::ListItem("Counter");
comFPSCounter->setClickListener([](uint64_t keys) {
if (keys & KEY_A) {
tsl::changeTo<com_FPS>();
return true;
}
return false;
});
list->addItem(comFPSCounter);

rootFrame->setContent(list);

return rootFrame;
Expand Down Expand Up @@ -154,16 +164,7 @@ class MainMenu : public tsl::Gui {
list->addItem(Micro);
}
if (SaltySD) {
auto comFPS = new tsl::elm::ListItem("FPS Counter");
comFPS->setClickListener([](uint64_t keys) {
if (keys & KEY_A) {
tsl::changeTo<com_FPS>();
return true;
}
return false;
});
list->addItem(comFPS);
auto Graphs = new tsl::elm::ListItem("Graphs");
auto Graphs = new tsl::elm::ListItem("FPS");
Graphs->setClickListener([](uint64_t keys) {
if (keys & KEY_A) {
tsl::changeTo<GraphsMenu>();
Expand Down

0 comments on commit 5688f8e

Please sign in to comment.