예제 #1
0
        private void menuItemOpen_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog fd = new OpenFileDialog();

            fd.Filter = "Nox Player Files (*.plr)|*.plr";
            //fd.ReadOnlyChecked = true;
            fd.ShowDialog();

            if (System.IO.File.Exists(fd.FileName))
            {
                player = new PlayerFile();
                player.Load(fd.FileName);

                //Update the GUI
                nameBox.Text = player.Name;

                //colors
                colorBoxHair.BackColor = player.HairColor;
                colorBoxSkin.BackColor = player.SkinColor;
                colorBoxBeard.BackColor = player.BeardColor;
                colorBoxMustache.BackColor = player.MustacheColor;
                colorBoxSideburns.BackColor = player.SideburnsColor;

                colorBoxPants.BackColor = player.PantsColor;
                colorBoxShirt.BackColor = player.ShirtColor;
                colorBoxShirtTrim.BackColor = player.ShirtTrimColor;
                colorBoxShoes.BackColor = player.ShoesColor;
                colorBoxShoesTrim.BackColor = player.ShoesTrimColor;

                classBox.SelectedIndex = (int) player.Class;
            }
        }
예제 #2
0
 public MainWindow()
 {
     player = new PlayerFile();
     InitializeComponent();
     MyInitializeComponent();
 }