Пример #1
0
        public UITileFileItem(TileFile tiles, int idx)
        {
            Index = idx;
            file  = tiles;

            this.Width.Set(120f, 0f);
            this.Height.Set(150f, 0f);
            this.CornerSize  = new Vector2(8, 8);
            base.MainTexture = TemplateMod.ModTexturesTable["AdvInvBack1"];
            this.Color       = Color.Cyan * 0.8f;
            base.SetPadding(6f);
            this.OverflowHidden = true;

            fileNameText              = new UIText(tiles.FileName);
            fileNameText.VAlign       = 1f;
            fileNameText.HAlign       = 0.5f;
            fileNameText.MarginBottom = 2f;
            Append(fileNameText);

            tilePanel = new UIAdvPanel(TemplateMod.ModTexturesTable["AdvInvBack1"]);
            tilePanel.Width.Set(115f, 0f);
            tilePanel.Height.Set(115f, 0f);
            tilePanel.HAlign = 0.5f;
            tilePanel.VAlign = 0f;
            Append(tilePanel);
        }
Пример #2
0
        public override void OnInitialize()
        {
            _collapseOn = false;
            windowPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["AdvInvBack1"]);
            windowPanel.Left.Set(Main.screenWidth / 2 - TOOLBAR_INIT_WIDTH / 2, 0f);
            windowPanel.Top.Set(Main.screenHeight - 12f, 0f);
            windowPanel.Width.Set(TOOLBAR_INIT_WIDTH, 0f);
            windowPanel.Height.Set(TOOLBAR_INIT_HEIGHT, 0f);
            windowPanel.Color      = Color.Transparent;
            windowPanel.CornerSize = new Vector2(12, 12);

            _openButton = new UIButton(ServerSideCharacter2.ModTexturesTable["CollapseButtonUp"], false);
            _openButton.Left.Set(Main.screenWidth / 2 - 122f, 0f);
            _openButton.Top.Set(windowPanel.GetDimensions().Position().Y - 12f, 0f);
            _openButton.Width.Set(48f, 0f);
            _openButton.Height.Set(14f, 0f);
            _openButton.ButtonDefaultColor = Color.White;
            _openButton.ButtonChangeColor  = new Color(0.8f, 0.8f, 0.8f, 1f);
            _openButton.Tooltip            = "打开底栏";
            _openButton.OnClick           += OpenPanel_OnClick;

            SetUpButtons();
            ShowButtons();
            base.Append(_openButton);
            base.Append(windowPanel);
        }
Пример #3
0
        private void AddItemSlots()
        {
            var itemSlotPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true,
                Color          = Color.Gray * 0.5f
            };

            itemSlotPanel.VAlign = 1f;
            itemSlotPanel.Width.Set(0, 1f);
            itemSlotPanel.Height.Set(ITEMSLOT_HEIGHT, 0f);
            itemSlotPanel.SetPadding(10f);
            itemSlotPanel.Visible = false;
            outerContentPanel.Append(itemSlotPanel);

            _uiItemGrid = new UIAdvGrid();
            _uiItemGrid.Width.Set(-25f, 1f);
            _uiItemGrid.Height.Set(0f, 1f);
            _uiItemGrid.ListPadding = 10f;
            itemSlotPanel.Append(_uiItemGrid);

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

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            itemSlotPanel.Append(uiscrollbar);
            _uiItemGrid.SetScrollbar(uiscrollbar);
        }
Пример #4
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;

            var friendListPanel = new UIAdvPanel(Drawing.Box1);

            friendListPanel.Top.Set(95, 0f);
            friendListPanel.Left.Set(10f, 0f);
            friendListPanel.Width.Set(FRIENDLIST_WIDTH, 0f);
            friendListPanel.Height.Set(FRIENDLIST_HEIGHT, 0f);
            friendListPanel.SetPadding(10f);

            _friendList = new UIAdvList();
            _friendList.Width.Set(-25f, 1f);
            _friendList.Height.Set(0f, 1f);
            _friendList.ListPadding = 5f;
            friendListPanel.Append(_friendList);

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

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            friendListPanel.Append(uiscrollbar);
            _friendList.SetScrollbar(uiscrollbar);
            WindowPanel.Append(friendListPanel);
        }
        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;
        }
Пример #6
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);
        }
Пример #7
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;

            var matchlistPanel = new UIAdvPanel(Drawing.Box1);

            matchlistPanel.Top.Set(-MATCH_LIST_HEIGHT / 2 + MATCHLIST_OFFSET_TOP, 0.5f);
            matchlistPanel.Left.Set(-MATCH_LIST_WIDTH / 2 + MATCHLIST_OFFSET_RIGHT, 0.5f);
            matchlistPanel.Width.Set(MATCH_LIST_WIDTH, 0f);
            matchlistPanel.Height.Set(MATCH_LIST_HEIGHT, 0f);
            matchlistPanel.SetPadding(10f);

            _matchedGameList = new UIAdvList();
            _matchedGameList.Width.Set(-25f, 1f);
            _matchedGameList.Height.Set(0f, 1f);
            _matchedGameList.ListPadding = 5f;
            matchlistPanel.Append(_matchedGameList);

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

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            matchlistPanel.Append(uiscrollbar);
            _matchedGameList.SetScrollbar(uiscrollbar);
            WindowPanel.Append(matchlistPanel);

            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(55, 0f);
            refreshButton.Left.Set(-35 / 2 - 65, 1f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.OnClick           += RefreshButton_OnClick;
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            WindowPanel.Append(refreshButton);

            onlinelabel = new UIText("游戏大厅");
            onlinelabel.Top.Set(-MATCH_LIST_HEIGHT / 2 + MATCHLIST_OFFSET_TOP - 25f, 0.5f);
            var texSize = Main.fontMouseText.MeasureString(onlinelabel.Text);

            onlinelabel.Left.Set(-MATCH_LIST_WIDTH / 2 + MATCHLIST_OFFSET_RIGHT, 0.5f);
            WindowPanel.Append(onlinelabel);
        }
Пример #8
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();
            _itemPanel.BackgroundColor = Color.DarkBlue * 0.75f;
            _itemPanel.Top.Set(ITEM_BROWSER_OFFSETY, 0f);
            _itemPanel.Left.Set(ITEM_BROWSER_OFFSETX, 0f);
            _itemPanel.Width.Set(INVENTORY_WIDTH, 0f);
            _itemPanel.Height.Set(INVENTORY_HEIGHT, 0f);


            //UISwitch uISwitch = new UISwitch();
            //uISwitch.Top.Set(50, 0);
            //uISwitch.Left.Set(50, 0);
            //uISwitch.Width.Set(60, 0f);
            //uISwitch.Height.Set(30, 0f);
            //WindowPanel.Append(uISwitch);

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

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

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

            WindowPanel.Append(_itemPanel);


            _playerName        = new UIText("玩家的背包", 0.7f, true);
            _playerName.HAlign = 0.5f;
            _playerName.Top.Set(30, 0f);

            WindowPanel.Append(_playerName);
        }
 protected override void Initialize(UIAdvPanel WindowPanel)
 {
     musicPlayer.OnProgressUpdate += MusicPlayer_OnProgressUpdate;
     base.Initialize(WindowPanel);
     height          = MusicBox.NormalStringHeight * 2 + 40f;
     titlePadding    = new Vector2(10f, 10f);
     progressPadding = titlePadding + new Vector2(0f, MusicBox.NormalStringHeight + 7f);
     width           = MathHelper.Max(Main.fontMouseText.MeasureString(musicPlayer.NowPlaying).X, MIN_WIDTH);
     WindowPanel.SetPadding(0);
     WindowPanel.Left.Set(20f, 0f);
     WindowPanel.Top.Set(80f, 0f);
     WindowPanel.Width.Set(width, 0f);
     WindowPanel.Height.Set(height, 0f);
     WindowPanel.Color      = Color.Transparent;
     WindowPanel.CornerSize = 12;
 }
        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;


            uIPlayerProfileHead = new UIPlayerProfileHead();
            uIPlayerProfileHead.Top.Set(PLAYER_IMAGE_OFFSET_Y, 0f);
            uIPlayerProfileHead.Left.Set(PLAYER_IMAGE_OFFSET_X - 20, 0f);
            uIPlayerProfileHead.Width.Set(300, 0f);
            uIPlayerProfileHead.Height.Set(300, 0f);
            WindowPanel.Append(uIPlayerProfileHead);
        }
        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;

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

            WindowPanel.Append(candidatesPanel);

            _candidateList = new UIAdvList();
            _candidateList.Width.Set(-25f, 1f);
            _candidateList.Height.Set(0f, 1f);
            _candidateList.ListPadding    = 5f;
            _candidateList.OverflowHidden = true;
            candidatesPanel.Append(_candidateList);

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

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


            var label = new UIText("公会申请信息", 0.7f, true);

            label.Top.Set(50, 0f);
            label.Left.Set(-UNIONLIST_WIDTH / 2 + UNIONLIST_OFFSET_RIGHT + 5, 0.5f);
            WindowPanel.Append(label);
        }
Пример #12
0
        private void GenerateSetting(UIAdvPanel panel)
        {
            UIText label = new UIText("设置");

            label.Top.Set(-20, 0f);
            label.Left.Set(0, 0f);
            panel.Append(label);

            UIText labelDisplayAboveHead = new UIText("显示段位标记");

            labelDisplayAboveHead.Top.Set(10, 0f);
            labelDisplayAboveHead.Left.Set(10, 0f);
            panel.Append(labelDisplayAboveHead);

            aboveHeadSwitch = new UISwitch();
            aboveHeadSwitch.Top.Set(0, 0f);
            aboveHeadSwitch.Left.Set(-80, 1f);
            aboveHeadSwitch.Width.Set(60f, 0f);
            aboveHeadSwitch.Height.Set(30f, 0f);
            aboveHeadSwitch.OnSwitch += AboveHeadSwitch_OnSwitch;
            panel.Append(aboveHeadSwitch);


            UIText crownText = new UIText("显示赞助商标记");

            crownText.Top.Set(50, 0f);
            crownText.Left.Set(10, 0f);
            panel.Append(crownText);

            crownSwitch = new UISwitch();
            crownSwitch.Top.Set(40, 0f);
            crownSwitch.Left.Set(-80, 1f);
            crownSwitch.Width.Set(60f, 0f);
            crownSwitch.Height.Set(30f, 0f);
            crownSwitch.OnSwitch += CrownSwitch_OnSwitch;
            panel.Append(crownSwitch);
        }
Пример #13
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);
        }
        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);
        }
