Jump to content

EVA scrambles part window field/event order having issues with the fix.


Recommended Posts

Going EVA scrambles the ordering of fields and events due to the ShowUpgradeStats event button disappearing on EVA, and how that interacts with KSP's own internal part field/event ordering system.   To solve this I've made the ShowUpgradeStats button permanent, but the problem is that this then causes buttons on different parts to mix and duplicate while other buttons that should unload don't.

Untsssitled.png

I did find this old post where someone else was having the same/similar issue as me but their solution didn't work when I tried to apply it to my code.  So does anyone know how I can fix this duplication issue or another way I can make the original field/event order permanent?  Here's the code I've been using for ShowUpgradeStats.

		public void Start()
		{
			List<Part> parts = FlightGlobals.ActiveVessel.parts;
			for (int i = 0; i < parts.Count; i++)
			{
				Part p = parts.ElementAt(i);
				foreach (BaseEvent ShowUpgradeStats in p.Events)
				{
					int id = ShowUpgradeStats.id;
					p.Events[id].guiActiveUnfocused = true;
				}
			}
		}

 

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...