public UIUnionCandidateBar(SimplifiedPlayerInfo info) : base(info)
        {
            collapsedHeight   = expandedHeight = 50f;
            shouldDrawDivider = false;
            var acceptCandidateButton = new UICDButton(null, true);

            acceptCandidateButton.Top.Set(0f, 0f);
            acceptCandidateButton.Left.Set(-70f, 1f);
            acceptCandidateButton.Width.Set(70f, 0f);
            acceptCandidateButton.Height.Set(38f, 0f);
            acceptCandidateButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack3"];
            acceptCandidateButton.ButtonDefaultColor = new Color(200, 200, 200);
            acceptCandidateButton.ButtonChangeColor  = Color.White;
            acceptCandidateButton.CornerSize         = new Vector2(12, 12);
            acceptCandidateButton.ButtonText         = "接受";
            acceptCandidateButton.OnClick           += AcceptCandidateButton_OnClick;
            Append(acceptCandidateButton);

            var rejectButton = new UICDButton(null, true);

            rejectButton.Top.Set(0f, 0f);
            rejectButton.Left.Set(-155f, 1f);
            rejectButton.Width.Set(70f, 0f);
            rejectButton.Height.Set(38f, 0f);
            rejectButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBackRej"];
            rejectButton.ButtonDefaultColor = new Color(200, 200, 200);
            rejectButton.ButtonChangeColor  = Color.White;
            rejectButton.CornerSize         = new Vector2(12, 12);
            rejectButton.ButtonText         = "拒绝";
            rejectButton.OnClick           += RejectButton_OnClick;
            Append(rejectButton);
        }
 private void AddExtraButtons(List <UICDButton> buttons)
 {
     if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("match-join"))
     {
         var matchJoinButton = new UICDButton(null, true);
         matchJoinButton.Width.Set(70f, 0f);
         matchJoinButton.Height.Set(38f, 0f);
         matchJoinButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
         matchJoinButton.ButtonDefaultColor = new Color(200, 200, 200);
         matchJoinButton.ButtonChangeColor  = Color.White;
         matchJoinButton.CornerSize         = new Vector2(12, 12);
         matchJoinButton.ButtonText         = "加入";
         matchJoinButton.OnClick           += MatchJoinButton_OnClick;
         buttons.Add(matchJoinButton);
     }
     if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("match-new") && !matchInfo.IsMatching)
     {
         var matchnewButton = new UICDButton(null, true);
         matchnewButton.Width.Set(100f, 0f);
         matchnewButton.Height.Set(38f, 0f);
         matchnewButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
         matchnewButton.ButtonDefaultColor = new Color(200, 200, 200);
         matchnewButton.ButtonChangeColor  = Color.White;
         matchnewButton.CornerSize         = new Vector2(12, 12);
         matchnewButton.ButtonText         = "开启匹配";
         matchnewButton.OnClick           += MatchnewButton_OnClick;;
         buttons.Add(matchnewButton);
     }
 }
        protected virtual void AddExtraButtons(List <UICDButton> buttons)
        {
            AddFriendButton();
            var profilebutton = new UICDButton(null, true);

            profilebutton.Width.Set(70f, 0f);
            profilebutton.Height.Set(38f, 0f);
            profilebutton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            profilebutton.ButtonDefaultColor = new Color(200, 200, 200);
            profilebutton.ButtonChangeColor  = Color.White;
            profilebutton.CornerSize         = new Vector2(12, 12);
            profilebutton.ButtonText         = "资料";
            profilebutton.OnClick           += Profilebutton_OnClick;
            buttons.Add(profilebutton);



            if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("tp"))
            {
                var tpbutton = new UICDButton(null, true);
                tpbutton.Width.Set(70f, 0f);
                tpbutton.Height.Set(38f, 0f);
                tpbutton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                tpbutton.ButtonDefaultColor = new Color(200, 200, 200);
                tpbutton.ButtonChangeColor  = Color.White;
                tpbutton.CornerSize         = new Vector2(12, 12);
                tpbutton.ButtonText         = "传送";
                tpbutton.OnClick           += Tpbutton_OnClick;
                buttons.Add(tpbutton);
            }


            if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("lock"))
            {
                var lockButton = new UICDButton(null, true);
                lockButton.Width.Set(70f, 0f);
                lockButton.Height.Set(38f, 0f);
                lockButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                lockButton.ButtonDefaultColor = new Color(200, 200, 200);
                lockButton.ButtonChangeColor  = Color.White;
                lockButton.CornerSize         = new Vector2(12, 12);
                lockButton.ButtonText         = "锁住";
                lockButton.OnClick           += LockButton_OnClick;
                buttons.Add(lockButton);
            }

            if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("kick"))
            {
                var kickButton = new UICDButton(null, true);
                kickButton.Width.Set(70f, 0f);
                kickButton.Height.Set(38f, 0f);
                kickButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                kickButton.ButtonDefaultColor = new Color(200, 200, 200);
                kickButton.ButtonChangeColor  = Color.White;
                kickButton.CornerSize         = new Vector2(12, 12);
                kickButton.ButtonText         = "踢掉";
                kickButton.OnClick           += KickButton_OnClick;
                buttons.Add(kickButton);
            }
        }
