| @@ -174,13 +174,9 @@ auto main(int argc, char const *argv[]) -> int { |
| 174 | return 0; | 174 | return 0; |
| 175 | } | 175 | } |
| 176 | | 176 | |
| 177 | - int exit_id = games.size(); | | |
| 178 | - int choice = 0; | | |
| 179 | - // do { | | |
| 180 | system("clear"); | 177 | system("clear"); |
| 181 | | 178 | |
| 182 | std::vector<std::string> menuOptions{ | 179 | std::vector<std::string> menuOptions{ |
| 183 | - "Games (old)", | | |
| 184 | "Games", | 180 | "Games", |
| 185 | }; | 181 | }; |
| 186 | int menuOptionSelected{0}; | 182 | int menuOptionSelected{0}; |
| @@ -199,14 +195,12 @@ auto main(int argc, char const *argv[]) -> int { |
| 199 | } | 195 | } |
| 200 | | 196 | |
| 201 | auto menu_screen = ScreenInteractive::TerminalOutput(); | 197 | auto menu_screen = ScreenInteractive::TerminalOutput(); |
| 202 | - gamesContainer->Add(Button( | 198 | + |
| 203 | - "Exit", [&] { menu_screen.ExitLoopClosure(); }, Style())); | 199 | + auto quitButton = Button("Exit", menu_screen.ExitLoopClosure(), Style()); |
| 204 | - MenuOption option; | 200 | + gamesContainer->Add(quitButton); |
| 205 | - // option.on_enter = menu_screen.ExitLoopClosure(); | | |
| 206 | - auto menu = Menu(&localGames, &choice, option); | | |
| 207 | | 201 | |
| 208 | auto appContainer = | 202 | auto appContainer = |
| 209 | - Container::Tab({menu, gamesContainer}, &menuOptionSelected); | 203 | + Container::Tab({gamesContainer}, &menuOptionSelected); |
| 210 | | 204 | |
| 211 | auto container = Container::Horizontal({ | 205 | auto container = Container::Horizontal({ |
| 212 | menuOptionToggle, | 206 | menuOptionToggle, |
| @@ -224,19 +218,6 @@ auto main(int argc, char const *argv[]) -> int { |
| 224 | | 218 | |
| 225 | menu_screen.Loop(renderer); | 219 | menu_screen.Loop(renderer); |
| 226 | | 220 | |
| 227 | - // if (choice != exit_id) { | | |
| 228 | - // int i{0}; | | |
| 229 | - // std::string gameToRun = ""; | | |
| 230 | - // for (auto &game : games) { | | |
| 231 | - | | |
| 232 | - // if (i == choice) { | | |
| 233 | - // gameToRun = game.getName(); | | |
| 234 | - // } | | |
| 235 | - // i++; | | |
| 236 | - // } | | |
| 237 | - // runGame(database, gameToRun); | | |
| 238 | - // } | | |
| 239 | - // } while (choice != exit_id); | | |
| 240 | sqlite3_close(database); | 221 | sqlite3_close(database); |
| 241 | return EXIT_SUCCESS; | 222 | return EXIT_SUCCESS; |
| 242 | } | 223 | } |
| \ No newline at end of file | | \ No newline at end of file |