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

Method LoadDefaults

engine/Poseidon/UI/Settings/ControlsConfig.cpp:40–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38} // namespace
39
40void ControlsConfig::LoadDefaults()
41{
42 UserActionDesc* descs = InputSubsystem::GetUserActionDesc();
43 for (int i = 0; i < UAN; i++)
44 {
45 // Pull only the keyboard / mouse defaults — joystick defaults
46 // ride along in GamepadConfig::LoadDefaults.
47 bindings[i].Resize(0);
48 modifiers[i].Resize(0);
49 const KeyList& src = descs[i].keys;
50 for (int j = 0; j < src.Size(); j++)
51 {
52 if (IsKbmCode(src[j]))
53 {
54 bindings[i].Add(src[j]);
55 modifiers[i].Add(-1);
56 }
57 }
58 bindings[i].Compact();
59 modifiers[i].Compact();
60 }
61}
62
63bool ControlsConfig::Load(const std::string& path)
64{

Callers

nothing calls this directly

Calls 5

IsKbmCodeFunction · 0.85
ResizeMethod · 0.45
SizeMethod · 0.45
AddMethod · 0.45
CompactMethod · 0.45

Tested by

no test coverage detected