public override void SetGameScreen <T>() { var screen = Screens.First(a => a is T); Screen = screen; Screen.PositionMembers(); }
public AppModel() { Screens = Screen.AllScreens .Select((s, i) => new DisplayScreen(i + 1, s)) .ToArray(); SelectedScreen.Value = Screens.FirstOrDefault(s => !s.Screen.Primary) ?? Screens.First(); }
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); }
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); }
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); }
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(); }
protected virtual void CloseItems(IEnumerable <TModel> items) { ClosePresenters( items.Select(closedModel => Screens.First(x => closedModel.Equals((x).Model))). ToList()); }