Exemple #1
0
 public void getParishFrontPageCallback(GetParishFrontPageInfo_ReturnType returnData)
 {
     if (returnData.Success)
     {
         StoredParishInfo info = (StoredParishInfo)this.parishList[returnData.parishID];
         if (info == null)
         {
             info = new StoredParishInfo();
             this.parishList[returnData.parishID] = info;
         }
         info.m_lastUpdateTime = DateTime.Now;
         info.lastReturnData   = returnData;
         if (this.currentParish == returnData.parishID)
         {
             m_userIDOnCurrent      = -1;
             this.electedLeaderID   = returnData.leaderID;
             this.electedLeaderName = returnData.leaderName;
             this.currentLeaderID   = returnData.leaderID;
             this.currentLeaderName = returnData.leaderName;
             if (this.currentLeaderID == RemoteServices.Instance.UserID)
             {
                 foreach (CustomSelfDrawPanel.ParishChatPanel panel in this.chatAreas)
                 {
                     panel.setAsSteward();
                 }
             }
             this.createParishWall(returnData.parishWallInfo);
         }
     }
     this.updateLeaderInfo();
 }
        private void sendProclamation()
        {
            StoredParishInfo info = (StoredParishInfo)this.parishList[this.currentParish];

            if (info != null)
            {
                info.m_lastUpdateTime = DateTime.MinValue;
            }
            GameEngine.Instance.playInterfaceSound("UserInfoScreen_send_mail");
            InterfaceMgr.Instance.getMainTabBar().selectDummyTabFast(0x15);
            InterfaceMgr.Instance.sendProclamation(4, GameEngine.Instance.World.getParishFromVillageID(this.m_currentVillage));
        }
 public void getParishMembersListCallback(GetParishMembersList_ReturnType returnData)
 {
     if (returnData.Success)
     {
         StoredParishInfo info = (StoredParishInfo)this.parishList[returnData.parishID];
         if (info == null)
         {
             info = new StoredParishInfo();
             this.parishList[returnData.parishID] = info;
         }
         info.m_lastUpdateTime = DateTime.Now;
         info.lastReturnData   = returnData;
         if (this.currentParish == returnData.parishID)
         {
             this.votingAllowed = returnData.votingAllowed;
             if (this.parishMembers == null)
             {
                 this.parishMembers = new List <ParishMember>();
             }
             else
             {
                 this.parishMembers.Clear();
             }
             if (returnData.parishMembers != null)
             {
                 this.parishMembers.AddRange(returnData.parishMembers);
             }
             this.lastProclamationTime   = returnData.lastProclamation;
             this.m_userIDOnCurrent      = -1;
             this.electedLeaderID        = returnData.leaderID;
             this.electedLeaderName      = returnData.leaderName;
             this.currentLeaderID        = returnData.leaderID;
             this.currentLeaderName      = returnData.leaderName;
             this.voteCapLabelValue.Text = returnData.voteCap.ToString();
             this.voteCap = returnData.voteCap;
             this.addPlayers();
         }
     }
 }
        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);
            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);
            CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundImage, 15, new Point(base.Width - 0x2c, 3));
            this.headerLabelsImage.Size     = new Size((base.Width - 0x19) - 0x17, 0x1c);
            this.headerLabelsImage.Position = new Point(0x19, 0x81);
            this.backgroundImage.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(0x5f, 0);
            this.headerLabelsImage.addControl(this.divider1Image);
            this.divider2Image.Image    = (Image)GFXLibrary.mail2_field_bar_mail_divider;
            this.divider2Image.Position = new Point(0x16e, 0);
            this.headerLabelsImage.addControl(this.divider2Image);
            this.divider3Image.Image    = (Image)GFXLibrary.mail2_field_bar_mail_divider;
            this.divider3Image.Position = new Point(0x273, 0);
            this.headerLabelsImage.addControl(this.divider3Image);
            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.proclamationButton.ImageNorm      = (Image)GFXLibrary.misc_button_blue_210wide_normal;
            this.proclamationButton.ImageOver      = (Image)GFXLibrary.misc_button_blue_210wide_over;
            this.proclamationButton.ImageClick     = (Image)GFXLibrary.misc_button_blue_210wide_pushed;
            this.proclamationButton.Position       = new Point(base.Width - 220, 7);
            this.proclamationButton.Text.Text      = SK.Text("Capitials_Proclamation", "Send Proclamation");
            this.proclamationButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
            this.proclamationButton.Text.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.proclamationButton.TextYOffset    = -3;
            this.proclamationButton.Text.Color     = ARGBColors.Black;
            this.proclamationButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendProclamation));
            this.proclamationButton.CustomTooltipID = 0x1068;
            this.proclamationButton.Visible         = false;
            this.headerImage.addControl(this.proclamationButton);
            this.proclamationLabel.Text            = "";
            this.proclamationLabel.Color           = ARGBColors.White;
            this.proclamationLabel.DropShadowColor = ARGBColors.Black;
            this.proclamationLabel.Position        = new Point(20, 0);
            this.proclamationLabel.Size            = new Size((base.Width - 40) - 220, 40);
            this.proclamationLabel.Font            = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.proclamationLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT;
            this.proclamationLabel.Visible         = false;
            this.headerImage.addControl(this.proclamationLabel);
            this.wallInfoImage.Size     = new Size(440, 0x55);
            this.wallInfoImage.Position = new Point(460, 20);
            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.wallScrollArea.Position = new Point(0x19, 0x9e);
            this.wallScrollArea.Size     = new Size(0x393, height - 0xd4);
            this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, height - 0xd4));
            this.backgroundImage.addControl(this.wallScrollArea);
            int num1 = this.wallScrollBar.Value;

            this.wallScrollBar.Position = new Point(0x3af, 0x9e);
            this.wallScrollBar.Size     = new Size(0x18, height - 0xd4);
            this.backgroundImage.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.votesAvailableLabel.Text      = SK.Text("GENERIC_Votes_Available", "Votes Available") + " :";
            this.votesAvailableLabel.Color     = ARGBColors.Black;
            this.votesAvailableLabel.Position  = new Point(0x1f, 12);
            this.votesAvailableLabel.Size      = new Size(300, 40);
            this.votesAvailableLabel.Font      = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
            this.votesAvailableLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.wallInfoImage.addControl(this.votesAvailableLabel);
            this.votesAvailableLabelValue.Text      = "0";
            this.votesAvailableLabelValue.Color     = ARGBColors.Black;
            this.votesAvailableLabelValue.Position  = new Point(0x133, 12);
            this.votesAvailableLabelValue.Size      = new Size(100, 40);
            this.votesAvailableLabelValue.Font      = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
            this.votesAvailableLabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            this.votesAvailableLabelValue.Visible   = true;
            this.wallInfoImage.addControl(this.votesAvailableLabelValue);
            this.voteCapLabel.Text      = SK.Text("ParishPanel_Current_Vote_cap", "Current Vote Cap") + " :";
            this.voteCapLabel.Color     = ARGBColors.Black;
            this.voteCapLabel.Position  = new Point(0x1f, 0x2a);
            this.voteCapLabel.Size      = new Size(300, 40);
            this.voteCapLabel.Font      = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
            this.voteCapLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.voteCapLabel.Visible   = true;
            this.wallInfoImage.addControl(this.voteCapLabel);
            this.voteCapLabelValue.Text      = "0";
            this.voteCapLabelValue.Color     = ARGBColors.Black;
            this.voteCapLabelValue.Position  = new Point(0x133, 0x2a);
            this.voteCapLabelValue.Size      = new Size(100, 40);
            this.voteCapLabelValue.Font      = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
            this.voteCapLabelValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            this.voteCapLabelValue.Visible   = true;
            this.wallInfoImage.addControl(this.voteCapLabelValue);
            this.voteLabel.Text      = SK.Text("GENERIC_Vote", "Vote");
            this.voteLabel.Color     = ARGBColors.Black;
            this.voteLabel.Position  = new Point(15, -2);
            this.voteLabel.Size      = new Size(0x51, this.headerLabelsImage.Height);
            this.voteLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.voteLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage.addControl(this.voteLabel);
            this.eligibleLabel.Text      = SK.Text("GENERIC_Eligible_Candidates", "Eligible Candidates");
            this.eligibleLabel.Color     = ARGBColors.Black;
            this.eligibleLabel.Position  = new Point(0x6a, -2);
            this.eligibleLabel.Size      = new Size(250, this.headerLabelsImage.Height);
            this.eligibleLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.eligibleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage.addControl(this.eligibleLabel);
            this.FactionsLabel.Text      = SK.Text("STATS_CATEGORY_TITLE_FACTION", "Faction");
            this.FactionsLabel.Color     = ARGBColors.Black;
            this.FactionsLabel.Position  = new Point(0x178, -2);
            this.FactionsLabel.Size      = new Size(0xf7, this.headerLabelsImage.Height);
            this.FactionsLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.FactionsLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage.addControl(this.FactionsLabel);
            this.votesReceivedLabel.Text      = SK.Text("GENERIC_Votes_Received", "Votes Received");
            this.votesReceivedLabel.Color     = ARGBColors.Black;
            this.votesReceivedLabel.Position  = new Point(0x27b, -2);
            this.votesReceivedLabel.Size      = new Size(300, this.headerLabelsImage.Height);
            this.votesReceivedLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.votesReceivedLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage.addControl(this.votesReceivedLabel);
            if (resized)
            {
                this.addPlayers();
                return;
            }
            StoredParishInfo info = (StoredParishInfo)this.parishList[parishID];
            bool             flag = false;

            if (info != null)
            {
                TimeSpan span = (TimeSpan)(DateTime.Now - info.m_lastUpdateTime);
                if ((span.TotalMinutes <= 2.0) && (info.lastReturnData != null))
                {
                    goto Label_0C6A;
                }
            }
            flag = true;
