Bug #27432
[Mod Related: 3] KSP's UIPartActionController to go crazy when following code is run
0%
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 over 3 years 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