Ejemplo n.º 1
0
            public void init(FactionNewForumPostsPanel.ForumPostData postData, int position, FactionNewForumPostsPanel parent, int yourRank)
            {
                this.m_parent   = parent;
                this.m_position = position;
                this.m_postData = postData;
                Graphics graphics = parent.CreateGraphics();
                Size     size     = graphics.MeasureString(postData.text, FontManager.GetFont("Arial", 9f, FontStyle.Regular), 630).ToSize();

                graphics.Dispose();
                int height = size.Height + 10;

                if (height < 0x20)
                {
                    height = 0x20;
                }
                this.clearControls();
                this.ClipVisible         = true;
                this.Size                = new Size(680, 0x19 + height);
                this.lightArea1.Size     = new Size(640, height);
                this.lightArea1.Position = new Point(40, 0x19);
                base.addControl(this.lightArea1);
                this.lightArea1.Create((Image)GFXLibrary.int_insetpanel_lighten_top_left, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_top_right, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_bottom_left, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_bottom_right);
                NumberFormatInfo nFI = GameEngine.NFI;

                this.userName.Text      = postData.userName;
                this.userName.Color     = ARGBColors.Black;
                this.userName.Position  = new Point(9, 3);
                this.userName.Size      = new Size(280, 30);
                this.userName.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
                this.userName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                base.addControl(this.userName);
                this.dateLabel.Text      = postData.postTime.ToShortTimeString() + " " + postData.postTime.ToShortDateString();
                this.dateLabel.Color     = ARGBColors.Black;
                this.dateLabel.Position  = new Point(0x216, 3);
                this.dateLabel.Size      = new Size(0xa1, 30);
                this.dateLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.dateLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                base.addControl(this.dateLabel);
                this.bodyLabel.Text      = postData.text;
                this.bodyLabel.Color     = ARGBColors.Black;
                this.bodyLabel.Position  = new Point(5, 5);
                this.bodyLabel.Size      = new Size(this.lightArea1.Width - 10, height - 5);
                this.bodyLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.bodyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                this.bodyLabel.setRightClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.copyTextToClipboardClick));
                this.lightArea1.addControl(this.bodyLabel);
                if (((yourRank == 1) || (yourRank == 2)) || (((postData.userID == RemoteServices.Instance.UserID) || 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(680, 4);
                    this.deleteThread.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "FactionNewForumPostsPanel_delete_post");
                    base.addControl(this.deleteThread);
                }
                base.invalidate();
            }
 public void init(FactionNewForumPostsPanel.ForumPostData postData, int position, FactionNewForumPostsPanel parent, int yourRank)
 {
     this.m_parent = parent;
     this.m_position = position;
     this.m_postData = postData;
     Graphics graphics = parent.CreateGraphics();
     Size size = graphics.MeasureString(postData.text, FontManager.GetFont("Arial", 9f, FontStyle.Regular), 630).ToSize();
     graphics.Dispose();
     int height = size.Height + 10;
     if (height < 0x20)
     {
         height = 0x20;
     }
     this.clearControls();
     this.ClipVisible = true;
     this.Size = new Size(680, 0x19 + height);
     this.lightArea1.Size = new Size(640, height);
     this.lightArea1.Position = new Point(40, 0x19);
     base.addControl(this.lightArea1);
     this.lightArea1.Create((Image) GFXLibrary.int_insetpanel_lighten_top_left, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_top_right, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_bottom_left, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_bottom_right);
     NumberFormatInfo nFI = GameEngine.NFI;
     this.userName.Text = postData.userName;
     this.userName.Color = ARGBColors.Black;
     this.userName.Position = new Point(9, 3);
     this.userName.Size = new Size(280, 30);
     this.userName.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.userName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     base.addControl(this.userName);
     this.dateLabel.Text = postData.postTime.ToShortTimeString() + " " + postData.postTime.ToShortDateString();
     this.dateLabel.Color = ARGBColors.Black;
     this.dateLabel.Position = new Point(0x216, 3);
     this.dateLabel.Size = new Size(0xa1, 30);
     this.dateLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.dateLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     base.addControl(this.dateLabel);
     this.bodyLabel.Text = postData.text;
     this.bodyLabel.Color = ARGBColors.Black;
     this.bodyLabel.Position = new Point(5, 5);
     this.bodyLabel.Size = new Size(this.lightArea1.Width - 10, height - 5);
     this.bodyLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.bodyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.bodyLabel.setRightClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.copyTextToClipboardClick));
     this.lightArea1.addControl(this.bodyLabel);
     if (((yourRank == 1) || (yourRank == 2)) || (((postData.userID == RemoteServices.Instance.UserID) || 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(680, 4);
         this.deleteThread.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "FactionNewForumPostsPanel_delete_post");
         base.addControl(this.deleteThread);
     }
     base.invalidate();
 }
 public void init(bool resized)
 {
     int height = base.Height;
     instance = this;
     base.clearControls();
     this.sidebar.addSideBar(6, this);
     this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5);
     this.mainBackgroundImage.Position = new Point(0, 0);
     this.mainBackgroundImage.Size = new Size(base.Width - 200, 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 - 200, this.backgroundFade.Image.Height);
     this.mainBackgroundImage.addControl(this.backgroundFade);
     this.headerLabelsImage.Size = new Size(((base.Width - 0x19) - 0x17) - 200, 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.factionLabel.Text = ThreadTitle;
     this.factionLabel.Color = ARGBColors.Black;
     this.factionLabel.Position = new Point(9, -2);
     this.factionLabel.Size = new Size(this.headerLabelsImage.Width - 0x12, this.headerLabelsImage.Height);
     this.factionLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.factionLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.headerLabelsImage.addControl(this.factionLabel);
     InterfaceMgr.Instance.setVillageHeading(ForumTitle);
     this.wallScrollArea.Position = new Point(0x19, 0x26);
     this.wallScrollArea.Size = new Size(0x2c1, height - 70);
     this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x2c1, (height - 50) - 20));
     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(0x2dd, 0x26);
     this.wallScrollBar.Size = new Size(0x18, height - 70);
     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));
     this.newPostButton.ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal;
     this.newPostButton.ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over;
     this.newPostButton.ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed;
     this.newPostButton.Position = new Point(20, height - 30);
     this.newPostButton.Text.Text = SK.Text("FORUMS_New_Post", "New Post");
     this.newPostButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.newPostButton.TextYOffset = -3;
     this.newPostButton.Text.Color = ARGBColors.Black;
     this.newPostButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.newPostClick), "FactionNewForumPostsPanel_new_post");
     this.mainBackgroundImage.addControl(this.newPostButton);
     this.backButton.ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal;
     this.backButton.ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over;
     this.backButton.ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed;
     this.backButton.Position = new Point(630, height - 30);
     this.backButton.Text.Text = SK.Text("FORUMS_Back", "Back");
     this.backButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.backButton.TextYOffset = -3;
     this.backButton.Text.Color = ARGBColors.Black;
     this.backButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.backClick), "FactionNewForumPostsPanel_back");
     this.mainBackgroundImage.addControl(this.backButton);
     if (!resized)
     {
         RemoteServices.Instance.set_GetForumThread_UserCallBack(new RemoteServices.GetForumThread_UserCallBack(this.forumThreadCallback));
         if ((this.threadArray[ThreadID] == null) || (((ForumThreadInfoData) this.threadArray[ThreadID]).lastTime.Year < 0x76c))
         {
             RemoteServices.Instance.GetForumThread(parentForumID, ThreadID, DateTime.MinValue, true);
         }
         else
         {
             ForumThreadInfoData data = (ForumThreadInfoData) this.threadArray[ThreadID];
             RemoteServices.Instance.GetForumThread(parentForumID, ThreadID, data.lastTime, false);
         }
     }
     this.addPosts();
 }
