Project

General

Profile

Bug #27432

[Mod Related: 3] KSP's UIPartActionController to go crazy when following code is run

Added by linuxgurugamer 27 days ago. Updated 17 days ago.

Status:
New
Severity:
Low
Assignee:
-
Category:
Editor
Target version:
-
Start date:
03/21/2021
% Done:

0%

Version:
Platform:
Windows
Expansion:
Core Game
Language:
English (US)
Mod Related:
Yes
Votes:
Arrow u r green
Arrow d r red

Description

Symptoms: This cause constant re-instantiation of the PAW by UIPartActionController .Update(), generating huge lag that result in PAWs becoming very unresponsive.

To reproduce :

In the editor, add a crewable and crewed root part (only one)
Open the PAW

Compile and add the following code is compiled against KSP 1.11.2:

// ************************************************
using KSP.UI;

public class TestCrewModule : PartModule {
bool called = false;
void Update() {
if (HighLogic.LoadedSceneIsEditor) {
if (!called) {
VesselCrewManifest originalVesselManifest = CrewAssignmentDialog.Instance.GetManifest();
CrewAssignmentDialog.Instance.RefreshCrewLists(originalVesselManifest, true, true);
called = true;
}
var manifest = KSP.UI.CrewAssignmentDialog.Instance.GetManifest();
}
}
}
// ************************************************

Add the following to parts with crew capacity:

MODULE
    {
name = TestCrewModule
}

You can use the following patch with ModuleManager to make it easier:
@PART[*]:HAS[#CrewCapacity[>0]]:FINAL {
MODULE {
name = TestCrewModule
}
}

Workarounds:

I did notice that removing/restoring crew also "cleared" the condition in the editor, so I'm assuming that my adding/removing parts was particular to command pods (since that was the first panel open in the part tray) as they would trigger crew info refreshing.

Add a second crewed part, then remove it

History

#1 Updated by victorr 17 days ago

  • Subject changed from KSP's UIPartActionController to go crazy when following code is run to [Mod Related: 3] KSP's UIPartActionController to go crazy when following code is run

Also available in: Atom PDF