@@ -44,6 +44,18 @@ public Section(Location owner)
4444 {
4545 VisualParent = owner ;
4646 mOwner = owner ;
47+
48+ PropertyChanging += ( sender , e ) =>
49+ {
50+ if ( e . PropertyName == nameof ( CapturedItem ) || e . PropertyName == nameof ( AvailableChestCount ) )
51+ ScriptManager . Instance . InvokeStandardCallback ( ScriptManager . StandardCallback . LocationUpdating , this ) ;
52+ } ;
53+
54+ PropertyChanged += ( sender , e ) =>
55+ {
56+ if ( e . PropertyName == nameof ( CapturedItem ) || e . PropertyName == nameof ( AvailableChestCount ) )
57+ ScriptManager . Instance . InvokeStandardCallback ( ScriptManager . StandardCallback . LocationUpdated , this ) ;
58+ } ;
4759 }
4860
4961 public Location Owner
@@ -95,8 +107,6 @@ public ITrackableItem CapturedItem
95107 {
96108 using ( TransactionProcessor . Current . OpenTransaction ( ) )
97109 {
98- ScriptManager . Instance . InvokeStandardCallback ( ScriptManager . StandardCallback . LocationUpdating , this ) ;
99-
100110 if ( SetTransactableProperty ( value , ( processedValue ) =>
101111 {
102112 LocationDatabase . Instance . RefeshAccessibility ( ) ;
@@ -134,8 +144,6 @@ public ITrackableItem CapturedItem
134144 // we update the pinned status here to include it in the
135145 // current open transaction.
136146 Owner . AutoUnpinIfAppropriate ( ) ;
137-
138- ScriptManager . Instance . InvokeStandardCallback ( ScriptManager . StandardCallback . LocationUpdated , this ) ;
139147 }
140148 }
141149 }
@@ -191,9 +199,6 @@ public uint AvailableChestCount
191199 {
192200 using ( TransactionProcessor . Current . OpenTransaction ( ) )
193201 {
194- if ( ! mSuppressCaptureClearing )
195- ScriptManager . Instance . InvokeStandardCallback ( ScriptManager . StandardCallback . LocationUpdating , this ) ;
196-
197202 if ( value == 0 && CapturedItem != null && ! mbCaptureBadge && ! mSuppressCaptureClearing )
198203 {
199204 CapturedItem . AdvanceToCode ( ) ;
@@ -209,9 +214,6 @@ public uint AvailableChestCount
209214 // we update the pinned status here to include it in the
210215 // current open transaction.
211216 Owner . AutoUnpinIfAppropriate ( ) ;
212-
213- if ( ! mSuppressCaptureClearing )
214- ScriptManager . Instance . InvokeStandardCallback ( ScriptManager . StandardCallback . LocationUpdated , this ) ;
215217 }
216218 }
217219 }
@@ -246,7 +248,7 @@ public bool CaptureItem
246248 public bool CaptureBadge
247249 {
248250 get { return mbCaptureBadge ; }
249- set { mbCaptureBadge = value ; NotifyPropertyChanged ( ) ; }
251+ set { SetProperty ( ref mbCaptureBadge , value ) ; }
250252 }
251253
252254 public double CaptureBadgeOffsetX
0 commit comments