Closed mattsemar closed 3 years ago
I got error when setting time period to all time.
System.NullReferenceException: Object reference not set to an instance of an object
at UIStatisticsWindow.EntryPrepareComputeDetail (UIProductEntry entry) [0x0000c] in <2b6b567be8b04c928a9ec5e7af421c2e>:0
at UIStatisticsWindow.ComputeDisplayEntriesDetail () [0x00101] in <2b6b567be8b04c928a9ec5e7af421c2e>:0
at UIStatisticsWindow._OnUpdate () [0x00344] in <2b6b567be8b04c928a9ec5e7af421c2e>:0
at ManualBehaviour._Update () [0x00017] in <2b6b567be8b04c928a9ec5e7af421c2e>:0_
I tested starfi5h's .dll and got the same error. Happened on 'Entire Star Cluster` set. Seems to persist through reloading various saves as well. The only way to be rid of the error I've found thus far is to exit DSP entirely (desktop) and reload it.
One of the other changes in the patch that broke BetterStats was "Now the entries with both production and consumption of 0 are not displayed in the production statistics panel." I wonder if that might be the cause of the error starfi5h reported. Or cause other problems.
I think it's because I was trying to use entry.Free() as a replacement for entry.Destroy(). I'm not really sure what entry.Destroy() actually did, though, so I'll just take it out and see what happens
That seems to work, but I would like to know what Destroy() was actually doing. Here's the dll
I fixed some display issues, and just made it so the the 'Theoretical max' stuff stays even in all time mode. Link to dll here
Thanks, The NullReferenceException bug is fixed now. There're only 2 minor issues left:
The theoretical max of orbital collector isn't correct. In the picture, I had level 8 VU and 180% mining speed.
the line
var collectorsWorkCost = Traverse.Create<PlanetTransport>().Field("collectorsWorkCost").GetValue<double>();
always get 0.
Assembly Publicizer can make all fields, methods, etc are public. You can reference the publicize assembly Assembly-CSharp_publicized.dll
to directly asscess transport.collectorsWorkCost
without using reflection.
The version number should be 1.3.1
Ok, the orbital collectors should calculate the max value correctly now. I also changed the version. Thanks for the help debugging @starfi5h
Also updated BetterStats.dll
@brokenmass, I think this is all working ok now, can we get it merged and cut a new version?
@mattsemar will check and build today, thanks !
released 1.3.1
Looks like UIProductionStatWindow went away. I took a stab at switching to UIStatisticsWindow. It seems to work on my machine 😄