Label_0C6A:
            this.m_currentVillage = villageID;
            if (this.currentParish != parishID)
            {
                this.parishMembers.Clear();
                this.currentLeaderID   = -1;
                this.electedLeaderID   = -1;
                this.currentLeaderName = "";
                this.electedLeaderName = "";
                this.m_userIDOnCurrent = -1;
            }
            this.currentParish = parishID;
            if (flag)
            {
                this.voteCap = 0x98967f;
                RemoteServices.Instance.set_GetParishMembersList_UserCallBack(new RemoteServices.GetParishMembersList_UserCallBack(this.getParishMembersListCallback));
                RemoteServices.Instance.GetParishMembersList(this.m_currentVillage);
            }
            this.nextElectionTime = DateTime.MinValue;
            this.votingAllowed    = false;
            this.addPlayers();
            if (!flag)
            {
                this.getParishMembersListCallback(info.lastReturnData);
            }
        }
Exemple #5
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 getParishFrontPageCallback(GetParishFrontPageInfo_ReturnType returnData)
 {
     if (returnData.Success)
     {
         StoredParishInfo info = (StoredParishInfo) this.parishList[returnData.parishID];
         if (info == null)
         {
             info = new StoredParishInfo();
             this.parishList[returnData.parishID] = info;
         }
         info.m_lastUpdateTime = DateTime.Now;
         info.lastReturnData = returnData;
         if (this.currentParish == returnData.parishID)
         {
             m_userIDOnCurrent = -1;
             this.electedLeaderID = returnData.leaderID;
             this.electedLeaderName = returnData.leaderName;
             this.currentLeaderID = returnData.leaderID;
             this.currentLeaderName = returnData.leaderName;
             if (this.currentLeaderID == RemoteServices.Instance.UserID)
             {
                 foreach (CustomSelfDrawPanel.ParishChatPanel panel in this.chatAreas)
                 {
                     panel.setAsSteward();
                 }
             }
             this.createParishWall(returnData.parishWallInfo);
         }
     }
     this.updateLeaderInfo();
 }