Пример #15
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);


            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(UNIONLIST_OFFSET_TOP - 50, 0f);
            refreshButton.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH - 35, 0f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            refreshButton.OnClick           += RefreshButton_OnClick;
            WindowPanel.Append(refreshButton);

            var returnButton = new UICDButton(null, true);

            returnButton.Top.Set(UNIONLIST_OFFSET_TOP - 50, 0f);
            returnButton.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH + 20, 0f);
            returnButton.Width.Set(105f, 0f);
            returnButton.Height.Set(50f, 0f);
            returnButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            returnButton.ButtonDefaultColor = new Color(200, 200, 200);
            returnButton.ButtonChangeColor  = Color.White;
            returnButton.CornerSize         = new Vector2(12, 12);
            returnButton.ButtonText         = "返回大厅";
            returnButton.OnClick           += ReturnButton_OnClick;
            WindowPanel.Append(returnButton);

            _memberList = new UIAdvList();
            _memberList.Width.Set(-25f, 1f);
            _memberList.Height.Set(0f, 1f);
            _memberList.ListPadding    = 5f;
            _memberList.OverflowHidden = true;
            unionsPanel.Append(_memberList);



            var buttonPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true
            };

            buttonPanel.Top.Set(UNIONLIST_OFFSET_TOP, 0f);
            buttonPanel.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH + 10, 0f);
            buttonPanel.Width.Set(150, 0f);
            buttonPanel.Height.Set(240, 0f);
            buttonPanel.SetPadding(10f);
            buttonPanel.Visible = false;
            WindowPanel.Append(buttonPanel);

            _buttonList = new UIAdvList();
            _buttonList.Width.Set(-25f, 1f);
            _buttonList.Height.Set(0f, 1f);
            _buttonList.ListPadding = 5f;
            buttonPanel.Append(_buttonList);

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

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


            unionNameText = new UIText("", 0.7f, true);
            unionNameText.Top.Set(UNIONLIST_OFFSET_TOP - 100, 0f);
            unionNameText.Left.Set(UNIONLIST_OFFSET_RIGHT + 5, 0f);
            WindowPanel.Append(unionNameText);

            //expBar = new UIBar
            //{
            //	BarFrameTex = ServerSideCharacter2.ModTexturesTable["ExpBarFrame"],
            //	BarFillTex = Main.magicPixel,
            //	FillerColor = Color.Yellow,
            //	BackGroundColor = Color.Transparent,
            //	BarFrameTexCornerSize = new Vector2(6, 6),
            //	FillerDrawOffset = new Vector2(6, 6),
            //	FillerSize = new Vector2(BAR_WIDTH - 12, BAR_HEIGHT - 12)
            //};
            //expBar.Top.Set(80f, 0f);
            //expBar.Left.Set(40, 0f);
            //expBar.Width.Set(BAR_WIDTH, 0f);
            //expBar.Height.Set(BAR_HEIGHT, 0f);
            //expBar.Value = 0.3f;
            //WindowPanel.Append(expBar);

            unionLevelText = new UIText("");
            unionLevelText.Top.Set(60f, 0f);
            unionLevelText.Left.Set(40, 0f);
            unionLevelText.SetText($"等级: {8} EXP: {10000000} / {30000000}");
            WindowPanel.Append(unionLevelText);

            unionWealthText = new UIText("");
            unionWealthText.Top.Set(90f, 0f);
            unionWealthText.Left.Set(40, 0f);
            unionWealthText.SetText($"财富值: 1000000");
            WindowPanel.Append(unionWealthText);

            //uiSlot = new UISlot(ServerSideCharacter2.ModTexturesTable["AdvInvBack1"]);
            //uiSlot.Left.Set(475, 0f);
            //uiSlot.Top.Set(340, 0f);
            //uiSlot.Width.Set(60, 0f);
            //uiSlot.Height.Set(60, 0f);
            //uiSlot.CanPutInSlot = new CheckPutSlotCondition((item) =>
            //{
            //	return item.type == UnionManager.CurrencyType;
            //});
            //uiSlot.Tooltip = "在这放置咕币来捐献";
            //uiSlot.DrawColor = Color.White;
            //WindowPanel.Append(uiSlot);
        }
Пример #16
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            uIPlayerBars = new List <UINormalPlayerBar>();

            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;

            _onlinePlayerPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true
            };
            _onlinePlayerPanel.Top.Set(-FRIENDLIST_HEIGHT / 2 + FRIENDLIST_OFFSET_TOP, 0.5f);
            _onlinePlayerPanel.Left.Set(-FRIENDLIST_WIDTH / 2 + FRIENDLIST_OFFSET_LEFT, 0.5f);
            _onlinePlayerPanel.Width.Set(FRIENDLIST_WIDTH, 0f);
            _onlinePlayerPanel.Height.Set(FRIENDLIST_HEIGHT, 0f);
            _onlinePlayerPanel.SetPadding(10f);

            onlinelabel = new UIText("在线玩家  人数: 0");
            onlinelabel.Top.Set(-FRIENDLIST_HEIGHT / 2 + FRIENDLIST_OFFSET_TOP - 25f, 0.5f);
            var texSize = Main.fontMouseText.MeasureString(onlinelabel.Text);

            onlinelabel.Left.Set(-FRIENDLIST_WIDTH / 2 + FRIENDLIST_OFFSET_LEFT, 0.5f);
            WindowPanel.Append(onlinelabel);
            WindowPanel.Append(_onlinePlayerPanel);

            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(55, 0f);
            refreshButton.Left.Set(-35 / 2 - 65, 1f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.OnClick           += RefreshButton_OnClick;
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            WindowPanel.Append(refreshButton);

            changeSortModeButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Home"], false);
            changeSortModeButton.Top.Set(55, 0f);
            changeSortModeButton.Left.Set(-35 / 2 - 50 - 65, 1f);
            changeSortModeButton.Width.Set(35, 0f);
            changeSortModeButton.Height.Set(35, 0f);
            changeSortModeButton.OnClick           += ChangeSortModeButton_OnClick;
            changeSortModeButton.ButtonDefaultColor = new Color(200, 200, 200);
            changeSortModeButton.ButtonChangeColor  = Color.White;
            changeSortModeButton.Tooltip            = "根据段位排序";
            WindowPanel.Append(changeSortModeButton);

            _onlinePlayerList = new UIAdvList();
            _onlinePlayerList.Width.Set(-25f, 1f);
            _onlinePlayerList.Height.Set(0f, 1f);
            _onlinePlayerList.ListPadding    = 5f;
            _onlinePlayerList.OverflowHidden = true;
            _onlinePlayerPanel.Append(_onlinePlayerList);

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

            // uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            _onlinePlayerPanel.Append(uiscrollbar);
            _onlinePlayerList.SetScrollbar(uiscrollbar);
        }
