Package pajammin :: Package util :: Module leveleditor :: Class AgentTool
[show private | hide private]
[frames | no frames]

Type AgentTool

     object --+        
              |        
LevelEditorTool --+    
                  |    
         EntityTool --+
                      |
                     AgentTool


A tool for editing scripts.
Method Summary
  __init__(self, level, display)
  activate(self)
Turn this tool on.
  add_entitymarker(self, entity, selected, entity_cls)
  add_posmarker(self, pos, selected)
  add_rectmarker(self, rect, selected)
  add_task(self, task)
  add_task_mode(self)
  add_task_tab(self, prefix)
  click_entity(self, entity, x, y)
Called when the user clicks the left mouse button on an entity; by default, this method selects the entity.
  click_space(self, x, y)
Called when the user clicks the left mouse button on an empty area; by default, this creates a new entity.
  deactivate(self)
Turn this tool off.
  delete_entity(self, entity)
  delete_task(self)
  drag_space(self, oldx, oldy, newx, newy)
Called when the user drags in empty space with the left moues button; by default this moves the newly created entity.
  edit_script_mode(self)
  init_listeners(self)
  init_textboxes(self)
  keypress_arrow(self, event)
  keypress_delete(self, event)
  keypress_esc(self, event)
  keypress_insert(self, event)
  keypress_return(self, event)
  keypress_tab(self, event)
  menu_Script(self, entity)
  newtaskbox_cancel(self, taskname)
  newtaskbox_set(self, taskname)
  relevant(self, entity)
Return true if this tool should manipulate the given entity.
  select(self, agent)
  select_mode(self)
  set_agent_value_mode(self)
  set_entity_value_mode(self, entity_subtype)
  set_float_value_mode(self)
  set_int_value_mode(self)
  set_pos_value_mode(self)
  set_rect_value_mode(self)
  set_string_value_mode(self)
  set_value(self, val)
  show_script(self)
  show_valuebox(self)
  signature(self, task)
  start_drag_space(self, x, y)
Called when the user starts dragging in empty space with the left mouse button; by default, this creates a new entity and selects it.
  stop_drag_space(self, x, y)
Called when the user finishes dragging in empty space with the left mouse button; by default, this does nothing.
  valuebox_set(self, text)
    Inherited from EntityTool
  add_entity(self, entity, select)
Add the given entity to the level, and mark it as applicable.
  drag_entity(self, entity, oldx, oldy, newx, newy)
Called when the user drags an entity with the left mouse button; by default, this moves the entity.
  getinfo(self, entity)
  menu_Delete(self, entity)
  menu_Lower(self, entity)
  menu_Raise(self, entity)
  select_subtool(self, subtool)
Select the subtool corresponding to the given icon
  start_drag_entity(self, entity, x, y)
Called when the user starts dragging an entity with the left mouse button; by default, this does nothing.
  stop_drag_entity(self, entity, x, y)
Called when the user finishes dragging an entity with the left mouse button; by default, this does nothing.
  update_infobox(self)
  _clear_marks(self)
  _context_menu_select(self, choice)
  _delete(self, event)
  _entity_at(self, x, y)
Return the relevant entity at the given world position, if there is one; otherwise, return None.
  _init_context_menu(self)
  _init_infobox(self)
  _init_listeners(self)
  _init_markers(self)
  _lclick(self, event)
  _ldrag(self, event)
  _mark(self, entity)
  _rpress(self, event)
  _start_ldrag(self, event)
  _start_listeners(self)
  _stop_ldrag(self, event)
  _stop_listeners(self)
  _togglemarks(self, event)
  _unmark(self, entity)
    Inherited from LevelEditorTool
  set_level(self, level)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Instance Variable Summary
  argno: The index of the currently selected argument.
str mode: 'select': select/move/create agents.
  selection: Currently selected agent.
NoneType shortcut: The keyboard shortcut for this tool, or None if this tool doesn't have a keyboard shortcut.
  taskno: The index of the currently selected task.
    Inherited from EntityTool
  _context_menu: A pop-up menu widget, for manipulating the currently selected entity.
  _dragged_entity: When the user is dragging an entity, this points to that entity; otherwise, it is None.
  _infobox: A textbox widget, for displaying information about the currently selected entity.
  _listeners: Mouse input delegators.
  _relevant_mark: A dictionary containing marker shapes that are used to highlight entities that are relevant to this tool.
  _selection_mark: A marker shape that is used to highlight the currently selected entity.

