Skip to content

Switch to using UIStatisticsWindow instead of UIProductionStatWindow - #119

Merged
brokenmass merged 5 commits into
DysonSphereMod:masterfrom
mattsemar:switchToUIStatisticsWindow
Aug 17, 2021
Merged

Switch to using UIStatisticsWindow instead of UIProductionStatWindow#119
brokenmass merged 5 commits into
DysonSphereMod:masterfrom
mattsemar:switchToUIStatisticsWindow

Conversation

@mattsemar

@mattsemar mattsemar commented Aug 13, 2021

Copy link
Copy Markdown
Contributor

Looks like UIProductionStatWindow went away. I took a stab at switching to UIStatisticsWindow. It seems to work on my machine 😄

@mattsemar
mattsemar force-pushed the switchToUIStatisticsWindow branch from 6a1726f to f664ff9 Compare August 13, 2021 22:26
@starfi5h

Copy link
Copy Markdown

I got error when setting time period to all time.
0.8.20.7996

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_ 

Here is the dll and dsv I used.

@cgc007

cgc007 commented Aug 15, 2021

Copy link
Copy Markdown

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.

@NelsonMinar

Copy link
Copy Markdown

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.

@mattsemar

Copy link
Copy Markdown
Contributor Author

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

@mattsemar

Copy link
Copy Markdown
Contributor Author

That seems to work, but I would like to know what Destroy() was actually doing. Here's the dll

@mattsemar

Copy link
Copy Markdown
Contributor Author

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

@starfi5h

Copy link
Copy Markdown

Thanks, The NullReferenceException bug is fixed now.
There're only 2 minor issues left:

  1. The theoretical max of orbital collector isn't correct. In the picture, I had level 8 VU and 180% mining speed.
    gas
    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.

  2. The version number should be 1.3.1

@mattsemar

Copy link
Copy Markdown
Contributor Author

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

@mattsemar

Copy link
Copy Markdown
Contributor Author

@brokenmass, I think this is all working ok now, can we get it merged and cut a new version?

@brokenmass

Copy link
Copy Markdown
Contributor

@mattsemar will check and build today, thanks !

@brokenmass
brokenmass merged commit 53f1b81 into DysonSphereMod:master Aug 17, 2021
@brokenmass

Copy link
Copy Markdown
Contributor

released 1.3.1

@mattsemar
mattsemar deleted the switchToUIStatisticsWindow branch August 17, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants