private void transferData(PartItemTransfer.DismissAction dismiss, Part p)
        {
            if (dismiss != PartItemTransfer.DismissAction.ItemMoved)
            {
                return;
            }

            if (p == null)
            {
                return;
            }

            if (handler == null)
            {
                return;
            }

            if (handler.GetScienceCount() <= 0)
            {
                ScreenMessages.PostScreenMessage(string.Format("[{0}]: has no data to transfer.", part.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            ModuleScienceContainer container = p.FindModuleImplementing <ModuleScienceContainer>();

            if (container == null)
            {
                ScreenMessages.PostScreenMessage(string.Format("<color=orange>[{0}]: {1} has no data container, canceling transfer.<color>", part.partInfo.title, p.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            onTransferData(container);
        }
Esempio n. 2
0
        private void transferData(PartItemTransfer.DismissAction dismiss, Part p)
        {
            if (dismiss != PartItemTransfer.DismissAction.ItemMoved)
            {
                return;
            }

            if (p == null)
            {
                return;
            }

            if (handler == null)
            {
                return;
            }

            if (handler.GetScienceCount() <= 0)
            {
                ScreenMessages.PostScreenMessage(Localizer.Format("#autoLOC_238567", part.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            ModuleScienceContainer container = p.FindModuleImplementing <ModuleScienceContainer>();

            if (container == null)
            {
                ScreenMessages.PostScreenMessage(Localizer.Format("#autoLOC_237432", part.partInfo.title, p.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            onTransferData(container);
        }
Esempio n. 3
0
 private void OnDialogDismiss(PartItemTransfer.DismissAction arg1, Part arg2)
 {
     if (BDArmorySettings.DRAW_DEBUG_LABELS)
     {
         Debug.Log(arg1);
     }
     if (BDArmorySettings.DRAW_DEBUG_LABELS)
     {
         Debug.Log(arg2);
     }
 }
        private void transferData(PartItemTransfer.DismissAction dismiss, Part p)
        {
            if (dismiss != PartItemTransfer.DismissAction.ItemMoved)
            {
                return;
            }

            if (p == null)
            {
                return;
            }

            if (scienceReports.Count <= 0)
            {
                ScreenMessages.PostScreenMessage(string.Format("[{0}]: has no data to transfer.", part.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            ModuleScienceContainer container = p.FindModuleImplementing <ModuleScienceContainer>();

            if (container == null)
            {
                ScreenMessages.PostScreenMessage(string.Format("<color=orange>[{0}]: {1} has no data container, canceling transfer.<color>", part.partInfo.title, p.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!rerunnable)
            {
                List <DialogGUIBase> dialog = new List <DialogGUIBase>();
                dialog.Add(new DialogGUIButton <ModuleScienceContainer>("Remove Data", new Callback <ModuleScienceContainer>(onTransferData), container));
                dialog.Add(new DialogGUIButton("Cancel", null, true));

                PopupDialog.SpawnPopupDialog(
                    new Vector2(0.5f, 0.5f),
                    new Vector2(0.5f, 0.5f),
                    new MultiOptionDialog(
                        "TransferWarning",
                        "Removing the experiment data will render this module inoperable.\n\nRestoring functionality will require a Scientist.",
                        part.partInfo.title + "Warning!",
                        UISkinManager.defaultSkin,
                        dialog.ToArray()
                        ),
                    false,
                    UISkinManager.defaultSkin,
                    true,
                    ""
                    );
            }
            else
            {
                onTransferData(container);
            }
        }
        private void transferData(PartItemTransfer.DismissAction dismiss, Part p)
        {
            if (dismiss != PartItemTransfer.DismissAction.ItemMoved)
            {
                return;
            }

            if (p == null)
            {
                return;
            }

            if (dataList.Count <= 0)
            {
                ScreenMessages.PostScreenMessage(Localizer.Format("#autoLOC_238567", part.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            ModuleScienceContainer container = p.FindModuleImplementing <ModuleScienceContainer>();

            if (container == null)
            {
                ScreenMessages.PostScreenMessage(Localizer.Format("#autoLOC_238572", part.partInfo.title, p.partInfo.title), 6, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!rerunnable)
            {
                List <DialogGUIBase> dialog = new List <DialogGUIBase>();
                dialog.Add(new DialogGUIButton <ModuleScienceContainer>(Localizer.Format("#autoLOC_7003412"), new Callback <ModuleScienceContainer>(onTransferData), container));
                dialog.Add(new DialogGUIButton(Localizer.Format("#autoLOC_236419"), null, true));

                PopupDialog.SpawnPopupDialog(
                    new Vector2(0.5f, 0.5f),
                    new Vector2(0.5f, 0.5f),
                    new MultiOptionDialog(
                        "DataWarning",
                        collectWarningText,
                        Localizer.Format("#autoLOC_238556", part.partInfo.title),
                        UISkinManager.defaultSkin,
                        dialog.ToArray()
                        ),
                    false,
                    UISkinManager.defaultSkin,
                    true,
                    ""
                    );
            }
            else
            {
                onTransferData(container);
            }
        }
Esempio n. 6
0
 private void OnDialogDismiss(PartItemTransfer.DismissAction arg1, Part arg2)
 {
     Debug.Log(arg1);
     Debug.Log(arg2);
 }