Пример #17
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;

            _onlinePlayerPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true
            };
            _onlinePlayerPanel.Top.Set(-FRIENDLIST_HEIGHT / 2 + FRIENDLIST_OFFSET_TOP, 0.5f);
            _onlinePlayerPanel.Left.Set(-FRIENDLIST_WIDTH / 2 + FRIENDLIST_OFFSET_RIGHT, 0.5f);
            _onlinePlayerPanel.Width.Set(FRIENDLIST_WIDTH, 0f);
            _onlinePlayerPanel.Height.Set(FRIENDLIST_HEIGHT, 0f);
            _onlinePlayerPanel.SetPadding(10f);

            onlinelabel = new UIText("排位积分榜(每天更新)");
            onlinelabel.Top.Set(-FRIENDLIST_HEIGHT / 2 + FRIENDLIST_OFFSET_TOP - 25f, 0.5f);
            var texSize = Main.fontMouseText.MeasureString(onlinelabel.Text);

            onlinelabel.Left.Set(-FRIENDLIST_WIDTH / 2 + FRIENDLIST_OFFSET_RIGHT, 0.5f);
            WindowPanel.Append(onlinelabel);
            WindowPanel.Append(_onlinePlayerPanel);

            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(55, 0f);
            refreshButton.Left.Set(-35 / 2 - 65, 1f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.OnClick           += RefreshButton_OnClick;
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            WindowPanel.Append(refreshButton);

            _onlinePlayerList = new UIAdvList();
            _onlinePlayerList.Width.Set(-25f, 1f);
            _onlinePlayerList.Height.Set(0f, 1f);
            _onlinePlayerList.ListPadding    = 5f;
            _onlinePlayerList.OverflowHidden = true;
            _onlinePlayerPanel.Append(_onlinePlayerList);

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

            // uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            _onlinePlayerPanel.Append(uiscrollbar);
            _onlinePlayerList.SetScrollbar(uiscrollbar);


            distanceToEnd = new UIText("00:00:00", 0.6f, true);
            distanceToEnd.Top.Set(20f, 0f);
            distanceToEnd.Left.Set(20f, 0f);
            WindowPanel.Append(distanceToEnd);

            UIAdvPanel infoPanel = new UIAdvPanel();

            infoPanel.Top.Set(-FRIENDLIST_HEIGHT / 2 + FRIENDLIST_OFFSET_TOP, 0.5f);
            infoPanel.Left.Set(440, 0f);
            infoPanel.Width.Set(200, 0f);
            infoPanel.Height.Set(FRIENDLIST_HEIGHT, 0f);
            WindowPanel.Append(infoPanel);

            var announcement = new UIMessageBox(GameLanguage.GetText("rankannouncement"));

            announcement.Width.Set(-25f, 1f);
            announcement.Height.Set(0f, 1f);
            infoPanel.Append(announcement);

            var uiscrollbar2 = new UIAdvScrollBar();

            uiscrollbar2.SetView(100f, 1000f);
            uiscrollbar2.Height.Set(-20f, 1f);
            uiscrollbar2.VAlign = 0.5f;
            uiscrollbar2.HAlign = 1f;
            infoPanel.Append(uiscrollbar2);
            announcement.SetScrollbar(uiscrollbar2);
        }
