示例#1
0
 public void SetMod(ModInfo mod)
 {
     Mod = mod;
     _modServiceGetter      = _modKernelFactory.Create(mod);
     _cachedMsgBlockService = _modServiceGetter.Get <ICachedMsgBlockService>();
     _cachedMsgBlockService.RebuildCache();
     SetCurrentModule(CurrentModuleId ?? ListItems[0].ModuleId, true);
     RaiseAllPropertiesChanged();
 }
示例#2
0
    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>();
    }
示例#3
0
    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();
    }
示例#4
0
    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>();
    }
示例#5
0
    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));
    }
示例#6
0
    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();
 }
示例#8
0
 public AbilityViewModel(ICachedMsgBlockService msgService)
 {
     _msgService = msgService;
     _model      = new Ability();
 }