示例#1
0
        public void UpdateAvatarState(VMTSOAvatarPermissions perm)
        {
            LastPermissions = perm;

            //personbuttontemplate_defaultthumbnail = 0x79500000001,

            ulong bgID      = 0;
            ulong overlayID = 0;

            switch (perm)
            {
            case VMTSOAvatarPermissions.Visitor: bgID = 0x25400000001; break;     //personbuttontemplate_visitorlarge

            case VMTSOAvatarPermissions.Roommate:
            case VMTSOAvatarPermissions.BuildBuyRoommate: bgID = 0x25200000001; overlayID = 0xB7F00000001; break;     //personbuttontemplate_roommatelarge, personbuttonoverlay_roommatelarge

            case VMTSOAvatarPermissions.Admin:
            case VMTSOAvatarPermissions.Owner: bgID = 0x25200000001; overlayID = 0x7A000000001; break;     //..., personbuttonoverlay_houseleaderlarge
            }

            if (Avatar.PersistID < 65536)
            {
                bgID = 0xCEF00000001; //peoplebuttontemplate_npclarge
            }

            if (Small)
            {
                bgID      += 0x00100000000;
                overlayID += 0x00100000000;
            }

            /*if (Avatar.PersistID == vm.MyUID)
             * {
             *  bgID = 0x25000000001; //personbuttontemplate_playerlarge
             * }*/

            Texture = GetTexture(bgID);
            Icon    = Avatar.GetIcon(GameFacade.GraphicsDevice, 0);
            if (Icon == null)
            {
                Icon = GetTexture(0x79500000001);               //personbuttontemplate_defaultthumbnail
            }
            Overlay = (overlayID == 0)?null:GetTexture(overlayID);

            Tooltip = GetAvatarString(Avatar);
        }