コード例 #1
0
            public void init(string playerName, int userID, int rank, int points, bool votingAllowed, int numSpareVotes, int numReceivedVotes, int factionID, int yourVotes, int position, ParishVotePanel parent)
            {
                this.m_parent    = parent;
                this.m_position  = position;
                this.m_userID    = userID;
                this.m_factionID = factionID;
                this.clearControls();
                if ((position & 1) == 0)
                {
                    this.backgroundImage.Image = (Image)GFXLibrary.lineitem_strip_02_light;
                }
                else
                {
                    this.backgroundImage.Image = (Image)GFXLibrary.lineitem_strip_02_dark;
                }
                this.backgroundImage.Position = new Point(0, 0);
                base.addControl(this.backgroundImage);
                this.Size = this.backgroundImage.Size;
                this.voteButton.ImageNorm  = (Image)GFXLibrary.parishwall_button_vote_checked_normal;
                this.voteButton.ImageOver  = (Image)GFXLibrary.parishwall_button_vote_checked_over;
                this.voteButton.Position   = new Point(8, 4);
                this.voteButton.Text.Text  = SK.Text("GENERIC_Vote", "Vote");
                this.voteButton.Text.Color = ARGBColors.Black;
                this.voteButton.Text.Font  = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.voteButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked), "ParishVotePanel_vote");
                this.backgroundImage.addControl(this.voteButton);
                if (yourVotes > 0)
                {
                    this.voteButton.Enabled = true;
                }
                else
                {
                    this.voteButton.Enabled = false;
                }
                NumberFormatInfo nFI = GameEngine.NFI;
                int num = 0;

                if (factionID < 0)
                {
                    this.factionName.Text = "";
                }
                else
                {
                    FactionData data = GameEngine.Instance.World.getFaction(factionID);
                    if (data == null)
                    {
                        this.factionName.Text = "";
                    }
                    else
                    {
                        this.factionName.Text = data.factionNameAbrv;
                        int houseID = data.houseID;
                        if (houseID > 0)
                        {
                            this.houseImage.Image = (Image)GFXLibrary.house_flag_001_small;
                            switch (houseID)
                            {
                            case 1:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_001_small;
                                break;

                            case 2:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_002_small;
                                break;

                            case 3:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_003_small;
                                break;

                            case 4:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_004_small;
                                break;

                            case 5:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_005_small;
                                break;

                            case 6:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_006_small;
                                break;

                            case 7:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_007_small;
                                break;

                            case 8:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_008_small;
                                break;

                            case 9:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_009_small;
                                break;

                            case 10:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_010_small;
                                break;

                            case 11:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_011_small;
                                break;

                            case 12:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_012_small;
                                break;

                            case 13:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_013_small;
                                break;

                            case 14:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_014_small;
                                break;

                            case 15:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_015_small;
                                break;

                            case 0x10:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_016_small;
                                break;

                            case 0x11:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_017_small;
                                break;

                            case 0x12:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_018_small;
                                break;

                            case 0x13:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_019_small;
                                break;

                            case 20:
                                this.houseImage.Image = (Image)GFXLibrary.house_flag_020_small;
                                break;
                            }
                            this.houseImage.Position = new Point(0x179, 5);
                            this.houseImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick));
                            this.backgroundImage.addControl(this.houseImage);
                            num = 0x20;
                        }
                    }
                }
                this.factionName.Color     = ARGBColors.Black;
                this.factionName.Position  = new Point(0x179 + num, 0);
                this.factionName.Size      = new Size(210, this.backgroundImage.Height);
                this.factionName.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.factionName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
                if (factionID >= 0)
                {
                    this.factionName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick));
                }
                this.backgroundImage.addControl(this.factionName);
                this.personName.Text      = playerName;
                this.personName.Color     = ARGBColors.Black;
                this.personName.Position  = new Point(0x88, 0);
                this.personName.Size      = new Size(0xe1, this.backgroundImage.Height);
                this.personName.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.personName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
                this.personName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.playerClick), "ParishVotePanel_user");
                this.backgroundImage.addControl(this.personName);
                this.votesLabel.Text      = numReceivedVotes.ToString("N", nFI);
                this.votesLabel.Color     = ARGBColors.Black;
                this.votesLabel.Position  = new Point(0x27b, 0);
                this.votesLabel.Size      = new Size(150, this.backgroundImage.Height);
                this.votesLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.votesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
                this.backgroundImage.addControl(this.votesLabel);
                this.shieldImage.Image = GameEngine.Instance.World.getWorldShield(userID, 0x19, 0x1c);
                if (this.shieldImage.Image != null)
                {
                    this.shieldImage.Position = new Point(0x6a, 1);
                    this.shieldImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.playerClick));
                    this.backgroundImage.addControl(this.shieldImage);
                }
                base.invalidate();
            }
コード例 #2
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);
            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);
            }
        }