KSPModdingLibs / KSPCommunityFixes

Community patches for bugs in the KSP codebase
49 stars 17 forks source link

VAB/SPH: Staging stack icons can get stuck and become unusable #211

Open numberlesstim opened 6 months ago

numberlesstim commented 6 months ago

Repro steps:

  1. Place a decoupler
  2. Hold the mouse above the decoupler icon in the staging stack
  3. Click and hold both left and right mouse buttons (order does not matter as long as the mouse isnt moved)
  4. drag the mouse far enough that the icon moves
  5. release both mouse buttons

Result: The icon has become stuck in place and can not be interacted with anymore. Clicking the 'Reset' button does not fix this either. The part is no longer in the staging sequence either, as you can collapse all stages by clicking the small '-' icon.

Mods i tested this with:

both with the same result.

Log in case it helps: KSP.log

[EXC 18:43:57.649] NullReferenceException: Object reference not set to an instance of an object
    KSP.UI.Screens.StageIcon.OnBeginDrag (UnityEngine.EventSystems.PointerEventData eventData) (at <4b449f2841f84227adfaad3149c8fdba>:0)
    UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <12e76cd50cc64cf19e759e981cb725af>:0)
    UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <12e76cd50cc64cf19e759e981cb725af>:0)
    KSP.UI.UIDragPanel.OnBeginDrag (UnityEngine.EventSystems.PointerEventData eventData) (at <4b449f2841f84227adfaad3149c8fdba>:0)
    UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IBeginDragHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <0c883c16262a4198973f823d01e07427>:0)
    UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <0c883c16262a4198973f823d01e07427>:0)
    UnityEngine.EventSystems.EventSystem:Update()
gotmachine commented 6 months ago

That's a fun bug. As a workaround, you can save and reload the current ship to fix it.

numberlesstim commented 6 months ago

Another workaround is to detach and reattach a subtree containing the affected part