22using System . Collections . Generic ;
33using System . Diagnostics ;
44using System . Threading ;
5- using System . Threading . Tasks ;
65using System . Windows . Media ;
76using EnhancePoE . Model ;
87
@@ -14,8 +13,6 @@ public static class Data
1413 public static ActiveItemTypes PreviousActiveItems { get ; set ; }
1514 public static MediaPlayer Player { get ; set ; } = new MediaPlayer ( ) ;
1615
17- public static MediaPlayer PlayerSet { get ; set ; } = new MediaPlayer ( ) ;
18-
1916 public static int SetAmount { get ; set ; }
2017 public static int SetTargetAmount { get ; set ; }
2118
@@ -271,16 +268,16 @@ public static void CheckActives()
271268 {
272269 if ( ApiAdapter . FetchError )
273270 {
274- MainWindow . overlay . WarningMessage = "Fetching Error..." ;
275- MainWindow . overlay . ShadowOpacity = 1 ;
276- MainWindow . overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
271+ MainWindow . Overlay . WarningMessage = "Fetching Error..." ;
272+ MainWindow . Overlay . ShadowOpacity = 1 ;
273+ MainWindow . Overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
277274 return ;
278275 }
279276 if ( StashTabList . StashTabs . Count == 0 )
280277 {
281- MainWindow . overlay . WarningMessage = "No Stashtabs found..." ;
282- MainWindow . overlay . ShadowOpacity = 1 ;
283- MainWindow . overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
278+ MainWindow . Overlay . WarningMessage = "No Stashtabs found..." ;
279+ MainWindow . Overlay . ShadowOpacity = 1 ;
280+ MainWindow . Overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
284281 return ;
285282 }
286283 if ( Properties . Settings . Default . Sound )
@@ -459,14 +456,14 @@ public static void CheckActives()
459456 Trace . WriteLine ( "section list cleared" ) ;
460457 }
461458
462- _ = MainWindow . overlay . Dispatcher . Invoke ( ( ) => MainWindow . overlay . FullSetsText = fullSets . ToString ( ) ) ;
459+ _ = MainWindow . Overlay . Dispatcher . Invoke ( ( ) => MainWindow . Overlay . FullSetsText = fullSets . ToString ( ) ) ;
463460
464461 // invoke chaos missing
465462 if ( missingChaos && ! Properties . Settings . Default . RegalRecipe )
466463 {
467- MainWindow . overlay . WarningMessage = "Need lower level items!" ;
468- MainWindow . overlay . ShadowOpacity = 1 ;
469- MainWindow . overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
464+ MainWindow . Overlay . WarningMessage = "Need lower level items!" ;
465+ MainWindow . Overlay . ShadowOpacity = 1 ;
466+ MainWindow . Overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
470467 }
471468
472469 // invoke exalted recipe ready
@@ -479,18 +476,18 @@ public static void CheckActives()
479476 || ItemSetHunter . EmptyItemSlots . Count == 0
480477 || ItemSetRedeemer . EmptyItemSlots . Count == 0 )
481478 {
482- MainWindow . overlay . WarningMessage = "Exalted Recipe ready!" ;
483- MainWindow . overlay . ShadowOpacity = 1 ;
484- MainWindow . overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
479+ MainWindow . Overlay . WarningMessage = "Exalted Recipe ready!" ;
480+ MainWindow . Overlay . ShadowOpacity = 1 ;
481+ MainWindow . Overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
485482 }
486483 }
487484
488485 // invoke set full
489486 if ( fullSets == SetTargetAmount && ! missingChaos )
490487 {
491- MainWindow . overlay . WarningMessage = "Sets full!" ;
492- MainWindow . overlay . ShadowOpacity = 1 ;
493- MainWindow . overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
488+ MainWindow . Overlay . WarningMessage = "Sets full!" ;
489+ MainWindow . Overlay . ShadowOpacity = 1 ;
490+ MainWindow . Overlay . WarningMessageVisibility = System . Windows . Visibility . Visible ;
494491 }
495492
496493 Trace . WriteLine ( fullSets , "full sets" ) ;
@@ -632,26 +629,26 @@ public static void CalculateItemAmounts()
632629 Trace . WriteLine ( a ) ;
633630 }
634631 amounts [ 4 ] = weaponsSmall + weaponBig ;
635- MainWindow . overlay . RingsAmount = amounts [ 0 ] ;
636- MainWindow . overlay . AmuletsAmount = amounts [ 1 ] ;
637- MainWindow . overlay . BeltsAmount = amounts [ 2 ] ;
638- MainWindow . overlay . ChestsAmount = amounts [ 3 ] ;
639- MainWindow . overlay . WeaponsAmount = amounts [ 4 ] ;
640- MainWindow . overlay . GlovesAmount = amounts [ 5 ] ;
641- MainWindow . overlay . HelmetsAmount = amounts [ 6 ] ;
642- MainWindow . overlay . BootsAmount = amounts [ 7 ] ;
632+ MainWindow . Overlay . RingsAmount = amounts [ 0 ] ;
633+ MainWindow . Overlay . AmuletsAmount = amounts [ 1 ] ;
634+ MainWindow . Overlay . BeltsAmount = amounts [ 2 ] ;
635+ MainWindow . Overlay . ChestsAmount = amounts [ 3 ] ;
636+ MainWindow . Overlay . WeaponsAmount = amounts [ 4 ] ;
637+ MainWindow . Overlay . GlovesAmount = amounts [ 5 ] ;
638+ MainWindow . Overlay . HelmetsAmount = amounts [ 6 ] ;
639+ MainWindow . Overlay . BootsAmount = amounts [ 7 ] ;
643640 }
644641 else if ( Properties . Settings . Default . ShowItemAmount == 2 )
645642 {
646643 amounts [ 4 ] = weaponsSmall + weaponBig ;
647- MainWindow . overlay . RingsAmount = Math . Max ( ( SetTargetAmount * 2 ) - amounts [ 0 ] , 0 ) ;
648- MainWindow . overlay . AmuletsAmount = Math . Max ( SetTargetAmount - amounts [ 1 ] , 0 ) ;
649- MainWindow . overlay . BeltsAmount = Math . Max ( SetTargetAmount - amounts [ 2 ] , 0 ) ;
650- MainWindow . overlay . ChestsAmount = Math . Max ( SetTargetAmount - amounts [ 3 ] , 0 ) ;
651- MainWindow . overlay . WeaponsAmount = Math . Max ( ( SetTargetAmount * 2 ) - ( weaponsSmall + ( weaponBig * 2 ) ) , 0 ) ;
652- MainWindow . overlay . GlovesAmount = Math . Max ( SetTargetAmount - amounts [ 5 ] , 0 ) ;
653- MainWindow . overlay . HelmetsAmount = Math . Max ( SetTargetAmount - amounts [ 6 ] , 0 ) ;
654- MainWindow . overlay . BootsAmount = Math . Max ( SetTargetAmount - amounts [ 7 ] , 0 ) ;
644+ MainWindow . Overlay . RingsAmount = Math . Max ( ( SetTargetAmount * 2 ) - amounts [ 0 ] , 0 ) ;
645+ MainWindow . Overlay . AmuletsAmount = Math . Max ( SetTargetAmount - amounts [ 1 ] , 0 ) ;
646+ MainWindow . Overlay . BeltsAmount = Math . Max ( SetTargetAmount - amounts [ 2 ] , 0 ) ;
647+ MainWindow . Overlay . ChestsAmount = Math . Max ( SetTargetAmount - amounts [ 3 ] , 0 ) ;
648+ MainWindow . Overlay . WeaponsAmount = Math . Max ( ( SetTargetAmount * 2 ) - ( weaponsSmall + ( weaponBig * 2 ) ) , 0 ) ;
649+ MainWindow . Overlay . GlovesAmount = Math . Max ( SetTargetAmount - amounts [ 5 ] , 0 ) ;
650+ MainWindow . Overlay . HelmetsAmount = Math . Max ( SetTargetAmount - amounts [ 6 ] , 0 ) ;
651+ MainWindow . Overlay . BootsAmount = Math . Max ( SetTargetAmount - amounts [ 7 ] , 0 ) ;
655652 }
656653 }
657654 }
@@ -663,13 +660,6 @@ public static void PlayNotificationSound()
663660 Player . Play ( ) ;
664661 }
665662
666- public static void PlayNotificationSoundSetPicked ( )
667- {
668- PlayerSet . Volume = ( double ) ( Properties . Settings . Default . Volume / 100.0 ) ;
669- PlayerSet . Position = TimeSpan . Zero ;
670- PlayerSet . Play ( ) ;
671- }
672-
673663 public static StashTab GetStashTabFromItem ( Item item )
674664 {
675665 foreach ( var s in StashTabList . StashTabs )
@@ -701,14 +691,14 @@ public static void ActivateNextCell( bool active, Cell cell )
701691 if ( ItemSetListHighlight [ 0 ] . ItemList . Count == 0 )
702692 {
703693 ItemSetListHighlight . RemoveAt ( 0 ) ;
704- PlayerSet . Dispatcher . Invoke ( ( ) => PlayNotificationSoundSetPicked ( ) ) ;
694+ Player . Dispatcher . Invoke ( ( ) => PlayNotificationSound ( ) ) ;
705695 }
706696 }
707697 else
708698 {
709699 if ( ItemSetListHighlight . Count > 0 )
710700 {
711- PlayerSet . Dispatcher . Invoke ( ( ) => PlayNotificationSoundSetPicked ( ) ) ;
701+ Player . Dispatcher . Invoke ( ( ) => PlayNotificationSound ( ) ) ;
712702 }
713703 }
714704
@@ -784,7 +774,7 @@ public static void ActivateNextCell( bool active, Cell cell )
784774
785775 // activate next set
786776 ActivateNextCell ( true , null ) ;
787- PlayerSet . Dispatcher . Invoke ( ( ) => PlayNotificationSoundSetPicked ( ) ) ;
777+ Player . Dispatcher . Invoke ( ( ) => PlayNotificationSound ( ) ) ;
788778 }
789779 }
790780 }
0 commit comments