public void init()
 {
     int height = base.Height;
     instance = this;
     base.clearControls();
     int villageID = InterfaceMgr.Instance.getSelectedMenuVillage();
     int countryID = GameEngine.Instance.World.getCountryFromVillageID(villageID);
     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 = SK.Text("GENERIC_Country", "Country") + " : " + GameEngine.Instance.World.getCountryName(countryID) + " (" + GameEngine.Instance.World.getVillageName(villageID) + ")";
     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.windowImage.Size = new Size(400, 150);
     this.windowImage.Position = new Point(0x1ed, 130);
     this.backgroundImage.addControl(this.windowImage);
     this.windowImage.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.sheriffLabel.Text = SK.Text("CountryFrontPagePanel_Current_King", "Current King");
     this.sheriffLabel.Position = new Point(30, 0x1a);
     this.sheriffLabel.Size = new Size(250, 40);
     this.sheriffLabel.Color = ARGBColors.Black;
     this.sheriffLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.sheriffLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.windowImage.addControl(this.sheriffLabel);
     this.goldLabel.Text = SK.Text("GENERIC_Current_Gold", "Current Gold");
     this.goldLabel.Position = new Point(30, 0x42);
     this.goldLabel.Size = new Size(250, 40);
     this.goldLabel.Color = ARGBColors.Black;
     this.goldLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.goldLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.windowImage.addControl(this.goldLabel);
     this.taxLabel.Text = SK.Text("GENERIC_Tax_Rate", "Tax Rate");
     this.taxLabel.Position = new Point(30, 0x6a);
     this.taxLabel.Size = new Size(250, 40);
     this.taxLabel.Color = ARGBColors.Black;
     this.taxLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.taxLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.windowImage.addControl(this.taxLabel);
     this.sheriffName.Text = "";
     this.sheriffName.Position = new Point(170, 0x1a);
     this.sheriffName.Size = new Size(200, 40);
     this.sheriffName.Color = ARGBColors.Black;
     this.sheriffName.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.sheriffName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.windowImage.addControl(this.sheriffName);
     this.goldValue.Text = "";
     this.goldValue.Position = new Point(170, 0x42);
     this.goldValue.Size = new Size(200, 40);
     this.goldValue.Color = ARGBColors.Black;
     this.goldValue.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.goldValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.windowImage.addControl(this.goldValue);
     this.taxValue.Text = "";
     this.taxValue.Position = new Point(170, 0x6a);
     this.taxValue.Size = new Size(200, 40);
     this.taxValue.Color = ARGBColors.Black;
     this.taxValue.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.taxValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.windowImage.addControl(this.taxValue);
     this.activityLabel.Text = SK.Text("WALL_recent_activity", "Recent Activity");
     this.activityLabel.Position = new Point(8, -16);
     this.activityLabel.Size = new Size(0x184, 40);
     this.activityLabel.Color = ARGBColors.Black;
     this.activityLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.activityLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
     this.backgroundImage.addControl(this.activityLabel);
     this.wallInfoImage.Size = new Size(0x18c, height - 80);
     this.wallInfoImage.Position = new Point(8, 0x1d);
     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(15, 15);
     this.wallScrollArea.Size = new Size(0x151, height - 0x65);
     this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x151, height - 0x65));
     this.wallInfoImage.addControl(this.wallScrollArea);
     int num1 = this.wallScrollBar.Value;
     this.wallScrollBar.Visible = false;
     this.wallScrollBar.Position = new Point(0x166, 15);
     this.wallScrollBar.Size = new Size(0x18, height - 0x65);
     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));
     StoredCountryInfo info = (StoredCountryInfo) this.countryList[countryID];
     bool flag = false;
     if (info != null)
     {
         TimeSpan span = (TimeSpan) (DateTime.Now - info.m_lastUpdateTime);
         if ((span.TotalMinutes <= 2.0) && (info.lastReturnData != null))
         {
             goto Label_08B9;
         }
     }
     flag = true;
     Label_08B9:
     this.m_currentVillage = villageID;
     if (this.currentCountry != countryID)
     {
         this.currentLeaderID = -1;
         this.currentLeaderName = "";
         this.m_userIDOnCurrent = -1;
     }
     this.currentCountry = countryID;
     if (flag)
     {
         RemoteServices.Instance.set_GetCountryFrontPageInfo_UserCallBack(new RemoteServices.GetCountryFrontPageInfo_UserCallBack(this.getCountryFrontPageInfoCallback));
         RemoteServices.Instance.GetCountryFrontPageInfo(this.m_currentVillage);
     }
     this.updateLeaderInfo();
     if (!flag)
     {
         this.getCountryFrontPageInfoCallback(info.lastReturnData);
     }
     this.btnChat.ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal;
     this.btnChat.ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over;
     this.btnChat.ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed;
     this.btnChat.Position = new Point(base.Width - 230, base.Height - 90);
     this.btnChat.Text.Text = SK.Text("GENERIC_Chat", "Chat");
     this.btnChat.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.btnChat.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.btnChat.TextYOffset = -3;
     this.btnChat.Text.Color = ARGBColors.Black;
     this.btnChat.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.chatClick), "CountryFrontPagePanel2_chat");
     this.backgroundImage.addControl(this.btnChat);
 }
