public void init(CapitalForumPanel.ForumThreadData threadData, int position, CapitalForumPanel parent) { this.m_parent = parent; this.m_position = position; this.m_ForumThreadData = threadData; this.clearControls(); if ((position & 1) == 0) { this.backgroundImage.Image = (Image)GFXLibrary.lineitem_strip_02_light; } else { this.backgroundImage.Image = (Image)GFXLibrary.lineitem_strip_02_dark; } this.backgroundImage.Position = new Point(0, 0); this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked)); base.addControl(this.backgroundImage); this.Size = new Size(900, this.backgroundImage.Size.Height); this.ClipVisible = true; FontStyle regular = FontStyle.Regular; if (!threadData.read) { regular = FontStyle.Bold; } this.threadTitleLabel.Text = threadData.title; this.threadTitleLabel.Color = ARGBColors.Black; this.threadTitleLabel.Position = new Point(8, 0); this.threadTitleLabel.Size = new Size(410, this.backgroundImage.Height); this.threadTitleLabel.Font = FontManager.GetFont("Arial", 9f, regular); this.threadTitleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.threadTitleLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked)); this.backgroundImage.addControl(this.threadTitleLabel); this.userLabel.Text = threadData.userName; this.userLabel.Color = ARGBColors.Black; this.userLabel.Position = new Point(420, 0); this.userLabel.Size = new Size(0x86, this.backgroundImage.Height); this.userLabel.Font = FontManager.GetFont("Arial", 9f, regular); this.userLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.userLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked)); this.backgroundImage.addControl(this.userLabel); this.dateLabel.Text = threadData.lastTime.ToShortTimeString() + " " + threadData.lastTime.ToShortDateString(); this.dateLabel.Color = ARGBColors.Black; this.dateLabel.Position = new Point(0x22a, 0); this.dateLabel.Size = new Size(0xab, this.backgroundImage.Height); this.dateLabel.Font = FontManager.GetFont("Arial", 9f, regular); this.dateLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.dateLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked)); this.backgroundImage.addControl(this.dateLabel); base.invalidate(); if (RemoteServices.Instance.Admin || RemoteServices.Instance.Moderator) { this.deleteThread.ImageNorm = (Image)GFXLibrary.trashcan_normal; this.deleteThread.ImageOver = (Image)GFXLibrary.trashcan_over; this.deleteThread.ImageClick = (Image)GFXLibrary.trashcan_clicked; this.deleteThread.Position = new Point(870, 4); this.deleteThread.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "CapitalForumPanel_delete"); this.backgroundImage.addControl(this.deleteThread); } }
public void init(bool resized) { int height = base.Height; instance = this; base.clearControls(); this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5); this.mainBackgroundImage.Position = new Point(0, 0); this.mainBackgroundImage.Size = new Size(base.Width, height); base.addControl(this.mainBackgroundImage); this.backgroundFade.Image = (Image)GFXLibrary.background_top; this.backgroundFade.Position = new Point(0, 0); this.backgroundFade.Size = new Size(base.Width, this.backgroundFade.Image.Height); this.mainBackgroundImage.addControl(this.backgroundFade); this.headerLabelsImage.Size = new Size((base.Width - 0x19) - 0x17, 0x1c); this.headerLabelsImage.Position = new Point(0x19, 9); this.mainBackgroundImage.addControl(this.headerLabelsImage); this.headerLabelsImage.Create((Image)GFXLibrary.mail2_field_bar_mail_left, (Image)GFXLibrary.mail2_field_bar_mail_middle, (Image)GFXLibrary.mail2_field_bar_mail_right); this.divider1Image.Image = (Image)GFXLibrary.mail2_field_bar_mail_divider; this.divider1Image.Position = new Point(0x19f, 0); this.headerLabelsImage.addControl(this.divider1Image); this.divider2Image.Image = (Image)GFXLibrary.mail2_field_bar_mail_divider; this.divider2Image.Position = new Point(0x225, 0); this.headerLabelsImage.addControl(this.divider2Image); if (this.selectedAreaType == 3) { this.titleForum = SK.Text("ParishForumPanel_Parish_Forum", "Parish Forum"); } if (this.selectedAreaType == 2) { this.titleForum = SK.Text("ParishForumPanel_County_Forum", "County Forum"); } if (this.selectedAreaType == 1) { this.titleForum = SK.Text("ParishForumPanel_Province_Forum", "Province Forum"); } if (this.selectedAreaType == 0) { this.titleForum = SK.Text("ParishForumPanel_Country_Forum", "Country Forum"); } InterfaceMgr.Instance.setVillageHeading(this.titleForum); CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x10, new Point((base.Width - 30) + 2, 7), true); this.newTopicButton.ImageNorm = (Image)GFXLibrary.mail2_button_blue_141wide_normal; this.newTopicButton.ImageOver = (Image)GFXLibrary.mail2_button_blue_141wide_over; this.newTopicButton.ImageClick = (Image)GFXLibrary.mail2_button_blue_141wide_pushed; this.newTopicButton.Position = new Point(20, height - 30); this.newTopicButton.Text.Text = SK.Text("FORUMS_New_Topic", "New Topic"); this.newTopicButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); this.newTopicButton.TextYOffset = -3; this.newTopicButton.Text.Color = ARGBColors.Black; this.newTopicButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.newTopicClick), "CapitalForumPanel_new_topic"); this.mainBackgroundImage.addControl(this.newTopicButton); this.threadTitleLabel.Text = SK.Text("FactionInvites_Thread_Title", "Thread Title"); this.threadTitleLabel.Color = ARGBColors.Black; this.threadTitleLabel.Position = new Point(9, -2); this.threadTitleLabel.Size = new Size(0x143, this.headerLabelsImage.Height); this.threadTitleLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.threadTitleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage.addControl(this.threadTitleLabel); this.playersLabel.Text = SK.Text("VillageMapPanel_Player", "Player"); this.playersLabel.Color = ARGBColors.Black; this.playersLabel.Position = new Point(420, -2); this.playersLabel.Size = new Size(140, this.headerLabelsImage.Height); this.playersLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.playersLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage.addControl(this.playersLabel); this.dateLabel.Text = SK.Text("FactionInvites_Last_Post_Date", "Last Post Date"); this.dateLabel.Color = ARGBColors.Black; this.dateLabel.Position = new Point(0x22a, -2); this.dateLabel.Size = new Size(160, this.headerLabelsImage.Height); this.dateLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.dateLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage.addControl(this.dateLabel); this.wallScrollArea.Position = new Point(0x19, 0x26); this.wallScrollArea.Size = new Size(0x393, height - 80); this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, ((height - 50) - 90) + 60)); this.mainBackgroundImage.addControl(this.wallScrollArea); this.mouseWheelOverlay.Position = this.wallScrollArea.Position; this.mouseWheelOverlay.Size = this.wallScrollArea.Size; this.mouseWheelOverlay.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved)); this.mainBackgroundImage.addControl(this.mouseWheelOverlay); int num1 = this.wallScrollBar.Value; this.wallScrollBar.Visible = false; this.wallScrollBar.Position = new Point(0x3af, 0x26); this.wallScrollBar.Size = new Size(0x18, height - 80); this.mainBackgroundImage.addControl(this.wallScrollBar); this.wallScrollBar.Value = 0; this.wallScrollBar.Max = 100; this.wallScrollBar.NumVisibleLines = 0x19; this.wallScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom); this.wallScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved)); if (resized) { this.initForum(); } else { bool flag = false; foreach (ForumData data in this.forumArray) { if ((data.areaID == this.selectedAreaID) && (data.areaType == this.selectedAreaType)) { flag = true; break; } } if (!flag) { RemoteServices.Instance.set_GetForumList_UserCallBack(new RemoteServices.GetForumList_UserCallBack(this.getForumListCallback)); RemoteServices.Instance.GetForumList(this.selectedAreaID, this.selectedAreaType); } else { TimeSpan span = (TimeSpan)(DateTime.Now - this.lastRefreshTime); if (span.TotalMinutes > 5.0) { RemoteServices.Instance.set_GetForumList_UserCallBack(new RemoteServices.GetForumList_UserCallBack(this.getForumListCallback)); RemoteServices.Instance.GetForumList(this.selectedAreaID, this.selectedAreaType); } this.initForum(); } } }