public void init(string username, int userID, int position, bool ally, UserDiplomacyPanel parent)
 {
     this.m_parent = parent;
     this.m_position = position;
     this.m_userID = userID;
     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(40, 0);
     this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.userClick));
     base.addControl(this.backgroundImage);
     this.Size = this.backgroundImage.Size;
     this.shieldImage.Image = GameEngine.Instance.World.getWorldShield(userID, 0x19, 0x1c);
     if (this.shieldImage.Image != null)
     {
         this.shieldImage.Position = new Point(0, 0);
         this.shieldImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.userClick));
         base.addControl(this.shieldImage);
     }
     this.factionName.Text = username;
     this.factionName.Color = ARGBColors.Black;
     this.factionName.Position = new Point(9, 0);
     this.factionName.Size = new Size(500, this.backgroundImage.Height);
     this.factionName.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.factionName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.factionName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.userClick));
     this.backgroundImage.addControl(this.factionName);
     this.trash.ImageNorm = (Image) GFXLibrary.trashcan_normal;
     this.trash.ImageOver = (Image) GFXLibrary.trashcan_over;
     this.trash.ImageClick = (Image) GFXLibrary.trashcan_clicked;
     this.trash.Position = new Point(830, 4);
     this.trash.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "FactionNewForumPanel_delete_thread");
     this.trash.CustomTooltipID = 0xc1e;
     this.backgroundImage.addControl(this.trash);
     this.playerNotesButton.ImageNormAndOver = (Image) GFXLibrary.faction_pen;
     this.playerNotesButton.Position = new Point(800, 4);
     this.playerNotesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.setNote), "Set_Player_Notes");
     this.playerNotesButton.CustomTooltipID = 0xc1f;
     this.backgroundImage.addControl(this.playerNotesButton);
     this.playerNotes.Text = "";
     this.playerNotes.Color = ARGBColors.Black;
     this.playerNotes.Position = new Point(this.factionName.Position.X + 240, 4);
     this.playerNotes.Size = new Size(500, this.backgroundImage.Height);
     this.playerNotes.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.playerNotes.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.backgroundImage.addControl(this.playerNotes);
     this.divider.Position = new Point(this.playerNotes.Position.X - 5, 5);
     this.divider.Height = this.backgroundImage.Height - 10;
     this.divider.Width = 0;
     this.divider.LineColor = ARGBColors.Black;
     this.backgroundImage.addControl(this.divider);
     for (int i = 0; i < UserDiplomacyPanel.customNotes.Count; i++)
     {
         string[] strArray = UserDiplomacyPanel.customNotes[i].Split(new char[] { '#' });
         if ((strArray[0] == username) && (strArray[1] == GameEngine.Instance.World.GetGlobalWorldID().ToString()))
         {
             this.playerNotes.Text = strArray[2];
             if (strArray.Length > 3)
             {
                 for (int j = 3; j < strArray.Length; j++)
                 {
                     this.playerNotes.Text = this.playerNotes.Text + "#" + strArray[j];
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public void init(string username, int userID, int position, bool ally, UserDiplomacyPanel parent)
 {
     this.m_parent   = parent;
     this.m_position = position;
     this.m_userID   = userID;
     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(40, 0);
     this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.userClick));
     base.addControl(this.backgroundImage);
     this.Size = this.backgroundImage.Size;
     this.shieldImage.Image = GameEngine.Instance.World.getWorldShield(userID, 0x19, 0x1c);
     if (this.shieldImage.Image != null)
     {
         this.shieldImage.Position = new Point(0, 0);
         this.shieldImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.userClick));
         base.addControl(this.shieldImage);
     }
     this.factionName.Text      = username;
     this.factionName.Color     = ARGBColors.Black;
     this.factionName.Position  = new Point(9, 0);
     this.factionName.Size      = new Size(500, this.backgroundImage.Height);
     this.factionName.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.factionName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.factionName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.userClick));
     this.backgroundImage.addControl(this.factionName);
     this.trash.ImageNorm  = (Image)GFXLibrary.trashcan_normal;
     this.trash.ImageOver  = (Image)GFXLibrary.trashcan_over;
     this.trash.ImageClick = (Image)GFXLibrary.trashcan_clicked;
     this.trash.Position   = new Point(830, 4);
     this.trash.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "FactionNewForumPanel_delete_thread");
     this.trash.CustomTooltipID = 0xc1e;
     this.backgroundImage.addControl(this.trash);
     this.playerNotesButton.ImageNormAndOver = (Image)GFXLibrary.faction_pen;
     this.playerNotesButton.Position         = new Point(800, 4);
     this.playerNotesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.setNote), "Set_Player_Notes");
     this.playerNotesButton.CustomTooltipID = 0xc1f;
     this.backgroundImage.addControl(this.playerNotesButton);
     this.playerNotes.Text      = "";
     this.playerNotes.Color     = ARGBColors.Black;
     this.playerNotes.Position  = new Point(this.factionName.Position.X + 240, 4);
     this.playerNotes.Size      = new Size(500, this.backgroundImage.Height);
     this.playerNotes.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.playerNotes.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.backgroundImage.addControl(this.playerNotes);
     this.divider.Position  = new Point(this.playerNotes.Position.X - 5, 5);
     this.divider.Height    = this.backgroundImage.Height - 10;
     this.divider.Width     = 0;
     this.divider.LineColor = ARGBColors.Black;
     this.backgroundImage.addControl(this.divider);
     for (int i = 0; i < UserDiplomacyPanel.customNotes.Count; i++)
     {
         string[] strArray = UserDiplomacyPanel.customNotes[i].Split(new char[] { '#' });
         if ((strArray[0] == username) && (strArray[1] == GameEngine.Instance.World.GetGlobalWorldID().ToString()))
         {
             this.playerNotes.Text = strArray[2];
             if (strArray.Length > 3)
             {
                 for (int j = 3; j < strArray.Length; j++)
                 {
                     this.playerNotes.Text = this.playerNotes.Text + "#" + strArray[j];
                 }
             }
         }
     }
 }
 public void init(bool resized)
 {
     int height = base.Height;
     this.blockYSize = height / 2;
     instance = this;
     base.clearControls();
     this.loadDiplomacyData();
     this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5);
     this.mainBackgroundImage.Position = new Point(0, 0);
     this.mainBackgroundImage.Size = new Size(base.Width, height);
     base.addControl(this.mainBackgroundImage);
     this.backgroundFade.Image = (Image) GFXLibrary.background_top;
     this.backgroundFade.Position = new Point(0, 0);
     this.backgroundFade.Size = new Size(base.Width, this.backgroundFade.Image.Height);
     this.mainBackgroundImage.addControl(this.backgroundFade);
     this.headerLabelsImage.Size = new Size((base.Width - 0x19) - 0x17, 0x1c);
     this.headerLabelsImage.Position = new Point(0x19, 5);
     this.mainBackgroundImage.addControl(this.headerLabelsImage);
     this.headerLabelsImage.Create((Image) GFXLibrary.mail2_field_bar_mail_left, (Image) GFXLibrary.mail2_field_bar_mail_middle, (Image) GFXLibrary.mail2_field_bar_mail_right);
     this.headerLabelsImage2.Size = new Size((base.Width - 0x19) - 0x17, 0x1c);
     this.headerLabelsImage2.Position = new Point(0x19, this.blockYSize + 5);
     this.mainBackgroundImage.addControl(this.headerLabelsImage2);
     this.headerLabelsImage2.Create((Image) GFXLibrary.mail2_field_bar_mail_left, (Image) GFXLibrary.mail2_field_bar_mail_middle, (Image) GFXLibrary.mail2_field_bar_mail_right);
     this.alliesLabel.Text = SK.Text("FactionDiplomacy_Allies", "Allies");
     this.alliesLabel.Color = ARGBColors.Black;
     this.alliesLabel.Position = new Point(9, -2);
     this.alliesLabel.Size = new Size(0x143, this.headerLabelsImage.Height);
     this.alliesLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.alliesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.headerLabelsImage.addControl(this.alliesLabel);
     this.enemiesLabel.Text = SK.Text("FactionDiplomacy_Enemies", "Enemies");
     this.enemiesLabel.Color = ARGBColors.Black;
     this.enemiesLabel.Position = new Point(9, -2);
     this.enemiesLabel.Size = new Size(0x143, this.headerLabelsImage.Height);
     this.enemiesLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.enemiesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.headerLabelsImage2.addControl(this.enemiesLabel);
     InterfaceMgr.Instance.setVillageHeading(SK.Text("AllArmiesPanel_Diplomacy", "Diplomacy"));
     this.alliesScrollArea.Position = new Point(0x19, 40);
     this.alliesScrollArea.Size = new Size(0x393, (this.blockYSize - 40) - 10);
     this.alliesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10));
     this.mainBackgroundImage.addControl(this.alliesScrollArea);
     this.mouseWheelOverlay1.Position = this.alliesScrollArea.Position;
     this.mouseWheelOverlay1.Size = this.alliesScrollArea.Size;
     this.mouseWheelOverlay1.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved1));
     this.mainBackgroundImage.addControl(this.mouseWheelOverlay1);
     int num1 = this.alliesScrollBar.Value;
     this.alliesScrollBar.Position = new Point(0x3a5, 40);
     this.alliesScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10);
     this.mainBackgroundImage.addControl(this.alliesScrollBar);
     this.alliesScrollBar.Value = 0;
     this.alliesScrollBar.Max = 100;
     this.alliesScrollBar.NumVisibleLines = 0x19;
     this.alliesScrollBar.Create(null, null, null, (Image) GFXLibrary._24wide_thumb_top, (Image) GFXLibrary._24wide_thumb_middle, (Image) GFXLibrary._24wide_thumb_bottom);
     this.alliesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved));
     this.enemiesScrollArea.Position = new Point(0x19, (0x23 + this.blockYSize) + 5);
     this.enemiesScrollArea.Size = new Size(0x393, (this.blockYSize - 40) - 10);
     this.enemiesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10));
     this.mainBackgroundImage.addControl(this.enemiesScrollArea);
     this.mouseWheelOverlay2.Position = this.enemiesScrollArea.Position;
     this.mouseWheelOverlay2.Size = this.enemiesScrollArea.Size;
     this.mouseWheelOverlay2.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved2));
     this.mainBackgroundImage.addControl(this.mouseWheelOverlay2);
     int num2 = this.enemiesScrollBar.Value;
     this.enemiesScrollBar.Position = new Point(0x3a5, (0x23 + this.blockYSize) + 5);
     this.enemiesScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10);
     this.mainBackgroundImage.addControl(this.enemiesScrollBar);
     this.enemiesScrollBar.Value = 0;
     this.enemiesScrollBar.Max = 100;
     this.enemiesScrollBar.NumVisibleLines = 0x19;
     this.enemiesScrollBar.Create(null, null, null, (Image) GFXLibrary._24wide_thumb_top, (Image) GFXLibrary._24wide_thumb_middle, (Image) GFXLibrary._24wide_thumb_bottom);
     this.enemiesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.incomingWallScrollBarMoved));
     this.addPlayers();
 }