Пример #2
0
        public void init()
        {
            int height = base.Height;

            instance = this;
            base.clearControls();
            int villageID = InterfaceMgr.Instance.getSelectedMenuVillage();
            int countryID = GameEngine.Instance.World.getCountryFromVillageID(villageID);

            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            = SK.Text("GENERIC_Country", "Country") + " : " + GameEngine.Instance.World.getCountryName(countryID) + " (" + GameEngine.Instance.World.getVillageName(villageID) + ")";
            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.windowImage.Size     = new Size(400, 150);
            this.windowImage.Position = new Point(0x1ed, 130);
            this.backgroundImage.addControl(this.windowImage);
            this.windowImage.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.sheriffLabel.Text      = SK.Text("CountryFrontPagePanel_Current_King", "Current King");
            this.sheriffLabel.Position  = new Point(30, 0x1a);
            this.sheriffLabel.Size      = new Size(250, 40);
            this.sheriffLabel.Color     = ARGBColors.Black;
            this.sheriffLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
            this.sheriffLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.windowImage.addControl(this.sheriffLabel);
            this.goldLabel.Text      = SK.Text("GENERIC_Current_Gold", "Current Gold");
            this.goldLabel.Position  = new Point(30, 0x42);
            this.goldLabel.Size      = new Size(250, 40);
            this.goldLabel.Color     = ARGBColors.Black;
            this.goldLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
            this.goldLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.windowImage.addControl(this.goldLabel);
            this.taxLabel.Text      = SK.Text("GENERIC_Tax_Rate", "Tax Rate");
            this.taxLabel.Position  = new Point(30, 0x6a);
            this.taxLabel.Size      = new Size(250, 40);
            this.taxLabel.Color     = ARGBColors.Black;
            this.taxLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
            this.taxLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.windowImage.addControl(this.taxLabel);
            this.sheriffName.Text      = "";
            this.sheriffName.Position  = new Point(170, 0x1a);
            this.sheriffName.Size      = new Size(200, 40);
            this.sheriffName.Color     = ARGBColors.Black;
            this.sheriffName.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.sheriffName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            this.windowImage.addControl(this.sheriffName);
            this.goldValue.Text      = "";
            this.goldValue.Position  = new Point(170, 0x42);
            this.goldValue.Size      = new Size(200, 40);
            this.goldValue.Color     = ARGBColors.Black;
            this.goldValue.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.goldValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            this.windowImage.addControl(this.goldValue);
            this.taxValue.Text      = "";
            this.taxValue.Position  = new Point(170, 0x6a);
            this.taxValue.Size      = new Size(200, 40);
            this.taxValue.Color     = ARGBColors.Black;
            this.taxValue.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.taxValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            this.windowImage.addControl(this.taxValue);
            this.activityLabel.Text      = SK.Text("WALL_recent_activity", "Recent Activity");
            this.activityLabel.Position  = new Point(8, -16);
            this.activityLabel.Size      = new Size(0x184, 40);
            this.activityLabel.Color     = ARGBColors.Black;
            this.activityLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.activityLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
            this.backgroundImage.addControl(this.activityLabel);
            this.wallInfoImage.Size     = new Size(0x18c, height - 80);
            this.wallInfoImage.Position = new Point(8, 0x1d);
            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(15, 15);
            this.wallScrollArea.Size     = new Size(0x151, height - 0x65);
            this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x151, height - 0x65));
            this.wallInfoImage.addControl(this.wallScrollArea);
            int num1 = this.wallScrollBar.Value;

            this.wallScrollBar.Visible  = false;
            this.wallScrollBar.Position = new Point(0x166, 15);
            this.wallScrollBar.Size     = new Size(0x18, height - 0x65);
            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));
            StoredCountryInfo info = (StoredCountryInfo)this.countryList[countryID];
            bool flag = false;

            if (info != null)
            {
                TimeSpan span = (TimeSpan)(DateTime.Now - info.m_lastUpdateTime);
                if ((span.TotalMinutes <= 2.0) && (info.lastReturnData != null))
                {
                    goto Label_08B9;
                }
            }
            flag = true;
Label_08B9:
            this.m_currentVillage = villageID;
            if (this.currentCountry != countryID)
            {
                this.currentLeaderID   = -1;
                this.currentLeaderName = "";
                this.m_userIDOnCurrent = -1;
            }
            this.currentCountry = countryID;
            if (flag)
            {
                RemoteServices.Instance.set_GetCountryFrontPageInfo_UserCallBack(new RemoteServices.GetCountryFrontPageInfo_UserCallBack(this.getCountryFrontPageInfoCallback));
                RemoteServices.Instance.GetCountryFrontPageInfo(this.m_currentVillage);
            }
            this.updateLeaderInfo();
            if (!flag)
            {
                this.getCountryFrontPageInfoCallback(info.lastReturnData);
            }
            this.btnChat.ImageNorm      = (Image)GFXLibrary.misc_button_blue_210wide_normal;
            this.btnChat.ImageOver      = (Image)GFXLibrary.misc_button_blue_210wide_over;
            this.btnChat.ImageClick     = (Image)GFXLibrary.misc_button_blue_210wide_pushed;
            this.btnChat.Position       = new Point(base.Width - 230, base.Height - 90);
            this.btnChat.Text.Text      = SK.Text("GENERIC_Chat", "Chat");
            this.btnChat.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
            this.btnChat.Text.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.btnChat.TextYOffset    = -3;
            this.btnChat.Text.Color     = ARGBColors.Black;
            this.btnChat.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.chatClick), "CountryFrontPagePanel2_chat");
            this.backgroundImage.addControl(this.btnChat);
        }