Ejemplo n.º 1
0
        void InitializeModules()
        {
            // We would prefer to drop Home all together but then it's difficult to show it up top :)
            Items.Add(Home);
            PreInit(Games);
            PreInit(Mods);
            PreInit(Missions);
            PreInit(Servers);

            //ActivateLastModule();
            if (Common.Flags.LockDown)
            {
                var activeGame = ActiveGame;
                if (activeGame.Servers != null)
                {
                    ActivateModule(ControllerModules.ServerBrowser);
                }
            }
            else
            {
                // TODO: Also use RX Router instead
                ActivateModule(ControllerModules.Home);
            }

            /*
             * TODO: Store per game?
             * this.WhenAnyValue(x => x.CurrentModule)
             *  .Skip(1)
             *  .Subscribe(
             *      x => { _userSettings.AppOptions.LastModule = x == null ? null : x.ModuleName.ToString(); });
             */

            ActiveGame.InitModules();
        }