Esempio n. 4
0
        public void init(bool resized)
        {
            int height = base.Height;

            this.blockYSize = height / 2;
            instance        = this;
            base.clearControls();
            this.loadDiplomacyData();
            this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5);
            this.mainBackgroundImage.Position  = new Point(0, 0);
            this.mainBackgroundImage.Size      = new Size(base.Width, height);
            base.addControl(this.mainBackgroundImage);
            this.backgroundFade.Image    = (Image)GFXLibrary.background_top;
            this.backgroundFade.Position = new Point(0, 0);
            this.backgroundFade.Size     = new Size(base.Width, this.backgroundFade.Image.Height);
            this.mainBackgroundImage.addControl(this.backgroundFade);
            this.headerLabelsImage.Size     = new Size((base.Width - 0x19) - 0x17, 0x1c);
            this.headerLabelsImage.Position = new Point(0x19, 5);
            this.mainBackgroundImage.addControl(this.headerLabelsImage);
            this.headerLabelsImage.Create((Image)GFXLibrary.mail2_field_bar_mail_left, (Image)GFXLibrary.mail2_field_bar_mail_middle, (Image)GFXLibrary.mail2_field_bar_mail_right);
            this.headerLabelsImage2.Size     = new Size((base.Width - 0x19) - 0x17, 0x1c);
            this.headerLabelsImage2.Position = new Point(0x19, this.blockYSize + 5);
            this.mainBackgroundImage.addControl(this.headerLabelsImage2);
            this.headerLabelsImage2.Create((Image)GFXLibrary.mail2_field_bar_mail_left, (Image)GFXLibrary.mail2_field_bar_mail_middle, (Image)GFXLibrary.mail2_field_bar_mail_right);
            this.alliesLabel.Text      = SK.Text("FactionDiplomacy_Allies", "Allies");
            this.alliesLabel.Color     = ARGBColors.Black;
            this.alliesLabel.Position  = new Point(9, -2);
            this.alliesLabel.Size      = new Size(0x143, this.headerLabelsImage.Height);
            this.alliesLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.alliesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage.addControl(this.alliesLabel);
            this.enemiesLabel.Text      = SK.Text("FactionDiplomacy_Enemies", "Enemies");
            this.enemiesLabel.Color     = ARGBColors.Black;
            this.enemiesLabel.Position  = new Point(9, -2);
            this.enemiesLabel.Size      = new Size(0x143, this.headerLabelsImage.Height);
            this.enemiesLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
            this.enemiesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
            this.headerLabelsImage2.addControl(this.enemiesLabel);
            InterfaceMgr.Instance.setVillageHeading(SK.Text("AllArmiesPanel_Diplomacy", "Diplomacy"));
            this.alliesScrollArea.Position = new Point(0x19, 40);
            this.alliesScrollArea.Size     = new Size(0x393, (this.blockYSize - 40) - 10);
            this.alliesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10));
            this.mainBackgroundImage.addControl(this.alliesScrollArea);
            this.mouseWheelOverlay1.Position = this.alliesScrollArea.Position;
            this.mouseWheelOverlay1.Size     = this.alliesScrollArea.Size;
            this.mouseWheelOverlay1.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved1));
            this.mainBackgroundImage.addControl(this.mouseWheelOverlay1);
            int num1 = this.alliesScrollBar.Value;

            this.alliesScrollBar.Position = new Point(0x3a5, 40);
            this.alliesScrollBar.Size     = new Size(0x18, (this.blockYSize - 40) - 10);
            this.mainBackgroundImage.addControl(this.alliesScrollBar);
            this.alliesScrollBar.Value           = 0;
            this.alliesScrollBar.Max             = 100;
            this.alliesScrollBar.NumVisibleLines = 0x19;
            this.alliesScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom);
            this.alliesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved));
            this.enemiesScrollArea.Position = new Point(0x19, (0x23 + this.blockYSize) + 5);
            this.enemiesScrollArea.Size     = new Size(0x393, (this.blockYSize - 40) - 10);
            this.enemiesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10));
            this.mainBackgroundImage.addControl(this.enemiesScrollArea);
            this.mouseWheelOverlay2.Position = this.enemiesScrollArea.Position;
            this.mouseWheelOverlay2.Size     = this.enemiesScrollArea.Size;
            this.mouseWheelOverlay2.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved2));
            this.mainBackgroundImage.addControl(this.mouseWheelOverlay2);
            int num2 = this.enemiesScrollBar.Value;

            this.enemiesScrollBar.Position = new Point(0x3a5, (0x23 + this.blockYSize) + 5);
            this.enemiesScrollBar.Size     = new Size(0x18, (this.blockYSize - 40) - 10);
            this.mainBackgroundImage.addControl(this.enemiesScrollBar);
            this.enemiesScrollBar.Value           = 0;
            this.enemiesScrollBar.Max             = 100;
            this.enemiesScrollBar.NumVisibleLines = 0x19;
            this.enemiesScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom);
            this.enemiesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.incomingWallScrollBarMoved));
            this.addPlayers();
        }