//This event fires if a new player is found in the updated list
        private void ClientManager_OtherPlayerConnected(object sender, vxNetClientEventPlayerConnected e)
        {
            //First Add a New Player in the Manager. The details will come in an update.
            Texture2D thumbnail = vxEngine.Assets.Textures.Arrow_Right;
            vxServerLobbyPlayerItem item = new vxServerLobbyPlayerItem(vxEngine,
                e.ConnectedPlayer,
            new Vector2(
                    (int)(2 * this.ArtProvider.Padding.X),
                    this.ArtProvider.Padding.Y + (this.ArtProvider.Padding.Y / 10 + 68) * (List_Items.Count + 1)),
            thumbnail,
            List_Items.Count);

            //Set Item Width
            item.ButtonWidth = ScrollPanel.Width - (int)(2 * this.ArtProvider.Padding.X) - ScrollPanel.ScrollBarWidth;

            //Set Clicked Event
            item.Clicked += GetHighlitedItem;

            //Add item too the list
            List_Items.Add(item);

            ScrollPanel.Clear();

            foreach (vxServerLobbyPlayerItem it in List_Items)
                ScrollPanel.AddItem(it);
        }
Ejemplo n.º 2
0
        public virtual void GetProperties(vxScrollPanel owningItem)
        {
            owningItem.Clear();

            nameBox = new vxTextbox(vxEngine, this.name, Vector2.Zero);
            owningItem.AddItem(nameBox);

            indexProp = new vxTextbox(vxEngine, this.Index.ToString(), new Vector2(0, 20));
            owningItem.AddItem(indexProp);
        }
        void SendDiscoverySignal()
        {
            List_Items.Clear();

            ScrollPanel.Clear();

            //TODO: increase port range (send out a 100 signals?)
            // Emit a discovery signal
            this.vxEngine.ClientManager.SendDiscoverySignal(14242);
        }