juk3n/fluffypublic Fork
⑂ 80e2bea
Commits
⬇ Clone ▾
git clone https://git.rickub.com/juk3n/fluffy.git
git clone ssh://git@rickub.com/juk3n/fluffy.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

changed games options to buttons

Adrian Duraj committed 2024-06-25T10:41:43+02:00 Browse files
80e2bea parent: 8e1b855
modified src/main.cpp +4 -23
@@ -174,13 +174,9 @@ auto main(int argc, char const *argv[]) -> int {
174174 return 0;
175175 }
176176
177- int exit_id = games.size();
178- int choice = 0;
179- // do {
180177 system("clear");
181178
182179 std::vector<std::string> menuOptions{
183- "Games (old)",
184180 "Games",
185181 };
186182 int menuOptionSelected{0};
@@ -199,14 +195,12 @@ auto main(int argc, char const *argv[]) -> int {
199195 }
200196
201197 auto menu_screen = ScreenInteractive::TerminalOutput();
202- gamesContainer->Add(Button(
203- "Exit", [&] { menu_screen.ExitLoopClosure(); }, Style()));
204- MenuOption option;
205- // option.on_enter = menu_screen.ExitLoopClosure();
206- auto menu = Menu(&localGames, &choice, option);
198+
199+ auto quitButton = Button("Exit", menu_screen.ExitLoopClosure(), Style());
200+ gamesContainer->Add(quitButton);
207201
208202 auto appContainer =
209- Container::Tab({menu, gamesContainer}, &menuOptionSelected);
203+ Container::Tab({gamesContainer}, &menuOptionSelected);
210204
211205 auto container = Container::Horizontal({
212206 menuOptionToggle,
@@ -224,19 +218,6 @@ auto main(int argc, char const *argv[]) -> int {
224218
225219 menu_screen.Loop(renderer);
226220
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);
240221 sqlite3_close(database);
241222 return EXIT_SUCCESS;
242223 }
\ No newline at end of file
@@ -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