Ejemplo n.º 1
0
 public SoundViewer(ReverserCore core)
 {
     _player = new SoundPlayer();
     _core   = core ?? throw new ArgumentNullException(nameof(core));
     _core.SelectionChanged += CoreOnSelectionChanged;
     InitializeComponent();
 }
Ejemplo n.º 2
0
        public ImageViewer(ReverserCore core)
        {
            _startTime = DateTime.Now;
            _core      = core;
            _timer     = new Timer {
                Interval = 250
            };
            _timer.Tick            += OnTimerTick;
            _core.SelectionChanged += CoreOnSelectionChanged;
            _timer.Start();

            InitializeComponent();

            foreach (var palette in _core.Palettes)
            {
                chkListPalettes.Items.Add(palette);
            }
            chkListPalettes.SelectedIndex = 0;
        }
Ejemplo n.º 3
0
        static void Main()
        {
            var baseDir       = FormatUtil.FindBasePath();
            var generalConfig = GeneralConfig.Load(baseDir);
            var config        = FullAssetConfig.Load(baseDir);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            void SaveChanges(object sender, EventArgs e) => config.Save(baseDir);

            var core = new ReverserCore(generalConfig, config);
            var form = new MainFrm(core);

            form.SaveClicked += SaveChanges;
            Application.Run(form);
            form.SaveClicked -= SaveChanges;

            SaveChanges(null, EventArgs.Empty);
        }
Ejemplo n.º 4
0
        static void Main()
        {
            var disk          = new FileSystem();
            var baseDir       = ConfigUtil.FindBasePath(disk);
            var generalConfig = GeneralConfig.Load(Path.Combine(baseDir, "data/config.json"), baseDir, disk);
            var config        = AssetConfig.Load(Path.Combine(baseDir, "mods/Base/assets.json"), disk);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            void SaveChanges(object sender, EventArgs e) => config.Save(Path.Combine(baseDir, "mods/Base/assets.json"), disk);

            var core = new ReverserCore(generalConfig, config);
            var form = new MainFrm(core);

            form.SaveClicked += SaveChanges;
            Application.Run(form);
            form.SaveClicked -= SaveChanges;

            SaveChanges(null, EventArgs.Empty);
        }
Ejemplo n.º 5
0
 public MainFrm(ReverserCore core)
 {
     _core = core;
     _core.AssetChanged += CoreOnAssetChanged;
     _imageViewer        = new ImageViewer(_core)
     {
         Visible = false
     };
     _textViewer = new TextViewer {
         Visible = false
     };
     _soundPlayer = new SoundViewer(_core)
     {
         Visible = false
     };
     InitializeComponent();
     mainPanel.Controls.Add(_imageViewer);
     mainPanel.Controls.Add(_textViewer);
     mainPanel.Controls.Add(_soundPlayer);
     ResumeLayout(false);
     PerformLayout();
 }