public ModListItemViewModel(
        IModSelectionViewModel parent,
        ModInfo mod,
        IModManager modManager,
        IModPatchingService modPatcher,
        IDialogService dialogService,
        IPluginLoader pluginLoader,
        IModServiceGetterFactory modKernelFactory)
    {
        _modKernelFactory = modKernelFactory;
        _parentVm         = parent;
        _modService       = modManager;
        _dialogService    = dialogService;
        _modPatcher       = modPatcher;
        Mod         = mod;
        PluginItems = pluginLoader.LoadPlugins(out var _);

        PatchRomCommand         = new RelayCommand(() => PatchRom(Mod));
        ExportModCommand        = new RelayCommand(() => ExportMod(Mod));
        EditModInfoCommand      = new RelayCommand(() => EditModInfo(Mod));
        CreateModBasedOnCommand = new RelayCommand(() => CreateModBasedOn(Mod));
        DeleteModCommand        = new RelayCommand(() => DeleteMod(Mod));
        RunPluginCommand        = new RelayCommand <PluginInfo>(parameter => RunPlugin(Mod, parameter));
    }
Beispiel #2
0
    public MainEditorViewModel(
        IDialogService dialogService,
        IModPatchingService modPatcher,
        ISettingService settingService,
        IPluginLoader pluginLoader,
        IModServiceGetterFactory modKernelFactory,
        IEnumerable <EditorModule> modules)
    {
        _modKernelFactory         = modKernelFactory;
        _dialogService            = dialogService;
        _modPatcher               = modPatcher;
        _settingService           = settingService;
        _editorModuleOrderSetting = _settingService.Get <EditorModuleOrderSetting>();

        PluginItems = pluginLoader.LoadPlugins(out var loadFailures);
        if (loadFailures?.AnyFailures == true)
        {
            _dialogService.ShowMessageBox(MessageBoxArgs.Ok("Failed to load some plugins", loadFailures?.ToString()));
        }

        CommitRomCommand = new RelayCommand(CommitRom);

        RegisterModules(modules);
    }
 public ModPatchingService(RomFsFactory ndsFactory, IFallbackSpriteProvider fallbackSpriteProvider, IModServiceGetterFactory modServiceGetterFactory)
 {
     _fallbackSpriteProvider  = fallbackSpriteProvider;
     _ndsFactory              = ndsFactory;
     _modServiceGetterFactory = modServiceGetterFactory;
 }
 public CurrentModService(ISettingService settingService, IModManager modManager, IModServiceGetterFactory modKernelFactory)
 {
     _modServiceGetterFactory      = modKernelFactory;
     _currentConsoleModSlotSetting = settingService.Get <CurrentConsoleModSlotSetting>();
     _modManager = modManager;
 }