private void open_ready_screen() { if (InvokeRequired) { func_delegate d = new func_delegate(open_ready_screen); this.Invoke(d, new object[] { }); } else { if (ready_screen == null) { ready_screen = new ready_scr(this); } if (ready_screen.IsDisposed) { ready_screen = new ready_scr(this); } ready_screen.Show(); ready_screen.TopMost = true; } }
public main_hub_scr(login_scr r_login, network r_udpclient) { InitializeComponent(); // send prof pic request List <string> prof_pic_req_packet = new List <string>(); prof_pic_req_packet.Add(r_login.steamid); r_udpclient.send_data(0x27, prof_pic_req_packet); // transfer refrences login_screen = r_login; udpclient = r_udpclient; shared_udpclient = r_udpclient; // set playscreen ref play_screen = new play_scr(this); // set lobby screen ref lobby_screen = new lobby_scr(this); // set ready screen ref ready_screen = new ready_scr(this); // load fonts username_label.Font = c_font.load_font(20, 1, true); // initialize packet listener thread listener_thread = new Thread(new ThreadStart(manage_packets)); listener_thread.Start(); // USER STUFF // load profile picture //paint_my_profile_picture("asd"); my_info.steamid = login_screen.steamid; my_info.username = login_screen.get_username(); my_info.s_hash = login_screen.s_hash; // Update labels username_label.Text = my_info.username; // add screens to screen panel // home screen keep_alive_tick(this, new EventArgs()); home_screen.TopLevel = false; home_screen.AutoScroll = false; screen_panel.Controls.Add(home_screen); home_screen.Show(); // play screen play_screen.TopLevel = false; play_screen.AutoScroll = false; screen_panel.Controls.Add(play_screen); // warmup screen warmup_screen.TopLevel = false; warmup_screen.AutoScroll = false; screen_panel.Controls.Add(warmup_screen); warmup_screen.servers.Add(new warmup_server("212.49.20.161", 27015, 0)); warmup_screen.servers.Add(new warmup_server("212.49.20.163", 27015, 1)); warmup_screen.servers.Add(new warmup_server("212.49.20.163", 27025, 2)); warmup_screen.servers.Add(new warmup_server("212.49.20.163", 27035, 3)); warmup_screen.servers.Add(new warmup_server("212.49.20.163", 27045, 4)); // stats screen stats_screen.TopLevel = false; stats_screen.AutoScroll = false; screen_panel.Controls.Add(stats_screen); // lobby screen lobby_screen.TopLevel = false; lobby_screen.AutoScroll = false; screen_panel.Controls.Add(lobby_screen); // initialize timers keep_alive.Interval = 2000; // 2 sec keep_alive.Tick += new EventHandler(keep_alive_tick); keep_alive.Start(); server_alive.Interval = 30000; // 30 sec server_alive.Tick += new EventHandler(check_server_alive); server_alive.Start(); update_warmup_servers.Interval = 10000; update_warmup_servers.Tick += new EventHandler(warmup_screen.refresh_servers); update_warmup_servers.Start(); }