Пример #18
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;

            outerContentPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize = new Vector2(8, 8),
                Color      = new Color(33, 43, 79) * 0.8f
            };
            outerContentPanel.Top.Set(-UNIONLIST_HEIGHT / 2 + UNIONLIST_OFFSET_TOP, 0.5f);
            outerContentPanel.Left.Set(-UNIONLIST_WIDTH / 2 + UNIONLIST_OFFSET_RIGHT, 0.5f);
            outerContentPanel.Width.Set(UNIONLIST_WIDTH, 0f);
            outerContentPanel.Height.Set(UNIONLIST_HEIGHT + ITEMSLOT_HEIGHT, 0f);
            outerContentPanel.SetPadding(10f);
            WindowPanel.Append(outerContentPanel);


            mailContentPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true,
                Color          = new Color(33, 43, 79) * 0.8f
            };
            mailContentPanel.Top.Set(-UNIONLIST_HEIGHT / 2 + UNIONLIST_OFFSET_TOP, 0.5f);
            mailContentPanel.Left.Set(-UNIONLIST_WIDTH / 2 + UNIONLIST_OFFSET_RIGHT, 0.5f);
            mailContentPanel.Width.Set(UNIONLIST_WIDTH, 0f);
            mailContentPanel.Height.Set(UNIONLIST_HEIGHT, 0f);
            mailContentPanel.SetPadding(10f);
            mailContentPanel.Visible = false;

            WindowPanel.Append(mailContentPanel);

            _mailContent = new UIMessageBox(GameLanguage.GetText("rankannouncement"));
            _mailContent.Width.Set(-25f, 1f);
            _mailContent.Height.Set(0f, 1f);
            mailContentPanel.Append(_mailContent);

            UIAdvScrollBar uiscrollbar = new UIAdvScrollBar();

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(-20f, 1f);
            uiscrollbar.VAlign = 0.5f;
            uiscrollbar.HAlign = 1f;
            mailContentPanel.Append(uiscrollbar);
            _mailContent.SetScrollbar(uiscrollbar);

            AddItemSlots();

            // 上方标题
            _uiTitle = new UIText("标题", 0.6f, true);
            _uiTitle.Top.Set(-70f, 0f);
            _uiTitle.SetPadding(15f);
            outerContentPanel.Append(_uiTitle);



            mailHeadPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true,
                Color          = new Color(33, 43, 79) * 0.8f
            };
            mailHeadPanel.Top.Set(-UNIONLIST_HEIGHT / 2 + UNIONLIST_OFFSET_TOP, 0.5f);
            mailHeadPanel.Left.Set(-UNIONLIST_WIDTH / 2 + UNIONLIST_OFFSET_RIGHT - 260, 0.5f);
            mailHeadPanel.Width.Set(240, 0f);
            mailHeadPanel.Height.Set(UNIONLIST_HEIGHT + ITEMSLOT_HEIGHT, 0f);
            mailHeadPanel.SetPadding(10f);
            WindowPanel.Append(mailHeadPanel);

            _mailList = new UIAdvList();
            _mailList.Width.Set(-25f, 1f);
            _mailList.Height.Set(0f, 1f);
            _mailList.ListPadding = 5f;
            mailHeadPanel.Append(_mailList);

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

            uiscrollbar2.SetView(100f, 1000f);
            uiscrollbar2.Height.Set(0f, 1f);
            uiscrollbar2.HAlign = 1f;
            mailHeadPanel.Append(uiscrollbar2);
            _mailList.SetScrollbar(uiscrollbar2);


            refreshButton = new UICDButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(-UNIONLIST_HEIGHT / 2 + UNIONLIST_OFFSET_TOP - 50, 0.5f);
            refreshButton.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH / 2 - 35, 0.5f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            refreshButton.OnClick           += RefreshButton_OnClick;
            WindowPanel.Append(refreshButton);
        }
Пример #19
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            WindowPanel.MainTexture = TemplateMod.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;

            var fileListPanel = new UIAdvPanel(TemplateMod.ModTexturesTable["Box"]);

            fileListPanel.Top.Set(-FILE_LIST_HEIGHT / 2 + FILELIST_OFFSET_TOP, 0.5f);
            fileListPanel.Left.Set(-FILE_LIST_WIDTH / 2 + FILE_LIST_OFFSET_LEFT, 0.5f);
            fileListPanel.Width.Set(FILE_LIST_WIDTH, 0f);
            fileListPanel.Height.Set(FILE_LIST_HEIGHT, 0f);
            fileListPanel.SetPadding(10f);

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

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

            uiscrollbar.SetView(100f, 1000f);
            uiscrollbar.Height.Set(0f, 1f);
            uiscrollbar.HAlign = 1f;
            fileListPanel.Append(uiscrollbar);
            _tilefilesList.SetScrollbar(uiscrollbar);
            WindowPanel.Append(fileListPanel);

            //refreshButton = new UIButton(TemplateMod.ModTexturesTable["Refresh"], false);
            //refreshButton.Top.Set(55, 0f);
            //refreshButton.Left.Set(-35 / 2 - 65, 1f);
            //refreshButton.Width.Set(35, 0f);
            //refreshButton.Height.Set(35, 0f);
            //refreshButton.OnClick += RefreshButton_OnClick;
            //refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            //refreshButton.ButtonChangeColor = Color.White;
            //refreshButton.UseRotation = true;
            //refreshButton.TextureScale = 0.2f;
            //refreshButton.Tooltip = "刷新";
            //WindowPanel.Append(refreshButton);

            var announcement = new UIMessageBox("打开选择模式以后,左键可以选择左上角的点,右键选择右下角的点,然后点击保存即可。");

            announcement.Top.Set(-FILE_LIST_HEIGHT / 2 + FILELIST_OFFSET_TOP - 45, 0.5f);
            announcement.Left.Set(-200, 1f);
            announcement.Width.Set(200, 0f);
            announcement.Height.Set(165, 0f);
            announcement.BackgroundColor = Color.Transparent;
            announcement.BorderColor     = Color.Transparent;
            WindowPanel.Append(announcement);


            Label = new UIText("地形选择器", 0.6f, true);
            Label.Top.Set(-FILE_LIST_HEIGHT / 2 + FILELIST_OFFSET_TOP - 35f, 0.5f);
            var texSize = Main.fontMouseText.MeasureString(Label.Text);

            Label.Left.Set(-FILE_LIST_WIDTH / 2 + FILE_LIST_OFFSET_LEFT, 0.5f);
            WindowPanel.Append(Label);

            selectModeButton = new UICDButton(null, true);
            selectModeButton.Top.Set(350, 0f);
            selectModeButton.Left.Set(-175, 1f);
            selectModeButton.Width.Set(150, 0f);
            selectModeButton.Height.Set(40, 0f);
            selectModeButton.BoxTexture         = TemplateMod.ModTexturesTable["AdvInvBack2"];
            selectModeButton.ButtonDefaultColor = new Color(200, 200, 200);
            selectModeButton.ButtonChangeColor  = Color.White;
            selectModeButton.CornerSize         = new Vector2(12, 12);
            selectModeButton.ButtonText         = "开启选择模式";
            selectModeButton.OnClick           += SelectButtonClick;
            WindowPanel.Append(selectModeButton);


            buildModeButton = new UICDButton(null, true);
            buildModeButton.Top.Set(305, 0f);
            buildModeButton.Left.Set(-175, 1f);
            buildModeButton.Width.Set(150, 0f);
            buildModeButton.Height.Set(40, 0f);
            buildModeButton.BoxTexture         = TemplateMod.ModTexturesTable["AdvInvBack2"];
            buildModeButton.ButtonDefaultColor = new Color(200, 200, 200);
            buildModeButton.ButtonChangeColor  = Color.White;
            buildModeButton.CornerSize         = new Vector2(12, 12);
            buildModeButton.ButtonText         = "开启建筑模式";
            buildModeButton.OnClick           += BuildModeButton_OnClick;
            WindowPanel.Append(buildModeButton);

            saveButton = new UICDButton(null, true);
            saveButton.Top.Set(260, 0f);
            saveButton.Left.Set(-175, 1f);
            saveButton.Width.Set(150, 0f);
            saveButton.Height.Set(40, 0f);
            saveButton.BoxTexture         = TemplateMod.ModTexturesTable["AdvInvBack2"];
            saveButton.ButtonDefaultColor = new Color(200, 200, 200);
            saveButton.ButtonChangeColor  = Color.White;
            saveButton.CornerSize         = new Vector2(12, 12);
            saveButton.ButtonText         = "保存已选择";
            saveButton.OnClick           += SaveButton_OnClick;
            WindowPanel.Append(saveButton);

            refreshButton = new UICDButton(null, true);
            refreshButton.Top.Set(215, 0f);
            refreshButton.Left.Set(-175, 1f);
            refreshButton.Width.Set(150, 0f);
            refreshButton.Height.Set(40, 0f);
            refreshButton.BoxTexture         = TemplateMod.ModTexturesTable["AdvInvBack2"];
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.CornerSize         = new Vector2(12, 12);
            refreshButton.ButtonText         = "刷新";
            refreshButton.OnClick           += RefreshButton_OnClick1;
            WindowPanel.Append(refreshButton);
        }
