| 1 | # |
| 2 | # (C) Copyright 2001 Alexandre Courbot <[email protected]> |
| 3 | # Part of the Adonthell Project http://adonthell.linuxgames.com |
| 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License. |
| 7 | # This program is distributed in the hope that it will be useful, |
| 8 | # but WITHOUT ANY WARRANTY. |
| 9 | # |
| 10 | # See the COPYING file for more details |
| 11 | # |
| 12 | |
| 13 | # Mapview schedule that makes it always center on a constructor-time |
| 14 | # given mapcharacter |
| 15 | |
| 16 | import adonthell |
| 17 | |
| 18 | class center_character(object): |
| 19 | |
| 20 | # Parameters: |
| 21 | # mapcharinstance: Name of the mapcharacter to follow |
| 22 | def __init__ (self, mapviewinstance, mapcharname): |
| 23 | self.myself = mapviewinstance |
| 24 | self.tofollow = adonthell.gamedata_get_character (mapcharname) |
| 25 | |
| 26 | def run (self): |
| 27 | p = self.tofollow |
| 28 | self.myself.center_on(p.submap(), p.posx(), p.posy(), p.offx(), p.offy()) |
| 29 |