Esempio n. 1
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            WindowPanel.OverflowHidden = true;
            WindowPanel.MainTexture    = ServerSideCharacter2.ModTexturesTable["AdvInvBack1"];
            WindowPanel.Left.Set(Main.screenWidth / 2 - windowWidth / 2, 0f);
            WindowPanel.Top.Set(Main.screenHeight / 2 - windowHeight / 2, 0f);
            WindowPanel.Width.Set(windowWidth, 0f);
            WindowPanel.Height.Set(windowHeight, 0f);
            WindowPanel.Color = Color.White * 0.8f;

            unionsPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true
            };
            unionsPanel.Top.Set(UNIONLIST_OFFSET_TOP, 0f);
            unionsPanel.Left.Set(UNIONLIST_OFFSET_RIGHT, 0f);
            unionsPanel.Width.Set(UNIONLIST_WIDTH, 0f);
            unionsPanel.Height.Set(UNIONLIST_HEIGHT, 0f);
            unionsPanel.SetPadding(10f);

            WindowPanel.Append(unionsPanel);

            chestImage              = new UIImageResizable(ServerSideCharacter2.ModTexturesTable["GoldChest"]);
            chestImage.FrameCount   = 3;
            chestImage.UsePosition  = false;
            chestImage.VAlign       = 1f;
            chestImage.HAlign       = 0.5f;
            chestImage.MarginBottom = 10f;
            unionsPanel.Append(chestImage);

            //_itemGrid = new UIAdvGrid();
            //_itemGrid.Width.Set(-25f, 1f);
            //_itemGrid.Height.Set(0f, 1f);
            //_itemGrid.ListPadding = 5f;
            //unionsPanel.Append(_itemGrid);
        }
Esempio n. 2
0
        public UIPlayerProfileHead()
        {
            textName = new UIText("");
            textName.Top.Set(0, 0f);
            textName.Left.Set(RANK_LEFT_OFFSET + 32, 0f);
            Append(textName);

            rankBar = new UIBar
            {
                BarFrameTex           = ServerSideCharacter2.ModTexturesTable["BarFrameRank"],
                BarFillTex            = Main.magicPixel,
                BarFrameTexCornerSize = new Vector2(6, 6),
                FillerDrawOffset      = new Vector2(6, 6),
                FillerSize            = new Vector2(RANK_BAR_WIDTH - 12, RANK_BAR_HEIGHT - 12)
            };
            rankBar.Top.Set(20f, 0f);
            rankBar.Left.Set(RANK_LEFT_OFFSET, 0f);
            rankBar.Width.Set(RANK_BAR_WIDTH, 0f);
            rankBar.Height.Set(RANK_BAR_HEIGHT, 0f);
            rankBar.Value = 0.3f;
            Append(rankBar);


            rankimage = new UIImageResizable(ServerSideCharacter2.ModTexturesTable["Crown"]);
            rankimage.Top.Set(-10, 0f);
            rankimage.Left.Set(RANK_LEFT_OFFSET, 0f);
            rankimage.UsePosition = false;
            center = new Vector2(RANK_LEFT_OFFSET + 16f, 6);
            Append(rankimage);

            rankLabel = new UIText("300/1000");
            rankLabel.Top.Set(20 + RANK_BAR_HEIGHT + 2f, 0f);
            rankLabel.Left.Set(RANK_LEFT_OFFSET, 0f);
            Append(rankLabel);

            var infopanel = new UIPanel();

            infopanel.Top.Set(20 + RANK_BAR_HEIGHT + 30f, 0f);
            infopanel.Left.Set(0f, 0f);
            infopanel.Width.Set(300f, 0f);
            infopanel.Height.Set(500f, 0f);
            infopanel.SetPadding(10f);

            infoList = new UIAdvList {
                StartPadding = 5f, ListPadding = 10f
            };
            infoList.Width.Set(0f, 1f);
            infoList.Height.Set(0f, 1f);
            infopanel.Append(infoList);


            var uiscrollbar = new UIAdvScrollBar();

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            infopanel.Append(uiscrollbar);
            infoList.SetScrollbar(uiscrollbar);


            gucoinText = new UIText("0");
            gucoinText.MarginBottom = 5f;
            gucoinText.TextColor    = Color.Yellow;
            gucoinText.VAlign       = 1f;
            gucoinText.HAlign       = 0.5f;
            infopanel.Append(gucoinText);
            Append(infopanel);
        }