/// <summary> /// Dispatched version of join game success which can launch the new window /// </summary> /// <param name="game"></param> public void joinGameSuccessDispatched(Game game) { ChatViewModel gameChat = new ChatViewModel(game.id, this, game); gameChat.leaveGame += mgr.leaveGame; gameChat.sendGameChat = sendGameChat; gameChat.leaveGame += exitGame; //Weird error here ChatWindows.Add(gameChat); gameChat.addBuddyList += addToBuddyList; gameChat.wind.sendPM += sendPM; //Create a new GUIBundle and update the game chat window with existing players GUIBundle newGameBund = new GUIBundle(); newGameBund.gameNum = game.id; newGameBund.Users = game.users; updateWindow(newGameBund); currGame = game; }
/// <summary> /// Creates a new chat window for the main chat /// </summary> private void initializeServerChatWindow() { ChatViewModel mainWin = new ChatViewModel(MAINCHAT, this); mainWin.winClosed += onMainChatClosed; mainWin.sendGameChat = sendGameChat; mainWin.addBuddyList += addToBuddyList; mainWin.gameNumber = MAINCHAT; mainWin.wind.sendPM += sendPM; ChatWindows.Add(mainWin); }