void OnDetails(MyGuiControlButton button)
 {
     if (m_selectedItem == null)
     {
         if (m_activeDetail)
         {
             MyScreenManager.RemoveScreen(m_detailScreen);
         }
         return;
     }
     else if (m_activeDetail)
     {
         MyScreenManager.RemoveScreen(m_detailScreen);
     }
     else if (!m_activeDetail)
     {
         if ((m_selectedItem.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.LOCAL)
         {
             var path = Path.Combine(m_localScriptFolder, m_selectedItem.Text.ToString());
             if (Directory.Exists(path))
             {
                 m_detailScreen = new MyGuiDetailScreenScriptLocal(
                       callBack: delegate(MyScriptItemInfo item)
                       {
                           if (item == null)
                           {
                               m_renameButton.Enabled = false;
                               m_detailsButton.Enabled = false;
                               m_deleteButton.Enabled = false;
                           }
                          m_activeDetail = false;
                           if (m_task.IsComplete)
                           {
                               RefreshBlueprintList(m_detailScreen.WasPublished);
                           }
                       },
                       selectedItem: (m_selectedItem.UserData  as MyScriptItemInfo),
                       parent: this,
                       textScale: m_textScale
                       );
                 m_activeDetail = true;
                 MyScreenManager.InputToNonFocusedScreens = true;
                 MyScreenManager.AddScreen(m_detailScreen);
             }
             else
             {
                 MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(
                             buttonType: MyMessageBoxButtonsType.OK,
                             styleEnum: MyMessageBoxStyleEnum.Error,
                             messageCaption: MyTexts.Get(MySpaceTexts.MessageBoxCaptionError),
                             messageText: MyTexts.Get(MySpaceTexts.ProgrammableBlock_ScriptNotFound)
                             ));
             }
         }
         else if ((m_selectedItem.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.STEAM)
         {
             m_detailScreen = new MyGuiDetailScreenScriptLocal(
                callBack: delegate(MyScriptItemInfo item)
                 {
                     m_activeDetail = false;
                     if (m_task.IsComplete)
                     {
                         RefreshBlueprintList();
                     }
                 },
                 selectedItem: (m_selectedItem.UserData as MyScriptItemInfo),
                 parent: this,
                 textScale: m_textScale
                 );
             m_activeDetail = true;
             MyScreenManager.InputToNonFocusedScreens = true;
             MyScreenManager.AddScreen(m_detailScreen);
         }
     }
 }
 void OnDetails(MyGuiControlButton button)
 {
     if (m_selectedItem == null)
     {
         if (m_activeDetail)
         {
             MyScreenManager.RemoveScreen(m_detailScreen);
         }
         return;
     }
     else if (m_activeDetail)
     {
         MyScreenManager.RemoveScreen(m_detailScreen);
     }
     else if (!m_activeDetail)
     {
         if ((m_selectedItem.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.LOCAL)
         {
             var path = Path.Combine(m_localBlueprintFolder, m_selectedItem.Text.ToString());
             if (Directory.Exists(path))
             {
                 m_detailScreen = new MyGuiDetailScreenScriptLocal(
                     callBack : delegate(MyScriptItemInfo item)
                 {
                     if (item == null)
                     {
                         m_renameButton.Enabled  = false;
                         m_detailsButton.Enabled = false;
                         m_deleteButton.Enabled  = false;
                     }
                     m_activeDetail = false;
                     if (m_task.IsComplete)
                     {
                         RefreshBlueprintList(m_detailScreen.WasPublished);
                     }
                 },
                     selectedItem: (m_selectedItem.UserData  as MyScriptItemInfo),
                     parent: this,
                     textScale: m_textScale
                     );
                 m_activeDetail = true;
                 MyScreenManager.InputToNonFocusedScreens = true;
                 MyScreenManager.AddScreen(m_detailScreen);
             }
             else
             {
                 MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(
                                            buttonType: MyMessageBoxButtonsType.OK,
                                            styleEnum: MyMessageBoxStyleEnum.Error,
                                            messageCaption: MyTexts.Get(MySpaceTexts.MessageBoxCaptionError),
                                            messageText: MyTexts.Get(MySpaceTexts.ProgrammableBlock_ScriptNotFound)
                                            ));
             }
         }
         else if ((m_selectedItem.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.STEAM)
         {
             m_detailScreen = new MyGuiDetailScreenScriptLocal(
                 callBack : delegate(MyScriptItemInfo item)
             {
                 m_activeDetail = false;
                 if (m_task.IsComplete)
                 {
                     RefreshBlueprintList();
                 }
             },
                 selectedItem: (m_selectedItem.UserData as MyScriptItemInfo),
                 parent: this,
                 textScale: m_textScale
                 );
             m_activeDetail = true;
             MyScreenManager.InputToNonFocusedScreens = true;
             MyScreenManager.AddScreen(m_detailScreen);
         }
     }
 }