public void SetMod(ModInfo mod) { Mod = mod; _modServiceGetter = _modKernelFactory.Create(mod); _cachedMsgBlockService = _modServiceGetter.Get <ICachedMsgBlockService>(); _cachedMsgBlockService.RebuildCache(); SetCurrentModule(CurrentModuleId ?? ListItems[0].ModuleId, true); RaiseAllPropertiesChanged(); }
public ItemViewModel(ICachedMsgBlockService msgService, IJumpService jumpService, IIdToNameService idToNameService) { _msgService = msgService; _model = new Item(); JumpToItemCommand = new RelayCommand <int>(id => jumpService.JumpTo(ItemSelectorEditorModule.Id, id)); ItemItems = idToNameService.GetComboBoxItemsPlusDefault <IItemService>(); }
public EpisodeViewModel(ICachedMsgBlockService msgService, IEpisodeService episodeService, IIdToNameService idToNameService) { _idToNameService = idToNameService; _msgService = msgService; _model = new Episode(); UnlockConditionItems = episodeService .ValidIds() .Select(i => new SelectorComboBoxItem(i, msgService.GetMsgOfType(MsgShortcut.EpisodeName, i))) .Append(new SelectorComboBoxItem(38, "Default")) .Append(new SelectorComboBoxItem(50, "Special")) .ToList(); }
public BaseWarriorViewModel(IJumpService jumpService, IOverrideSpriteProvider overrideSpriteProvider, IIdToNameService idToNameService, IBaseWarriorService baseWarriorService, ICachedMsgBlockService cachedMsgBlockService) { _model = new BaseWarrior(); _nameTable = baseWarriorService.NameTable; _spriteProvider = overrideSpriteProvider; _cachedMsgBlockService = cachedMsgBlockService; JumpToWarriorSkillCommand = new RelayCommand <int>(id => jumpService.JumpTo(WarriorSkillSelectorEditorModule.Id, id)); JumpToBaseWarriorCommand = new RelayCommand <int>(id => jumpService.JumpTo(BaseWarriorSelectorEditorModule.Id, id)); JumpToPokemonCommand = new RelayCommand <int>(id => jumpService.JumpTo(PokemonSelectorEditorModule.Id, id)); WarriorSkillItems = idToNameService.GetComboBoxItemsPlusDefault <IWarriorSkillService>(); BaseWarriorItems = idToNameService.GetComboBoxItemsPlusDefault <IBaseWarriorService>(); PokemonItems = idToNameService.GetComboBoxItemsPlusDefault <IPokemonService>(); }
public MoveViewModel(ICachedMsgBlockService msgService, IExternalService externalService, IJumpService jumpService) { _msgService = msgService; _externalService = externalService; _model = new Move(); SetPreviewAnimationModeCommand = new RelayCommand <MoveAnimationPreviewMode>(mode => { PreviewAnimationMode = mode; UpdatePreviewAnimation(); }); UpdatePreviewAnimation(); JumpToMoveRangeCommand = new RelayCommand <MoveRangeId>(id => jumpService.JumpTo(MoveRangeSelectorEditorModule.Id, (int)id)); }
public MsgGridViewModel(ICachedMsgBlockService cachedMsgBlockService) { _cachedMsgBlockService = cachedMsgBlockService; for (int i = 0; i < _cachedMsgBlockService.BlockCount; i++) { var block = _cachedMsgBlockService.Retrieve(i); for (int j = 0; j < block.Count; j++) { _allItems.Add(new MsgViewModel(i, j, block)); } } Items = new ObservableCollection <MsgViewModel>(_allItems); SearchCommand = new RelayCommand(Search, () => !_busy); ReplaceAllCommand = new RelayCommand(ReplaceAll, () => !_busy); ClearCommand = new RelayCommand(() => SearchTerm = "", () => !_busy); }
public WarriorSkillViewModel(ICachedMsgBlockService msgService) { _msgService = msgService; _model = new WarriorSkill(); }
public AbilityViewModel(ICachedMsgBlockService msgService) { _msgService = msgService; _model = new Ability(); }