MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnNav

Method OnNav

engine/Poseidon/UI/Options/ControlsPage.cpp:27–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool ControlsPage::OnNav(OptionsShell& shell, int idc)
28{
29 switch (idc)
30 {
31 case 1401: // Keyboard & Mouse
32 shell.PushPage(std::make_unique<KbmPage>());
33 return true;
34
35 case 1402: // Mouse
36 shell.PushPage(std::make_unique<MousePage>());
37 return true;
38
39 case 1405: // Gamepad bindings
40 shell.PushPage(std::make_unique<GamepadPage>());
41 return true;
42
43 case 1406: // Gamepad Tuning
44 shell.PushPage(std::make_unique<GamepadTuningPage>());
45 return true;
46
47 case 1403: // Reset all to defaults — confirm first
48 {
49 auto onYes = []()
50 {
51 auto& sub = InputSubsystem::Instance();
52 for (int c = 0; c < ControlsCategoryCount; ++c)
53 sub.ResetCategoryDefaults((ControlsCategory)c);
54 sub.SaveKeys();
55 };
56 shell.PushPage(std::make_unique<ConfirmPage>(
57 std::string((const char*)LocalizeString("STR_DISP_OPT_CONFIRM_RESET_TITLE")),
58 std::string((const char*)LocalizeString("STR_DISP_OPT_CONFIRM_RESET_BODY")), std::move(onYes),
59 std::string((const char*)LocalizeString("STR_DISP_OPT_CTL_RESET_ALL")),
60 std::string((const char*)LocalizeString("STR_DISP_OPT_CAP_CANCEL"))));
61 return true;
62 }
63 }
64 return false;
65}
66
67} // namespace Poseidon

Callers

nothing calls this directly

Calls 4

LocalizeStringFunction · 0.85
PushPageMethod · 0.80
ResetCategoryDefaultsMethod · 0.80
SaveKeysMethod · 0.80

Tested by

no test coverage detected