MCPcopy Create free account
hub / github.com/davemoore22/sorcery / start

Method start

src/modules/reorder.cpp:48–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47 return true;
48}
49
50auto Sorcery::Reorder::start(const int mode) -> int {
51
52 _ctx.controller->go_to(Enums::Screen::REORDER);
53 _ctx.controller->initialise();
54
55 show_immediately();
56
57 // Main loop
58 auto done{false};
59 while (!done) {
60
61 SDL_Event event;
62 while (SDL_PollEvent(&event)) {
63
64 switch (process_event(
65 event,
66 {.menu_key = true, .quicksave = false, .quickload = false})) {
67
68 case ModuleEvent::ABORT:
69 done = true;
70 break;
71
72 case ModuleEvent::QUICKLOAD:
73 continue;
74
75 case ModuleEvent::NONE:
76 break;
77 }
78
79 if (_ctx.controller->check_for_back(event))
80 return BACK_TO_TAVERN;
81 }
82
83 _ctx.ui->display(Enums::Screen::REORDER, mode);
84 _ctx.tick();

Callers

nothing calls this directly

Calls 8

go_toMethod · 0.80
check_for_abortMethod · 0.80
check_for_resizeMethod · 0.80
check_for_backMethod · 0.80
tickMethod · 0.80
wantsMethod · 0.80
initialiseMethod · 0.45
displayMethod · 0.45

Tested by

no test coverage detected