Пример #20
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            // uIFriendBars = new List<UIFriendBar>();
            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;

            settingPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true
            };
            settingPanel.SetPadding(10f);
            settingPanel.Top.Set(-FRIENDLIST_HEIGHT / 2 + FRIENDLIST_OFFSET_TOP, 0.5f);
            settingPanel.Left.Set(-FRIENDLIST_WIDTH / 2 + FRIENDLIST_OFFSET_RIGHT, 0.5f);
            settingPanel.Width.Set(FRIENDLIST_WIDTH, 0f);
            settingPanel.Height.Set(FRIENDLIST_HEIGHT, 0f);
            WindowPanel.Append(settingPanel);
            GenerateSetting(settingPanel);

            //var onlinelabel = new UIText("好友列表");
            //onlinelabel.Top.Set(35 + FRIENDLIST_OFFSET_TOP, 0f);
            //var texSize = Main.fontMouseText.MeasureString(onlinelabel.Text);
            //onlinelabel.Left.Set(-FRIENDLIST_WIDTH / 2 + FRIENDLIST_OFFSET_RIGHT, 0.5f);
            //WindowPanel.Append(onlinelabel);
            //WindowPanel.Append(_onlinePlayerPanel);

            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(47f, 0f);
            refreshButton.Left.Set(FRIENDLIST_OFFSET_RIGHT + FRIENDLIST_WIDTH / 2 - 35, 0.5f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            refreshButton.OnClick           += RefreshButton_OnClick;
            WindowPanel.Append(refreshButton);


            //_friendList = new UIAdvList();
            //_friendList.Width.Set(-25f, 1f);
            //_friendList.Height.Set(0f, 1f);
            //_friendList.ListPadding = 5f;
            //_onlinePlayerPanel.Append(_friendList);

            //// ScrollBar设定
            //var uiscrollbar = new UIAdvScrollBar();
            //uiscrollbar.SetView(100f, 1000f);
            //uiscrollbar.Height.Set(0f, 1f);
            //uiscrollbar.HAlign = 1f;
            //_onlinePlayerPanel.Append(uiscrollbar);
            //_friendList.SetScrollbar(uiscrollbar);

            uIPlayerProfileHead = new UIPlayerProfileHead();
            uIPlayerProfileHead.Top.Set(PLAYER_IMAGE_OFFSET_Y, 0f);
            uIPlayerProfileHead.Left.Set(PLAYER_IMAGE_OFFSET_X - 20, 0f);
            uIPlayerProfileHead.Width.Set(280, 0f);
            uIPlayerProfileHead.Height.Set(300, 0f);
            WindowPanel.Append(uIPlayerProfileHead);
        }
