Package horizons :: Package gui :: Package mousetools :: Module selectiontool :: Class SelectionTool
[hide private]
[frames] | no frames]

Class SelectionTool

source code

              object --+            
                       |            
fife.fife.IMouseListener --+        
                           |        
       cursortool.CursorTool --+    
                               |    
   navigationtool.NavigationTool --+
                                   |
                                  SelectionTool

Instance Methods [hide private]
 
__init__(self, session)
__init__(FIFE::IMouseListener self) -> IMouseListener
source code
 
remove(self) source code
 
is_selectable(self, entity) source code
 
filter_component(self, component, instances)
Only get specific component from a list of world objects
source code
 
filter_selectable(self, instances)
Only keeps selectables from a list of world objects
source code
 
is_owned_by_player(self, instance)
Returns boolean if single world object is owned by local player
source code
 
filter_owner(self, instances)
Only keep instances belonging to the user.
source code
 
fife_instance_to_uh_instance(self, instance)
Visual fife instance to uh game logic object or None
source code
 
mouseDragged(self, evt)
mouseDragged(IMouseListener self, MouseEvent evt)
source code
 
mouseReleased(self, evt)
mouseReleased(IMouseListener self, MouseEvent evt)
source code
 
apply_select(self)
Called when selected instances changes.
source code
 
mousePressed(self, evt)
mousePressed(IMouseListener self, MouseEvent evt)
source code
 
_draw_rect_line(self, start, end) source code
 
_update_selection(self, instances, do_multi=False)
self.select_old are old instances still relevant now (esp.
source code

Inherited from fife.fife.IMouseListener: __disown__, __repr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from navigationtool.NavigationTool
 
_schedule_hover_instance_update(self)
Hover instances have potentially changed, do an update in a timely fashion (but not right away)
source code
 
_send_hover_instance_upate(self)
Broadcast update with new instances below mouse (hovered).
source code
 
end(self) source code
 
get_hover_instances(self, where, layers=None)
Utility method, returns the instances under the cursor
source code
 
mouseMoved(self, evt)
mouseMoved(IMouseListener self, MouseEvent evt)
source code
 
mouseWheelMovedDown(self, evt)
mouseWheelMovedDown(IMouseListener self, MouseEvent evt)
source code
 
mouseWheelMovedUp(self, evt)
mouseWheelMovedUp(IMouseListener self, MouseEvent evt)
source code
 
onCommand(self, command)
Called when some kind of command-event happens.
source code
    Inherited from cursortool.CursorTool
 
_get_screenpoint(self, arg)
Python lacks polymorphism.
source code
 
_round_map_coords(self, map_x, map_y)
Returns the coordinates of an event at the map.
source code
 
disable(self)
Call this to not get events.
source code
 
enable(self)
Call this to get events.
source code
 
get_exact_world_location(self, evt)
Returns the coordinates of an event at the map.
source code
 
get_world_location(self, evt) source code
 
mouseClicked(self, evt)
mouseClicked(IMouseListener self, MouseEvent evt)
source code
 
mouseEntered(self, evt)
mouseEntered(IMouseListener self, MouseEvent evt)
source code
 
mouseExited(self, evt)
mouseExited(IMouseListener self, MouseEvent evt)
source code
 
mouseWheelMovedLeft(self, evt) source code
 
mouseWheelMovedRight(self, evt) source code
Class Variables [hide private]
  _SELECTION_RECTANGLE_NAME = "_select"

Inherited from fife.fife.IMouseListener: __del__, __swig_destroy__, thisown

    Inherited from navigationtool.NavigationTool
  HOVER_INSTANCES_UPDATE_DELAY = 1
  consumed_by_widgets = False
  last_event_pos = fife.ScreenPoint(0, 0)
  last_hover_instances = WeakList()
  send_hover_instances_update = True
    Inherited from cursortool.CursorTool
  log = logging.getLogger("gui.mousetools")
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, session)
(Constructor)

source code 

__init__(FIFE::IMouseListener self) -> IMouseListener

Overrides: object.__init__
(inherited documentation)

remove(self)

source code 
Overrides: cursortool.CursorTool.remove

filter_owner(self, instances)

source code 

Only keep instances belonging to the user. This is used for multiselection

mouseDragged(self, evt)

source code 

mouseDragged(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseDragged
(inherited documentation)

mouseReleased(self, evt)

source code 

mouseReleased(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mouseReleased
(inherited documentation)

apply_select(self)

source code 

Called when selected instances changes. (Shows their menu) Does not do anything when nothing is selected, i.e. doesn't hide their menu. If one of the selected instances can attack, switch mousetool to AttackingTool.

mousePressed(self, evt)

source code 

mousePressed(IMouseListener self, MouseEvent evt)

Overrides: fife.fife.IMouseListener.mousePressed
(inherited documentation)

_update_selection(self, instances, do_multi=False)

source code 

self.select_old are old instances still relevant now (esp. on ctrl)

Parameters:
  • instances - uh instances
  • do_multi - True if selection rectangle on drag is used