예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LifeBulbViewModel"/> class.
        /// </summary>
        /// <param name="windowManager">The window manager.</param>
        /// <param name="dockingHelper">The docking helper.</param>
        /// <param name="lurker"></param>
        /// <param name="settingsService"></param>H
        public ManaBulbViewModel(IEventAggregator eventAggregator, IWindowManager windowManager, DockingHelper dockingHelper, ClientLurker lurker, SettingsService settingsService, PoeKeyboardHelper keyboard, SettingsViewModel settingsViewModel)
            : base(windowManager, dockingHelper, lurker, settingsService)
        {
            this._settingsViewModel = settingsViewModel;
            this._eventAggregator   = eventAggregator;
            this._eventAggregator.Subscribe(this);

            lurker.LocationChanged   += this.Lurker_LocationChanged;
            lurker.RemainingMonsters += this.Lurker_RemainingMonsters;
        }
예제 #2
0
        /// <summary>
        /// Registers the instances.
        /// </summary>
        private void ShowOverlays(int processId)
        {
            Execute.OnUIThread(() =>
            {
                this._currentDockingHelper = new DockingHelper(processId, this._settingsService);

                // Keyboard
                var keyboarHelper    = new PoeKeyboardHelper(processId);
                this._keyboardLurker = new KeyboardLurker(processId, this._settingsService, this._keyCodeService, keyboarHelper);
                this._keyboardLurker.BuildToggled += this.KeyboardLurker_BuildToggled;

                // Mouse
                this._mouseLurker          = new MouseLurker(processId, this._settingsService);
                this._mouseLurker.Newitem += this.MouseLurker_Newitem;

                // Clipboard
                this._clipboardLurker = new ClipboardLurker();

                this._container.RegisterInstance(typeof(ProcessLurker), null, this._processLurker);
                this._container.RegisterInstance(typeof(MouseLurker), null, this._mouseLurker);
                this._container.RegisterInstance(typeof(ClientLurker), null, this._currentLurker);
                this._container.RegisterInstance(typeof(PlayerService), null, this._currentCharacterService);
                this._container.RegisterInstance(typeof(ClipboardLurker), null, this._clipboardLurker);
                this._container.RegisterInstance(typeof(DockingHelper), null, this._currentDockingHelper);
                this._container.RegisterInstance(typeof(PoeKeyboardHelper), null, keyboarHelper);
                this._container.RegisterInstance(typeof(KeyboardLurker), null, this._keyboardLurker);

                this._skillTimelineOverlay    = this._container.GetInstance <BuildTimelineViewModel>();
                this._incomingTradeBarOverlay = this._container.GetInstance <TradebarViewModel>();
                this._outgoingTradeBarOverlay = this._container.GetInstance <OutgoingbarViewModel>();
                this._popup           = this._container.GetInstance <PopupViewModel>();
                this._lifeBulbOverlay = this._container.GetInstance <LifeBulbViewModel>();
                this._manaBulbOverlay = this._container.GetInstance <ManaBulbViewModel>();
                this._afkService      = this._container.GetInstance <AfkService>();
                this._hideoutOverlay  = this._container.GetInstance <HideoutViewModel>();
                this._helpOverlay     = this._container.GetInstance <HelpViewModel>();
                this._helpOverlay.Initialize(this.ToggleBuildHelper);
                this._buildViewModel = this._container.GetInstance <BuildViewModel>();

                if (this._settingsService.BuildHelper)
                {
                    this.ActivateItem(this._buildViewModel);
                }

                if (this._settingsService.BuildHelper)
                {
                    if (this._settingsService.TimelineEnabled)
                    {
                        this.ActivateItem(this._skillTimelineOverlay);
                    }

                    this.ActivateItem(this._helpOverlay);
                }

                if (this._settingsService.IncomingTradeEnabled)
                {
                    this.ActivateItem(this._incomingTradeBarOverlay);
                }

                if (this._settingsService.OutgoingTradeEnabled)
                {
                    this.ActivateItem(this._outgoingTradeBarOverlay);
                }

                this.ActivateItem(this._lifeBulbOverlay);
                this.ActivateItem(this._manaBulbOverlay);
                this.ActivateItem(this._hideoutOverlay);
            });
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TradebarViewModel" /> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="clientLurker">The client lurker.</param>
        /// <param name="processLurker">The process lurker.</param>
        /// <param name="dockingHelper">The docking helper.</param>
        /// <param name="keyboardHelper">The keyboard helper.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="windowManager">The window manager.</param>
        /// <param name="soundService">The sound service.</param>
        public TradebarViewModel(IEventAggregator eventAggregator, ClientLurker clientLurker, ProcessLurker processLurker, DockingHelper dockingHelper, PoeKeyboardHelper keyboardHelper, SettingsService settingsService, IWindowManager windowManager, SoundService soundService)
            : base(windowManager, dockingHelper, processLurker, settingsService)
        {
            this._eventAggregator = eventAggregator;
            this._keyboardHelper  = keyboardHelper;
            this._soundService    = soundService;
            this._clientLurker    = clientLurker;
            this.TradeOffers      = new ObservableCollection <OfferViewModel>();
            this._soldOffers      = new List <TradeEvent>();

            this._context                = new TradebarContext(this.RemoveOffer, this.AddActiveOffer, this.AddToSoldOffer, this.SetActiveOffer, this.ClearAll);
            this.DisplayName             = "Poe Lurker";
            this.SettingsService.OnSave += this.SettingsService_OnSave;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LifeBulbViewModel"/> class.
        /// </summary>
        /// <param name="windowManager">The window manager.</param>
        /// <param name="dockingHelper">The docking helper.</param>
        /// <param name="lurker"></param>
        /// <param name="settingsService"></param>H
        public ManaBulbViewModel(IEventAggregator eventAggregator, IWindowManager windowManager, DockingHelper dockingHelper, ClientLurker lurker, SettingsService settingsService)
            : base(windowManager, dockingHelper, lurker, settingsService)
        {
            this._eventAggregator = eventAggregator;
            this._eventAggregator.Subscribe(this);

            this._lurker.LocationChanged   += this.Lurker_LocationChanged;
            this._lurker.RemainingMonsters += this.Lurker_RemainingMonsters;
            this._settingsService.OnSave   += this.SettingsService_OnSave;
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OutgoingbarViewModel" /> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="clipboardLurker">The clipboard lurker.</param>
        /// <param name="clientLurker">The client lurker.</param>
        /// <param name="processLurker">The process lurker.</param>
        /// <param name="dockingHelper">The docking helper.</param>
        /// <param name="keyboardHelper">The keyboard helper.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="windowManager">The window manager.</param>
        /// <param name="playerService">The player service.</param>
        public OutgoingbarViewModel(IEventAggregator eventAggregator, ClipboardLurker clipboardLurker, ClientLurker clientLurker, ProcessLurker processLurker, DockingHelper dockingHelper, PoeKeyboardHelper keyboardHelper, SettingsService settingsService, IWindowManager windowManager, PlayerService playerService)
            : base(windowManager, dockingHelper, processLurker, settingsService)
        {
            this.Offers           = new ObservableCollection <OutgoingOfferViewModel>();
            this.FilteredOffers   = new ObservableCollection <OutgoingOfferViewModel>();
            this._timer           = new Timer(50);
            this._timer.Elapsed  += this.Timer_Elapsed;
            this._keyboardHelper  = keyboardHelper;
            this._clipboardLurker = clipboardLurker;
            this._eventAggregator = eventAggregator;
            this._clientLurker    = clientLurker;
            this._playerService   = playerService;

            this.Offers.CollectionChanged  += this.Offers_CollectionChanged;
            this._clipboardLurker.NewOffer += this.ClipboardLurker_NewOffer;
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LifeBulbViewModel"/> class.
 /// </summary>
 /// <param name="windowManager">The window manager.</param>
 /// <param name="dockingHelper">The docking helper.</param>
 /// <param name="lurker"></param>
 /// <param name="settingsService"></param>H
 public LifeBulbViewModel(IEventAggregator eventAggregator, IWindowManager windowManager, DockingHelper dockingHelper, ClientLurker lurker, SettingsService settingsService, PoeKeyboardHelper keyboard)
     : base(windowManager, dockingHelper, lurker, settingsService)
 {
     this._keyboardHelper  = keyboard;
     this._eventAggregator = eventAggregator;
     this._eventAggregator.Subscribe(this);
 }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TradebarViewModel" /> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="clientLurker">The client lurker.</param>
        /// <param name="processLurker">The process lurker.</param>
        /// <param name="dockingHelper">The docking helper.</param>
        /// <param name="keyboardHelper">The keyboard helper.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="windowManager">The window manager.</param>
        /// <param name="soundService">The sound service.</param>
        public TradebarViewModel(IEventAggregator eventAggregator, ClientLurker clientLurker, ProcessLurker processLurker, DockingHelper dockingHelper, PoeKeyboardHelper keyboardHelper, SettingsService settingsService, IWindowManager windowManager, SoundService soundService)
            : base(windowManager, dockingHelper, processLurker, settingsService)
        {
            this._eventAggregator = eventAggregator;
            this._keyboardHelper  = keyboardHelper;
            this._soundService    = soundService;
            this._clientLurker    = clientLurker;
            this.TradeOffers      = new ObservableCollection <OfferViewModel>();
            this._lastOffers      = new List <TradeEvent>();

            this._clientLurker.IncomingOffer += this.Lurker_IncomingOffer;
            this._clientLurker.TradeAccepted += this.Lurker_TradeAccepted;
            this._clientLurker.PlayerJoined  += this.Lurker_PlayerJoined;
            this._clientLurker.PlayerLeft    += this.Lurker_PlayerLeft;

            this._context                = new TradebarContext(this.RemoveOffer, this.AddActiveOffer, this.SetActiveOffer);
            this.DisplayName             = "Poe Lurker";
            this.SettingsService.OnSave += this.SettingsService_OnSave;
        }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BulbViewModelBase" /> class.
 /// </summary>
 /// <param name="windowManager">The window manager.</param>
 /// <param name="dockingHelper">The docking helper.</param>
 /// <param name="processLurker">The Processs lurker.</param>
 /// <param name="settingsService">The settings serivce.</param>
 /// <param name="clientLurker">The client lurker.</param>
 public BulbViewModelBase(IWindowManager windowManager, DockingHelper dockingHelper, ProcessLurker processLurker, SettingsService settingsService, ClientLurker clientLurker)
     : base(windowManager, dockingHelper, processLurker, settingsService)
 {
     this.ClientLurker = clientLurker;
     this.SetDefaultAction();
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PopupViewModel"/> class.
 /// </summary>
 /// <param name="windowManager">The window manager.</param>
 /// <param name="dockingHelper">The docking helper.</param>
 /// <param name="processLurker">The process lurker.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="mouseLurker">The mouse lurker.</param>
 public PopupViewModel(IWindowManager windowManager, DockingHelper dockingHelper, ProcessLurker processLurker, SettingsService settingsService, MouseLurker mouseLurker)
     : base(windowManager, dockingHelper, processLurker, settingsService)
 {
     this._mouseLurker = mouseLurker;
     this._opacity     = 1;
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HelpViewModel"/> class.
 /// </summary>
 /// <param name="windowManager">The window manager.</param>
 /// <param name="dockingHelper">The docking helper.</param>
 /// <param name="processLurker">The process lurker.</param>
 /// <param name="settingsService">The settings service.</param>
 public HelpViewModel(IWindowManager windowManager, DockingHelper dockingHelper, ProcessLurker processLurker, SettingsService settingsService)
     : base(windowManager, dockingHelper, processLurker, settingsService)
 {
     this._windowManager = windowManager;
 }
예제 #11
0
        /// <summary>
        /// Cleans up.
        /// </summary>
        private void CleanUp()
        {
            this.ActivePlayer = null;
            this._container.UnregisterHandler <ClientLurker>();
            this._container.UnregisterHandler <PlayerService>();
            this._container.UnregisterHandler <ProcessLurker>();
            this._container.UnregisterHandler <DockingHelper>();
            this._container.UnregisterHandler <PoeKeyboardHelper>();
            this._container.UnregisterHandler <ClipboardLurker>();
            this._container.UnregisterHandler <MouseLurker>();
            this._container.UnregisterHandler <KeyboardLurker>();

            if (this._clipboardLurker != null)
            {
                this._clipboardLurker.Dispose();
                this._clipboardLurker = null;
            }

            if (this._currentLurker != null)
            {
                this._currentLurker.AdminRequested -= this.CurrentLurker_AdminRequested;
                this._currentLurker.Dispose();
                this._currentLurker = null;
            }

            if (this._currentCharacterService != null)
            {
                this._currentCharacterService.Dispose();
            }

            if (this._processLurker != null)
            {
                this._processLurker.ProcessClosed -= this.PoeClosed;
                this._processLurker.Dispose();
                this._processLurker = null;
            }

            if (this._currentDockingHelper != null)
            {
                this._currentDockingHelper.Dispose();
                this._currentDockingHelper = null;
            }

            if (this._afkService != null)
            {
                this._afkService.Dispose();
                this._afkService = null;
            }

            if (this._mouseLurker != null)
            {
                this._mouseLurker.ItemDetails    -= this.ShowItemDetails;
                this._mouseLurker.ItemIdentified -= this.ShowMap;
                this._mouseLurker.Dispose();
                this._mouseLurker = null;
            }

            if (this._keyboardLurker != null)
            {
                this._keyboardLurker.BuildToggled -= this.KeyboardLurker_BuildToggled;
                this._keyboardLurker.Dispose();
            }
        }
예제 #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OfferViewModel" /> class.
        /// </summary>
        /// <param name="tradeEvent">The trade event.</param>
        /// <param name="keyboardHelper">The keyboard helper.</param>
        /// <param name="tradebarContext">The tradebar context.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="sold">if set to <c>true</c> [sold].</param>
        /// <param name="dockingHelper">The docking helper.</param>
        public OfferViewModel(TradeEvent tradeEvent, PoeKeyboardHelper keyboardHelper, TradebarContext tradebarContext, SettingsService settingsService, bool sold, DockingHelper dockingHelper)
        {
            this._tradeEvent      = tradeEvent;
            this._keyboardHelper  = keyboardHelper;
            this._tradebarContext = tradebarContext;
            this._settingsService = settingsService;
            this._alreadySold     = sold;
            this._dockingHelper   = dockingHelper;

            this._settingsService.OnSave += this.SettingsService_OnSave;
        }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LifeBulbViewModel"/> class.
 /// </summary>
 /// <param name="windowManager">The window manager.</param>
 /// <param name="dockingHelper">The docking helper.</param>
 /// <param name="lurker"></param>
 /// <param name="settingsService"></param>H
 public BulbViewModel(IWindowManager windowManager, DockingHelper dockingHelper, ClientLurker lurker, SettingsService settingsService)
     : base(windowManager, dockingHelper, lurker, settingsService)
 {
     this.SetDefaultAction();
 }