Example #1
0
 // Show a new party window, host name is used to enable/disable the invite button
 private void hidePartyWindow()
 {
     party = null;
     partyGrid.Children.Clear();
     // Enable the player to invite other players (would create a new party)
     inviteButton.IsEnabled = true;
 }
Example #2
0
 // Is called from within the PartyControl
 private void leaveParty(string host)
 {
     // Remove lobby window visually
     partyGrid.Children.Clear();
     // Tell server we left the party
     LobbyProxy.LeaveParty();
     party = null;
     // Enable the player to invite other players (would create a new party)
     inviteButton.IsEnabled = true;
 }
Example #3
0
        // Show a new party window, host name is used to enable/disable the invite button
        private void showPartyWindow(string host)
        {
            if (host == username)
            {
                LobbyProxy.CreateParty();
            }
            //party?.Leave() // Maybe need to leave any existing party first, but it shouldn't be needed
            party = new PartyControl(username, host, leaveParty, LobbyProxy.SendMessageParty, startGame);
            foreach (var player in LobbyProxy.GetPartyMembers())
            {
                // Host and player are already in the lobby, due to being required in constructor
                if (player.UserName != username && player.UserName != host)
                {
                    party.AddPlayer(player.UserName);
                }
            }

            partyGrid.Children.Add(party);

            inviteButton.IsEnabled = (username == host);
        }