self._side_panel = SidePanel(world, self._mouse_plane_node, (-5, 4), (-3, 1), 1, self.items)
self._scene_tsk = taskMgr.add(self.on_frame, 'on_frame')
- @staticmethod
- def name():
- return ''
+ @classmethod
+ def name(cls):
+ if not cls.json:
+ with open(cls.filename) as f:
+ cls.json = loads(f.read())
+ return _(cls.json['name'])
@classmethod
def version(cls):
return bool([(name, version) for name, version in cls.scenes_done if cls.__name__ == name and cls.version() == version])
def _instr_txt(self):
- return ''
+ txt = _('Scene: ') + self.name() + '\n\n'
+ for instruction_line in self.__class__.json['instructions']:
+ instruction_line = self.__process_json_escape(instruction_line)
+ txt += _(instruction_line)
+ return txt
+
+ def __process_json_escape(self, string):
+ return bytes(string, 'utf-8').decode('unicode-escape')
def _set_items(self):
self.items = []