Пример #21
0
        protected override void Initialize(UIAdvPanel WindowPanel)
        {
            _spectrumAnalyzer                = new SpectrumAnalyzer();
            musicPlayer.OnProgressUpdate    += MusicPlayer_OnProgressUpdate;
            musicPlayer.OnSongPicLoaded     += MusicPlayer_OnSongPicLoaded;
            musicPlayer.OnFFTCalculated     += MusicPlayer_OnFFTCalculated;
            musicPlayer.OnMaximumCalculated += MusicPlayer_OnMaximumCalculated;
            base.Initialize(WindowPanel);
            WindowPanel.MainTexture = MusicBox.ModTexturesTable["AdvInvBack1"];
            WindowPanel.SetPadding(0);
            WindowPanel.Left.Set(Main.screenWidth / 2 - UI_PANEL_WIDTH / 2, 0f);
            WindowPanel.Top.Set(Main.screenHeight / 2 - UI_PANEL_HEIGHT / 2, 0f);
            WindowPanel.Width.Set(UI_PANEL_WIDTH, 0f);
            WindowPanel.Height.Set(UI_PANEL_HEIGHT, 0f);
            WindowPanel.Color      = Color.White;
            WindowPanel.CornerSize = 12;


            _progressBar = new UIBar();
            _progressBar.SetPadding(0);
            _progressBar.Top.Set(100f, 0.5f);
            _progressBar.Left.Set(-UI_BAR_WIDTH / 2 + UI_BAR_LEFT_OFFSET, 0.5f);
            _progressBar.Width.Set(UI_BAR_WIDTH, 0f);
            _progressBar.Height.Set(UI_BAR_HEIGHT, 0f);
            _progressBar.BarFrameTex           = MusicBox.ModTexturesTable["BarFrame"];
            _progressBar.BarFillTex            = MusicBox.ModTexturesTable["BarFiller"];
            _progressBar.BarFrameTexCornerSize = new Vector2(6, 6);
            _progressBar.FillerDrawOffset      = new Vector2(6, 6);
            _progressBar.FillerSize            = new Vector2(UI_BAR_WIDTH - 12, 6);
            WindowPanel.Append(_progressBar);

            _playButton         = new UIPicButton();
            _playButton.Texture = MusicBox.ModTexturesTable["PlayButtonN"];
            _playButton.Top.Set(135f - 15f, 0.5f);
            _playButton.Left.Set(-15 + UI_BAR_LEFT_OFFSET, 0.5f);
            _playButton.Width.Set(30, 0f);
            _playButton.Height.Set(30, 0f);
            _playButton.OnMouseHover += _playButton_OnMouseHover;
            _playButton.OnMouseOut   += _playButton_OnMouseOut;
            _playButton.OnClick      += _playButton_OnClick;
            WindowPanel.Append(_playButton);

            _playSlider         = new UISliderH();
            _playSlider.Texture = MusicBox.ModTexturesTable["PlaySliderN"];
            _playSlider.Top.Set(0, 0f);
            _playSlider.Left.Set(0, 0f);
            _playSlider.Width.Set(30, 0f);
            _playSlider.Height.Set(30, 0f);
            _playSlider.StartX         = 6f;
            _playSlider.EndX           = UI_BAR_WIDTH - 6;
            _playSlider.Scale          = 1.35f;
            _playSlider.OnValueChange += _playSlider_OnValueChange;
            _playSlider.OnMouseOver   += _playSlider_OnMouseOver;
            _playSlider.OnMouseOut    += _playSlider_OnMouseOut;
            _progressBar.Append(_playSlider);

            _volumeSlider         = new UISliderV();
            _volumeSlider.Texture = MusicBox.ModTexturesTable["PlaySliderN"];
            _volumeSlider.Top.Set(200f, 0f);
            _volumeSlider.Left.Set(-50f, 1f);
            _volumeSlider.Width.Set(30, 0f);
            _volumeSlider.Height.Set(30, 0f);
            _volumeSlider.StartY         = 200f;
            _volumeSlider.EndY           = 160f;
            _volumeSlider.Scale          = 1.35f;
            _volumeSlider.OnValueChange += _volumeSlider_OnValueChange;
            _volumeSlider.OnMouseOver   += _volumeSlider_OnMouseOver;
            _volumeSlider.OnMouseOut    += _volumeSlider_OnMouseOut;
            _volumeSlider.DragSync       = true;
            _volumeSlider.PreDraw       += (s, sb) =>
            {
                sb.Draw(MusicBox.ModTexturesTable["Box"], new Rectangle((int)(WindowPanel.GetInnerDimensions().X + WindowPanel.GetInnerDimensions().Width) - 37,
                                                                        (int)WindowPanel.GetInnerDimensions().Y + 160 - 5, 4, 50), Color.Gray * 0.5f);
                //Drawing.DrawAdvBox(sb, new Rectangle((int)(WindowPanel.GetInnerDimensions().X + WindowPanel.GetInnerDimensions().Width) - 50 - 2,
                //		(int)WindowPanel.GetInnerDimensions().Y + 200 - 2, 8, 44), Color.Gray, MusicBox.ModTexturesTable["Box"], new Vector2(8, 8));
            };
            WindowPanel.Append(_volumeSlider);

            _forwardButton         = new UIPicButton();
            _forwardButton.Texture = MusicBox.ModTexturesTable["ForwardButtonN"];
            _forwardButton.Top.Set(135f - 15f, 0.5f);
            _forwardButton.Left.Set(30f + UI_BAR_LEFT_OFFSET, 0.5f);
            _forwardButton.Width.Set(30, 0f);
            _forwardButton.Height.Set(30, 0f);
            _forwardButton.OnMouseHover += _forwardButton_OnMouseHover;
            _forwardButton.OnMouseOut   += _forwardButton_OnMouseOut;
            _forwardButton.OnClick      += _forwardButton_OnClick;
            WindowPanel.Append(_forwardButton);


            _backwardButton         = new UIPicButton();
            _backwardButton.Texture = MusicBox.ModTexturesTable["BackwardButtonN"];
            _backwardButton.Top.Set(135f - 15f, 0.5f);
            _backwardButton.Left.Set(-60f + UI_BAR_LEFT_OFFSET, 0.5f);
            _backwardButton.Width.Set(30, 0f);
            _backwardButton.Height.Set(30, 0f);
            _backwardButton.OnMouseHover += _backwardButton_OnMouseHover;
            _backwardButton.OnMouseOut   += _backwardButton_OnMouseOut;
            _backwardButton.OnClick      += _backwardButton_OnClick;
            WindowPanel.Append(_backwardButton);

            _songTexture = MusicBox.ModTexturesTable["AdvInvBack1"];
            _songImage   = new UIFixedImage(_songTexture);
            _songImage.Top.Set(60f, 0.5f);
            _songImage.Left.Set(-UI_BAR_WIDTH / 2 + UI_BAR_LEFT_OFFSET - 110f, 0.5f);
            _songImage.Width.Set(90f, 0f);
            _songImage.Height.Set(90f, 0f);
            WindowPanel.Append(_songImage);
        }
