Exemple #1
0
        public void init(bool resized)
        {
            int villageID = InterfaceMgr.Instance.getSelectedMenuVillage();

            this.m_currentVillage = villageID;
            int parishID = GameEngine.Instance.World.getParishFromVillageID(villageID);
            int height   = base.Height;

            instance = this;
            base.clearControls();
            this.headerImage.Size     = new Size(base.Width, 40);
            this.headerImage.Position = new Point(0, 0);
            base.addControl(this.headerImage);
            this.headerImage.Create((Image)GFXLibrary.mail2_titlebar_left, (Image)GFXLibrary.mail2_titlebar_middle, (Image)GFXLibrary.mail2_titlebar_right);
            CustomSelfDrawPanel.WikiLinkControl.init(this.headerImage, 14, new Point(base.Width - 0x2c, 3));
            this.backgroundImage.Size     = new Size(base.Width, height - 40);
            this.backgroundImage.Position = new Point(0, 40);
            base.addControl(this.backgroundImage);
            this.backgroundImage.Create((Image)GFXLibrary.mail2_mail_panel_upper_left, (Image)GFXLibrary.mail2_mail_panel_upper_middle, (Image)GFXLibrary.mail2_mail_panel_upper_right, (Image)GFXLibrary.mail2_mail_panel_middle_left, (Image)GFXLibrary.mail2_mail_panel_middle_middle, (Image)GFXLibrary.mail2_mail_panel_middle_right, (Image)GFXLibrary.mail2_mail_panel_lower_left, (Image)GFXLibrary.mail2_mail_panel_lower_middle, (Image)GFXLibrary.mail2_mail_panel_lower_right);
            this.parishNameLabel.Text            = GameEngine.Instance.World.getParishName(parishID);
            this.parishNameLabel.Color           = ARGBColors.White;
            this.parishNameLabel.DropShadowColor = ARGBColors.Black;
            this.parishNameLabel.Position        = new Point(20, 0);
            this.parishNameLabel.Size            = new Size(base.Width - 40, 40);
            this.parishNameLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
            this.parishNameLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerImage.addControl(this.parishNameLabel);
            this.illustrationImage.Image    = (Image)GFXLibrary.parishwall_village_illlustration_01;
            this.illustrationImage.Position = new Point(0x11, 5);
            this.backgroundImage.addControl(this.illustrationImage);
            this.stewardLabel.Text      = SK.Text("ParishWallPanel_Steward", "Steward") + " : ";
            this.stewardLabel.Color     = ARGBColors.Black;
            this.stewardLabel.Position  = new Point(5, 5);
            this.stewardLabel.Size      = new Size(this.illustrationImage.Width - 6, 30);
            this.stewardLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
            this.stewardLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.illustrationImage.addControl(this.stewardLabel);
            this.wallInfoImage.Size     = new Size(0x18c, height - 170);
            this.wallInfoImage.Position = new Point(8, 0x77);
            this.backgroundImage.addControl(this.wallInfoImage);
            this.wallInfoImage.Create((Image)GFXLibrary.mail2_rounded_rectangle_tan_upper_left, (Image)GFXLibrary.mail2_rounded_rectangle_tan_upper_middle, (Image)GFXLibrary.mail2_rounded_rectangle_tan_upper_right, (Image)GFXLibrary.mail2_rounded_rectangle_tan_middle_left, (Image)GFXLibrary.mail2_rounded_rectangle_tan_middle_middle, (Image)GFXLibrary.mail2_rounded_rectangle_tan_middle_right, (Image)GFXLibrary.mail2_rounded_rectangle_tan_bottom_left, (Image)GFXLibrary.mail2_rounded_rectangle_tan_bottom_middle, (Image)GFXLibrary.mail2_rounded_rectangle_tan_bottom_right);
            this.areaWindow.Size     = new Size(0x234, height - 0x4e);
            this.areaWindow.Position = new Point(0x19b, 0x1a);
            this.backgroundImage.addControl(this.areaWindow);
            this.areaWindow.Create((Image)GFXLibrary.parishwall_village_center_tab_outline_top_left, (Image)GFXLibrary.parishwall_village_center_tab_outline_top_middle, (Image)GFXLibrary.parishwall_village_center_tab_outline_top_right, (Image)GFXLibrary.parishwall_village_center_tab_outline_middle_left, null, (Image)GFXLibrary.parishwall_village_center_tab_outline_middle_right, (Image)GFXLibrary.parishwall_village_center_tab_outline_bottom_left, (Image)GFXLibrary.parishwall_village_center_tab_outline_bottom_middle, (Image)GFXLibrary.parishwall_village_center_tab_outline_bottom_right);
            this.tab1Button.UseTextSize    = true;
            this.tab1Button.ImageNorm      = (Image)GFXLibrary.parishwall_village_center_tab_up;
            this.tab1Button.ImageOver      = (Image)GFXLibrary.parishwall_village_center_tab_up;
            this.tab1Button.Position       = new Point(0x1a9, 6);
            this.tab1Button.Text.Text      = SK.Text("ParishWallPanel_General", "General");
            this.tab1Button.Text.Size      = new Size(this.tab1Button.Size.Width, this.tab1Button.Text.Size.Height + 20);
            this.tab1Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.tab1Button.TextYOffset    = 3;
            this.tab1Button.Text.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.tab1Button.Text.Color     = ARGBColors.Black;
            this.tab1Button.Data           = 0;
            this.tab1Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
            this.backgroundImage.addControl(this.tab1Button);
            this.tab2Button.UseTextSize    = true;
            this.tab2Button.ImageNorm      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab2Button.ImageOver      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab2Button.Position       = new Point(510, 6);
            this.tab2Button.Text.Text      = SK.Text("ParishWallPanel_War", "War");
            this.tab2Button.Text.Size      = new Size(this.tab2Button.Size.Width, this.tab2Button.Text.Size.Height + 20);
            this.tab2Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.tab2Button.TextYOffset    = 3;
            this.tab2Button.Text.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.tab2Button.Text.Color     = ARGBColors.Black;
            this.tab2Button.Data           = 1;
            this.tab2Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
            this.backgroundImage.addControl(this.tab2Button);
            this.tab3Button.UseTextSize    = true;
            this.tab3Button.ImageNorm      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab3Button.ImageOver      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab3Button.Position       = new Point(0x253, 6);
            this.tab3Button.Text.Text      = SK.Text("ParishWallPanel_inn", "Inn");
            this.tab3Button.Text.Size      = new Size(this.tab3Button.Size.Width, this.tab3Button.Text.Size.Height + 20);
            this.tab3Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.tab3Button.TextYOffset    = 3;
            this.tab3Button.Text.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.tab3Button.Text.Color     = ARGBColors.Black;
            this.tab3Button.Data           = 2;
            this.tab3Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
            this.backgroundImage.addControl(this.tab3Button);
            this.tab4Button.UseTextSize    = true;
            this.tab4Button.ImageNorm      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab4Button.ImageOver      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab4Button.Position       = new Point(680, 6);
            this.tab4Button.Text.Text      = SK.Text("ParishWallPanel_Steward", "Steward");
            this.tab4Button.Text.Size      = new Size(this.tab4Button.Size.Width, this.tab4Button.Text.Size.Height + 20);
            this.tab4Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.tab4Button.TextYOffset    = 3;
            this.tab4Button.Text.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.tab4Button.Text.Color     = ARGBColors.Black;
            this.tab4Button.Data           = 3;
            this.tab4Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
            this.backgroundImage.addControl(this.tab4Button);
            this.tab5Button.UseTextSize    = true;
            this.tab5Button.ImageNorm      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab5Button.ImageOver      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab5Button.Position       = new Point(0x2fd, 6);
            this.tab5Button.Text.Text      = SK.Text("ParishWallPanel_Free", "Free");
            this.tab5Button.Text.Size      = new Size(this.tab5Button.Size.Width, this.tab5Button.Text.Size.Height + 20);
            this.tab5Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.tab5Button.TextYOffset    = 3;
            this.tab5Button.Text.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.tab5Button.Text.Color     = ARGBColors.Black;
            this.tab5Button.Data           = 4;
            this.tab5Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
            this.backgroundImage.addControl(this.tab5Button);
            this.tab6Button.UseTextSize    = true;
            this.tab6Button.ImageNorm      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab6Button.ImageOver      = (Image)GFXLibrary.parishwall_village_center_tab_down;
            this.tab6Button.Position       = new Point(850, 6);
            this.tab6Button.Text.Text      = SK.Text("ParishWallPanel_Free", "Free");
            this.tab6Button.Text.Size      = new Size(this.tab6Button.Size.Width, this.tab6Button.Text.Size.Height + 20);
            this.tab6Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.tab6Button.TextYOffset    = 3;
            this.tab6Button.Text.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.tab6Button.Text.Color     = ARGBColors.Black;
            this.tab6Button.Data           = 5;
            this.tab6Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
            this.backgroundImage.addControl(this.tab6Button);
            this.textInputImage.Image    = (Image)GFXLibrary.parishwall_what_say_thou_box;
            this.textInputImage.Position = new Point(0x1b0, 0x2f);
            this.backgroundImage.addControl(this.textInputImage);
            this.wallScrollArea.Position = new Point(15, 15);
            this.wallScrollArea.Size     = new Size(0x151, height - 0xbf);
            this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x151, height - 0xbf));
            this.wallInfoImage.addControl(this.wallScrollArea);
            int max = this.wallScrollBar.Value;

            this.wallScrollBar.Visible  = false;
            this.wallScrollBar.Position = new Point(0x166, 15);
            this.wallScrollBar.Size     = new Size(0x18, height - 0xbf);
            this.wallInfoImage.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.updateWallArea();
                if ((max > 0) && this.wallScrollBar.Visible)
                {
                    if (max >= this.wallScrollBar.Max)
                    {
                        max = this.wallScrollBar.Max;
                    }
                    this.wallScrollBar.Value = max;
                    this.wallScrollBarMoved();
                }
                int id = 0;
                foreach (CustomSelfDrawPanel.ParishChatPanel panel4 in this.chatAreas)
                {
                    panel4.Size = new Size(0x216, height - 0x99);
                    this.areaWindow.addControl(panel4);
                    panel4.reset(this, id);
                    if (GameEngine.Instance.Village != null)
                    {
                        panel4.importText(GameEngine.Instance.World.getParishChat(parishID, id, GameEngine.Instance.Village.m_ownedDate).ToArray(), false, -1L);
                    }
                    panel4.scrollToBottom();
                    panel4.Visible = false;
                    id++;
                }
                this.tabEntered(this.lastTab);
                goto Label_1127;
            }
            this.focusPanel.Focus();
            this.initialTextInTextbox = true;
            this.textBox1.Text        = SK.Text("ParishWallPanel_Enter_Text_Here", "Enter Text Here");
            StoredParishInfo info = (StoredParishInfo)this.parishList[parishID];
            bool             flag = false;

            if (info != null)
            {
                TimeSpan span = (TimeSpan)(DateTime.Now - info.m_lastUpdateTime);
                if ((span.TotalMinutes <= 1.0) && (info.lastReturnData != null))
                {
                    goto Label_0D51;
                }
            }
            flag = true;
