-
Notifications
You must be signed in to change notification settings - Fork 7
Description
First of all, thank you for all your work in the DSP modding community!
Now for the issue, buildings added with the CommonAPI do not show up correctly in the power chart in the statistics panel:
The building in the image is the Interstellar Giga Station, but the issue is the call to ItemProto.InitPowerFacilityIndices() seems to happen before ProtoRegistry actually adds the new items, so the ItemProto.powerConIndex2Id (and the similar arrays) do not contain the new items, and the power chart gets the default ItemProto when trying to add the item, producing the result shown above.
I managed to fix this specific issue with a simple
ProtoRegistry.onLoadingFinished += () => { ItemProto.InitPowerFacilityIndices(); };
and it SEEMS this causes no issues, though I'm not entirely sure. Here is the image after adding this code:
Unfortunately I'm quite new to modding and couldn't quite figure out how to even compile the CommonAPI (much less understand what I'm looking at), so I can't solve this and make a pull request, but at least these pointers I can give you (really, if you could help me compile the CommonAPI it would be a great help).
Thanks again for everything!