public bool Commit(IKeyBinds keybinds)
 {
     //逐次_keybindsを変更しているので同一インスタンスなら何もしなくていい
     if (keybinds != _keybinds)
         keybinds.Import(_keybinds);
     return true;
 }
Exemple #2
0
 public void OnKeyBindChanged(IKeyBinds newvalues)
 {
     foreach (MainWindow w in _windows)
     {
         w.ReloadMenu(_menu, false);
     }
 }
Exemple #3
0
 public bool Commit(IKeyBinds keybinds)
 {
     //逐次_keybindsを変更しているので同一インスタンスなら何もしなくていい
     if (keybinds != _keybinds)
     {
         keybinds.Import(_keybinds);
     }
     return(true);
 }
Exemple #4
0
        public KeyBindsWindow(IKeyBinds keyBinds, IGame game)
        {
            InitializeComponent();

            this.edited   = false;
            this.keyBinds = keyBinds;
            this.game     = game;

            this.keyBindsDictionary = this.keyBinds.GetKeyBinds(game).ToDictionary(x => x.Key, y => y.Value);

            CreateChildren(game.CheatCodes);

            this.Closing += KeyBindsWindow_Closing;
        }
        public MainWindow(IGameSource gameSource, IKeyBinds keyBinds)
        {
            InitializeComponent();

            SetStatus(false);
            isFocused = false;

            gameSource.Load();
            gamesComboBox.ItemsSource = gameSource.GameList;

            this.nativeMethods        = new NativeMethods();
            this.keyboardListener     = new KeyboardListener();
            keyboardListener.KeyDown += OnKeyPress;

            this.keyBinds = keyBinds;
            nativeMethods.WindowChanged += NativeMethods_WindowChanged;
        }
Exemple #6
0
        public void Import(IKeyBinds keybinds)
        {
            _data.Clear();
            _keyToTag.Clear();
            _commandToTag.Clear();
            KeyBindConfiguration src = (KeyBindConfiguration)keybinds; //異なるIKeyBinds実装もあるかもしれないが

            foreach (Tag tag in src._data)
            {
                Tag newtag = tag.Clone();
                _data.Add(newtag);
                _commandToTag.Add(tag.Command, newtag);
                if (newtag.Key != Keys.None)
                {
                    _keyToTag.Add(newtag.Key, newtag);
                }
            }
            Debug.Assert(_keyToTag.Count == src._keyToTag.Count);
        }
Exemple #7
0
 public void OnKeyBindChanged(IKeyBinds newvalues)
 {
     foreach (MainWindow w in _windows)
         w.ReloadMenu(_menu, false);
 }
Exemple #8
0
 public void InitUI(IKeyBinds keybinds)
 {
     _keybinds = keybinds;
     InitKeyConfigUI();
 }
 public void InitUI(IKeyBinds keybinds)
 {
     _keybinds = keybinds;
     InitKeyConfigUI();
 }
Exemple #10
0
 public void Import(IKeyBinds keybinds) {
     _data.Clear();
     _keyToTag.Clear();
     _commandToTag.Clear();
     KeyBindConfiguration src = (KeyBindConfiguration)keybinds; //異なるIKeyBinds実装もあるかもしれないが
     foreach (Tag tag in src._data) {
         Tag newtag = tag.Clone();
         _data.Add(newtag);
         _commandToTag.Add(tag.Command, newtag);
         if (newtag.Key != Keys.None)
             _keyToTag.Add(newtag.Key, newtag);
     }
     Debug.Assert(_keyToTag.Count == src._keyToTag.Count);
 }