Ejemplo n.º 1
0
        private void OpenSettings(object sender, RoutedEventArgs e)
        {
            var settingWindow = new DmdSettings(_dmdConfig.Style, _config);

            _settingSubscription = settingWindow.OnConfigUpdated.Subscribe(style => {
                Dmd.SetStyle(style, _config.DataPath);
            });
            settingWindow.Show();
        }
Ejemplo n.º 2
0
        public void Setup(Configuration config = null, string gameName = null)
        {
            _config    = config;
            _dmdConfig = _config?.VirtualDmd as VirtualDmdConfig;

            if (_dmdConfig != null)
            {
                ParentGrid.ContextMenu = new ContextMenu();

                var saveGlobalPos = new MenuItem();
                saveGlobalPos.Click += SavePositionGlobally;
                saveGlobalPos.Header = "Save position globally";
                ParentGrid.ContextMenu.Items.Add(saveGlobalPos);

                if (gameName != null)
                {
                    var saveGamePosItem = new MenuItem();
                    saveGamePosItem.Click += SavePositionGame;
                    saveGamePosItem.Header = "Save position for \"" + gameName + "\"";
                    ParentGrid.ContextMenu.Items.Add(saveGamePosItem);
                }

                ParentGrid.ContextMenu.Items.Add(new Separator());

                var toggleAspect = new MenuItem();
                toggleAspect.Click      += ToggleAspectRatio;
                toggleAspect.Header      = "Ignore Aspect Ratio";
                toggleAspect.IsCheckable = true;
                ParentGrid.ContextMenu.Items.Add(toggleAspect);

                ParentGrid.ContextMenu.Items.Add(new Separator());

                var openSettings = new MenuItem();
                openSettings.Click += OpenSettings;
                openSettings.Header = "Customize Style";
                ParentGrid.ContextMenu.Items.Add(openSettings);
            }
            else
            {
                ParentGrid.ContextMenu = null;
            }

            if (_config != null)
            {
                Dmd.SetStyle(_config.VirtualDmd.Style, _config.DataPath);
                IgnoreAspectRatio = _config.VirtualDmd.IgnoreAr;
                AlwaysOnTop       = _config.VirtualDmd.StayOnTop;
            }
        }