MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Load

Method Load

src/hotkeys.cpp:269–280  ·  view source on GitHub ↗

* Load HotkeyList from IniFile. * @param ini IniFile to load from. */

Source from the content-addressed store, hash-verified

267 * @param ini IniFile to load from.
268 */
269void HotkeyList::Load(const IniFile &ini)
270{
271 const IniGroup *group = ini.GetGroup(this->ini_group);
272 if (group == nullptr) return;
273 for (Hotkey &hotkey : this->items) {
274 const IniItem *item = group->GetItem(hotkey.name);
275 if (item != nullptr) {
276 hotkey.keycodes.clear();
277 if (item->value.has_value()) ParseHotkeys(hotkey, *item->value);
278 }
279 }
280}
281
282/**
283 * Save HotkeyList to IniFile.

Callers 3

LoadSoundDataFunction · 0.45
LoadUnloadVehicleFunction · 0.45
SaveLoadHotkeysFunction · 0.45

Calls 4

ParseHotkeysFunction · 0.85
GetGroupMethod · 0.80
GetItemMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected