MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / G_initializeMenus

Function G_initializeMenus

engine/src/game.cpp:492–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492void G_initializeMenus()
493{
494 float ty = 0, dth = 32.0f, tx = 0;
495 game.menu.start.addItem(tx, ty, false, "Start",
496 _L(G_playEvent("start", false);));
497 ty += dth;
498 game.menu.start.addItem(tx, ty, false, "Options",
499 []()
500 {
501 game.menu.current = &game.menu.options;
502 game.menu.currentItem = 0;
503 });
504 ty += dth;
505 game.menu.start.addItem(tx, ty, false, "Exit",
506 []() { requestQuit(); });
507
508 ty = 0;
509 game.menu.pause.addItem(tx, ty, false, "Resume", []() { P_pause(false); });
510 ty += dth;
511 game.menu.pause.addItem(tx, ty, false, "Options",
512 []()
513 {
514 game.menu.current = &game.menu.options;
515 game.menu.currentItem = 0;
516 });
517 ty += dth;
518 game.menu.pause.addItem(tx, ty, false, "Quit",
519 []() { G_playEvent("quit", false); });
520
521 ty = 0;
522 game.menu.options.addItem(tx, ty, false, "Video",
523 []()
524 {
525 game.menu.current = &game.menu.video;
526 game.menu.currentItem = 0;
527 });
528 ty += dth;
529 game.menu.options.addItem(tx, ty, false, "Sound",
530 []()
531 {
532 game.menu.current = &game.menu.sound;
533 game.menu.currentItem = 4;
534 });
535 ty += dth;
536 game.menu.options.addItem(tx, ty, false, "Debug",
537 []() { bdebugtext = !bdebugtext; });
538 ty += dth;
539 game.menu.options.addItem(tx, ty, false, "Back",
540 []()
541 {
542 game.menu.current = bstarted
543 ? &game.menu.pause
544 : &game.menu.start;
545 game.menu.currentItem = 0;
546 });
547 game.menu.options.items[2].boolValue = &bdebugtext;
548
549 ty = 0;

Callers 1

G_initializeGameFunction · 0.85

Calls 4

G_playEventFunction · 0.85
requestQuitFunction · 0.85
P_pauseFunction · 0.85
addItemMethod · 0.80

Tested by

no test coverage detected