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

            var label1 = new UIText("QQ");

            label1.Top.Set(7, 0);
            label1.Left.Set(-50, 0);
            label1.Width.Set(50, 0);
            label1.Height.Set(0, 1);
            _usernameText = new UIAdvTextBox();
            _usernameText.Top.Set(-TEXTBOX_HEIGHT - Y_OFFSET, 0.5f);
            _usernameText.Left.Set(-TEXTBOX_WIDTH / 2 + X_OFFSET, 0.5f);
            _usernameText.Width.Set(TEXTBOX_WIDTH, 0f);
            _usernameText.Height.Set(TEXTBOX_HEIGHT, 0f);
            _usernameText.Enabled = true;
            _usernameText.Append(label1);
            WindowPanel.Append(_usernameText);


            var label2 = new UIText("密码");

            label2.Top.Set(7, 0);
            label2.Left.Set(-50, 0);
            label2.Width.Set(50, 0);
            label2.Height.Set(0, 1);
            _passwordText = new UIAdvTextBox();
            _passwordText.Top.Set(15 - Y_OFFSET, 0.5f);
            _passwordText.Left.Set(-TEXTBOX_WIDTH / 2 + X_OFFSET, 0.5f);
            _passwordText.Width.Set(TEXTBOX_WIDTH, 0f);
            _passwordText.Height.Set(TEXTBOX_HEIGHT, 0f);
            _passwordText.Password = true;
            _passwordText.Append(label2);
            WindowPanel.Append(_passwordText);

            _submitFormButton = new UIButton(null, true);
            _submitFormButton.Left.Set(-BUTTON_WIDTH / 2, 0.5f);
            _submitFormButton.Top.Set(60 - BUTTON_HEIGHT / 2, 0.5f);
            _submitFormButton.Width.Set(BUTTON_WIDTH, 0f);
            _submitFormButton.Height.Set(BUTTON_HEIGHT, 0f);
            _submitFormButton.ButtonText         = "提交";
            _submitFormButton.CornerSize         = new Vector2(12, 12);
            _submitFormButton.ButtonDefaultColor = new Color(200, 200, 200);
            _submitFormButton.ButtonChangeColor  = Color.White;
            _submitFormButton.OnClick           += _submitFormButton_OnClick;
            WindowPanel.Append(_submitFormButton);

            _showWaiting = false;
        }
示例#2
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            WindowPanel.MainTexture = ServerSideCharacter2.ModTexturesTable["AdvInvBack1"];
            WindowPanel.Left.Set(Main.screenWidth / 2 - WINDOW_WIDTH / 2, 0f);
            WindowPanel.Top.Set(Main.screenHeight / 2 - WINDOW_HEIGHT / 2, 0f);
            WindowPanel.Width.Set(WINDOW_WIDTH, 0f);
            WindowPanel.Height.Set(WINDOW_HEIGHT, 0f);
            WindowPanel.Color = Color.White * 0.8f;

            _itemPanel = new UIPanel {
                BackgroundColor = Color.DarkBlue * 0.75f
            };
            _itemPanel.Top.Set(ITEM_BROWSER_OFFSETY, 0f);
            _itemPanel.Left.Set(ITEM_BROWSER_OFFSETX, 0f);
            _itemPanel.Width.Set(-2 * ITEM_BROWSER_OFFSETX, 1f);
            _itemPanel.Height.Set(-20 - ITEM_BROWSER_OFFSETY, 1f);

            _npcGrid = new UIAdvGrid();
            _npcGrid.Width.Set(-25f, 1f);
            _npcGrid.Height.Set(0f, 1f);
            _npcGrid.ListPadding = 5f;
            _itemPanel.Append(_npcGrid);


            uISlots = new List <UISimpleSlot>();
            for (var i = 1; i < Main.npcTexture.Length; i++)
            {
                var simpleslot = new UISimpleSlot(i);

                simpleslot.Width.Set(40f, 0f);
                simpleslot.Height.Set(40f, 0f);
                uISlots.Add(simpleslot);
            }
            _npcGrid.AddRange(uISlots);

            // ScrollBar设定
            var uiscrollbar = new UIAdvScrollBar();

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

            WindowPanel.Append(_itemPanel);

            _searchTextBox = new UIAdvTextBox();
            _searchTextBox.Left.Set(-ITEM_BROWSER_OFFSETX - SEARCH_BAR_WIDTH, 1f);
            _searchTextBox.Top.Set(50, 0f);
            _searchTextBox.Width.Set(SEARCH_BAR_WIDTH, 0f);
            _searchTextBox.Height.Set(SEARCH_BAR_HEIGHT, 0f);
            _searchTextBox.OnTextChange += _searchTextBox_OnTextChange;
            WindowPanel.Append(_searchTextBox);
        }
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            WindowPanel.MainTexture = ServerSideCharacter2.ModTexturesTable["AdvInvBack1"];
            WindowPanel.Left.Set(Main.screenWidth / 2 - WINDOW_WIDTH / 2, 0f);
            WindowPanel.Top.Set(Main.screenHeight / 2 - WINDOW_HEIGHT / 2, 0f);
            WindowPanel.Width.Set(WINDOW_WIDTH, 0f);
            WindowPanel.Height.Set(WINDOW_HEIGHT, 0f);
            WindowPanel.Color = Color.White * 0.8f;

            _donationValueText = new UIAdvTextBox();
            _donationValueText.Top.Set(-TEXTBOX_HEIGHT + Y_OFFSET, 0.5f);
            _donationValueText.Left.Set(-TEXTBOX_WIDTH / 2 + X_OFFSET, 0.5f);
            _donationValueText.Width.Set(TEXTBOX_WIDTH, 0f);
            _donationValueText.Height.Set(TEXTBOX_HEIGHT, 0f);
            WindowPanel.Append(_donationValueText);

            var label = new UIText("输入需要购买的数量");

            label.Top.Set(60, 0f);
            label.Left.Set(-TEXTBOX_WIDTH / 2 + X_OFFSET, 0.5f);
            WindowPanel.Append(label);

            var submitButton = new UICDButton(null, true);

            submitButton.Top.Set(-TEXTBOX_HEIGHT + Y_OFFSET - 5, 0.5f);
            submitButton.Left.Set(TEXTBOX_WIDTH / 2 + X_OFFSET + 20, 0.5f);
            submitButton.Width.Set(70f, 0f);
            submitButton.Height.Set(38f, 0f);
            submitButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            submitButton.ButtonDefaultColor = new Color(200, 200, 200);
            submitButton.ButtonChangeColor  = Color.White;
            submitButton.CornerSize         = new Vector2(12, 12);
            submitButton.ButtonText         = "确认";
            submitButton.OnClick           += SubmitButton_OnClick;
            WindowPanel.Append(submitButton);
        }