Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/celerity/CeleritySpriteGenerator.php
| Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | public function buildMenuSheet() { | ||||
| $sheet->setScales($scales); | $sheet->setScales($scales); | ||||
| foreach ($sprites as $sprite) { | foreach ($sprites as $sprite) { | ||||
| $sheet->addSprite($sprite); | $sheet->addSprite($sprite); | ||||
| } | } | ||||
| return $sheet; | return $sheet; | ||||
| } | } | ||||
| public function buildTokenSheet() { | |||||
| $tokens = $this->getDirectoryList('tokens_1x'); | |||||
| $template = id(new PhutilSprite()) | |||||
| ->setSourceSize(16, 16); | |||||
| $sprites = array(); | |||||
| foreach ($tokens as $token) { | |||||
| $path = $this->getPath('tokens_1x/'.$token.'.png'); | |||||
| $sprite = id(clone $template) | |||||
| ->setName('token-'.$token) | |||||
| ->setTargetCSS('.token-'.$token) | |||||
| ->setSourceFile($path, 1); | |||||
| $sprites[] = $sprite; | |||||
| } | |||||
| $sheet = $this->buildSheet('tokens', false); | |||||
| foreach ($sprites as $sprite) { | |||||
| $sheet->addSprite($sprite); | |||||
| } | |||||
| return $sheet; | |||||
| } | |||||
| public function buildConpherenceSheet() { | public function buildConpherenceSheet() { | ||||
| $icons = $this->getDirectoryList('conpher_1x'); | $icons = $this->getDirectoryList('conpher_1x'); | ||||
| $scales = array( | $scales = array( | ||||
| '1x' => 1, | '1x' => 1, | ||||
| '2x' => 2, | '2x' => 2, | ||||
| ); | ); | ||||
| $template = id(new PhutilSprite()) | $template = id(new PhutilSprite()) | ||||
| ->setSourceSize(32, 32); | ->setSourceSize(32, 32); | ||||
| $sprites = array(); | $sprites = array(); | ||||
| foreach ($icons as $icon) { | foreach ($icons as $icon) { | ||||
| $color = preg_match('/_on/', $icon) ? 'on' : 'off'; | $color = preg_match('/_on/', $icon) ? 'on' : 'off'; | ||||
| $prefix = 'conpher_'; | $prefix = 'conpher_'; | ||||
| $sprite = id(clone $template) | $sprite = id(clone $template) | ||||
| ->setName($prefix.$icon); | ->setName($prefix.$icon); | ||||
| $tcss = array(); | $tcss = array(); | ||||
| ▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines | |||||