Exemple #1
0
 private void InitServices(ElvenarEnv elvenar)
 {
     _elvenar      = elvenar;
     _macroService = new MacroService(elvenar.Symbols, elvenar.Macros, LeftClick, GetMousePosition, KeyPress);
     _views        = new ObservableCollection <ViewModelBase>
     {
         new QuestViewModel(elvenar.Quests, _macroService),
         new PolierenViewModel(elvenar.Polieren, elvenar.MyPosition, _macroService),
         new OtherViewModel(),
     };
     NotifyPropertyChanged("CurrentView");
 }
Exemple #2
0
        private void OpenSymbolWindow(object sender, RoutedEventArgs e)
        {
            var viewModel    = new SymbolViewModel(_elvenar.Symbols);
            var symbolWindow = new SymbolWindow(viewModel, new MouseHook(), new KeyboardHook());

            if (symbolWindow.ShowDialog() != true)
            {
                return;
            }

            _elvenar.Symbols = viewModel.Symbols.ToArray();
            var service = new MacroService(_elvenar.Symbols, _elvenar.Macros, LeftClick, GetMousePosition, KeyPress);

            foreach (var replace in viewModel.ReplaceSymbolNames)
            {
                service.ReplaceSymbolName(Macros, replace.Key, replace.Value);
            }
            SetModified(true);
        }
Exemple #3
0
 public PolierenViewModel(IEnumerable <string> polieren, int myPosition, MacroService macroService)
     : base(macroService)
 {
     PolierenList = new ObservableCollection <string>(polieren ?? new string[0]);
     MyPosition   = myPosition;
 }
Exemple #4
0
 public QuestViewModel(IEnumerable <string> quests, MacroService macroService)
     : base(macroService)
 {
     QuestList = new ObservableCollection <string>(quests ?? new string[0]);
     NextIndex = -1;
 }
Exemple #5
0
 public ViewModelBase(MacroService macroService)
 {
     _macroService = macroService;
 }