Label_0D51:
            if (this.chatAreas == null)
            {
                this.chatAreas = new CustomSelfDrawPanel.ParishChatPanel[6];
                for (int i = 0; i < 6; i++)
                {
                    this.chatAreas[i] = new CustomSelfDrawPanel.ParishChatPanel {
                        Position = new Point(20, 0x44), Size = new Size(0x216, height - 0x99)
                    };
                }
            }
            if ((this.currentParish != parishID) || this.forceNextUpdate)
            {
                this.forceNextUpdate     = false;
                this.currentLeaderID     = -1;
                this.electedLeaderID     = -1;
                this.currentLeaderName   = "";
                this.electedLeaderName   = "";
                m_userIDOnCurrent        = -1;
                this.checkTextUpdateTime = 5;
                int num6 = 0;
                foreach (CustomSelfDrawPanel.ParishChatPanel panel2 in this.chatAreas)
                {
                    this.areaWindow.addControl(panel2);
                    panel2.Visible = false;
                    panel2.reset(this, num6);
                    if (GameEngine.Instance.Village != null)
                    {
                        panel2.importText(GameEngine.Instance.World.getParishChat(parishID, num6, GameEngine.Instance.Village.m_ownedDate).ToArray(), false, -1L);
                    }
                    panel2.scrollToBottom();
                    panel2.Visible = false;
                    num6++;
                }
                long[] readIDs   = new long[] { -1L, -1L, -1L, -1L, -1L, -1L };
                int[]  numArray2 = GameEngine.Instance.World.setReadIDs(parishID, readIDs);
                if (numArray2 != null)
                {
                    for (int j = 0; j < 6; j++)
                    {
                        this.chatAreas[j].setUnreads(numArray2[j]);
                    }
                }
                this.currentParish = parishID;
                this.tabEntered(0);
            }
            else
            {
                foreach (CustomSelfDrawPanel.ParishChatPanel panel3 in this.chatAreas)
                {
                    panel3.Repopulate = true;
                    panel3.Size       = new Size(0x216, height - 0x99);
                    this.areaWindow.addControl(panel3);
                    panel3.Visible = false;
                }
                this.currentParish = parishID;
                this.tabEntered(this.lastTab);
            }
            this.currentParish = parishID;
            if (GameEngine.Instance.Village != null)
            {
                if (flag)
                {
                    RemoteServices.Instance.set_GetParishFrontPageInfo_UserCallBack(new RemoteServices.GetParishFrontPageInfo_UserCallBack(this.getParishFrontPageCallback));
                    RemoteServices.Instance.GetParishFrontPageInfo(this.m_currentVillage, DateTime.MinValue);
                    Thread.Sleep(500);
                }
                else
                {
                    DateTime lastUpdateTime = info.m_lastUpdateTime;
                    this.getParishFrontPageCallback(info.lastReturnData);
                    info.m_lastUpdateTime = lastUpdateTime;
                }
                this.inSend = true;
                RemoteServices.Instance.set_Chat_ReceiveParishText_UserCallBack(new RemoteServices.Chat_ReceiveParishText_UserCallBack(this.chat_ReceiveParishTextCallback));
                RemoteServices.Instance.Chat_ReceiveParishText(this.currentParish, GameEngine.Instance.World.getParishChatNewestPostTime(this.currentParish, GameEngine.Instance.Village.m_ownedDate));
            }
            else
            {
                this.forceNextUpdate = true;
            }