Class Variable Summary
type AgentValueMarker = pajammin.util.leveleditor.AgentValueMarker
NoneType entity_factories: A list of entity constructors or factory functions, which take (x,y) as input and return a new entity.
NoneType entity_type = None                                                                  
type EntityValueMarker = pajammin.util.leveleditor.EntityValueMarker
type NewRectValueMarker = pajammin.util.leveleditor.NewRectValueMarker
type PosValueMarker = pajammin.util.leveleditor.PosValueMarker
type RectValueMarker = pajammin.util.leveleditor.RectValueMarker
    Inherited from EntityTool
  entity_factory: The currently selected entity factory function.
bool hide_body_markers = True

Method Details

__init__(self, level, display)
(Constructor)

Overrides:
pajammin.util.leveleditor.EntityTool.__init__

activate(self)

Turn this tool on.
Overrides:
pajammin.util.leveleditor.EntityTool.activate

add_entitymarker(self, entity, selected, entity_cls)

add_posmarker(self, pos, selected)

add_rectmarker(self, rect, selected)

add_task(self, task)

add_task_mode(self)

add_task_tab(self, prefix)

click_entity(self, entity, x, y)

Called when the user clicks the left mouse button on an entity; by default, this method selects the entity.
Overrides:
pajammin.util.leveleditor.EntityTool.click_entity (inherited documentation)

click_space(self, x, y)

Called when the user clicks the left mouse button on an empty area; by default, this creates a new entity.
Overrides:
pajammin.util.leveleditor.EntityTool.click_space (inherited documentation)

deactivate(self)

Turn this tool off.
Overrides:
pajammin.util.leveleditor.EntityTool.deactivate

delete_entity(self, entity)

Overrides:
pajammin.util.leveleditor.EntityTool.delete_entity

delete_task(self)

drag_space(self, oldx, oldy, newx, newy)

Called when the user drags in empty space with the left moues button; by default this moves the newly created entity.
Overrides:
pajammin.util.leveleditor.EntityTool.drag_space (inherited documentation)

edit_script_mode(self)

init_listeners(self)

init_textboxes(self)

keypress_arrow(self, event)

keypress_delete(self, event)

keypress_esc(self, event)

keypress_insert(self, event)

keypress_return(self, event)

keypress_tab(self, event)

menu_Script(self, entity)

newtaskbox_cancel(self, taskname)

newtaskbox_set(self, taskname)

relevant(self, entity)

Return true if this tool should manipulate the given entity.
Overrides:
pajammin.util.leveleditor.EntityTool.relevant (inherited documentation)

select(self, agent)

Overrides:
pajammin.util.leveleditor.EntityTool.select

select_mode(self)

set_agent_value_mode(self)

set_entity_value_mode(self, entity_subtype)

set_float_value_mode(self)

set_int_value_mode(self)

set_pos_value_mode(self)

set_rect_value_mode(self)

set_string_value_mode(self)

set_value(self, val)

show_script(self)

show_valuebox(self)

signature(self, task)

start_drag_space(self, x, y)

Called when the user starts dragging in empty space with the left mouse button; by default, this creates a new entity and selects it.
Overrides:
pajammin.util.leveleditor.EntityTool.start_drag_space (inherited documentation)

stop_drag_space(self, x, y)

Called when the user finishes dragging in empty space with the left mouse button; by default, this does nothing.
Overrides:
pajammin.util.leveleditor.EntityTool.stop_drag_space (inherited documentation)

valuebox_set(self, text)


Instance Variable Details

argno

The index of the currently selected argument.

mode

  • 'select': select/move/create agents.
  • 'edit_script': edit the agent's script
  • 'set_<typ>': set a value of type <typ>
Type:
str
Value:
'select'                                                               

selection

Currently selected agent.

shortcut

The keyboard shortcut for this tool, or None if this tool doesn't have a keyboard shortcut.
Type:
NoneType
Value:
'n'                                                                    

taskno

The index of the currently selected task.

Class Variable Details

entity_factories

A list of entity constructors or factory functions, which take (x,y) as input and return a new entity.
Type:
NoneType
Value:
[<class 'pajammin.entity.agent.flyer.WhiteBird'>,
 <class 'pajammin.entity.agent.flyer.BrownBird'>,
 <class 'pajammin.entity.agent.flyer.BlueBird'>,
 <class 'pajammin.entity.agent.flyer.RedBird'>,
 <class 'pajammin.entity.agent.flyer.Farie'>,
 <class 'pajammin.entity.agent.walker.RedBall'>,
 <class 'pajammin.entity.agent.walker.RedMoop'>,
 <class 'pajammin.entity.agent.walker.GreenMoop'>,
...                                                                    

entity_type

Type:
NoneType
Value:
None