Beispiel #1
0
        public override void SetGameScreen <T>()
        {
            var screen = Screens.First(a => a is T);

            Screen = screen;
            Screen.PositionMembers();
        }
Beispiel #2
0
 public AppModel()
 {
     Screens = Screen.AllScreens
               .Select((s, i) => new DisplayScreen(i + 1, s))
               .ToArray();
     SelectedScreen.Value = Screens.FirstOrDefault(s => !s.Screen.Primary) ?? Screens.First();
 }
Beispiel #3
0
        public void StartGame()
        {
            var saveHandler = new SaveHandler();

            Screens = (List <Screen>)saveHandler
                      .Load(typeof(List <Screen>), saveHandler.ScreensFile);

            Companions = (List <Companion>)saveHandler
                         .Load(typeof(List <Companion>), saveHandler.CompanionsFile);

            Items = (List <Item>)saveHandler
                    .Load(typeof(List <Item>), saveHandler.ItemsFile);

            Shops = (List <Shop>)saveHandler
                    .Load(typeof(List <Shop>), saveHandler.ShopsFile);

            LoadScreen(Screens.First().Id);
        }
Beispiel #4
0
        void SaveSettings()
        {
            if (Screens.Count < 1)
            {
                return;
            }

            if (SelectedScreen == null)
            {
                SelectedScreen = Screens.First();
            }

            Settings.Screen = SelectedScreen.Index;

            if (SelectedScreen.NotificationPlacementTopLeft)
            {
                Settings.Placement = NotificationPlacement.TopLeft;
            }
            else if (SelectedScreen.NotificationPlacementBottomLeft)
            {
                Settings.Placement = NotificationPlacement.BottomLeft;
            }
            else if (SelectedScreen.NotificationPlacementTopRight)
            {
                Settings.Placement = NotificationPlacement.TopRight;
            }
            else if (SelectedScreen.NotificationPlacementBottomRight)
            {
                Settings.Placement = NotificationPlacement.BottomRight;
            }
            else
            {
                Settings.Placement = NotificationPlacement.BottomLeft;
            }

            PlaceScreen();

            Settings.SettingsConfigured  = true;
            Settings.FontColor           = FontColor.Name;
            Settings.ItemBackgroundColor = ItemBackgroundColor.Name;
            Settings.LeftClickColor      = LeftClickColor.Name;
            Settings.RightClickColor     = RightClickColor.Name;
            settingsProvider.SaveSettings(Settings);
        }
Beispiel #5
0
        public void SaveSettings()
        {
            if (Screens.Count < 1)
            {
                return;
            }

            if (SelectedScreen == null)
            {
                SelectedScreen = Screens.First();
            }

            Settings.Screen = SelectedScreen.Index;

            if (SelectedScreen.NotificationPlacementTopLeft)
            {
                Settings.Placement = NotificationPlacement.TopLeft;
            }
            else if (SelectedScreen.NotificationPlacementBottomLeft)
            {
                Settings.Placement = NotificationPlacement.BottomLeft;
            }
            else if (SelectedScreen.NotificationPlacementTopRight)
            {
                Settings.Placement = NotificationPlacement.TopRight;
            }
            else if (SelectedScreen.NotificationPlacementBottomRight)
            {
                Settings.Placement = NotificationPlacement.BottomRight;
            }
            else
            {
                Settings.Placement = NotificationPlacement.BottomLeft;
            }

            PlaceScreen();

            Settings.SettingsConfigured = true;
            settingsProvider.SaveSettings(Settings);
        }
Beispiel #6
0
        public void SaveSettings()
        {
            if (Screens.Count < 1)
            {
                return;
            }

            if (SelectedScreen == null)
            {
                SelectedScreen = Screens.First();
            }

            Settings.Screen = SelectedScreen.Index;

            if (SelectedScreen.NotificationPlacementTopLeft)
            {
                Settings.Placement = NotificationPlacement.TopLeft;
            }
            else if (SelectedScreen.NotificationPlacementBottomLeft)
            {
                Settings.Placement = NotificationPlacement.BottomLeft;
            }
            else if (SelectedScreen.NotificationPlacementTopRight)
            {
                Settings.Placement = NotificationPlacement.TopRight;
            }
            else if (SelectedScreen.NotificationPlacementBottomRight)
            {
                Settings.Placement = NotificationPlacement.BottomRight;
            }
            else
            {
                Settings.Placement = NotificationPlacement.BottomLeft;
            }

            PlaceScreen();

            settingsService.Set("PopupSettings", Settings);
            settingsService.Save();
        }
Beispiel #7
0
 protected virtual void CloseItems(IEnumerable <TModel> items)
 {
     ClosePresenters(
         items.Select(closedModel => Screens.First(x => closedModel.Equals((x).Model))).
         ToList());
 }