Example #1
0
 public D2SoundSettings(D2ChatClient client)
 {
     InitializeComponent(); ini = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
     av          = new d2avatar();
     DataContext = av;
     AddHotKeys();
     spawnChat = client;
     btns      = new List <SpChBtn>();
     loadSettings();
     setupButtons();
 }
 public D2SettingsWindow(D2ChatWindow chat, D2ChatClient client)
 {
     InitializeComponent(); ini = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
     //windowIcon = new ImageSource();
     AddHotKeys();
     gameTitle = "Diablo II";
     this.chat = chat;
     spawnChat = client;
     btns      = new List <SpChBtn>();
     loadSettings();
     setupButtons();
 }
Example #3
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();
        }
        //ObservableCollection<d2Item> items = new ObservableCollection<d2Item>();
        public D2ChatWindow(string username, string channel, MainWindow main, D2ChatClient client)
        {
            InitializeComponent();
            gameID = "D2DV";
            ini    = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
            rnd    = new Random();
            AddHotKeys();
            mw = main;
            d2avatar t = new d2avatar();

            //Border border = (Border)VisualTreeHelper.GetChild(lstUsers, 0);
            //sv = VisualTreeHelper.GetChild(border, 0) as ScrollViewer;
            DataContext = t;
            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
            {
                avArmor = int.Parse(ini.IniReadValue(gameID, "armor"));
            }
            catch (FormatException e)
            {
                avArmor = 0;
            }
            //tempUri = new Uri(@"pack://application:,,,/" + Assembly.GetCallingAssembly().GetName().Name + ";component/" + avatar, UriKind.Absolute);
            //tempBmp = new BitmapImage(tempUri);

            setupButtons();

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