示例#4
0
        private void AddExtraButton()
        {
            AddFriendButton();
            var profilebutton = new UICDButton(null, true);

            profilebutton.Width.Set(70f, 0f);
            profilebutton.Height.Set(38f, 0f);
            profilebutton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            profilebutton.ButtonDefaultColor = new Color(200, 200, 200);
            profilebutton.ButtonChangeColor  = Color.White;
            profilebutton.CornerSize         = new Vector2(12, 12);
            profilebutton.ButtonText         = "资料";
            profilebutton.OnClick           += Profilebutton_OnClick;
            extraButtons.Add(profilebutton);

            if (Main.netMode == 0 || ServerSideCharacter2.MainPlayerGroup.HasPermission("tp"))
            {
                var tpbutton = new UICDButton(null, true);
                tpbutton.Width.Set(70f, 0f);
                tpbutton.Height.Set(38f, 0f);
                tpbutton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                tpbutton.ButtonDefaultColor = new Color(200, 200, 200);
                tpbutton.ButtonChangeColor  = Color.White;
                tpbutton.CornerSize         = new Vector2(12, 12);
                tpbutton.ButtonText         = "传送";
                tpbutton.OnClick           += Tpbutton_OnClick;
                extraButtons.Add(tpbutton);
            }


            if (Main.netMode == 0 || ServerSideCharacter2.ClientUnion.Owner == Main.LocalPlayer.name)
            {
                var kickButton = new UICDButton(null, true);
                kickButton.Width.Set(70f, 0f);
                kickButton.Height.Set(38f, 0f);
                kickButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack3"];
                kickButton.ButtonDefaultColor = new Color(200, 200, 200);
                kickButton.ButtonChangeColor  = Color.White;
                kickButton.CornerSize         = new Vector2(12, 12);
                kickButton.ButtonText         = "踢出";
                kickButton.OnClick           += KickButton_OnClick1;
                extraButtons.Add(kickButton);
            }

            if (_position != UnionPosition.会长 && (Main.netMode == 0 || ServerSideCharacter2.ClientUnion.Owner == Main.LocalPlayer.name))
            {
                var builderButton = new UICDButton(null, true);
                builderButton.Width.Set(125f, 0f);
                builderButton.Height.Set(38f, 0f);
                builderButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack3"];
                builderButton.ButtonDefaultColor = new Color(200, 200, 200);
                builderButton.ButtonChangeColor  = Color.White;
                builderButton.CornerSize         = new Vector2(12, 12);
                builderButton.ButtonText         = (_position == UnionPosition.建筑师 ? "取消" : "任命") + "建筑师";
                builderButton.OnClick           += BuilderButton_OnClick;
                extraButtons.Add(builderButton);
            }
            buttonTopOffset = 75f;
        }
示例#5
0
        public UIShopItem(SimplifiedMarketItem info)
        {
            marketItem = info;
            this.Width.Set(140f, 0f);
            this.Height.Set(170f, 0f);
            this.CornerSize  = new Vector2(8, 8);
            base.MainTexture = ServerSideCharacter2.ModTexturesTable["AdvInvBack1"];
            this.Color       = Color.Cyan * 0.8f;
            base.SetPadding(6f);
            this.OverflowHidden = true;

            itemslot         = new UISimpleSlot(info.ItemID);
            itemslot.CanPick = false;
            itemslot.Width.Set(50, 0f);
            itemslot.Height.Set(50, 0f);
            itemslot.Top.Set(20, 0f);
            itemslot.Left.Set(-25f, 0.5f);
            Append(itemslot);

            gucoinText = new UIText(info.Price.ToString());
            gucoinText.MarginBottom = 10f;
            gucoinText.PaddingLeft  = 15f;
            gucoinText.VAlign       = 1f;
            gucoinText.HAlign       = 0.5f;
            Append(gucoinText);

            var buyButton = new UICDButton(null);

            buyButton.Top.Set(80f, 0f);
            buyButton.Left.Set(-40, 0.5f);
            buyButton.Width.Set(80f, 0f);
            buyButton.Height.Set(35f, 0f);
            buyButton.ButtonText         = "购买";
            buyButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack1"];
            buyButton.CornerSize         = new Vector2(12, 12);
            buyButton.ButtonDefaultColor = new Color(200, 200, 200);
            buyButton.ButtonChangeColor  = Color.White;
            buyButton.OnClick           += BuyButton_OnClick;
            Append(buyButton);

            if (info.Discount > 0)
            {
                var discountText = new UIText($"-{info.Discount}%");
                discountText.Top.Set(5f, 0);
                discountText.HAlign      = 1f;
                discountText.MarginRight = 5f;
                discountText.TextColor   = Color.Lime;
                Append(discountText);
            }
        }
