Exemple #1
0
        private void ButtonPal_Click(object sender, EventArgs e)
        {
            using var ofd = new OpenFileDialog
                  {
                      InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("NES"),
                      Filter           = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(),
                      RestoreDirectory = true
                  };

            var result = ofd.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }

            var palette = new HawkFile(ofd.FileName);

            if (palette.Exists)
            {
                var data = Emulation.Cores.Nintendo.NES.Palettes.Load_FCEUX_Palette(HawkFile.ReadAllBytes(palette.Name));
                _settings.SetNesHawkPalette(data);
                SetPaletteImage();
            }
        }
Exemple #2
0
        private void ButtonPal_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog
            {
                InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries["NES", "Palettes"].Path, "NES"),
                Filter           = "Palette Files (.pal)|*.PAL|All Files (*.*)|*.*",
                RestoreDirectory = true
            };

            var result = ofd.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }

            var palette = new HawkFile(ofd.FileName);

            if (palette.Exists)
            {
                var data = Emulation.Cores.Nintendo.NES.Palettes.Load_FCEUX_Palette(HawkFile.ReadAllBytes(palette.Name));
                _settings.SetNesHawkPalette(data);
                SetPaletteImage();
            }
        }