MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / LoadShortcuts

Method LoadShortcuts

Source/Accelerator.cpp:258–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void CAccelerator::LoadShortcuts(CSettings *pSettings)
259{
260 auto *App = FTEnv.GetMainApp(); // // //
261
262 // Set up names and default values
263 LoadDefaults();
264
265 m_iUsedKeys.clear(); // // //
266
267 // Load custom values, if exists
268 /*
269 location priorities:
270 1. HKCU/SOFTWARE/0CC-FamiTracker
271 1. HKCU/SOFTWARE/0CC-FamiTracker, original key
272 2. HKCU/SOFTWARE/FamiTracker
273 3. HKCU/SOFTWARE/FamiTracker, original key (using stAccelEntry::orig_name)
274 4. default value
275 */
276 for (auto &x : m_pEntriesTable) { // // //
277 int Setting = (x.mod << 8) | x.key;
278 { // // //
279 stOldSettingContext s;
280 if (x.orig_name != nullptr) // // //
281 Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.orig_name, Setting);
282 Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.name, Setting);
283 }
284 if (x.orig_name != nullptr) // // //
285 Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.orig_name, Setting);
286 Setting = App->GetProfileIntW(SHORTCUTS_SECTION, x.name, Setting);
287
288 x.key = Setting & 0xFF;
289 x.mod = Setting >> 8;
290 if (!x.mod && x.key) // // //
291 m_iUsedKeys.insert(x.key);
292 }
293}
294
295void CAccelerator::LoadDefaults()
296{

Callers 1

InitInstanceMethod · 0.80

Calls 2

GetMainAppMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected