X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

Provide a hook to run code on every save load with the mod enabled #808

Closed Xymanek closed 3 years ago

Xymanek commented 4 years ago

It's possible to achieve this already using a fake DLCInfo with OnLoadedSavedGame but this creates a "waste" for every DLCInfo call for every mod that uses such method.

We should investigate providing a centralized hook via CHL to avoid the "waste".

Xymanek commented 4 years ago

Turns out that DLCInfo::OnLoadedSavedGame is called from unrealscript - XComOnlineEventMgr::PreloadSaveGameData. We can just add another call there, something like DLCInfo::OnLoadedSavedGameIncludingExisting.

Thoughts on naming?