Пример #22
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;

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

            WindowPanel.Append(unionsPanel);

            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(-UNIONLIST_HEIGHT / 2 + UNIONLIST_OFFSET_TOP - 50, 0.5f);
            refreshButton.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH / 2 - 35, 0.5f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            refreshButton.OnClick           += RefreshButton_OnClick;
            WindowPanel.Append(refreshButton);

            _unionsList = new UIAdvList();
            _unionsList.Width.Set(-25f, 1f);
            _unionsList.Height.Set(0f, 1f);
            _unionsList.ListPadding    = 5f;
            _unionsList.OverflowHidden = true;
            unionsPanel.Append(_unionsList);

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

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

            var label = new UIText("公会列表", 0.7f, true);

            label.Top.Set(40, 0f);
            label.Left.Set(-UNIONLIST_WIDTH / 2 + UNIONLIST_OFFSET_RIGHT + 5, 0.5f);
            WindowPanel.Append(label);

            createUnionButton = new UICDButton(null, true);
            createUnionButton.Top.Set(-UNIONLIST_HEIGHT / 2 + UNIONLIST_OFFSET_TOP, 0.5f);
            createUnionButton.Left.Set(-120, 1f);
            createUnionButton.Width.Set(100, 0f);
            createUnionButton.Height.Set(35, 0f);
            createUnionButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            createUnionButton.ButtonDefaultColor = new Color(200, 200, 200);
            createUnionButton.ButtonChangeColor  = Color.White;
            createUnionButton.CornerSize         = new Vector2(12, 12);
            createUnionButton.ButtonText         = "创建";
            createUnionButton.OnClick           += CreateUnionButton_OnClick;
            WindowPanel.Append(createUnionButton);
        }
Пример #23
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);


            _shopItemGrid = new UIAdvGrid();
            _shopItemGrid.Width.Set(-25f, 1f);
            _shopItemGrid.Height.Set(0f, 1f);
            _shopItemGrid.ListPadding    = 7f;
            _shopItemGrid.OverflowHidden = true;
            unionsPanel.Append(_shopItemGrid);


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

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

            refreshButton = new UIButton(ServerSideCharacter2.ModTexturesTable["Refresh"], false);
            refreshButton.Top.Set(UNIONLIST_OFFSET_TOP - 50, 0f);
            refreshButton.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH - 35, 0f);
            refreshButton.Width.Set(35, 0f);
            refreshButton.Height.Set(35, 0f);
            refreshButton.ButtonDefaultColor = new Color(200, 200, 200);
            refreshButton.ButtonChangeColor  = Color.White;
            refreshButton.UseRotation        = true;
            refreshButton.TextureScale       = 0.2f;
            refreshButton.Tooltip            = "刷新";
            refreshButton.OnClick           += RefreshButton_OnClick;
            WindowPanel.Append(refreshButton);

            var currencyPanel = new UIAdvPanel(ServerSideCharacter2.ModTexturesTable["Box"])
            {
                CornerSize     = new Vector2(8, 8),
                OverflowHidden = true
            };

            currencyPanel.Top.Set(UNIONLIST_OFFSET_TOP, 0f);
            currencyPanel.Left.Set(UNIONLIST_OFFSET_RIGHT + UNIONLIST_WIDTH + 15, 0f);
            currencyPanel.Width.Set(165, 0f);
            currencyPanel.Height.Set(80, 0f);
            currencyPanel.SetPadding(5f);
            var currencylabel = new UIText("当前货币");

            currencylabel.Top.Set(5, 0f);
            currencylabel.HAlign = 0.5f;
            currencyPanel.Append(currencylabel);

            currencyText              = new UIText("1000");
            currencyText.TextColor    = Color.Yellow;
            currencyText.MarginBottom = 10f;
            currencyText.PaddingLeft  = 15f;
            currencyText.VAlign       = 1f;
            currencyText.HAlign       = 0.5f;
            currencyPanel.Append(currencyText);

            WindowPanel.Append(currencyPanel);
        }