示例#1
0
 public SSettingsWindow(SChatWindow chat, SChatClient client)
 {
     InitializeComponent();
     ini = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
     AddHotKeys();
     gameTitle = "StarCraft";
     this.chat = chat;
     spawnChat = client;
     btns      = new List <SpChBtn>();
     loadSettings();
     setupButtons();
 }
示例#2
0
        public void connect()
        {
            switch (game)
            {
            case 1:
                SChatClient starChat = new SChatClient(txtName.Text, cboxServer.Text, "#" + txtChan.Text, game, this, chkNickServ.IsChecked.Value, pboxNSpass.Password, txtNSname.Text);
                break;

            case 2:
                WChatClient war2Chat = new WChatClient(txtName.Text, cboxServer.Text, "#" + txtChan.Text, game, this, chkNickServ.IsChecked.Value, pboxNSpass.Password, txtNSname.Text);
                break;

            case 3:
                D2ChatClient d2Chat = new D2ChatClient(txtName.Text, cboxServer.Text, "#" + txtChan.Text, game, this, chkNickServ.IsChecked.Value, pboxNSpass.Password, txtNSname.Text);
                break;

            default:
                DChatClient diabloChat = new DChatClient(txtName.Text, cboxServer.Text, "#" + txtChan.Text, game, this, chkNickServ.IsChecked.Value, pboxNSpass.Password, txtNSname.Text);
                break;
            }
            this.Hide();
        }
示例#3
0
        public SChatWindow(string username, string channel, MainWindow main, SChatClient client)
        {
            InitializeComponent();
            gameID = "STAR";
            ini    = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
            rnd    = new Random();
            AddHotKeys();
            mw        = main;
            nick      = username;
            chan      = channel;
            btns      = new List <SpChBtn>();
            spawnChat = client;
            try
            {
                elnotif = (Boolean.Parse(ini.IniReadValue("Settings", "enterleave")));
            }
            catch (FormatException e)
            {
                elnotif = false;
            }
            try
            {
                timestamps = (Boolean.Parse(ini.IniReadValue("Settings", "timestamp")));
            }
            catch (FormatException e)
            {
                timestamps = false;
            }
            try
            {
                fullscreen = (Boolean.Parse(ini.IniReadValue("Window", "fullscreen")));
            }
            catch (FormatException e)
            {
                fullscreen = false;
            }
            try
            {
                exitOnQuit = (Boolean.Parse(ini.IniReadValue("Settings", "exitonquit")));
            }
            catch (FormatException e)
            {
                exitOnQuit = false;
            }
            try
            {
                avChar = int.Parse(ini.IniReadValue(gameID, "char"));
            }
            catch (FormatException e)
            {
                avChar = 0;
            }
            try
            {
                avWins = int.Parse(ini.IniReadValue(gameID, "wins"));
            }
            catch (FormatException e)
            {
                avWins = 0;
            }
            //tempUri = new Uri(@"pack://application:,,,/" + Assembly.GetCallingAssembly().GetName().Name + ";component/" + avatar, UriKind.Absolute);
            //tempBmp = new BitmapImage(tempUri);

            DefineChatIcons();
            setupButtons();
            mediaPlayer.Volume = 0.00;

            if (fullscreen)
            {
                this.WindowState = WindowState.Maximized;
                this.WindowStyle = WindowStyle.None;
            }
        }