Example #1
0
 private void userClick()
 {
     GameEngine.Instance.playInterfaceSound("FactionDiplomacyPanel_faction_clicked");
     InterfaceMgr.Instance.changeTab(0);
     WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
         userID = this.m_userID
     };
     InterfaceMgr.Instance.showUserInfoScreen(userInfo);
 }
 private void playerClick()
 {
     if (this.m_userID >= 0)
     {
         WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
             userID = this.m_userID
         };
         InterfaceMgr.Instance.showUserInfoScreen(userInfo);
     }
 }
        private void playerClicked()
        {
            InterfaceMgr.Instance.closeGloryVictoryWindowPopup();
            InterfaceMgr.Instance.changeTab(0);
            GloryRoundData houseGloryRoundData = GameEngine.Instance.World.HouseGloryRoundData;

            WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
                userID = houseGloryRoundData.marshallUserID
            };
            InterfaceMgr.Instance.showUserInfoScreen(userInfo);
        }
 private void userClick()
 {
     GameEngine.Instance.playInterfaceSound("FactionDiplomacyPanel_faction_clicked");
     InterfaceMgr.Instance.changeTab(0);
     WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
         userID = this.m_userID
     };
     InterfaceMgr.Instance.showUserInfoScreen(userInfo);
 }
 public void clickedLine()
 {
     if (this.m_factionMemberData.userID >= 0)
     {
         GameEngine.Instance.playInterfaceSound("FactionMyFactionPanel_user_clicked");
         WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
             userID = this.m_factionMemberData.userID
         };
         InterfaceMgr.Instance.showUserInfoScreen(userInfo);
     }
 }
 private void getUserIDFromNameCallback(GetUserIDFromName_ReturnType returnData)
 {
     if (returnData.Success && (returnData.userID != -1))
     {
         InterfaceMgr.Instance.changeTab(0);
         WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
             userID = returnData.userID
         };
         InterfaceMgr.Instance.showUserInfoScreen(userInfo);
     }
 }
        public void updateVillageInfo(WorldMap.VillageRolloverInfo villageInfo, WorldMap.CachedUserInfo userInfo)
        {
            CustomTooltipManager.UserInfo = userInfo;
            this.m_userInfo = userInfo;
            this.pointsLabel.CustomTooltipID = 0;
            this.rankLabel.CustomTooltipID   = 0;
            if (userInfo == null)
            {
                this.avatarImage.Visible      = false;
                this.rankLabel.TextDiffOnly   = "";
                this.nameLabel.TextDiffOnly   = "";
                this.pointsLabel.TextDiffOnly = "";
            }
            else
            {
                this.pointsLabel.CustomTooltipID = 0x9c7;
                this.rankLabel.CustomTooltipID   = 0x9c7;
                NumberFormatInfo nFI = GameEngine.NFI;
                this.nameLabel.TextDiffOnly = userInfo.userName;
                if (userInfo.avatarData != null)
                {
                    this.rankLabel.TextDiffOnly = Rankings.getRankingName(userInfo.rank, userInfo.avatarData.male);
                }
                else
                {
                    this.rankLabel.TextDiffOnly = Rankings.getRankingName(userInfo.rank);
                }
                if (userInfo.userID != this.lastShieldUserID)
                {
                    this.lastShieldUserID  = userInfo.userID;
                    this.shieldImage.Image = GameEngine.Instance.World.getWorldShieldOrBlank(userInfo.userID, 0x2f, 0x36);
                    if (this.shieldImage.Image != null)
                    {
                        GameEngine.Instance.World.showShieldUser(this.lastShieldUserID);
                        this.shieldImage.Visible = true;
                    }
                    else
                    {
                        this.shieldImage.Visible = false;
                    }
                }
                if (userInfo.factionID >= 0)
                {
                    FactionData data = GameEngine.Instance.World.getFaction(userInfo.factionID);
                    if (data != null)
                    {
                        if (this.lastFlagData != data.flagData)
                        {
                            this.flagImage.createFromFlagData(data.flagData);
                        }
                        this.flagImage.CustomTooltipData = data.factionID;
                        this.flagImage.Visible           = true;
                        if (data.houseID > 0)
                        {
                            this.houseImage.Image             = this.houseImage.Image = (Image)GFXLibrary.house_circles_medium[data.houseID - 1];
                            this.houseImage.CustomTooltipData = data.houseID;
                            this.houseImage.Visible           = true;
                        }
                        else
                        {
                            this.houseImage.Visible = false;
                        }
                    }
                    else
                    {
                        this.flagImage.Visible  = false;
                        this.houseImage.Visible = false;
                    }
                }
                else
                {
                    this.flagImage.Visible  = false;
                    this.houseImage.Visible = false;
                }
                this.avatarImage.Image   = userInfo.avatarBitmap;
                this.avatarImage.Visible = true;
                int numVillages = userInfo.numVillages;
                if (GameEngine.Instance.LocalWorldData.AIWorld)
                {
                    switch (userInfo.userID)
                    {
                    case 1:
                        numVillages = GameEngine.Instance.World.countRatsCastles();
                        break;

                    case 2:
                        numVillages = GameEngine.Instance.World.countSnakesCastles();
                        break;

                    case 3:
                        numVillages = GameEngine.Instance.World.countPigsCastles();
                        break;

                    case 4:
                        numVillages = GameEngine.Instance.World.countWolfsCastles();
                        break;
                    }
                }
                this.pointsLabel.TextDiffOnly = SK.Text("GENERIC_Villages", "Villages") + " : " + numVillages.ToString("N", nFI);
                this.lastUserID = userInfo.userID;
            }
        }
 private void lbActiveChatters_DoubleClick(object sender, EventArgs e)
 {
     int selectedIndex = this.lbActiveChatters.SelectedIndex;
     if ((selectedIndex >= 0) && (selectedIndex < this.lbActiveChatters.Items.Count))
     {
         string str = (string) this.lbActiveChatters.Items[selectedIndex];
         ChatRoom room = (ChatRoom) this.localChatRooms[this.activeChatRoomIdent];
         if (room != null)
         {
             foreach (Chat_UserInRoom room2 in room.usersDataInRoom)
             {
                 if (room2.username == str)
                 {
                     GameEngine.Instance.playInterfaceSound("ChatScreen_user_clicked");
                     InterfaceMgr.Instance.changeTab(0);
                     WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
                         userID = room2.userID
                     };
                     InterfaceMgr.Instance.showUserInfoScreen(userInfo);
                     break;
                 }
             }
         }
     }
 }
        public void updateVillageInfo(WorldMap.VillageRolloverInfo villageInfo, WorldMap.CachedUserInfo userInfo)
        {
            CustomTooltipManager.UserInfo = userInfo;
            this.m_userInfo = userInfo;
            this.pointsLabel.CustomTooltipID = 0;
            this.rankLabel.CustomTooltipID = 0;
            if (userInfo == null)
            {
                this.avatarImage.Visible = false;
                this.rankLabel.TextDiffOnly = "";
                this.nameLabel.TextDiffOnly = "";
                this.pointsLabel.TextDiffOnly = "";
            }
            else
            {
                this.pointsLabel.CustomTooltipID = 0x9c7;
                this.rankLabel.CustomTooltipID = 0x9c7;
                NumberFormatInfo nFI = GameEngine.NFI;
                this.nameLabel.TextDiffOnly = userInfo.userName;
                if (userInfo.avatarData != null)
                {
                    this.rankLabel.TextDiffOnly = Rankings.getRankingName(userInfo.rank, userInfo.avatarData.male);
                }
                else
                {
                    this.rankLabel.TextDiffOnly = Rankings.getRankingName(userInfo.rank);
                }
                if (userInfo.userID != this.lastShieldUserID)
                {
                    this.lastShieldUserID = userInfo.userID;
                    this.shieldImage.Image = GameEngine.Instance.World.getWorldShieldOrBlank(userInfo.userID, 0x2f, 0x36);
                    if (this.shieldImage.Image != null)
                    {
                        GameEngine.Instance.World.showShieldUser(this.lastShieldUserID);
                        this.shieldImage.Visible = true;
                    }
                    else
                    {
                        this.shieldImage.Visible = false;
                    }
                }
                if (userInfo.factionID >= 0)
                {
                    FactionData data = GameEngine.Instance.World.getFaction(userInfo.factionID);
                    if (data != null)
                    {
                        if (this.lastFlagData != data.flagData)
                        {
                            this.flagImage.createFromFlagData(data.flagData);
                        }
                        this.flagImage.CustomTooltipData = data.factionID;
                        this.flagImage.Visible = true;
                        if (data.houseID > 0)
                        {
                            this.houseImage.Image = this.houseImage.Image = (Image) GFXLibrary.house_circles_medium[data.houseID - 1];
                            this.houseImage.CustomTooltipData = data.houseID;
                            this.houseImage.Visible = true;
                        }
                        else
                        {
                            this.houseImage.Visible = false;
                        }
                    }
                    else
                    {
                        this.flagImage.Visible = false;
                        this.houseImage.Visible = false;
                    }
                }
                else
                {
                    this.flagImage.Visible = false;
                    this.houseImage.Visible = false;
                }
                this.avatarImage.Image = userInfo.avatarBitmap;
                this.avatarImage.Visible = true;
                int numVillages = userInfo.numVillages;
                if (GameEngine.Instance.LocalWorldData.AIWorld)
                {
                    switch (userInfo.userID)
                    {
                        case 1:
                            numVillages = GameEngine.Instance.World.countRatsCastles();
                            break;

                        case 2:
                            numVillages = GameEngine.Instance.World.countSnakesCastles();
                            break;

                        case 3:
                            numVillages = GameEngine.Instance.World.countPigsCastles();
                            break;

                        case 4:
                            numVillages = GameEngine.Instance.World.countWolfsCastles();
                            break;
                    }
                }
                this.pointsLabel.TextDiffOnly = SK.Text("GENERIC_Villages", "Villages") + " : " + numVillages.ToString("N", nFI);
                this.lastUserID = userInfo.userID;
            }
        }
 public void init(WorldMap.CachedUserInfo userInfo)
 {
     this.btnClose.Text = SK.Text("GENERIC_Close", "Close");
     this.lblUserName.Text = "";
     this.lblRank.Text = "";
     this.label1.Text = SK.Text("GENERIC_Points", "Points") + " : ";
     this.label3.Text = SK.Text("UserInfoScreen_Rank", "Rank") + " : ";
     this.label2.Text = SK.Text("UserInfoScreen_Villages", "Villages");
     this.label5.Text = SK.Text("STATS_CATEGORY_TITLE_FACTION", "Faction") + " : ";
     this.btnSendMail.Text = SK.Text("UserInfoScreen_Send_Mail", "Send Mail");
     this.btnAchievements.Text = SK.Text("GENERIC_Achievements", "Achievements");
     this.btnInviteToFaction.Text = SK.Text("UserInfoScreen_InviteToFaction", "Invite To Faction");
     this.btnEditAvatar.Text = SK.Text("MENU_Edit_Avatar", "Edit Avatar");
     if (userInfo == null)
     {
         userInfo = new WorldMap.CachedUserInfo();
         userInfo.userID = this.m_userID;
     }
     this.m_userID = userInfo.userID;
     NumberFormatInfo nFI = GameEngine.NFI;
     WorldMap.VillageRolloverInfo villageInfo = null;
     GameEngine.Instance.World.retrieveUserData(-1, userInfo.userID, ref villageInfo, ref userInfo, true, true);
     this.btnEditAvatar.Visible = this.m_userID == RemoteServices.Instance.UserID;
     this.m_userInfo = userInfo;
     if (userInfo != null)
     {
         this.lblUserName.Text = userInfo.userName;
         this.lblPoints.Text = userInfo.points.ToString("N", nFI);
         if (userInfo.standing >= 0)
         {
             this.lblStanding.Text = userInfo.standing.ToString("N", nFI);
         }
         else
         {
             this.lblStanding.Text = "?";
         }
         if (userInfo.avatarData != null)
         {
             this.lblRank.Text = Rankings.getRankingName(userInfo.rank, userInfo.avatarData.male);
         }
         else
         {
             this.lblRank.Text = Rankings.getRankingName(userInfo.rank);
         }
         if (userInfo.factionID >= 0)
         {
             FactionData data = GameEngine.Instance.World.getFaction(userInfo.factionID);
             if (data != null)
             {
                 this.lblFaction.Text = data.factionNameAbrv;
             }
             else
             {
                 this.lblFaction.Text = "";
             }
         }
         else
         {
             this.lblFaction.Text = "";
         }
         if ((userInfo.avatarData != null) && (this.imgAvatar.BackgroundImage == null))
         {
             this.imgAvatar.BackgroundImage = Avatar.CreateAvatar(userInfo.avatarData, ARGBColors.Transparent);
         }
         if (!this.areEqual(userInfo.villages, this.m_villages))
         {
             this.m_villages = userInfo.villages;
             this.addVillages(this.m_villages);
         }
         if (!RemoteServices.Instance.Admin && !RemoteServices.Instance.Moderator)
         {
             this.lblIsAdmin.Visible = false;
             this.lblIsModerator.Visible = false;
             this.gbModerator.Visible = false;
         }
         else
         {
             this.gbModerator.Visible = true;
             this.lblIsAdmin.Visible = RemoteServices.Instance.Admin;
             this.lblIsModerator.Visible = RemoteServices.Instance.Moderator;
             this.btnChatBan7.Visible = RemoteServices.Instance.Admin;
             this.btnChatBanPerma.Visible = RemoteServices.Instance.Admin;
             this.btnMailBanClear.Visible = RemoteServices.Instance.Admin;
             this.btnMailBan1.Visible = RemoteServices.Instance.Admin;
             this.btnMailBan3.Visible = RemoteServices.Instance.Admin;
             this.btnMailBan7.Visible = RemoteServices.Instance.Admin;
             this.btnMailBanPerma.Visible = RemoteServices.Instance.Admin;
             this.btnForumBan7.Visible = RemoteServices.Instance.Admin;
             this.btnForumBanPerma.Visible = RemoteServices.Instance.Admin;
             this.btnWalBan7.Visible = RemoteServices.Instance.Admin;
             this.btnWalBanPerma.Visible = RemoteServices.Instance.Admin;
             this.btnMakeModerator.Visible = false;
             this.btnRemoveModerator.Visible = false;
             this.lblGold.Visible = RemoteServices.Instance.Admin;
             this.lblHonour.Visible = RemoteServices.Instance.Admin;
             this.lblRP.Visible = RemoteServices.Instance.Admin;
             this.tbGold.Visible = RemoteServices.Instance.Admin;
             this.tbHonour.Visible = RemoteServices.Instance.Admin;
             this.tbRP.Visible = RemoteServices.Instance.Admin;
             this.btnApplyGold.Visible = RemoteServices.Instance.Admin;
             this.btnApplyHonour.Visible = RemoteServices.Instance.Admin;
             this.btnApplyRP.Visible = RemoteServices.Instance.Admin;
             this.btnFlushCaches.Visible = RemoteServices.Instance.Admin;
             if (RemoteServices.Instance.Admin)
             {
                 this.tbStuff.Text = userInfo.stuff.Replace("-", "");
             }
             this.btnFixAchievements.Visible = RemoteServices.Instance.Admin;
             this.btnGiveQuests.Visible = RemoteServices.Instance.Admin;
         }
     }
     else
     {
         this.lblUserName.Text = "";
         this.lblPoints.Text = "0";
         this.lblStanding.Text = "0";
         this.lblRank.Text = "";
         this.lblFaction.Text = "";
         this.imgAvatar.BackgroundImage = null;
         this.lblIsAdmin.Visible = false;
         this.lblIsModerator.Visible = false;
         this.gbModerator.Visible = false;
     }
     int num = GameEngine.Instance.World.getYourFactionRank();
     bool flag = false;
     if (((GameEngine.Instance.World.YourFaction != null) && (this.m_userInfo != null)) && (this.m_userInfo.userID != RemoteServices.Instance.UserID))
     {
         FactionMemberData[] factionMembers = GameEngine.Instance.World.FactionMembers;
         if (((factionMembers != null) && (num > 0)) && (factionMembers.Length < GameEngine.Instance.LocalWorldData.Faction_MaxMembers))
         {
             flag = true;
         }
     }
     this.btnInviteToFaction.Visible = flag;
 }
 public void clear()
 {
     this.m_villages = null;
     this.m_userInfo = null;
     this.imgAvatar.BackgroundImage = null;
     this.lblFaction.ForeColor = ARGBColors.Black;
 }
 private void playerClicked()
 {
     InterfaceMgr.Instance.closeGloryVictoryWindowPopup();
     InterfaceMgr.Instance.changeTab(0);
     GloryRoundData houseGloryRoundData = GameEngine.Instance.World.HouseGloryRoundData;
     WorldMap.CachedUserInfo userInfo = new WorldMap.CachedUserInfo {
         userID = houseGloryRoundData.marshallUserID
     };
     InterfaceMgr.Instance.showUserInfoScreen(userInfo);
 }