Ejemplo n.º 4
0
        public void init(bool resized)
        {
            int height = base.Height;

            instance = this;
            base.clearControls();
            this.sidebar.addSideBar(6, this);
            this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5);
            this.mainBackgroundImage.Position  = new Point(0, 0);
            this.mainBackgroundImage.Size      = new Size(base.Width - 200, 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 - 200, this.backgroundFade.Image.Height);
            this.mainBackgroundImage.addControl(this.backgroundFade);
            this.headerLabelsImage.Size     = new Size(((base.Width - 0x19) - 0x17) - 200, 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.factionLabel.Text      = ThreadTitle;
            this.factionLabel.Color     = ARGBColors.Black;
            this.factionLabel.Position  = new Point(9, -2);
            this.factionLabel.Size      = new Size(this.headerLabelsImage.Width - 0x12, this.headerLabelsImage.Height);
            this.factionLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.factionLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage.addControl(this.factionLabel);
            InterfaceMgr.Instance.setVillageHeading(ForumTitle);
            this.wallScrollArea.Position = new Point(0x19, 0x26);
            this.wallScrollArea.Size     = new Size(0x2c1, height - 70);
            this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x2c1, (height - 50) - 20));
            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(0x2dd, 0x26);
            this.wallScrollBar.Size     = new Size(0x18, height - 70);
            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));
            this.newPostButton.ImageNorm   = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
            this.newPostButton.ImageOver   = (Image)GFXLibrary.mail2_button_blue_141wide_over;
            this.newPostButton.ImageClick  = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
            this.newPostButton.Position    = new Point(20, height - 30);
            this.newPostButton.Text.Text   = SK.Text("FORUMS_New_Post", "New Post");
            this.newPostButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.newPostButton.TextYOffset = -3;
            this.newPostButton.Text.Color  = ARGBColors.Black;
            this.newPostButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.newPostClick), "FactionNewForumPostsPanel_new_post");
            this.mainBackgroundImage.addControl(this.newPostButton);
            this.backButton.ImageNorm   = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
            this.backButton.ImageOver   = (Image)GFXLibrary.mail2_button_blue_141wide_over;
            this.backButton.ImageClick  = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
            this.backButton.Position    = new Point(630, height - 30);
            this.backButton.Text.Text   = SK.Text("FORUMS_Back", "Back");
            this.backButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.backButton.TextYOffset = -3;
            this.backButton.Text.Color  = ARGBColors.Black;
            this.backButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.backClick), "FactionNewForumPostsPanel_back");
            this.mainBackgroundImage.addControl(this.backButton);
            if (!resized)
            {
                RemoteServices.Instance.set_GetForumThread_UserCallBack(new RemoteServices.GetForumThread_UserCallBack(this.forumThreadCallback));
                if ((this.threadArray[ThreadID] == null) || (((ForumThreadInfoData)this.threadArray[ThreadID]).lastTime.Year < 0x76c))
                {
                    RemoteServices.Instance.GetForumThread(parentForumID, ThreadID, DateTime.MinValue, true);
                }
                else
                {
                    ForumThreadInfoData data = (ForumThreadInfoData)this.threadArray[ThreadID];
                    RemoteServices.Instance.GetForumThread(parentForumID, ThreadID, data.lastTime, false);
                }
            }
            this.addPosts();
        }