Ejemplo n.º 1
0
        public MyGuiDetailScreenBase(bool isTopMostScreen, MyGuiBlueprintScreenBase parent, string thumbnailTexture, MyGuiControlListbox.Item selectedItem, float textScale)
            : base(new Vector2(0.37f, 0.325f), new Vector2(0.725f, 0.4f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, isTopMostScreen)
        {
            m_thumbnailImage = new MyGuiControlImage()
            {
                BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK,
            };
            m_thumbnailImage.SetPadding(new MyGuiBorderThickness(3f, 2f, 3f, 2f));
            m_thumbnailImage.SetTexture(thumbnailTexture);

            m_selectedItem  = selectedItem;
            m_blueprintName = selectedItem.Text.ToString();
            m_textScale     = textScale;
            m_parent        = parent;
        }
Ejemplo n.º 2
0
 public MyGuiDetailScreenBase(bool isTopMostScreen, MyGuiBlueprintScreenBase parent, string thumbnailTexture, MyGuiControlListbox.Item selectedItem, float textScale)
     : base(new Vector2(0.37f, 0.325f), new Vector2(0.725f, 0.4f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, isTopMostScreen)
 {
     m_thumbnailImage = new MyGuiControlImage()
     {
         BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK,
     };
     m_thumbnailImage.SetPadding(new MyGuiBorderThickness(3f, 2f, 3f, 2f));
     m_thumbnailImage.SetTexture(thumbnailTexture);
     
     m_selectedItem = selectedItem;
     m_blueprintName = selectedItem.Text.ToString();
     m_textScale = textScale;
     m_parent = parent;
 }
Ejemplo n.º 3
0
 public MyGuiDetailScreenBase(bool isTopMostScreen, MyGuiBlueprintScreenBase parent, MyGuiCompositeTexture thumbnailTexture, MyGuiControlListbox.Item selectedItem, float textScale)
     : base(new Vector2(0.37f, 0.325f), new Vector2(0.725f, 0.4f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, isTopMostScreen)
 {
     m_thumbnailImage = new MyGuiControlImageButton(true);
     if (thumbnailTexture == null)
     {
         m_thumbnailImage.Visible = false;
     }
     else
     {
         m_thumbnailImage.BackgroundTexture = thumbnailTexture;
     }
     m_selectedItem = selectedItem;
     m_blueprintName = selectedItem.Text.ToString();
     m_textScale = textScale;
     m_parent = parent;
 }
Ejemplo n.º 4
0
 public MyGuiDetailScreenBase(bool isTopMostScreen, MyGuiBlueprintScreenBase parent, MyGuiCompositeTexture thumbnailTexture, MyGuiControlListbox.Item selectedItem, float textScale)
     : base(new Vector2(0.37f, 0.325f), new Vector2(0.725f, 0.4f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, isTopMostScreen)
 {
     m_thumbnailImage = new MyGuiControlImageButton(true);
     if (thumbnailTexture == null)
     {
         m_thumbnailImage.Visible = false;
     }
     else
     {
         m_thumbnailImage.BackgroundTexture = thumbnailTexture;
     }
     m_selectedItem  = selectedItem;
     m_blueprintName = selectedItem.Text.ToString();
     m_textScale     = textScale;
     m_parent        = parent;
 }
Ejemplo n.º 5
0
        public MyGuiDetailScreenLocal(Action<MyGuiControlListbox.Item> callBack, MyGuiControlListbox.Item selectedItem, MyGuiBlueprintScreenBase parent , MyGuiCompositeTexture thumbnailTexture, float textScale) :
            base(false, parent, thumbnailTexture, selectedItem, textScale)
        {
            var prefabPath = Path.Combine(m_localBlueprintFolder, m_blueprintName, "bp.sbc");
            this.callBack = callBack;

            if (File.Exists(prefabPath))
            {
                m_loadedPrefab = LoadPrefab(prefabPath);

                if (m_loadedPrefab == null)
                {
                    MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(
                        buttonType: MyMessageBoxButtonsType.OK,
                        styleEnum: MyMessageBoxStyleEnum.Error,
                        messageCaption: new StringBuilder("Error"),
                        messageText: new StringBuilder("Failed to load the blueprint file.")
                        ));
                    m_killScreen = true;
                }
                else
                {
                    RecreateControls(true);
                }
            }
            else 
            {
                m_killScreen = true;
            }
        }
Ejemplo n.º 6
0
        public MyGuiDetailScreenLocal(Action <MyGuiControlListbox.Item> callBack, MyGuiControlListbox.Item selectedItem, MyGuiBlueprintScreenBase parent, string thumbnailTexture, float textScale) :
            base(false, parent, thumbnailTexture, selectedItem, textScale)
        {
            var prefabPath = Path.Combine(m_localBlueprintFolder, m_blueprintName, "bp.sbc");

            this.callBack = callBack;

            if (File.Exists(prefabPath))
            {
                m_loadedPrefab = LoadPrefab(prefabPath);

                if (m_loadedPrefab == null)
                {
                    MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(
                                               buttonType: MyMessageBoxButtonsType.OK,
                                               styleEnum: MyMessageBoxStyleEnum.Error,
                                               messageCaption: new StringBuilder("Error"),
                                               messageText: new StringBuilder("Failed to load the blueprint file.")
                                               ));
                    m_killScreen = true;
                }
                else
                {
                    RecreateControls(true);
                }
            }
            else
            {
                m_killScreen = true;
            }
        }