@@ -159,7 +159,7 @@ public Vector2 Draw(Vector2 position)
159
159
public void DrawSettingsWinEditor ( int WindowID )
160
160
{
161
161
162
- if ( GUI . Button ( new Rect ( 10 , 25 , 130 , 25 ) , "Reset Windows" , AGXBtnStyle ) )
162
+ if ( GUI . Button ( new Rect ( 10 , 25 , 130 , 25 ) , "Reset Windows" , AGXBtnStyle ) )
163
163
{
164
164
KeySetWin . x = 250 ;
165
165
KeySetWin . y = 250 ;
@@ -546,6 +546,7 @@ public void Start()
546
546
GameEvents . onPartAttach . Add ( PartAttaching ) ; // this game event only fires for part removed, not child parts
547
547
GameEvents . onPartRemove . Add ( PartRemove ) ;
548
548
GameEvents . onEditorShipModified . Add ( VesselChanged ) ;
549
+ GameEvents . onEditorLoad . Add ( OnShipLoad ) ;
549
550
isDirectAction = new Dictionary < int , bool > ( ) ;
550
551
CurrentVesselActions . Clear ( ) ;
551
552
EditorLoadFromFile ( ) ;
@@ -555,7 +556,7 @@ public void Start()
555
556
//print("Loading now");
556
557
//EditorActionGroups.Instance.groupActionsList.AddValueChangedDelegate(OnGroupActionsListChange);
557
558
LoadFinished = true ;
558
- Debug . Log ( "AGX Editor Start Okay" ) ;
559
+ // Debug.Log("AGX Editor Start Okay");
559
560
}
560
561
catch ( Exception e )
561
562
{
@@ -564,6 +565,21 @@ public void Start()
564
565
}
565
566
}
566
567
568
+ public void OnShipLoad ( ShipConstruct ship , CraftBrowser . LoadType loadType )
569
+ {
570
+ if ( loadType == CraftBrowser . LoadType . Normal )
571
+ {
572
+ CurrentVesselActions . Clear ( ) ;
573
+ //EditorLoadFromFile();
574
+ EditorLoadFromNode ( ) ;
575
+ //Debug.Log("AGX Ship Load of type NORMAL detected");
576
+ }
577
+ else
578
+ {
579
+ Debug . Log ( "AGX Ship Load of type MERGE detected" ) ;
580
+ }
581
+ }
582
+
567
583
//public void OnGroupActionsListChange(IUIObject obj)
568
584
//{
569
585
// print("List change " + obj.GetType());
@@ -1155,6 +1171,7 @@ public void OnDisable()
1155
1171
GameEvents . onPartAttach . Remove ( PartAttaching ) ;
1156
1172
GameEvents . onPartRemove . Remove ( PartRemove ) ;
1157
1173
GameEvents . onEditorShipModified . Remove ( VesselChanged ) ;
1174
+ GameEvents . onEditorLoad . Remove ( OnShipLoad ) ;
1158
1175
//GameEvents.onGameSceneLoadRequested.Remove(LeavingEditor);
1159
1176
1160
1177
@@ -2374,7 +2391,7 @@ public void SelParts(int WindowID)
2374
2391
2375
2392
2376
2393
//if (Checking.Count == 0)
2377
- if ( ! CurrentVesselActions . Contains ( ToAdd ) )
2394
+ if ( ! CurrentVesselActions . Contains ( ToAdd ) )
2378
2395
{
2379
2396
2380
2397
CurrentVesselActions . Add ( ToAdd ) ;
@@ -2726,7 +2743,7 @@ public void RefreshDefaultActionsList()
2726
2743
}
2727
2744
}
2728
2745
}
2729
- catch ( Exception e )
2746
+ catch ( Exception e )
2730
2747
{
2731
2748
Debug . Log ( "AGX RefDefActsList Error " + errLine + " " + e ) ;
2732
2749
}
@@ -2751,7 +2768,7 @@ public void RefreshDefaultActionsListType()
2751
2768
}
2752
2769
}
2753
2770
}
2754
- catch ( Exception e )
2771
+ catch ( Exception e )
2755
2772
{
2756
2773
Debug . Log ( "AGX RefDefActsListType Error " + errLine + " " + e ) ;
2757
2774
}
@@ -3960,7 +3977,7 @@ public void MonitorDefaultActions()
3960
3977
}
3961
3978
}
3962
3979
}
3963
- catch ( Exception e )
3980
+ catch ( Exception e )
3964
3981
{
3965
3982
Debug . Log ( "AGX Monitor Default Actions Error " + errLine + " " + e ) ;
3966
3983
}
0 commit comments