示例#6
0
        protected virtual void AddExtraButtons(List <UICDButton> buttons)
        {
            var unionjoinButton = new UICDButton(null, true);

            unionjoinButton.Width.Set(70f, 0f);
            unionjoinButton.Height.Set(38f, 0f);
            unionjoinButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            unionjoinButton.ButtonDefaultColor = new Color(200, 200, 200);
            unionjoinButton.ButtonChangeColor  = Color.White;
            unionjoinButton.CornerSize         = new Vector2(12, 12);
            unionjoinButton.ButtonText         = "申请";
            unionjoinButton.OnClick           += UnionjoinButton_OnClick;
            buttons.Add(unionjoinButton);
        }
 protected void AddFriendButton()
 {
     if (!playerInfo.IsFriend)
     {
         addFriendButton = new UICDButton(null, true);
         addFriendButton.Top.Set(0f, 0f);
         addFriendButton.Left.Set(-70f, 1f);
         addFriendButton.Width.Set(70f, 0f);
         addFriendButton.Height.Set(38f, 0f);
         addFriendButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack3"];
         addFriendButton.ButtonDefaultColor = new Color(200, 200, 200);
         addFriendButton.ButtonChangeColor  = Color.White;
         addFriendButton.CornerSize         = new Vector2(12, 12);
         addFriendButton.ButtonText         = "+好友";
         addFriendButton.OnClick           += AddFriendButton_OnClick;
         Append(addFriendButton);
     }
 }
        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);
        }
示例#9
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);
        }
示例#10
0
        private void AdjustOwnerUI(bool owner)
        {
            _buttonList.Clear();
            if (owner)
            {
                var candidateButton = new UICDButton(null, true);
                candidateButton.Width.Set(0, 1f);
                candidateButton.Height.Set(50f, 0f);
                candidateButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                candidateButton.ButtonDefaultColor = new Color(200, 200, 200);
                candidateButton.ButtonChangeColor  = Color.White;
                candidateButton.CornerSize         = new Vector2(12, 12);
                candidateButton.ButtonText         = "申请信息";
                candidateButton.OnClick           += CandidateButton_OnClick;
                _buttonList.Add(candidateButton);

                var exitButton = new UICDButton(null, true);
                exitButton.Width.Set(0, 1f);
                exitButton.Height.Set(50f, 0f);
                exitButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                exitButton.ButtonDefaultColor = new Color(200, 200, 200);
                exitButton.ButtonChangeColor  = Color.White;
                exitButton.CornerSize         = new Vector2(12, 12);
                exitButton.ButtonText         = "解散";
                exitButton.OnClick           += ExitButton_OnClick1;
                _buttonList.Add(exitButton);
            }
            else
            {
                var exitButton = new UICDButton(null, true);
                exitButton.Width.Set(0, 1f);
                exitButton.Height.Set(50f, 0f);
                exitButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
                exitButton.ButtonDefaultColor = new Color(200, 200, 200);
                exitButton.ButtonChangeColor  = Color.White;
                exitButton.CornerSize         = new Vector2(12, 12);
                exitButton.ButtonText         = "退出";
                exitButton.OnClick           += ExitButton_OnClick;
                _buttonList.Add(exitButton);
            }
            var donateButton = new UICDButton(null, true);

            donateButton.Width.Set(0, 1f);
            donateButton.Height.Set(50, 0f);
            donateButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            donateButton.ButtonDefaultColor = new Color(200, 200, 200);
            donateButton.ButtonChangeColor  = Color.White;
            donateButton.CornerSize         = new Vector2(12, 12);
            donateButton.ButtonText         = "捐献";
            donateButton.OnClick           += DonateButton_OnClick;
            _buttonList.Add(donateButton);

            var tpRegionButton = new UICDButton(null, true);

            tpRegionButton.Width.Set(0, 1f);
            tpRegionButton.Height.Set(50, 0f);
            tpRegionButton.CoolDownCount      = 60;
            tpRegionButton.BoxTexture         = ServerSideCharacter2.ModTexturesTable["AdvInvBack2"];
            tpRegionButton.ButtonDefaultColor = new Color(200, 200, 200);
            tpRegionButton.ButtonChangeColor  = Color.White;
            tpRegionButton.CornerSize         = new Vector2(12, 12);
            tpRegionButton.ButtonText         = "传送领地";
            tpRegionButton.OnClick           += TpRegionButton_OnClick;
            _buttonList.Add(tpRegionButton);
        }
示例#11
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);
        }