Exemple #1
0
        private void BtnSettingsClick(object sender, EventArgs e)
        {
            FrmSettings set = new FrmSettings(this.Path);

            set.StartPosition = FormStartPosition.CenterParent;
            set.ShowDialog();
        }
Exemple #2
0
        private void initialload()
        {
            string RegDir;
            string RegUser;

            unrolfify(out RegDir, out RegUser);
            //this.LoadAndParse();
            //Well if the folder doesn't exsist then yeah...nothing we can really do at the momment.
            if (Directory.Exists(this.Path + @"\players"))
            {
                //Ok so load all the directory paths in \players\ into an arrary of our own
                string[] accountsdir = Directory.GetDirectories(RegDir + @"\players\");


                //Make another array from the size of the last one. I could have used MORE regex but..
                string[] accounts = new string[accountsdir.Length];

                //Now for the most commonly repeated for statement.
                for (int i = 0; i < accountsdir.Length; i++)
                {
                    //Where is the last \\ in the strings?
                    int start = accountsdir[i].LastIndexOf("\\");

                    //Ok cut everything after it, out and slap it into the accounts array equal to the same posistion.
                    accounts[i] = accountsdir[i].Substring(start + 1);
                    //Repeat
                }

                //Merge accounts into the combo box named Accounts's list like hot hot molten metal. "Metal must be glowing to combind"
                this.cbAccounts.Items.AddRange(accounts);

                //NOTE: This is interesting, seems I can actually refer to an Item in the CB as a string...Well then...text search FTW ..Select the user that was last logged on.
                this.cbAccounts.SelectedItem = RegUser;
            }
            else
            {
                //NOTE NOTE NOTE THIS NEEDS SERIOUS WORK. The settings window is being refactored out soon. Redesigned later when I actually have shit to put in it!
                this.Path = @"C:\";
                MessageBox.Show("Wurm folder not found!\r\n\r\nWelcome to Wurm Statistics!\r\n\r\n Since this is the first time you have ran the program, we need to know what logs you want to read from.\r\n\r\n In the next dialog, please specify your Wurm charactors event log folder.");

                FrmSettings initset = new FrmSettings(this.Path);
                initset.ShowDialog();
            }
        }