Example #1
0
 public DSettingsWindow(DChatWindow chat, DChatClient client)
 {
     InitializeComponent();
     ini = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
     AddHotKeys();
     gameTitle = "Diablo";
     this.chat = chat;
     spawnChat = client;
     btns      = new List <SpChBtn>();
     loadSettings();
     setupButtons();
 }
Example #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();
        }
Example #3
0
        public DChatWindow(string username, string channel, MainWindow main, DChatClient client)
        {
            InitializeComponent();
            wavBtnClick.Load();
            gameID = "DRTL";
            ini    = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
            rnd    = new Random();
            AddHotKeys();
            mw = main;
            //txtChat.CaretIndex = txtChat.Text.Length;
            nick = username;
            chan = channel;
            //setBanner();
            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;
            }
        }