Beispiel #1
0
        public LoginStage()
        {
            m_font = MainGame.Instance.Content.Load<SpriteFont>("Fonts/DefaultFont");

            m_btnConnect = new Button(m_font, 100, 50, 100, 100);
            m_btnConnect.OnClicked += new Action<Button>(OnButtonClicked);
            m_btnConnect.SetText("Connect");

            m_btnExit = new Button(m_font, 210, 50, 100, 100);
            m_btnExit.OnClicked += new Action<Button>(OnButtonClicked);
            m_btnExit.SetText("Exit");
        }
Beispiel #2
0
 private void OnButtonClicked(Button sender)
 {
     if (sender == m_btnConnect)
     {
         Logger.Write(LogLevel.Connection, "Connecting");
         MainGame.Instance.Socket.Connect(Constants.LoginIp, 8484);
         m_btnConnect.Enabled = false;
     }
     else if (sender == m_btnExit)
     {
         MainGame.Instance.Socket.Dispose();
         MainGame.Instance.Exit();
     }
 }