Jump to content

Engineer's report showing wrong mass


Recommended Posts

I'm trying to find a strange bug in my SRB mod.  It seems to be specific to keeping the engineer's report open while building.

 If I put a singe part down, the mass in the engineer's report is fine;  for example, just an SRB segment.  The segments have three different variants, each of which has a different  length, and you can cycle through them.  The motors are similar, they can either have a segment or not.

When I put the two of them together, and change the variants on either, the mass in the engineer's report seems to not be updated properly.  Simply hiding and showing the report again fixes it.  But somehow it's not getting updated properly.

Anybody know of a way to force the engineer's report to update it's data?  I suppose I could toggle the button, but that seems kind of silly

 

I am calling the following to change the dV of the motor, but there isn't anything to call to change the mass:

GameEvents.onChangeEngineDVIncludeState.Fire(this);

 

Edit:  Just noticed that the height is being updated properly, it's only the mass which isn't

Edited by linuxgurugamer
Link to comment
Share on other sites

3 hours ago, peteletroll said:

This solved a problem I had with editor updates, maybe it's worth experimenting: https://github.com/peteletroll/DockRotate/blob/7009043c07e3c6e9b1acd10528fecc2df0604ddb/DockRotate/DockRotate.cs#L313

Thank you, I'll try it.

Edit:  Unfortunately, it didn't do it.

 

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 11 months later...
On 12/25/2019 at 1:57 PM, linuxgurugamer said:

Thank you, I'll try it.
Edit:  Unfortunately, it didn't do it.

I was looking for the same solution and found this method that uses reflection.  

using System.Reflection;

MethodInfo editorReportUpdate;

editorReportUpdate = EngineersReport.Instance.GetType().GetMethod("OnCraftModified", BindingFlags.Instance | BindingFlags.NonPublic, null, Type.EmptyTypes, null);

editorReportUpdate.Invoke(EngineersReport.Instance, null);

FAR uses it in this module

https://github.com/ferram4/Ferram-Aerospace-Research/blob/787a30bc9deab0bde87591f0cc973ec3b0dd2de9/FerramAerospaceResearch/FARGUI/FAREditorGUI/EditorGUI.cs#L183

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...