Beispiel #1
0
        public static void LoadModList(ModsViewModel ModsVM)
        {
            var modListXml = (new WebClient()).DownloadString("https://raw.githubusercontent.com/StarOfDoom/MelvorIdleModAssistant/main/MelvorIdleModAssistant/ModList.xml");

            ModList = XmlModel.XmlDeserializeFromString <List <Mod> >(modListXml);

            ModsVM.OnPropertyChanged("ModList");
        }
Beispiel #2
0
        public ModsController(ModsViewModel ViewModel, IMessenger Messenger, IMapper Mapper, IUpkFileRepository Repository)
        {
            viewModel = ViewModel;

            viewModel.Mods = new ObservableCollection <FileViewEntity>();

            messenger = Messenger;

            mapper = Mapper;

            repository = Repository;

            allMods = new List <DomainUpkFile>();
        }
Beispiel #3
0
        public ConnectViewModel(ContactList contactList, IDialogManager dialogManager,
                                ModsViewModel mods, MissionsViewModel missions, UserSettings settings,
                                IEventAggregator ea)
        {
            _dialogManager = dialogManager;
            _settings      = settings;
            _eventBus      = ea;
            ContactList    = contactList;
            Mods           = mods;
            Missions       = missions;

            _wasEnabled = IsEnabled;
            IsEnabled   = false;
        }
        // TODO: We probably want to create a new viewmodel for each game, also pass in the game?
        // Or should we merge these viewmodels into this one as the more important part is the libraries that are within those viewmodels?
        public GameViewModel(Game game, ServersViewModel serversViewModel, ModsViewModel modsViewModel,
            MissionsViewModel missionsViewModel, Lazy<ContentViewModel> cvmLazy) {
            _game = game;
            _cvmLazy = cvmLazy;
            if (game.SupportsServers())
                Servers = serversViewModel;
            serversViewModel.SwitchGame(game);

            if (game.SupportsMods())
                Mods = modsViewModel;
            modsViewModel.SwitchGame(game);

            if (game.SupportsMissions())
                Missions = missionsViewModel;
            missionsViewModel.SwitchGame(game);

            this.SetCommand(x => ActivateServerList).Subscribe(() => ShowServerList());
            this.SetCommand(x => ActivateMissionList).Subscribe(() => ShowMissionList());
        }
Beispiel #5
0
        public void FirstSetupDone()
        {
            FirstSetup = false;

            if (!CheckSteamPath())
            {
                return;
            }

            App.Game = new Game(Configuration.Games[Configuration.CurrentGame]);
            App.Game.OnModlibUpdate += (s, e) => Dispatcher.Invoke(delegate { UpdateModlibVersion(); });
            UpdateModlibVersion();

            ModProjects             = new ModProjectsViewModel();
            Mods                    = new ModsViewModel();
            ModsPanel.DataContext   = Mods;
            Development.DataContext = ModProjects;

            Configuration.Save();

            /*
             * if (Configuration.GetString("AutoUpdate").ToLower() == "true")
             * {
             *  var webReq = (HttpWebRequest) WebRequest.Create("http://www.modapi.cc/app/lastVersion.txt");
             *  webReq.Method = "GET";
             *  var webResp = (HttpWebResponse) webReq.GetResponse();
             *  var Answer = webResp.GetResponseStream();
             *  var _Answer = new StreamReader(Answer);
             *  var answer = _Answer.ReadToEnd();
             *  if (answer != Version.Number + "")
             *  {
             *      var win = new UpdateAvailable("Lang.Windows.UpdateAvailable", answer);
             *      win.ShowSubWindow();
             *  }
             * }
             */
        }
Beispiel #6
0
        public void FirstSetupDone()
        {
            FirstSetup = false;

            if (!CheckSteamPath())
                return;

            App.Game = new Data.Game(Configuration.Games[Configuration.CurrentGame]);
            App.Game.OnModlibUpdate += (s, e) => Dispatcher.Invoke((Action) delegate() {
                UpdateModlibVersion();
            });
            UpdateModlibVersion();

            ModProjects = new ModProjectsViewModel();
            Mods = new ModsViewModel();
            ModsPanel.DataContext = Mods;
            Development.DataContext = ModProjects;

            Configuration.Save();

            if (Configuration.GetString("AutoUpdate").ToLower() == "true")
            {
                HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create("http://www.modapi.de/app/lastVersion.txt");
                WebReq.Method = "GET";
                HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
                Stream Answer = WebResp.GetResponseStream();
                StreamReader _Answer = new StreamReader(Answer);
                string answer = _Answer.ReadToEnd();
                if (answer != ModAPI.Version.Number + "")
                {
                    ModAPI.Windows.SubWindows.UpdateAvailable win = new ModAPI.Windows.SubWindows.UpdateAvailable("Lang.Windows.UpdateAvailable", answer);
                    win.ShowSubWindow();
                }
            }
        }
Beispiel #7
0
 public ModsPage()
 {
     ViewModel = Ioc.Default.GetService <ModsViewModel>();
     InitializeComponent();
 }