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 - 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); }
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); }
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); }
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); }
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); }
public UIPlayerProfileHead() { textName = new UIText(""); textName.Top.Set(0, 0f); textName.Left.Set(RANK_LEFT_OFFSET + 32, 0f); Append(textName); rankBar = new UIBar { BarFrameTex = ServerSideCharacter2.ModTexturesTable["BarFrameRank"], BarFillTex = Main.magicPixel, BarFrameTexCornerSize = new Vector2(6, 6), FillerDrawOffset = new Vector2(6, 6), FillerSize = new Vector2(RANK_BAR_WIDTH - 12, RANK_BAR_HEIGHT - 12) }; rankBar.Top.Set(20f, 0f); rankBar.Left.Set(RANK_LEFT_OFFSET, 0f); rankBar.Width.Set(RANK_BAR_WIDTH, 0f); rankBar.Height.Set(RANK_BAR_HEIGHT, 0f); rankBar.Value = 0.3f; Append(rankBar); rankimage = new UIImageResizable(ServerSideCharacter2.ModTexturesTable["Crown"]); rankimage.Top.Set(-10, 0f); rankimage.Left.Set(RANK_LEFT_OFFSET, 0f); rankimage.UsePosition = false; center = new Vector2(RANK_LEFT_OFFSET + 16f, 6); Append(rankimage); rankLabel = new UIText("300/1000"); rankLabel.Top.Set(20 + RANK_BAR_HEIGHT + 2f, 0f); rankLabel.Left.Set(RANK_LEFT_OFFSET, 0f); Append(rankLabel); var infopanel = new UIPanel(); infopanel.Top.Set(20 + RANK_BAR_HEIGHT + 30f, 0f); infopanel.Left.Set(0f, 0f); infopanel.Width.Set(300f, 0f); infopanel.Height.Set(500f, 0f); infopanel.SetPadding(10f); infoList = new UIAdvList { StartPadding = 5f, ListPadding = 10f }; infoList.Width.Set(0f, 1f); infoList.Height.Set(0f, 1f); infopanel.Append(infoList); var uiscrollbar = new UIAdvScrollBar(); uiscrollbar.SetView(100f, 1000f); uiscrollbar.Height.Set(0f, 1f); uiscrollbar.HAlign = 1f; infopanel.Append(uiscrollbar); infoList.SetScrollbar(uiscrollbar); gucoinText = new UIText("0"); gucoinText.MarginBottom = 5f; gucoinText.TextColor = Color.Yellow; gucoinText.VAlign = 1f; gucoinText.HAlign = 0.5f; infopanel.Append(gucoinText); Append(infopanel); }
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); }
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); }