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); }
public override void OnInitialize() { _area = new UIElement { Width = { Percent = 0.8f }, Top = { Pixels = 200 }, Height = { Pixels = -210, Percent = 1f }, HAlign = 0.5f }; UIPanel backPanel = new UIPanel { Width = { Percent = 1f }, Height = { Pixels = -110, Percent = 1f }, BackgroundColor = UICommon.MainPanelBackground }; _area.Append(backPanel); _messageBox = new UIMessageBox(string.Empty) { Width = { Pixels = -25, Percent = 1f }, Height = { Percent = 1f } }; backPanel.Append(_messageBox); UIScrollbar scrollbar = new UIScrollbar { Height = { Pixels = -20, Percent = 1f }, VAlign = 0.5f, HAlign = 1f }.WithView(100f, 1000f); backPanel.Append(scrollbar); _messageBox.SetScrollbar(scrollbar); _exitButton = new UITextPanel <string>(Language.GetTextValue("UI.Back"), 0.7f, true) { Width = { Pixels = -10, Percent = 1f }, Height = { Pixels = 50 }, Top = { Pixels = -108, Percent = 1f } }.WithFadedMouseOver(); _exitButton.OnClick += ExitButtonClick; _area.Append(_exitButton); _previousButton = new UITextPanel <string>("Previous", 0.7f, true); _previousButton.CopyStyle(_exitButton); _previousButton.Width.Set(-10, 0.5f); _previousButton.Top.Set(-55f, 1f); _previousButton.WithFadedMouseOver(); _previousButton.OnClick += PreviousOnClick; if (Index != ChangelogData.Changelogs.Count - 1) { _area.Append(_previousButton); } _nextButton = new UITextPanel <string>("Next", 0.7f, true); _nextButton.CopyStyle(_previousButton); _nextButton.HAlign = 1f; _nextButton.WithFadedMouseOver(); _nextButton.OnClick += NextOnClick; if (Index != 0) { _area.Append(_nextButton); } Append(_area); }
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); }