MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / add

Function add

src/Engine/src/Input/ShortcutManager.cpp:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 }
20
21 void add(Shortcut id, StringId displayName, const ShortcutAction& action, const char* configName, const char* defaultBinding)
22 {
23 auto it = findShortcut(id);
24 if (it == std::end(_shortcuts) || it->id != id)
25 {
26 _shortcuts.insert(it, ShortcutEntry{ id, action, displayName, configName, defaultBinding });
27 }
28 else
29 {
30 it->id = id;
31 it->action = action;
32 it->configName = configName;
33 it->defaultBinding = defaultBinding;
34 }
35 }
36
37 void remove(Shortcut id)
38 {

Callers

nothing calls this directly

Calls 2

findShortcutFunction · 0.85
endFunction · 0.85

Tested by

no test coverage detected