public BattleChatControl() : base("Battle") { if (this.IsInDesignMode()) { return; } Program.TasClient.Said += TasClient_Said; Program.TasClient.BattleJoinSuccess += TasClientBattleJoinSuccess; Program.TasClient.BattleUserLeft += TasClient_BattleUserLeft; Program.TasClient.BattleUserJoined += TasClient_BattleUserJoined; Program.TasClient.BattleUserStatusChanged += TasClient_BattleUserStatusChanged; Program.TasClient.BattleClosed += (s, e) => Reset(); Program.TasClient.ConnectionLost += (s, e) => Reset(); Program.TasClient.BattleBotAdded += (s, e) => SortByTeam(); Program.TasClient.BattleBotRemoved += (s, e) => SortByTeam(); Program.TasClient.BattleBotUpdated += (s, e) => SortByTeam(); Program.TasClient.BattleMapChanged += TasClient_BattleMapChanged; if (Program.TasClient.MyBattle != null) { foreach (var user in Program.TasClient.MyBattle.Users) { AddUser(user.Key); } } ChatLine += (s, e) => { if (Program.TasClient.IsLoggedIn) { Program.TasClient.Say(SayPlace.Battle, null, e.Data, false); } }; playerBox.IsBattle = true; minimapFuncBox = new ZeroKLobby.Controls.MinimapFuncBox { Dock = DockStyle.Fill }; minimapBox = new PictureBox { Dock = DockStyle.Fill, SizeMode = PictureBoxSizeMode.CenterImage }; minimapBox.Cursor = Cursors.Hand; minimapBox.Click += (s, e) => { if (Program.TasClient.MyBattle != null) { Program.MainWindow.navigationControl.Path = string.Format("{1}/Maps/DetailName?name={0}", Program.TasClient.MyBattle.MapName, GlobalConst.BaseSiteUrl); } }; // playerBoxSearchBarContainer.Controls.Add(battleFuncBox); playerListMapSplitContainer.Panel2.Controls.Add(minimapFuncBox); minimapFuncBox.mapPanel.Controls.Add(minimapBox); minimapFuncBox.Visible = false; //hide button before joining game playerListMapSplitContainer.Panel2Collapsed = false; //show mappanel when in battleroom finishLoad = true; }
public BattleChatControl(): base("Battle") { if (this.IsInDesignMode()) return; Program.TasClient.Said += TasClient_Said; Program.TasClient.BattleJoined += TasClient_BattleJoined; Program.TasClient.BattleUserLeft += TasClient_BattleUserLeft; Program.TasClient.BattleUserJoined += TasClient_BattleUserJoined; Program.TasClient.BattleUserStatusChanged += TasClient_BattleUserStatusChanged; Program.TasClient.BattleClosed += (s, e) => Reset(); Program.TasClient.ConnectionLost += (s, e) => Reset(); Program.TasClient.BattleBotAdded += (s, e) => SortByTeam(); Program.TasClient.BattleBotRemoved += (s, e) => SortByTeam(); Program.TasClient.BattleBotUpdated += (s, e) => SortByTeam(); Program.TasClient.BattleMapChanged += TasClient_BattleMapChanged; Program.TasClient.StartRectAdded += (s, e) => DrawMinimap(); Program.TasClient.StartRectRemoved += (s, e) => DrawMinimap(); Program.ModStore.ModLoaded += ModStoreModLoaded; if (Program.TasClient.MyBattle != null) foreach (var user in Program.TasClient.MyBattle.Users.Values) AddUser(user.Name); ChatLine += (s, e) => { if (Program.TasClient.IsLoggedIn) Program.TasClient.Say(SayPlace.Battle, null, e.Data, false); }; playerBox.IsBattle = true; minimapFuncBox = new ZeroKLobby.Controls.MinimapFuncBox { Dock = DockStyle.Fill }; minimapBox = new PictureBox { Dock = DockStyle.Fill, SizeMode = PictureBoxSizeMode.CenterImage }; minimapBox.Cursor = Cursors.Hand; minimapBox.Click += (s, e) => { if (Program.TasClient.MyBattle != null) Program.MainWindow.navigationControl.Path = string.Format("{1}/Maps/DetailName?name={0}", Program.TasClient.MyBattle.MapName, GlobalConst.BaseSiteUrl); }; // playerBoxSearchBarContainer.Controls.Add(battleFuncBox); playerListMapSplitContainer.Panel2.Controls.Add(minimapFuncBox); minimapFuncBox.mapPanel.Controls.Add(minimapBox); minimapFuncBox.Visible = false; //hide button before joining game playerListMapSplitContainer.Panel2Collapsed = false; //show mappanel when in battleroom finishLoad = true; }