private MyGuiControlImageButton AddIcon(Vector2 position, string texture, Vector2 size)
        {
            var image = new MyGuiControlImageButton();

            image.Position = position;
            image.Size     = size;
            image.SetTexture(texture);
            Controls.Add(image);
            return(image);
        }
        void OnSelectItem(MyGuiControlListbox list)
        {
            if (list.SelectedItems.Count == 0)
            {
                return;
            }

            m_selectedItem             = list.SelectedItems[0];
            m_detailsButton.Enabled    = true;
            m_screenshotButton.Enabled = true;
            m_replaceButton.Enabled    = m_clipboard.HasCopiedGrids();

            var type = (m_selectedItem.UserData as MyBlueprintItemInfo).Type;
            var id   = (m_selectedItem.UserData as MyBlueprintItemInfo).PublishedItemId;
            var path = "";

            if (type == MyBlueprintTypeEnum.LOCAL)
            {
                path = Path.Combine(m_localBlueprintFolder, m_selectedItem.Text.ToString(), "thumb.png");
                m_deleteButton.Enabled = true;
            }
            else if (type == MyBlueprintTypeEnum.STEAM)
            {
                path = Path.Combine(m_workshopBlueprintFolder, "temp", id.ToString(), "thumb.png");
                m_screenshotButton.Enabled = false;
                m_replaceButton.Enabled    = false;
                m_deleteButton.Enabled     = false;
            }
            else if (type == MyBlueprintTypeEnum.SHARED)
            {
                m_replaceButton.Enabled    = false;
                m_screenshotButton.Enabled = false;
                m_detailsButton.Enabled    = false;
                m_deleteButton.Enabled     = false;
            }
            else if (type == MyBlueprintTypeEnum.DEFAULT)
            {
                path = Path.Combine(m_defaultBlueprintFolder, m_selectedItem.Text.ToString(), "thumb.png");
                m_replaceButton.Enabled    = false;
                m_screenshotButton.Enabled = false;
                m_deleteButton.Enabled     = false;
            }

            if (File.Exists(path))
            {
                m_selectedImage.SetTexture(path);
            }

            else
            {
                m_selectedImage.BackgroundTexture = null;
            }
        }
        void OnMouseOverItem(MyGuiControlListbox listBox)
        {
            var item = listBox.MouseOverItem;
            var path = "";

            if (item != null)
            {
                if ((item.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.LOCAL)
                {
                    path = Path.Combine(m_localBlueprintFolder, item.Text.ToString(), "thumb.png");
                }
                else if ((item.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.STEAM)
                {
                    var id = (item.UserData as MyBlueprintItemInfo).PublishedItemId;
                    if (id != null)
                    {
                        path = Path.Combine(m_workshopBlueprintFolder, "temp", id.ToString(), "thumb.png");
                    }
                }
                else if ((item.UserData as MyBlueprintItemInfo).Type == MyBlueprintTypeEnum.DEFAULT)
                {
                    path = Path.Combine(m_defaultBlueprintFolder, item.Text.ToString(), "thumb.png");
                }

                if (File.Exists(path))
                {
                    m_thumbnailImage.SetTexture(path);
                    if (!m_activeDetail)
                    {
                        if (m_thumbnailImage.BackgroundTexture != null)
                        {
                            m_thumbnailImage.Visible = true;
                        }
                    }
                }
                else
                {
                    m_thumbnailImage.Visible           = false;
                    m_thumbnailImage.BackgroundTexture = null;
                }
            }
            else
            {
                m_thumbnailImage.Visible = false;
            }
        }
 private MyGuiControlImageButton AddIcon(Vector2 position, string texture, Vector2 size)
 {
     var image = new MyGuiControlImageButton();
     image.Position = position;
     image.Size = size;
     image.SetTexture(texture);
     Controls.Add(image);
     return image;
 }