public MapViewModel(IZoneCompletionController zoneController, IZoneService zoneService, IPlayerService playerService, ZoneItemsStore zoneItemsStore, MapUserData userData) { this.zoneController = zoneController; this.zoneService = zoneService; this.userData = userData; this.CharacterPointer = new CharacterPointerViewModel(zoneController, userData); this.CharacterPointer.PropertyChanged += CharacterPointer_PropertyChanged; this.MapMarkers = new MarkersViewModel(userData); this.ZoneItems = new ZoneItemsViewModel(zoneItemsStore); if (playerService.HasValidMapId) { this.ContinentData = this.zoneService.GetContinentByMap(playerService.MapId); } else { this.ContinentData = this.zoneService.GetContinent(DEFAULT_CONTINENT_ID); } this.FloorId = 1; ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged; this.zoneController.Start(); }
public MapViewModel(IZoneCompletionController zoneController, IZoneService zoneService, IPlayerService playerService, PlayerMarkersViewModel mapMarkers, ZoneItemsViewModel zoneItems, MapUserData userData) { this.zoneController = zoneController; this.zoneService = zoneService; this.userData = userData; this.CharacterPointer = new CharacterPointerViewModel(zoneController, userData); this.CharacterPointer.PropertyChanged += CharacterPointer_PropertyChanged; this.Drawings = new DrawingsViewModel(this.CharacterPointer, zoneService, playerService, userData); this.MapMarkers = mapMarkers; this.ZoneItems = zoneItems; // Make sure the zone service is ready this.zoneService.Initialize(); if (playerService.HasValidMapId) { this.ContinentData = this.zoneService.GetContinentByMap(playerService.MapId); } else { this.ContinentData = this.zoneService.GetContinent(DEFAULT_CONTINENT_ID); } this.FloorId = 1; if (playerService.HasValidMapId) { this.FloorId = this.zoneService.GetMap(playerService.MapId).DefaultFloor; } ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged; this.zoneController.Start(); }
/// <summary> /// Default constructor /// </summary> /// <param name="zoneItemsController">The zone completion controller</param> /// <param name="zoneName">The zone name view model</param> public ZoneCompletionView(IZoneCompletionController zoneItemsController, IHasZoneName zoneName) { logger.Debug("New ZoneCompletionView created"); this.controller = zoneItemsController; this.DataContext = new ZoneCompletionViewModel(this.controller, zoneName); InitializeComponent(); // Save the height values for use when collapsing the window this.MinHeight = minHeight; this.Height = Properties.Settings.Default.ZoneAssistantHeight; this.Closing += ZoneCompletionView_Closing; this.beforeCollapseHeight = this.Height; }
/// <summary> /// Notifies the module that it has be initialized. /// </summary> public void Initialize() { logger.Debug("Initializing Zone Completion Module"); this.zoneCompletionController = this.Container.GetExportedValue <IZoneCompletionController>(); this.viewController = this.Container.GetExportedValue <IZoneCompletionViewController>(); // Register for shutdown Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown)); // Initialize the view controller this.viewController.Initialize(); logger.Debug("Zone Completion Module initialized"); }
/// <summary> /// Constructs a new CharacterPointerViewModel /// </summary> public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData) { this.zoneController = zoneController; this.userData = userData; this.PlayerTrail = new ObservableCollection <Location>(); this.DisplayCharacterPointer = true; this.SnapToCharacter = false; this.ShowPlayerTrail = true; this.PlayerTrailLength = 100; this.CanDisplayCharacterPointer = this.zoneController.ValidMapID; ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged; }
/// <summary> /// Constructs a new CharacterPointerViewModel /// </summary> public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData) { this.zoneController = zoneController; this.userData = userData; this.PlayerTrail = new ObservableCollection <Location>(); this.CanDisplayCharacterPointer = this.zoneController.ValidMapID; this.RefreshCharacterLocation(); this.RefreshCharacterDirection(); string validMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ValidMapID); string activeMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ActiveMap); string charPosProp = ReflectionUtility.GetPropertyName(() => this.zoneController.CharacterPosition); string camDirProp = ReflectionUtility.GetPropertyName(() => this.zoneController.CameraDirection); ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) => { if (e.PropertyName == validMapProp) { this.CanDisplayCharacterPointer = this.zoneController.ValidMapID; } else if (e.PropertyName == activeMapProp) { this.RefreshCharacterLocation(); this.RefreshCharacterDirection(); } else if (e.PropertyName == charPosProp) { this.RefreshCharacterLocation(); } else if (e.PropertyName == camDirProp) { this.RefreshCharacterDirection(); } }; this.PlayerTrailColorOptions = new List <string>() { "#FFFFFF", "#000000", "#DD2C00", "#6200EA", "#2962FF", "#00C853", "#FFEA00", "#FF6D00" }; }
/// <summary> /// Notifies the module that it has be initialized. /// </summary> public void Initialize() { logger.Debug("Initializing Zone Completion Module"); this.zoneCompletionController = this.Container.GetExportedValue<IZoneCompletionController>(); this.viewController = this.Container.GetExportedValue<IZoneCompletionViewController>(); // Initialize the zone items store on a background thread var zoneItemsStore = this.Container.GetExportedValue<ZoneItemsStore>(); Task.Factory.StartNew(zoneItemsStore.InitializeStore); // Register for shutdown Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown)); // Initialize the view controller this.viewController.Initialize(); logger.Debug("Zone Completion Module initialized"); }
/// <summary> /// Notifies the module that it has be initialized. /// </summary> public void Initialize() { logger.Debug("Initializing Zone Completion Module"); this.zoneCompletionController = this.Container.GetExportedValue <IZoneCompletionController>(); this.viewController = this.Container.GetExportedValue <IZoneCompletionViewController>(); // Initialize the zone items store on a background thread var zoneItemsStore = this.Container.GetExportedValue <ZoneItemsStore>(); Task.Factory.StartNew(zoneItemsStore.InitializeStore); // Register for shutdown Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown)); // Initialize the view controller this.viewController.Initialize(); logger.Debug("Zone Completion Module initialized"); }
public ZoneItemsViewModel(ZoneItemsStore zoneItemsStore, IZoneCompletionController zoneController, MapUserData userData) { this.zoneItemsStore = zoneItemsStore; this.zoneController = zoneController; this.userData = userData; this.ShowHeartQuests = true; this.ShowHeroPoints = true; this.ShowPOIs = true; this.ShowVistas = true; this.ShowWaypoints = true; this.ShowDungeons = true; ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) => { if (!this.userData.ShowEntireContinent && e.PropertyName.ToLower().Contains("map")) { this.OnPropertyChanged(() => this.Waypoints); this.OnPropertyChanged(() => this.POIs); this.OnPropertyChanged(() => this.Vistas); this.OnPropertyChanged(() => this.HeartQuests); this.OnPropertyChanged(() => this.HeroPoints); this.OnPropertyChanged(() => this.Dungeons); } }; this.zoneItemsStore.DataLoaded += (o, e) => { this.OnPropertyChanged(() => this.Waypoints); this.OnPropertyChanged(() => this.POIs); this.OnPropertyChanged(() => this.Vistas); this.OnPropertyChanged(() => this.HeartQuests); this.OnPropertyChanged(() => this.HeroPoints); this.OnPropertyChanged(() => this.Dungeons); }; }
/// <summary> /// Constructs a new CharacterPointerViewModel /// </summary> public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData) { this.zoneController = zoneController; this.userData = userData; this.PlayerTrail = new ObservableCollection<Location>(); this.CanDisplayCharacterPointer = this.zoneController.ValidMapID; this.RefreshCharacterLocation(); this.RefreshCharacterDirection(); string validMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ValidMapID); string activeMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ActiveMap); string charPosProp = ReflectionUtility.GetPropertyName(() => this.zoneController.CharacterPosition); string camDirProp = ReflectionUtility.GetPropertyName(() => this.zoneController.CameraDirection); ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) => { if (e.PropertyName == validMapProp) { this.CanDisplayCharacterPointer = this.zoneController.ValidMapID; } else if (e.PropertyName == activeMapProp) { this.RefreshCharacterLocation(); this.RefreshCharacterDirection(); } else if (e.PropertyName == charPosProp) { this.RefreshCharacterLocation(); } else if (e.PropertyName == camDirProp) { this.RefreshCharacterDirection(); } }; this.PlayerTrailColorOptions = new List<string>() { "#FFFFFF", "#000000", "#DD2C00", "#6200EA", "#2962FF", "#00C853", "#FFEA00", "#FF6D00" }; }
/// <summary> /// Default constructor /// </summary> /// <param name="zoneCompletionController">The zone completion controller</param> /// <param name="zoneNameVm">The zone name view model</param> public ZoneCompletionViewModel(IZoneCompletionController zoneCompletionController, IHasZoneName zoneNameVm) { this.controller = zoneCompletionController; this.ZoneNameVM = zoneNameVm; }
public ZoneCompletionViewModel(IZoneCompletionController zoneCompletionController) { this.controller = zoneCompletionController; this.controller.Start(); }
public MapViewModel(IZoneCompletionController zoneController, IZoneService zoneService, IPlayerService playerService, ZoneItemsStore zoneItemsStore, MapUserData userData) { this.zoneController = zoneController; this.zoneService = zoneService; this.userData = userData; this.CharacterPointer = new CharacterPointerViewModel(zoneController, userData); this.CharacterPointer.PropertyChanged += CharacterPointer_PropertyChanged; this.MapMarkers = new MarkersViewModel(userData); this.ZoneItems = new ZoneItemsViewModel(zoneItemsStore); if (playerService.HasValidMapId) this.ContinentData = this.zoneService.GetContinentByMap(playerService.MapId); else this.ContinentData = this.zoneService.GetContinent(DEFAULT_CONTINENT_ID); this.FloorId = 1; ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged; this.zoneController.Start(); }
/// <summary> /// Constructs a new CharacterPointerViewModel /// </summary> public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData) { this.zoneController = zoneController; this.userData = userData; this.PlayerTrail = new ObservableCollection<Location>(); this.DisplayCharacterPointer = true; this.SnapToCharacter = false; this.ShowPlayerTrail = true; this.PlayerTrailLength = 100; this.CanDisplayCharacterPointer = this.zoneController.ValidMapID; ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged; }