Label_1127:
            this.updateLeaderInfo();
        }
 public void init(bool resized)
 {
     int villageID = InterfaceMgr.Instance.getSelectedMenuVillage();
     this.m_currentVillage = villageID;
     int parishID = GameEngine.Instance.World.getParishFromVillageID(villageID);
     int height = base.Height;
     instance = this;
     base.clearControls();
     this.headerImage.Size = new Size(base.Width, 40);
     this.headerImage.Position = new Point(0, 0);
     base.addControl(this.headerImage);
     this.headerImage.Create((Image) GFXLibrary.mail2_titlebar_left, (Image) GFXLibrary.mail2_titlebar_middle, (Image) GFXLibrary.mail2_titlebar_right);
     CustomSelfDrawPanel.WikiLinkControl.init(this.headerImage, 14, new Point(base.Width - 0x2c, 3));
     this.backgroundImage.Size = new Size(base.Width, height - 40);
     this.backgroundImage.Position = new Point(0, 40);
     base.addControl(this.backgroundImage);
     this.backgroundImage.Create((Image) GFXLibrary.mail2_mail_panel_upper_left, (Image) GFXLibrary.mail2_mail_panel_upper_middle, (Image) GFXLibrary.mail2_mail_panel_upper_right, (Image) GFXLibrary.mail2_mail_panel_middle_left, (Image) GFXLibrary.mail2_mail_panel_middle_middle, (Image) GFXLibrary.mail2_mail_panel_middle_right, (Image) GFXLibrary.mail2_mail_panel_lower_left, (Image) GFXLibrary.mail2_mail_panel_lower_middle, (Image) GFXLibrary.mail2_mail_panel_lower_right);
     this.parishNameLabel.Text = GameEngine.Instance.World.getParishName(parishID);
     this.parishNameLabel.Color = ARGBColors.White;
     this.parishNameLabel.DropShadowColor = ARGBColors.Black;
     this.parishNameLabel.Position = new Point(20, 0);
     this.parishNameLabel.Size = new Size(base.Width - 40, 40);
     this.parishNameLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
     this.parishNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.headerImage.addControl(this.parishNameLabel);
     this.illustrationImage.Image = (Image) GFXLibrary.parishwall_village_illlustration_01;
     this.illustrationImage.Position = new Point(0x11, 5);
     this.backgroundImage.addControl(this.illustrationImage);
     this.stewardLabel.Text = SK.Text("ParishWallPanel_Steward", "Steward") + " : ";
     this.stewardLabel.Color = ARGBColors.Black;
     this.stewardLabel.Position = new Point(5, 5);
     this.stewardLabel.Size = new Size(this.illustrationImage.Width - 6, 30);
     this.stewardLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.stewardLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.illustrationImage.addControl(this.stewardLabel);
     this.wallInfoImage.Size = new Size(0x18c, height - 170);
     this.wallInfoImage.Position = new Point(8, 0x77);
     this.backgroundImage.addControl(this.wallInfoImage);
     this.wallInfoImage.Create((Image) GFXLibrary.mail2_rounded_rectangle_tan_upper_left, (Image) GFXLibrary.mail2_rounded_rectangle_tan_upper_middle, (Image) GFXLibrary.mail2_rounded_rectangle_tan_upper_right, (Image) GFXLibrary.mail2_rounded_rectangle_tan_middle_left, (Image) GFXLibrary.mail2_rounded_rectangle_tan_middle_middle, (Image) GFXLibrary.mail2_rounded_rectangle_tan_middle_right, (Image) GFXLibrary.mail2_rounded_rectangle_tan_bottom_left, (Image) GFXLibrary.mail2_rounded_rectangle_tan_bottom_middle, (Image) GFXLibrary.mail2_rounded_rectangle_tan_bottom_right);
     this.areaWindow.Size = new Size(0x234, height - 0x4e);
     this.areaWindow.Position = new Point(0x19b, 0x1a);
     this.backgroundImage.addControl(this.areaWindow);
     this.areaWindow.Create((Image) GFXLibrary.parishwall_village_center_tab_outline_top_left, (Image) GFXLibrary.parishwall_village_center_tab_outline_top_middle, (Image) GFXLibrary.parishwall_village_center_tab_outline_top_right, (Image) GFXLibrary.parishwall_village_center_tab_outline_middle_left, null, (Image) GFXLibrary.parishwall_village_center_tab_outline_middle_right, (Image) GFXLibrary.parishwall_village_center_tab_outline_bottom_left, (Image) GFXLibrary.parishwall_village_center_tab_outline_bottom_middle, (Image) GFXLibrary.parishwall_village_center_tab_outline_bottom_right);
     this.tab1Button.UseTextSize = true;
     this.tab1Button.ImageNorm = (Image) GFXLibrary.parishwall_village_center_tab_up;
     this.tab1Button.ImageOver = (Image) GFXLibrary.parishwall_village_center_tab_up;
     this.tab1Button.Position = new Point(0x1a9, 6);
     this.tab1Button.Text.Text = SK.Text("ParishWallPanel_General", "General");
     this.tab1Button.Text.Size = new Size(this.tab1Button.Size.Width, this.tab1Button.Text.Size.Height + 20);
     this.tab1Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.tab1Button.TextYOffset = 3;
     this.tab1Button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.tab1Button.Text.Color = ARGBColors.Black;
     this.tab1Button.Data = 0;
     this.tab1Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
     this.backgroundImage.addControl(this.tab1Button);
     this.tab2Button.UseTextSize = true;
     this.tab2Button.ImageNorm = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab2Button.ImageOver = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab2Button.Position = new Point(510, 6);
     this.tab2Button.Text.Text = SK.Text("ParishWallPanel_War", "War");
     this.tab2Button.Text.Size = new Size(this.tab2Button.Size.Width, this.tab2Button.Text.Size.Height + 20);
     this.tab2Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.tab2Button.TextYOffset = 3;
     this.tab2Button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.tab2Button.Text.Color = ARGBColors.Black;
     this.tab2Button.Data = 1;
     this.tab2Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
     this.backgroundImage.addControl(this.tab2Button);
     this.tab3Button.UseTextSize = true;
     this.tab3Button.ImageNorm = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab3Button.ImageOver = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab3Button.Position = new Point(0x253, 6);
     this.tab3Button.Text.Text = SK.Text("ParishWallPanel_inn", "Inn");
     this.tab3Button.Text.Size = new Size(this.tab3Button.Size.Width, this.tab3Button.Text.Size.Height + 20);
     this.tab3Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.tab3Button.TextYOffset = 3;
     this.tab3Button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.tab3Button.Text.Color = ARGBColors.Black;
     this.tab3Button.Data = 2;
     this.tab3Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
     this.backgroundImage.addControl(this.tab3Button);
     this.tab4Button.UseTextSize = true;
     this.tab4Button.ImageNorm = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab4Button.ImageOver = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab4Button.Position = new Point(680, 6);
     this.tab4Button.Text.Text = SK.Text("ParishWallPanel_Steward", "Steward");
     this.tab4Button.Text.Size = new Size(this.tab4Button.Size.Width, this.tab4Button.Text.Size.Height + 20);
     this.tab4Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.tab4Button.TextYOffset = 3;
     this.tab4Button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.tab4Button.Text.Color = ARGBColors.Black;
     this.tab4Button.Data = 3;
     this.tab4Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
     this.backgroundImage.addControl(this.tab4Button);
     this.tab5Button.UseTextSize = true;
     this.tab5Button.ImageNorm = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab5Button.ImageOver = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab5Button.Position = new Point(0x2fd, 6);
     this.tab5Button.Text.Text = SK.Text("ParishWallPanel_Free", "Free");
     this.tab5Button.Text.Size = new Size(this.tab5Button.Size.Width, this.tab5Button.Text.Size.Height + 20);
     this.tab5Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.tab5Button.TextYOffset = 3;
     this.tab5Button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.tab5Button.Text.Color = ARGBColors.Black;
     this.tab5Button.Data = 4;
     this.tab5Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
     this.backgroundImage.addControl(this.tab5Button);
     this.tab6Button.UseTextSize = true;
     this.tab6Button.ImageNorm = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab6Button.ImageOver = (Image) GFXLibrary.parishwall_village_center_tab_down;
     this.tab6Button.Position = new Point(850, 6);
     this.tab6Button.Text.Text = SK.Text("ParishWallPanel_Free", "Free");
     this.tab6Button.Text.Size = new Size(this.tab6Button.Size.Width, this.tab6Button.Text.Size.Height + 20);
     this.tab6Button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.tab6Button.TextYOffset = 3;
     this.tab6Button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.tab6Button.Text.Color = ARGBColors.Black;
     this.tab6Button.Data = 5;
     this.tab6Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tabClick), "ParishWallPanel_tab");
     this.backgroundImage.addControl(this.tab6Button);
     this.textInputImage.Image = (Image) GFXLibrary.parishwall_what_say_thou_box;
     this.textInputImage.Position = new Point(0x1b0, 0x2f);
     this.backgroundImage.addControl(this.textInputImage);
     this.wallScrollArea.Position = new Point(15, 15);
     this.wallScrollArea.Size = new Size(0x151, height - 0xbf);
     this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x151, height - 0xbf));
     this.wallInfoImage.addControl(this.wallScrollArea);
     int max = this.wallScrollBar.Value;
     this.wallScrollBar.Visible = false;
     this.wallScrollBar.Position = new Point(0x166, 15);
     this.wallScrollBar.Size = new Size(0x18, height - 0xbf);
     this.wallInfoImage.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.updateWallArea();
         if ((max > 0) && this.wallScrollBar.Visible)
         {
             if (max >= this.wallScrollBar.Max)
             {
                 max = this.wallScrollBar.Max;
             }
             this.wallScrollBar.Value = max;
             this.wallScrollBarMoved();
         }
         int id = 0;
         foreach (CustomSelfDrawPanel.ParishChatPanel panel4 in this.chatAreas)
         {
             panel4.Size = new Size(0x216, height - 0x99);
             this.areaWindow.addControl(panel4);
             panel4.reset(this, id);
             if (GameEngine.Instance.Village != null)
             {
                 panel4.importText(GameEngine.Instance.World.getParishChat(parishID, id, GameEngine.Instance.Village.m_ownedDate).ToArray(), false, -1L);
             }
             panel4.scrollToBottom();
             panel4.Visible = false;
             id++;
         }
         this.tabEntered(this.lastTab);
         goto Label_1127;
     }
     this.focusPanel.Focus();
     this.initialTextInTextbox = true;
     this.textBox1.Text = SK.Text("ParishWallPanel_Enter_Text_Here", "Enter Text Here");
     StoredParishInfo info = (StoredParishInfo) this.parishList[parishID];
     bool flag = false;
     if (info != null)
     {
         TimeSpan span = (TimeSpan) (DateTime.Now - info.m_lastUpdateTime);
         if ((span.TotalMinutes <= 1.0) && (info.lastReturnData != null))
         {
             goto Label_0D51;
         }
     }
     flag = true;
     Label_0D51:
     if (this.chatAreas == null)
     {
         this.chatAreas = new CustomSelfDrawPanel.ParishChatPanel[6];
         for (int i = 0; i < 6; i++)
         {
             this.chatAreas[i] = new CustomSelfDrawPanel.ParishChatPanel { Position = new Point(20, 0x44), Size = new Size(0x216, height - 0x99) };
         }
     }
     if ((this.currentParish != parishID) || this.forceNextUpdate)
     {
         this.forceNextUpdate = false;
         this.currentLeaderID = -1;
         this.electedLeaderID = -1;
         this.currentLeaderName = "";
         this.electedLeaderName = "";
         m_userIDOnCurrent = -1;
         this.checkTextUpdateTime = 5;
         int num6 = 0;
         foreach (CustomSelfDrawPanel.ParishChatPanel panel2 in this.chatAreas)
         {
             this.areaWindow.addControl(panel2);
             panel2.Visible = false;
             panel2.reset(this, num6);
             if (GameEngine.Instance.Village != null)
             {
                 panel2.importText(GameEngine.Instance.World.getParishChat(parishID, num6, GameEngine.Instance.Village.m_ownedDate).ToArray(), false, -1L);
             }
             panel2.scrollToBottom();
             panel2.Visible = false;
             num6++;
         }
         long[] readIDs = new long[] { -1L, -1L, -1L, -1L, -1L, -1L };
         int[] numArray2 = GameEngine.Instance.World.setReadIDs(parishID, readIDs);
         if (numArray2 != null)
         {
             for (int j = 0; j < 6; j++)
             {
                 this.chatAreas[j].setUnreads(numArray2[j]);
             }
         }
         this.currentParish = parishID;
         this.tabEntered(0);
     }
     else
     {
         foreach (CustomSelfDrawPanel.ParishChatPanel panel3 in this.chatAreas)
         {
             panel3.Repopulate = true;
             panel3.Size = new Size(0x216, height - 0x99);
             this.areaWindow.addControl(panel3);
             panel3.Visible = false;
         }
         this.currentParish = parishID;
         this.tabEntered(this.lastTab);
     }
     this.currentParish = parishID;
     if (GameEngine.Instance.Village != null)
     {
         if (flag)
         {
             RemoteServices.Instance.set_GetParishFrontPageInfo_UserCallBack(new RemoteServices.GetParishFrontPageInfo_UserCallBack(this.getParishFrontPageCallback));
             RemoteServices.Instance.GetParishFrontPageInfo(this.m_currentVillage, DateTime.MinValue);
             Thread.Sleep(500);
         }
         else
         {
             DateTime lastUpdateTime = info.m_lastUpdateTime;
             this.getParishFrontPageCallback(info.lastReturnData);
             info.m_lastUpdateTime = lastUpdateTime;
         }
         this.inSend = true;
         RemoteServices.Instance.set_Chat_ReceiveParishText_UserCallBack(new RemoteServices.Chat_ReceiveParishText_UserCallBack(this.chat_ReceiveParishTextCallback));
         RemoteServices.Instance.Chat_ReceiveParishText(this.currentParish, GameEngine.Instance.World.getParishChatNewestPostTime(this.currentParish, GameEngine.Instance.Village.m_ownedDate));
     }
     else
     {
         this.forceNextUpdate = true;
     }
     Label_1127:
     this.updateLeaderInfo();
 }