@@ -339,7 +339,7 @@ public void Start()
339
339
//print("b");
340
340
if ( ( string ) AGExtNode . GetValue ( "OverrideCareer" ) == "1" )
341
341
{
342
- //print("c ");
342
+ //print("AGX 0 ");
343
343
showCareerCustomAGs = true ;
344
344
showCareerStockAGs = true ;
345
345
}
@@ -362,19 +362,19 @@ public void Start()
362
362
363
363
if ( GameVariables . Instance . UnlockedActionGroupsCustom ( facilityLevel , inVAB ) )
364
364
{
365
- // print("g ");
365
+ //print("AGX 1 ");
366
366
showCareerStockAGs = true ;
367
367
showCareerCustomAGs = true ;
368
368
}
369
369
else if ( GameVariables . Instance . UnlockedActionGroupsStock ( facilityLevel , inVAB ) )
370
370
{
371
- //print("h ");
371
+ //print("AGX 2 ");
372
372
showCareerStockAGs = true ;
373
373
showCareerCustomAGs = false ;
374
374
}
375
375
else
376
376
{
377
- //print("i ");
377
+ //print("AGX 3 ");
378
378
showCareerStockAGs = false ;
379
379
showCareerCustomAGs = false ;
380
380
}
@@ -765,43 +765,49 @@ public void onLeftButtonClick()
765
765
//Debug.Log("AGX nods editor" + EditorLogic.fetch.editorScreen);
766
766
try
767
767
{
768
- if ( EditorLogic . fetch . editorScreen != EditorScreen . Actions )
768
+ if ( showCareerStockAGs )
769
769
{
770
- if ( EditorLogic . SortedShipList . Count > 0 )
770
+ if ( EditorLogic . fetch . editorScreen != EditorScreen . Actions )
771
771
{
772
- EditorLogic . fetch . SelectPanelActions ( ) ;
773
- }
774
- //Debug.Log("AGX no editor");
775
- //if (EditorLogic.SortedShipList.Count > 0 && showCareerStockAGs)
776
- //{
772
+ if ( EditorLogic . SortedShipList . Count > 0 )
773
+ {
774
+ EditorLogic . fetch . SelectPanelActions ( ) ;
775
+ }
776
+ //Debug.Log("AGX no editor");
777
+ //if (EditorLogic.SortedShipList.Count > 0 && showCareerStockAGs)
778
+ //{
777
779
778
- // EditorLogic.fetch.SelectPanelActions();
779
- // StartCoroutine("DelayPanelsMovement");
780
- //}
780
+ // EditorLogic.fetch.SelectPanelActions();
781
+ // StartCoroutine("DelayPanelsMovement");
782
+ //}
781
783
782
- }
783
- else
784
- {
785
- //Debug.Log("AGX iseditor");
786
- if ( AGXShow )
787
- {
788
- //UIPanelList.First().Translate(new Vector3(500f, 0, 0), UIPanelList.First().parent.transform); //hide UI panel
789
- AGXShow = false ;
790
- AGExtNode . SetValue ( "EditShow" , "0" ) ;
791
- //EditorPanels.Instance.panelManager.BringIn(EditorPanels.Instance.actions);
792
- //StartCoroutine("DelayPanelsMovement");
793
784
}
794
785
else
795
786
{
796
- // UIPanelList.First().Translate(new Vector3(-500f, 0, 0), UIPanelList.First().parent.transform); //show UI panel
797
- AGXShow = true ;
798
- AGExtNode . SetValue ( "EditShow" , "1" ) ;
799
- //EditorPanels.Instance.panelManager.Dismiss();
800
- //StartCoroutine("DelayPanelsMovement");
787
+ //Debug.Log("AGX iseditor");
788
+ if ( AGXShow )
789
+ {
790
+ //UIPanelList.First().Translate(new Vector3(500f, 0, 0), UIPanelList.First().parent.transform); //hide UI panel
791
+ AGXShow = false ;
792
+ AGExtNode . SetValue ( "EditShow" , "0" ) ;
793
+ //EditorPanels.Instance.panelManager.BringIn(EditorPanels.Instance.actions);
794
+ //StartCoroutine("DelayPanelsMovement");
795
+ }
796
+ else
797
+ {
798
+ // UIPanelList.First().Translate(new Vector3(-500f, 0, 0), UIPanelList.First().parent.transform); //show UI panel
799
+ AGXShow = true ;
800
+ AGExtNode . SetValue ( "EditShow" , "1" ) ;
801
+ //EditorPanels.Instance.panelManager.Dismiss();
802
+ //StartCoroutine("DelayPanelsMovement");
803
+ }
804
+ AGXStaticData . SaveBaseConfigNode ( AGExtNode ) ;
801
805
}
802
- AGXStaticData . SaveBaseConfigNode ( AGExtNode ) ;
803
806
}
804
-
807
+ else
808
+ {
809
+ ScreenMessages . PostScreenMessage ( "Action Groups Unavailable. Facility Upgrade Required." ) ;
810
+ }
805
811
}
806
812
catch
807
813
{
@@ -836,7 +842,12 @@ public void PartAttaching(GameEvents.HostTargetAction<Part, Part> host_target)
836
842
// ErrLine = "5";
837
843
// }
838
844
ErrLine = "6" ;
839
-
845
+ //Debug.Log("AGX 1 " + host_target.host.name);
846
+ //Debug.Log("AGX 2 " + host_target.host.Modules.Count);
847
+ //foreach(PartModule pm in host_target.host.Modules)
848
+ //{
849
+ // Debug.Log("AGX 3 " + pm.moduleName);
850
+ //}
840
851
ErrLine = "7" ;
841
852
ModuleAGX agxMod = host_target . host . Modules . OfType < ModuleAGX > ( ) . First ( ) ;
842
853
ErrLine = "8" ;
@@ -1133,11 +1144,11 @@ public static void LoadGroupVisibility(string LoadString)
1133
1144
1134
1145
//}
1135
1146
1136
- public void OnActionButtonClick ( IUIObject obj ) //reset EditorPanel if needed, note AGX button on toolbar hooks this method as well
1137
- {
1138
- //Debug.Log("act button click");
1139
- StartCoroutine ( "DelayPanelsMovement" ) ;
1140
- }
1147
+ // public void OnActionButtonClick(IUIObject obj) //reset EditorPanel if needed, note AGX button on toolbar hooks this method as well
1148
+ // {
1149
+ // //Debug.Log("act button click");
1150
+ // StartCoroutine("DelayPanelsMovement");
1151
+ // }
1141
1152
1142
1153
public void ImmediatePanelsMovement ( )
1143
1154
{
@@ -1250,11 +1261,11 @@ public void ActualPanelsMovement()
1250
1261
}
1251
1262
1252
1263
1253
- public void OnPartButtonClick ( IUIObject obj ) //reset EditorPanel if needed
1254
- {
1255
- //Debug.Log("Part button click");
1256
- StartCoroutine ( "DelayPanelsMovement" ) ;
1257
- }
1264
+ // public void OnPartButtonClick(IUIObject obj) //reset EditorPanel if needed
1265
+ // {
1266
+ // //Debug.Log("Part button click");
1267
+ // StartCoroutine("DelayPanelsMovement");
1268
+ // }
1258
1269
//public void OnPartButtonClick(IUIObject obj) //reset EditorPanel if needed
1259
1270
//{
1260
1271
// if(agxWindowsShowing)
@@ -1268,57 +1279,57 @@ public void ActualPanelsMovement()
1268
1279
// EditorLogic.fetch.SetBackup();
1269
1280
//}
1270
1281
1271
- public void OnCrewButtonClick ( IUIObject obj ) //reset EditorPanel if needed
1272
- {
1273
- StartCoroutine ( "DelayPanelsMovement" ) ;
1274
- }
1282
+ // public void OnCrewButtonClick(IUIObject obj) //reset EditorPanel if needed
1283
+ // {
1284
+ // StartCoroutine("DelayPanelsMovement");
1285
+ // }
1275
1286
1276
- public void OnLoadClick ( IUIObject obj ) //reset EditorPanel if needed
1277
- {
1278
- if ( EditorLogic . fetch . editorScreen == EditorScreen . Actions )
1279
- {
1280
- EditorPanels . Instance . panelManager . BringIn ( EditorPanels . Instance . actions ) ;
1281
- }
1282
- //StartCoroutine("DelayPanelsMovement");
1283
- }
1287
+ // public void OnLoadClick(IUIObject obj) //reset EditorPanel if needed
1288
+ // {
1289
+ // if (EditorLogic.fetch.editorScreen == EditorScreen.Actions)
1290
+ // {
1291
+ // EditorPanels.Instance.panelManager.BringIn(EditorPanels.Instance.actions);
1292
+ // }
1293
+ // //StartCoroutine("DelayPanelsMovement");
1294
+ // }
1284
1295
1285
- public void OnSaveButtonClick ( IUIObject obj ) //reset EditorPanel if needed
1286
- {
1287
- //save button actually doesn't affect the visible UI, do nothing
1288
- }
1296
+ // public void OnSaveButtonClick(IUIObject obj) //reset EditorPanel if needed
1297
+ // {
1298
+ // //save button actually doesn't affect the visible UI, do nothing
1299
+ // }
1289
1300
1290
- public void OnLaunchButtonClick ( IUIObject obj ) //reset EditorPanel if needed
1291
- {
1292
- if ( EditorLogic . fetch . editorScreen == EditorScreen . Actions )
1293
- {
1294
- EditorPanels . Instance . panelManager . BringIn ( EditorPanels . Instance . actions ) ;
1295
- }
1296
- //StartCoroutine("DelayPanelsMovement");
1297
- }
1301
+ // public void OnLaunchButtonClick(IUIObject obj) //reset EditorPanel if needed
1302
+ // {
1303
+ // if (EditorLogic.fetch.editorScreen == EditorScreen.Actions)
1304
+ // {
1305
+ // EditorPanels.Instance.panelManager.BringIn(EditorPanels.Instance.actions);
1306
+ // }
1307
+ // //StartCoroutine("DelayPanelsMovement");
1308
+ // }
1298
1309
1299
- public void OnExitButtonClick ( IUIObject obj ) //reset EditorPanel if needed
1300
- {
1301
- if ( EditorLogic . fetch . editorScreen == EditorScreen . Actions )
1302
- {
1303
- EditorPanels . Instance . panelManager . BringIn ( EditorPanels . Instance . actions ) ;
1304
- }
1305
- // StartCoroutine("DelayPanelsMovement");
1310
+ // public void OnExitButtonClick(IUIObject obj) //reset EditorPanel if needed
1311
+ // {
1312
+ // if (EditorLogic.fetch.editorScreen == EditorScreen.Actions)
1313
+ // {
1314
+ // EditorPanels.Instance.panelManager.BringIn(EditorPanels.Instance.actions);
1315
+ // }
1316
+ // // StartCoroutine("DelayPanelsMovement");
1306
1317
1307
- }
1318
+ // }
1308
1319
1309
- public void OnNewButtonClick ( IUIObject obj ) //reset EditorPanel if needed
1310
- {
1311
- if ( EditorLogic . fetch . editorScreen == EditorScreen . Actions )
1312
- {
1313
- EditorPanels . Instance . panelManager . BringIn ( EditorPanels . Instance . actions ) ;
1314
- }
1315
- //StartCoroutine("DelayPanelsMovement");
1316
- }
1320
+ // public void OnNewButtonClick(IUIObject obj) //reset EditorPanel if needed
1321
+ // {
1322
+ // if(EditorLogic.fetch.editorScreen == EditorScreen.Actions)
1323
+ // {
1324
+ // EditorPanels.Instance.panelManager.BringIn(EditorPanels.Instance.actions);
1325
+ // }
1326
+ // //StartCoroutine("DelayPanelsMovement");
1327
+ // }
1317
1328
1318
- public void OnActionPanelsUIChanged ( IUIObject obj ) //reset EditorPanel if needed
1319
- {
1320
- //StartCoroutine("DelayPanelsMovement");
1321
- }
1329
+ // public void OnActionPanelsUIChanged(IUIObject obj) //reset EditorPanel if needed
1330
+ // {
1331
+ // //StartCoroutine("DelayPanelsMovement");
1332
+ // }
1322
1333
1323
1334
//public void OnOtherButtonClick(IUIObject obj) //reset EditorPanel if needed
1324
1335
//{
@@ -1500,24 +1511,36 @@ public void LeavingEditor(GameScenes gScn)
1500
1511
1501
1512
public void OnDisable ( )
1502
1513
{
1503
-
1514
+ string errLine = "1" ;
1515
+ try
1516
+ {
1504
1517
LoadFinished = false ;
1518
+ errLine = "2" ;
1505
1519
SaveCurrentKeyBindings ( ) ;
1520
+ errLine = "3" ;
1506
1521
SaveWindowPositions ( ) ;
1522
+ errLine = "4" ;
1507
1523
if ( ToolbarManager . ToolbarAvailable ) //if toolbar loaded, destroy button on leaving scene
1508
1524
{
1525
+ errLine = "5" ;
1509
1526
AGXBtn . Destroy ( ) ;
1510
1527
}
1511
1528
else
1512
1529
{
1530
+ errLine = "6" ;
1513
1531
ApplicationLauncher . Instance . RemoveModApplication ( AGXAppEditorButton ) ;
1514
1532
}
1515
1533
//EditorSaveToFile(); //some of my data has already been deleted by this point
1534
+ errLine = "7" ;
1516
1535
GameEvents . onPartAttach . Remove ( PartAttaching ) ;
1536
+ errLine = "8" ;
1517
1537
GameEvents . onPartRemove . Remove ( PartRemove ) ;
1538
+ errLine = "9" ;
1518
1539
GameEvents . onEditorPartEvent . Remove ( OnPartEvent ) ;
1540
+ errLine = "10" ;
1519
1541
//GameEvents.onEditorShipModified.Remove(VesselChanged);
1520
1542
GameEvents . onEditorLoad . Remove ( OnShipLoad ) ;
1543
+ errLine = "11" ;
1521
1544
//GameEvents.onGameStateSave.Remove(OnSaveTest);
1522
1545
//GameEvents.onGameSceneLoadRequested.Remove(LeavingEditor);
1523
1546
//GameEvents.onEditorLoad(OnEditorLoadCall);
@@ -1541,8 +1564,16 @@ public void OnDisable()
1541
1564
//EditorLogic.fetch.launchBtn.RemoveValueChangedDelegate(OnLaunchButtonClick);
1542
1565
//EditorLogic.fetch.exitBtn.RemoveValueChangedDelegate(OnExitButtonClick);
1543
1566
//EditorLogic.fetch.newBtn.RemoveValueChangedDelegate(OnNewButtonClick);
1544
- EditorLogic . fetch . Unlock ( "AGXLock" ) ;
1567
+ //EditorLogic.fetch.Unlock("AGXLock");
1568
+ InputLockManager . RemoveControlLock ( "AGXLock" ) ;
1569
+ errLine = "12" ;
1545
1570
StaticData . CurrentVesselActions . Clear ( ) ;
1571
+ errLine = "13" ;
1572
+ }
1573
+ catch ( Exception e )
1574
+ {
1575
+ Debug . Log ( "AGX Editor.OnDestroy " + errLine + "|" + e ) ;
1576
+ }
1546
1577
1547
1578
}
1548
1579
0 commit comments