def something_changed(self):
		"""Used as proxy to send messages when a changelistener notifies us.

		Masks the message sender to be `self.instance` rather than self because
		that is what we are interested in, usually.
		"""
		InstanceInventoryUpdated.broadcast(self.instance, self.inventory._storage)
Ejemplo n.º 2
0
	def something_changed(self):
		"""Used as proxy to send messages when a changelistener notifies us.

		Masks the message sender to be `self.instance` rather than self because
		that is what we are interested in, usually.
		"""
		InstanceInventoryUpdated.broadcast(self.instance, self.inventory._storage)
	def remove(self):
		"""Removes all animation overlays from the fife instance.

		Also converts the animation overlay on drawing order 0 (i.e. the old base image)
		back to a plain "action set" in UH terminology.
		"""
		InstanceInventoryUpdated.unsubscribe(self.inventory_changed, sender=self.instance)

		for (res_id, overlay) in self.current_overlays.iteritems():
			if overlay is not None:
				self.remove_overlay(res_id)

		# remove base image "overlay" that we did `convertToOverlays` in `initialize`
		# Note that this gets us back the actual base image as not-an-overlay.
		# In particular, no animation overlays can be added unless `convertToOverlays`
		# is called again.
		self.remove_overlay(0)

		super(InventoryOverlayComponent, self).remove()
Ejemplo n.º 4
0
    def remove(self):
        """Removes all animation overlays from the fife instance.

		Also converts the animation overlay on drawing order 0 (i.e. the old base image)
		back to a plain "action set" in UH terminology.
		"""
        InstanceInventoryUpdated.unsubscribe(self.inventory_changed,
                                             sender=self.instance)

        for (res_id, overlay) in self.current_overlays.iteritems():
            if overlay is not None:
                self.remove_overlay(res_id)

        # remove base image "overlay" that we did `convertToOverlays` in `initialize`
        # Note that this gets us back the actual base image as not-an-overlay.
        # In particular, no animation overlays can be added unless `convertToOverlays`
        # is called again.
        self.remove_overlay(0)

        super(InventoryOverlayComponent, self).remove()
Ejemplo n.º 5
0
 def initialize(self):
     super(InventoryOverlayComponent, self).initialize()
     InstanceInventoryUpdated.subscribe(self.inventory_changed,
                                        sender=self.instance)
 def initialize(self):
     super(InventoryOverlayComponent, self).initialize()
     InstanceInventoryUpdated.subscribe(
         self.inventory_changed, sender=self.instance)
	def initialize(self):
		super().initialize()
		InstanceInventoryUpdated.subscribe(self.inventory_changed, sender=self.instance)
Ejemplo n.º 8
0
 def initialize(self):
     super().initialize()
     InstanceInventoryUpdated.subscribe(self.inventory_changed,
                                        sender=self.instance)