def onenter(self,x,y): default = default_text data = self.gamemap.tile(x,y).get('events/onenter', default) data = editsnippet('\n'.join(data)) tile = self.gamemap.tile(x,y) tile.put('events/onenter',data.split('\n')) self.gamemap.load_tile(x,y,tile) self.tile = self.gamemap.tile(x,y) self.updatetile(x, y)
def make_event(self, sender, key): self.update_yaml() if key.startswith('event'): default = default_text else: default = [''] data = self.item.get(key, default) if not key in data[0]: data.insert(0,'#%s' % key) data = editsnippet('\n'.join(data)) self.item.put(key,data.split('\n')) self.update_yaml()