['filter' => FILTER_CALLBACK, 'options' => [Locale::class, 'tryFromDomain']] ); public function __construct(string $id) { parent::__construct($id); // temp locale if ($this->_get['domain']) Lang::load($this->_get['domain']); $this->typeId = intVal($id); } protected function generate() : void { $creature = new CreatureList(array(['id', $this->typeId])); if ($creature->error) $this->cacheType = CACHE_TYPE_NONE; else $opts = array( 'name' => $creature->getField('name', true), 'tooltip' => $creature->renderTooltip(), 'map' => $creature->getSpawns(SPAWNINFO_SHORT) ); $this->result = new Tooltip(self::POWER_TEMPLATE, $this->typeId, $opts ?? []); } } ?>